Gazebo Gazebo

API Reference

6.18.0
Scene3D.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GZ_GAZEBO_GUI_SCENE3D_HH_
19 #define GZ_GAZEBO_GUI_SCENE3D_HH_
20 
21 #include <gz/msgs/boolean.pb.h>
22 #include <gz/msgs/gui_camera.pb.h>
23 #include <gz/msgs/stringmsg.pb.h>
24 #include <gz/msgs/vector3d.pb.h>
25 #include <gz/msgs/video_record.pb.h>
26 
27 #include <string>
28 #include <memory>
29 #include <mutex>
30 
31 #include <sdf/Root.hh>
32 
33 #include <gz/math/Color.hh>
34 #include <gz/math/Pose3.hh>
35 #include <gz/math/Vector2.hh>
36 #include <gz/math/Vector3.hh>
37 
38 #include <gz/common/MouseEvent.hh>
39 #include <gz/common/KeyEvent.hh>
40 
41 #include <gz/rendering/Camera.hh>
42 
43 #include <gz/sim/gui/GuiSystem.hh>
44 
45 #include "gz/gui/qt.h"
46 
47 
48 namespace ignition
49 {
50 namespace gazebo
51 {
52 // Inline bracket to help doxygen filtering.
53 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
54  class IgnRendererPrivate;
55  class RenderWindowItemPrivate;
56  class Scene3DPrivate;
57  class RenderUtil;
58 
83  {
84  Q_OBJECT
85 
87  Q_PROPERTY(
88  QString errorPopupText
89  READ ErrorPopupText
90  WRITE SetErrorPopupText
91  NOTIFY ErrorPopupTextChanged
92  )
93 
94 
95  Q_PROPERTY(
96  QString loadingError
97  READ LoadingError
98  WRITE SetLoadingError
99  NOTIFY LoadingErrorChanged
100  )
101 
102 
103  public: Scene3D();
104 
106  public: ~Scene3D() override;
107 
108  // Documentation inherited
109  public: void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override;
110 
111  // Documentation inherited
112  public: void Update(const UpdateInfo &_info,
113  EntityComponentManager &_ecm) override;
114 
119  public slots: void OnDropped(const QString &_drop,
120  int _mouseX, int _mouseY);
121 
125  public slots: void OnHovered(int _mouseX, int _mouseY);
126 
129  public slots: void OnFocusWindow();
130 
131  // Documentation inherited
132  protected: bool eventFilter(QObject *_obj, QEvent *_event) override;
133 
138  private: bool OnTransformMode(const msgs::StringMsg &_msg,
139  msgs::Boolean &_res);
140 
145  private: bool OnRecordVideo(const msgs::VideoRecord &_msg,
146  msgs::Boolean &_res);
147 
152  private: bool OnMoveTo(const msgs::StringMsg &_msg,
153  msgs::Boolean &_res);
154 
159  private: bool OnFollow(const msgs::StringMsg &_msg,
160  msgs::Boolean &_res);
161 
166  private: bool OnFollowOffset(const msgs::Vector3d &_msg,
167  msgs::Boolean &_res);
168 
173  private: bool OnViewAngle(const msgs::Vector3d &_msg,
174  msgs::Boolean &_res);
175 
180  private: bool OnMoveToPose(const msgs::GUICamera &_msg,
181  msgs::Boolean &_res);
182 
188  private: bool OnViewTransparent(const msgs::StringMsg &_msg,
189  msgs::Boolean &_res);
190 
196  private: bool OnViewCOM(const msgs::StringMsg &_msg,
197  msgs::Boolean &_res);
198 
203  private: bool OnViewInertia(const msgs::StringMsg &_msg,
204  msgs::Boolean &_res);
205 
210  private: bool OnViewJoints(const msgs::StringMsg &_msg,
211  msgs::Boolean &_res);
212 
217  private: bool OnViewWireframes(const msgs::StringMsg &_msg,
218  msgs::Boolean &_res);
219 
224  private: bool OnViewCollisions(const msgs::StringMsg &_msg,
225  msgs::Boolean &_res);
226 
229  public: Q_INVOKABLE QString ErrorPopupText() const;
230 
233  public: Q_INVOKABLE void SetErrorPopupText(const QString &_errorTxt);
234 
236  signals: void ErrorPopupTextChanged();
237 
241  signals: void popupError();
242 
247  private: bool OnViewControl(const msgs::StringMsg &_msg,
248  msgs::Boolean &_res);
249 
252  public: Q_INVOKABLE QString LoadingError() const;
253 
256  public: Q_INVOKABLE void SetLoadingError(const QString &_loadingError);
257 
259  signals: void LoadingErrorChanged();
260 
262  public: QString loadingError;
263 
266  private: std::unique_ptr<Scene3DPrivate> dataPtr;
267  };
268 
269  class RenderSync;
270 
277  class IgnRenderer : public QObject
278  {
279  Q_OBJECT
280 
282  public: IgnRenderer();
283 
285  public: ~IgnRenderer() override;
286 
290  public: void Render(RenderSync *_renderSync);
291 
296 
298  public: void Destroy();
299 
301  public: class RenderUtil *RenderUtil() const;
302 
305  public: void SetTransformMode(const std::string &_mode);
306 
309  public: void SetModel(const std::string &_model);
310 
313  public: void SetModelPath(const std::string &_filePath);
314 
318  public: void SetDropdownMenuEnabled(bool _enableDropdownMenu);
319 
324  public: void SetRecordVideo(bool _record, const std::string &_format,
325  const std::string &_savePath);
326 
329  public: void SetRecordVideoUseSimTime(bool _useSimTime);
330 
333  public: void SetRecordVideoLockstep(bool _lockstep);
334 
337  public: void SetRecordVideoBitrate(unsigned int _bitrate);
338 
341  public: void SetMoveTo(const std::string &_target);
342 
348  public: void SetFollowTarget(const std::string &_target,
349  bool _waitForTarget = false);
350 
355  public: void SetViewAngle(const math::Vector3d &_direction);
356 
359  public: void SetMoveToPose(const math::Pose3d &_pose);
360 
363  public: void SetViewTransparentTarget(const std::string &_target);
364 
367  public: void SetViewCOMTarget(const std::string &_target);
368 
371  public: void SetViewInertiaTarget(const std::string &_target);
372 
375  public: void SetViewJointsTarget(const std::string &_target);
376 
379  public: void SetViewWireframesTarget(const std::string &_target);
380 
383  public: void SetViewCollisionsTarget(const std::string &_target);
384 
387  public: void SetViewController(const std::string &_viewController);
388 
391  public: void SetFollowPGain(double _gain);
392 
396  public: void SetFollowWorldFrame(bool _worldFrame);
397 
400  public: void SetFollowOffset(const math::Vector3d &_offset);
401 
404  public: std::string FollowTarget() const;
405 
408  public: bool FollowWorldFrame() const;
409 
412  public: math::Vector3d FollowOffset() const;
413 
416  public: void SetInitCameraPose(const math::Pose3d &_pose);
417 
421  public: void NewMouseEvent(const common::MouseEvent &_e,
422  const math::Vector2d &_drag = math::Vector2d::Zero);
423 
426  public: void NewHoverEvent(const math::Vector2i &_hoverPos);
427 
430  public: void HandleKeyPress(QKeyEvent *_e);
431 
434  public: void HandleKeyRelease(QKeyEvent *_e);
435 
438  public: void SetXYZSnap(const math::Vector3d &_xyz);
439 
442  public: math::Vector3d XYZSnap() const;
443 
446  public: void SetRPYSnap(const math::Vector3d &_rpy);
447 
450  public: math::Vector3d RPYSnap() const;
451 
454  public: void SetScaleSnap(const math::Vector3d &_scale);
455 
458  public: math::Vector3d ScaleSnap() const;
459 
467  public: void SnapPoint(
468  math::Vector3d &_point,
469  math::Vector3d &_snapVals, double _sensitivity = 0.4) const;
470 
476  public: void RequestSelectionChange(Entity _selectedEntity,
477  bool _deselectAll, bool _sendEvent);
478 
487  private: double SnapValue(
488  double _coord, double _interval, double _sensitivity) const;
489 
492  private: void XYZConstraint(math::Vector3d &_axis);
493 
495  private: void HandleMouseEvent();
496 
498  private: void HandleMouseContextMenu();
499 
501  private: void HandleMouseViewControl();
502 
504  private: void HandleMouseTransformControl();
505 
507  private: void HandleEntitySelection();
508 
510  private: void HandleModelPlacement();
511 
513  private: void BroadcastHoverPos();
514 
516  private: void BroadcastLeftClick();
517 
519  private: void BroadcastRightClick();
520 
523  private: Entity UniqueId();
524 
528  public: bool GeneratePreview(const sdf::Root &_sdf);
529 
531  public: void TerminateSpawnPreview();
532 
537  public: math::Vector3d ScreenToPlane(const math::Vector2i &_screenPos)
538  const;
539 
544  public: math::Vector3d ScreenToScene(const math::Vector2i &_screenPos)
545  const;
546 
549  public: math::Pose3d CameraPose() const;
550 
552  private: void OnMoveToComplete();
553 
555  private: void OnViewAngleComplete();
556 
558  private: void OnMoveToPoseComplete();
559 
564  private: void UpdateSelectedEntity(const rendering::NodePtr &_node,
565  bool _sendEvent);
566 
570  private: void DeselectAllEntities(bool _sendEvent);
571 
573  signals: void ContextMenuRequested(QString _entity);
574 
579  signals: void FollowTargetChanged(const std::string &_target,
580  bool _waitForTarget);
581 
586  public: GLuint textureId;
587 
589  public: math::Pose3d cameraPose = math::Pose3d(0, 0, 2, 0, 0.4, 0);
590 
593 
595  public: uint32_t visibilityMask = 0xFFFFFFFFu;
596 
598  public: bool initialized = false;
599 
601  public: QSize textureSize = QSize(1024, 1024);
602 
604  public: bool textureDirty = false;
605 
608  private: std::unique_ptr<IgnRendererPrivate> dataPtr;
609  };
610 
612  class RenderThread : public QThread
613  {
614  Q_OBJECT
615 
617  public: RenderThread();
618 
622  public slots: void RenderNext(RenderSync *renderSync);
623 
625  public slots: void ShutDown();
626 
628  public slots: void SizeChanged();
629 
634  signals: void TextureReady(uint _id, const QSize &_size);
635 
638  public: void SetErrorCb(std::function<void(const QString &)> _cb);
639 
641  public: std::function<void(const QString &)> errorCb;
642 
644  public: QOffscreenSurface *surface = nullptr;
645 
647  public: QOpenGLContext *context = nullptr;
648 
651  };
652 
653 
655  class RenderWindowItem : public QQuickItem
656  {
657  Q_OBJECT
658 
661  public: explicit RenderWindowItem(QQuickItem *_parent = nullptr);
662 
664  public: ~RenderWindowItem() override;
665 
667  public: class RenderUtil *RenderUtil() const;
668 
671  public: void SetCameraPose(const math::Pose3d &_pose);
672 
675  public: math::Pose3d CameraPose() const;
676 
679  public: void SetInitCameraPose(const math::Pose3d &_pose);
680 
683  public: void SetVisibilityMask(uint32_t _mask);
684 
687  public: void SetTransformMode(const std::string &_mode);
688 
691  public: void SetModel(const std::string &_model);
692 
695  public: void SetModelPath(const std::string &_filePath);
696 
700  public: void SetDropdownMenuEnabled(bool _enableDropdownMenu);
701 
706  public: void SetRecordVideo(bool _record, const std::string &_format,
707  const std::string &_savePath);
708 
711  public: void SetRecordVideoUseSimTime(bool _useSimTime);
712 
715  public: void SetRecordVideoLockstep(bool _lockstep);
716 
719  public: void SetRecordVideoBitrate(unsigned int _bitrate);
720 
723  public: void SetMoveTo(const std::string &_target);
724 
730  public Q_SLOTS: void SetFollowTarget(const std::string &_target,
731  bool _waitForTarget = false);
732 
737  public: void SetViewAngle(const math::Vector3d &_direction);
738 
741  public: void SetMoveToPose(const math::Pose3d &_pose);
742 
745  public: void SetViewTransparentTarget(const std::string &_target);
746 
749  public: void SetViewCOMTarget(const std::string &_target);
750 
753  public: void SetViewInertiaTarget(const std::string &_target);
754 
757  public: void SetViewJointsTarget(const std::string &_target);
758 
761  public: void SetViewWireframesTarget(const std::string &_target);
762 
765  public: void SetViewCollisionsTarget(const std::string &_target);
766 
769  public: void SetViewController(const std::string &_viewController);
770 
773  public: void SetFollowPGain(double _gain);
774 
778  public: void SetFollowWorldFrame(bool _worldFrame);
779 
782  public: void SetFollowOffset(const math::Vector3d &_offset);
783 
786  public: void SetWorldName(const std::string &_name);
787 
798  public: void UpdateSelectedEntity(Entity _entity,
799  bool _sendEvent);
800 
805  public: void DeselectAllEntities(bool _sendEvent);
806 
809  public: void SetXYZSnap(const math::Vector3d &_xyz);
810 
813  public: void SetRPYSnap(const math::Vector3d &_rpy);
814 
817  public: void SetScaleSnap(const math::Vector3d &_scale);
818 
823  public: math::Vector3d ScreenToScene(const math::Vector2i &_screenPos);
824 
828  public: void OnHovered(const gz::math::Vector2i &_hoverPos);
829 
834  public: bool RendererInitialized() const;
835 
837  public Q_SLOTS: void Ready();
838 
841  public: void HandleKeyPress(QKeyEvent *_e);
842 
845  public: void HandleKeyRelease(QKeyEvent *_e);
846 
847  // Documentation inherited
848  protected: void mousePressEvent(QMouseEvent *_e) override;
849 
850  // Documentation inherited
851  protected: void mouseReleaseEvent(QMouseEvent *_e) override;
852 
853  // Documentation inherited
854  protected: void mouseMoveEvent(QMouseEvent *_e) override;
855 
856  // Documentation inherited
857  protected: void wheelEvent(QWheelEvent *_e) override;
858 
865  private: QSGNode *updatePaintNode(QSGNode *_oldNode,
866  QQuickItem::UpdatePaintNodeData *_data) override;
867 
872  signals: void openContextMenu(QString _entity); // NOLINT
873 
876  public slots: void OnContextMenuRequested(QString _entity);
877 
880  public: void SetErrorCb(std::function<void(const QString &)> _cb);
881 
885  };
886 
888  class TextureNode : public QObject, public QSGSimpleTextureNode
889  {
890  Q_OBJECT
891 
896  public: explicit TextureNode(QQuickWindow *_window,
897  RenderSync &_renderSync);
898 
900  public: ~TextureNode() override;
901 
906  public slots: void NewTexture(uint _id, const QSize &_size);
907 
910  public slots: void PrepareNode();
911 
915  signals: void TextureInUse(RenderSync *_renderSync);
916 
919  signals: void PendingNewTexture();
920 
922  public: uint id = 0;
923 
925  public: QSize size = QSize(0, 0);
926 
928  public: QMutex mutex;
929 
931  public: RenderSync &renderSync;
932 
934  public: QSGTexture *texture = nullptr;
935 
937  public: QQuickWindow *window = nullptr;
938  };
939 }
940 }
941 }
942 
943 #endif
The EntityComponentManager constructs, deletes, and returns components and entities....
Definition: gz/sim/EntityComponentManager.hh:67
Base class for a GUI System.
Definition: gz/sim/gui/GuiSystem.hh:45
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.
class RenderUtil * RenderUtil() const
Set the renderer.
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 Render(RenderSync *_renderSync)
Main render function.
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 ScaleSnap() const
Get the scale snap values.
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.
~IgnRenderer() override
Destructor.
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.
math::Vector3d XYZSnap() const
Get the XYZ snap values.
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 Destroy()
Destroy camera associated with this renderer.
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.
std::string Initialize()
Initialize the render engine.
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.
math::Vector3d RPYSnap() const
Get the RPY snap values.
void SetViewJointsTarget(const std::string &_target)
View joints of the specified target.
Rendering thread.
Definition: Scene3D.hh:613
void TextureReady(uint _id, const QSize &_size)
Signal to indicate that a frame has been rendered and ready to be displayed.
void ShutDown()
Shutdown the thread and the render engine.
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.
~RenderWindowItem() override
Destructor.
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.
~TextureNode() override
Destructor.
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
This library is part of the Gazebo project.
Definition: gz/sim/Actor.hh:34
STL namespace.
Information passed to systems on the update callback.
Definition: include/gz/sim/Types.hh:39