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

Add shapes plugin #107

Merged
merged 21 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions include/ignition/gazebo/gui/GuiEvents.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define IGNITION_GAZEBO_GUI_GUIEVENTS_HH_

#include <QEvent>
#include <string>
#include <utility>
#include <vector>
#include <ignition/math/Vector3.hh>
Expand Down Expand Up @@ -159,6 +160,27 @@ namespace events
/// \brief Unique type for this event.
static const QEvent::Type kType = QEvent::Type(QEvent::User + 3);
};

/// \brief Event called to spawn a preview model. Used in shapes plugin.
class SpawnPreviewModel : public QEvent
{
public: explicit SpawnPreviewModel(std::string &_modelSdfString)
: QEvent(kType), modelSdfString(_modelSdfString)
{
}
/// \brief Unique type for this event.
static const QEvent::Type kType = QEvent::Type(QEvent::User + 4);

/// \brief Get the sdf string of the model.
/// \return The model sdf string
public: std::string ModelSdfString() const
{
return this->modelSdfString;
}

/// \brief The sdf string of the model to be previewed.
std::string modelSdfString;
};
} // namespace events
}
} // namespace gui
Expand Down
4 changes: 4 additions & 0 deletions include/ignition/gazebo/rendering/SceneManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
/// \param[in] _id World ID.
public: void SetWorldId(Entity _id);

/// \brief Get the world's ID.
/// \return World ID
public: Entity WorldId() const;

/// \brief Create a model
/// \param[in] _id Unique model id
/// \param[in] _model Model sdf dom
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 @@ -85,6 +85,7 @@ add_subdirectory(component_inspector)
add_subdirectory(entity_tree)
add_subdirectory(grid_config)
add_subdirectory(scene3d)
add_subdirectory(shapes)
add_subdirectory(transform_control)
add_subdirectory(video_recorder)
add_subdirectory(view_angle)
3 changes: 3 additions & 0 deletions src/gui/plugins/scene3d/GzScene3D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Rectangle {
onEntered: {
GzScene3D.OnFocusWindow()
}
onPositionChanged: {
GzScene3D.OnHovered(mouseArea.mouseX, mouseArea.mouseY);
}
}

RenderWindow {
Expand Down
Loading