Scene3D.hh
Go to the documentation of this file.
229 public: Q_INVOKABLE QString ErrorPopupText() const;
252 public: Q_INVOKABLE QString LoadingError() const;
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:67
Ign-rendering renderer. All ign-rendering calls should be performed inside this class as it makes sur...
Definition: Scene3D.hh:278
void SetViewTransparentTarget(const std::string &_target)
View the specified target as transparent.
void SetMoveToPose(const math::Pose3d &_pose)
Set the world pose of the camera.
bool FollowWorldFrame() const
Get whether the camera is following the entity in world frame.
void SetXYZSnap(const math::Vector3d &_xyz)
Set the XYZ snap values.
void SetDropdownMenuEnabled(bool _enableDropdownMenu)
Set if the dropdown menu is enabled or disabled.
bool GeneratePreview(const sdf::Root &_sdf)
Generate a preview of a resource.
void SetViewAngle(const math::Vector3d &_direction)
Set the viewing angle of the camera.
void SetMoveTo(const std::string &_target)
Move the user camera to move to the speficied target.
void SetRecordVideo(bool _record, const std::string &_format, const std::string &_savePath)
Set whether to record video.
void SetRecordVideoUseSimTime(bool _useSimTime)
Set whether to record video using sim time as timestamp.
void HandleKeyPress(QKeyEvent *_e)
Handle key press event for snapping.
void HandleKeyRelease(QKeyEvent *_e)
Handle key release event for snapping.
void SetViewCOMTarget(const std::string &_target)
View center of mass of the specified target.
math::Pose3d CameraPose() const
Get the current camera pose.
void SetScaleSnap(const math::Vector3d &_scale)
Set the scale snap values.
void SetInitCameraPose(const math::Pose3d &_pose)
Set the initial user camera pose.
void SetRPYSnap(const math::Vector3d &_rpy)
Set the RPY snap values.
void SetViewController(const std::string &_viewController)
Set camera view controller.
void RequestSelectionChange(Entity _selectedEntity, bool _deselectAll, bool _sendEvent)
Request entity selection. This queues the selection to be handled later in the render thread.
math::Vector3d ScreenToScene(const math::Vector2i &_screenPos) const
Retrieve the first point on a surface in the 3D scene hit by a ray cast from the given 2D screen coor...
GLuint textureId
Render texture id Values is constantly constantly cycled/swapped/changed from a worker thread Don't r...
Definition: Scene3D.hh:586
void SetViewInertiaTarget(const std::string &_target)
View inertia of the specified target.
void TerminateSpawnPreview()
Delete the visuals generated while an entity is being spawned.
void SetFollowWorldFrame(bool _worldFrame)
True to set the camera to follow the target in world frame, false to follow in target's local frame.
math::Vector3d ScreenToPlane(const math::Vector2i &_screenPos) const
Retrieve the point on a plane at z = 0 in the 3D scene hit by a ray cast from the given 2D screen coo...
std::string worldName
Name of the world.
Definition: Scene3D.hh:592
math::Vector3d FollowOffset() const
Get the camera follow offset position.
void SetModelPath(const std::string &_filePath)
Set the path to the model to hover over the scene.
void SetRecordVideoLockstep(bool _lockstep)
Set whether to record video in lockstep mode.
void SetFollowOffset(const math::Vector3d &_offset)
Set the camera follow offset position.
void SetFollowPGain(double _gain)
Set the p gain for the camera follow movement.
void SetRecordVideoBitrate(unsigned int _bitrate)
Set video recorder bitrate in bps.
void SetViewWireframesTarget(const std::string &_target)
View wireframes of the specified target.
std::string FollowTarget() const
Get the target which the user camera is following.
void SetModel(const std::string &_model)
Set the model to hover over the scene.
void SnapPoint(math::Vector3d &_point, math::Vector3d &_snapVals, double _sensitivity=0.4) const
Snaps a point at intervals of a fixed distance. Currently used to give a snapping behavior when movin...
void SetFollowTarget(const std::string &_target, bool _waitForTarget=false)
Move the user camera to follow the speficied target.
void SetViewCollisionsTarget(const std::string &_target)
View collisions of the specified target.
void NewMouseEvent(const common::MouseEvent &_e, const math::Vector2d &_drag=math::Vector2d::Zero)
New mouse event triggered.
void NewHoverEvent(const math::Vector2i &_hoverPos)
New hover event triggered.
void SetTransformMode(const std::string &_mode)
Set the transform mode.
void ContextMenuRequested(QString _entity)
Signal fired when context menu event is triggered.
void FollowTargetChanged(const std::string &_target, bool _waitForTarget)
When fired, the follow target changed. May not be fired for every target change.
void SetViewJointsTarget(const std::string &_target)
View joints of the specified target.
void TextureReady(uint _id, const QSize &_size)
Signal to indicate that a frame has been rendered and ready to be displayed.
void SetErrorCb(std::function< void(const QString &)> _cb)
Set a callback to be called in case there are errors.
void RenderNext(RenderSync *renderSync)
Render the next frame.
IgnRenderer ignRenderer
Ign-rendering renderer.
Definition: Scene3D.hh:650
void SizeChanged()
Slot called to update render texture size.
std::function< void(const QString &)> errorCb
Function to be called if there are errors.
Definition: Scene3D.hh:641
Definition: gz/sim/rendering/RenderUtil.hh:46
A QQUickItem that manages the render window.
Definition: Scene3D.hh:656
void SetViewTransparentTarget(const std::string &_target)
View the specified target as transparent.
void SetMoveToPose(const math::Pose3d &_pose)
Set the pose of the camera.
void SetXYZSnap(const math::Vector3d &_xyz)
Set the XYZ snap values from the user input.
void mousePressEvent(QMouseEvent *_e) override
void SetDropdownMenuEnabled(bool _enableDropdownMenu)
Set if the dropdown menu is enabled or disabled.
void SetViewAngle(const math::Vector3d &_direction)
Set the viewing angle of the camera.
void SetMoveTo(const std::string &_target)
Move the user camera to move to the specified target.
void Ready()
Slot called when thread is ready to be started.
void SetRecordVideo(bool _record, const std::string &_format, const std::string &_savePath)
Set whether to record video.
void SetRecordVideoUseSimTime(bool _useSimTime)
Set whether to record video using sim time as timestamp.
class RenderUtil * RenderUtil() const
Set the renderer.
void HandleKeyPress(QKeyEvent *_e)
Handle key press event for snapping.
void mouseMoveEvent(QMouseEvent *_e) override
void HandleKeyRelease(QKeyEvent *_e)
Handle key release event for snapping.
void wheelEvent(QWheelEvent *_e) override
void mouseReleaseEvent(QMouseEvent *_e) override
void SetViewCOMTarget(const std::string &_target)
View center of mass of the specified target.
math::Pose3d CameraPose() const
Get the user camera pose.
void SetScaleSnap(const math::Vector3d &_scale)
Set the scale snap values from the user input.
void SetInitCameraPose(const math::Pose3d &_pose)
Set the initial user camera pose.
void SetRPYSnap(const math::Vector3d &_rpy)
Set the RPY snap values from the user input.
void SetViewController(const std::string &_viewController)
Set camera view controller.
void SetVisibilityMask(uint32_t _mask)
Set the user camera visibility mask.
void SetViewInertiaTarget(const std::string &_target)
View inertia of the specified target.
void SetFollowWorldFrame(bool _worldFrame)
True to set the camera to follow the target in world frame, false to follow in target's local frame.
void SetErrorCb(std::function< void(const QString &)> _cb)
Set a callback to be called in case there are errors.
void SetModelPath(const std::string &_filePath)
Set the path of the model to hover.
RenderWindowItem(QQuickItem *_parent=nullptr)
Constructor.
void SetRecordVideoLockstep(bool _lockstep)
Set whether to record video in lockstep mode.
bool RendererInitialized() const
Get whether the renderer is initialized. The renderer is initialized when the context is created and ...
void SetWorldName(const std::string &_name)
Set the world name.
void SetFollowOffset(const math::Vector3d &_offset)
Set the camera follow offset position.
math::Vector3d ScreenToScene(const math::Vector2i &_screenPos)
Retrieve the first point on a surface in the 3D scene hit by a ray cast from the given 2D screen coor...
void SetFollowPGain(double _gain)
Set the p gain for the camera follow movement.
void SetRecordVideoBitrate(unsigned int _bitrate)
Set video recorder bitrate in bps.
void SetViewWireframesTarget(const std::string &_target)
View wireframes of the specified target.
void SetModel(const std::string &_model)
Set the model to hover.
void openContextMenu(QString _entity)
Signal fired to open context menu Note that the function name needs to start with lowercase in order ...
void SetCameraPose(const math::Pose3d &_pose)
Set the initial user camera pose.
void SetFollowTarget(const std::string &_target, bool _waitForTarget=false)
Move the user camera to follow the specified target.
void SetViewCollisionsTarget(const std::string &_target)
View collisions of the specified target.
void OnContextMenuRequested(QString _entity)
Qt callback when context menu request is received.
void DeselectAllEntities(bool _sendEvent)
Deselect all the currently selected entities within the RenderUtil class.
void SetTransformMode(const std::string &_mode)
Set the transform mode.
void OnHovered(const gz::math::Vector2i &_hoverPos)
Called when the mouse hovers to a new position.
void SetViewJointsTarget(const std::string &_target)
View joints of the specified target.
void UpdateSelectedEntity(Entity _entity, bool _sendEvent)
An update function to apply the rules of selection to the passed in node. The rules are as follows:
Creates an ignition rendering scene and user camera. It is possible to orbit the camera around the sc...
Definition: Scene3D.hh:83
Texture node for displaying the render texture from ign-renderer.
Definition: Scene3D.hh:889
RenderSync & renderSync
See RenderSync.
Definition: Scene3D.hh:931
void NewTexture(uint _id, const QSize &_size)
This function gets called on the FBO rendering thread and will store the texture id and size and sche...
void PendingNewTexture()
Signal emitted when a new texture is ready to trigger window update.
TextureNode(QQuickWindow *_window, RenderSync &_renderSync)
Constructor.
void PrepareNode()
Before the scene graph starts to render, we update to the pending texture.
void TextureInUse(RenderSync *_renderSync)
Signal emitted when the texture is being rendered and renderer can start rendering next frame.
QMutex mutex
Mutex to protect the texture variables.
Definition: Scene3D.hh:928
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:58
STL namespace.
Information passed to systems on the update callback.
Definition: include/gz/sim/Types.hh:39