Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added transform control and select entities GUI plugins #854

Merged
merged 41 commits into from
Aug 14, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3a7d09c
Add scene manager GUI plugin that works with ign-gui's Scene3D
chapulina May 12, 2021
80161fb
cleanup
chapulina May 12, 2021
22454e9
Added tranform control and select entities GUI plugins
ahcorde Jun 9, 2021
4465595
Used new plugin
ahcorde Jun 18, 2021
eda24b6
Fix Key event class name
ahcorde Jun 18, 2021
d0d7066
Merge branch 'main' into chapulina/6/scene_manager
chapulina Jun 19, 2021
5f94fe2
Update to latest
chapulina Jun 21, 2021
b7922fc
Some fixes to select entities plugin
ahcorde Jun 22, 2021
1e8ab03
Merge branch 'chapulina/6/scene_manager' into ahcorde/plugin/selectEn…
ahcorde Jun 22, 2021
3493fa0
Fixed transform control and linters
ahcorde Jun 22, 2021
44681d4
Merge branch 'ahcorde/plugin/selectEntities_transformControl' of http…
ahcorde Jun 22, 2021
c5b16d2
Merge branch 'main' into chapulina/6/scene_manager
chapulina Jun 24, 2021
27ee0d6
Merge remote-tracking branch 'origin/chapulina/6/scene_manager' into …
ahcorde Jul 1, 2021
6bb0bce
Added feedback
ahcorde Jul 1, 2021
e00ee2e
make linters happy
ahcorde Jul 1, 2021
c3095a2
Merge branch 'main' into chapulina/6/scene_manager
ahcorde Jul 2, 2021
c741662
Merge branch 'main' into chapulina/6/scene_manager
chapulina Aug 9, 2021
fbceade
Don't make it official yet
chapulina Aug 9, 2021
f27887a
Merge branch 'chapulina/6/scene_manager' of ssh://github.com/ignition…
chapulina Aug 9, 2021
21e1b7b
alphabetize
chapulina Aug 9, 2021
20c0e0b
merged from chapulina/6/scene_manager
chapulina Aug 9, 2021
8694ac4
Merge remote-tracking branch 'origin/main' into ahcorde/plugin/select…
ahcorde Aug 10, 2021
a74a4a6
clean up select entities
chapulina Aug 10, 2021
357f626
Start combining TransformControls
chapulina Aug 10, 2021
209cb68
improvements
ahcorde Aug 11, 2021
5a46411
Merge branch 'main' into ahcorde/plugin/selectEntities_transformControl
ahcorde Aug 11, 2021
cbf5c00
make linters happy
ahcorde Aug 11, 2021
5282927
Remove transform control logic plugin
ahcorde Aug 11, 2021
ee7784c
Fixed compilation error
ahcorde Aug 12, 2021
73b9e4e
Remove traces
ahcorde Aug 12, 2021
caf08a9
Documentation and style
chapulina Aug 13, 2021
e6e3e16
Fixed keyRelease event
ahcorde Aug 13, 2021
ae18bad
Fixed frozen scene
ahcorde Aug 13, 2021
0a754f4
Fix seg fault
ahcorde Aug 13, 2021
4cec6b2
Renamed TransformControlModeActive to TransformControlModeActive
ahcorde Aug 13, 2021
4279b67
make linters happy
ahcorde Aug 13, 2021
6ab0c3d
Fixed key event for legacy mode
ahcorde Aug 13, 2021
d9cb640
Merge branch 'main' into ahcorde/plugin/selectEntities_transformControl
chapulina Aug 13, 2021
b822910
Merge branch 'main' into ahcorde/plugin/selectEntities_transformControl
chapulina Aug 13, 2021
eb51a6c
revert unused blockUpdate
chapulina Aug 13, 2021
943679d
Merge branch 'ahcorde/plugin/selectEntities_transformControl' of ssh:…
chapulina Aug 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions examples/worlds/minimal_scene.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Features:
* Markers
* Tape measure
* Grid config
* Select entities
* Transform controls

Missing for parity with GzScene3D:

* Spawn entities through GUI
* Context menu
* Transform controls
* Select entities
* Record video
* View angles
* View collisions, wireframe, transparent, CoM, etc
Expand Down Expand Up @@ -97,6 +97,19 @@ Missing for parity with GzScene3D:
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="SelectEntities" name="Select Entities">
<ignition-gui>
<anchors target="Select entities">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<!-- World control -->
<plugin filename="WorldControl" name="World control">
Expand Down Expand Up @@ -187,6 +200,9 @@ Missing for parity with GzScene3D:
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#777777</property>
</ignition-gui>

<!-- disable legacy features used to connect this plugin to GzScene3D -->
<legacy>false</legacy>
</plugin>

<!-- Screenshot -->
Expand Down
20 changes: 20 additions & 0 deletions include/ignition/gazebo/gui/GuiEvents.hh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ namespace events
/// \brief Whether the event was generated by the user,
private: bool fromUser{false};
};

class TransformControlMode : public QEvent
{
/// \brief Constructor
/// \param[in] _tranformModeActive is the transform control mode active
public: explicit TransformControlMode(const bool _tranformModeActive)
: QEvent(kType), tranformModeActive(_tranformModeActive)
{
}

/// \brief Unique type for this event.
static const QEvent::Type kType = QEvent::Type(QEvent::User + 6);

public: bool TransformControl()
{
return this->tranformModeActive;
}

private: bool tranformModeActive;
};
} // namespace events
}
} // namespace gui
Expand Down
1 change: 1 addition & 0 deletions src/gui/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ add_subdirectory(plot_3d)
add_subdirectory(plotting)
add_subdirectory(resource_spawner)
add_subdirectory(scene3d)
add_subdirectory(select_entities)
add_subdirectory(scene_manager)
add_subdirectory(shapes)
add_subdirectory(transform_control)
Expand Down
1 change: 1 addition & 0 deletions src/gui/plugins/scene3d/Scene3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ void IgnRenderer::Initialize()

// Camera
this->dataPtr->camera = scene->CreateCamera();
this->dataPtr->camera->SetUserData("user-camera", true);
root->AddChild(this->dataPtr->camera);
this->dataPtr->camera->SetLocalPose(this->cameraPose);
this->dataPtr->camera->SetImageWidth(this->textureSize.width());
Expand Down
15 changes: 13 additions & 2 deletions src/gui/plugins/scene_manager/GzSceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {

/// \brief Rendering utility
public: RenderUtil renderUtil;

public: bool blockUpdate = false;
};
}
}
Expand Down Expand Up @@ -79,8 +81,11 @@ void GzSceneManager::Update(const UpdateInfo &_info,
{
IGN_PROFILE("GzSceneManager::Update");

this->dataPtr->renderUtil.UpdateECM(_info, _ecm);
this->dataPtr->renderUtil.UpdateFromECM(_info, _ecm);
if (!this->dataPtr->blockUpdate)
ahcorde marked this conversation as resolved.
Show resolved Hide resolved
{
this->dataPtr->renderUtil.UpdateECM(_info, _ecm);
this->dataPtr->renderUtil.UpdateFromECM(_info, _ecm);
}
}

/////////////////////////////////////////////////
Expand All @@ -90,6 +95,12 @@ bool GzSceneManager::eventFilter(QObject *_obj, QEvent *_event)
{
this->dataPtr->OnRender();
}
else if (_event->type() == ignition::gui::events::BlockOrbit::kType)
{
auto blockOrbit = reinterpret_cast<ignition::gui::events::BlockOrbit *>(
_event);
this->dataPtr->blockUpdate = blockOrbit->Block();
}

// Standard event processing
return QObject::eventFilter(_obj, _event);
Expand Down
11 changes: 11 additions & 0 deletions src/gui/plugins/select_entities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gz_add_gui_plugin(SelectEntities
SOURCES
SelectEntities.cc
QT_HEADERS
SelectEntities.hh
TEST_SOURCES
# CameraControllerManager_TEST.cc
PUBLIC_LINK_LIBS
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
${PROJECT_LIBRARY_TARGET_NAME}-rendering
ahcorde marked this conversation as resolved.
Show resolved Hide resolved
)
Loading