Gazebo Rendering

API Reference

6.6.3
gz/rendering/Scene.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 #ifndef GZ_RENDERING_SCENE_HH_
18 #define GZ_RENDERING_SCENE_HH_
19 
20 #include <array>
21 #include <string>
22 #include <limits>
23 
24 #include <gz/common/Material.hh>
25 #include <gz/common/Mesh.hh>
26 #include <gz/common/Time.hh>
27 
28 #include <gz/math/Color.hh>
29 
30 #include "gz/rendering/config.hh"
34 #include "gz/rendering/Storage.hh"
35 #include "gz/rendering/Export.hh"
36 
37 namespace ignition
38 {
39  namespace rendering
40  {
41  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
42  //
43  class RenderEngine;
44 
49  class IGNITION_RENDERING_VISIBLE Scene
50  {
52  public: virtual ~Scene() { }
53 
55  public: virtual void Load() = 0;
56 
58  public: virtual void Init() = 0;
59 
60  // TODO(anyone): merge with Destroy
61  public: virtual void Fini() = 0;
62 
65  public: virtual bool IsInitialized() const = 0;
66 
69  public: virtual unsigned int Id() const = 0;
70 
73  public: virtual std::string Name() const = 0;
74 
77  public: virtual RenderEngine *Engine() const = 0;
78 
81  public: virtual common::Time IGN_DEPRECATED(4) SimTime() const = 0;
82 
85  public: virtual std::chrono::steady_clock::duration
86  Time() const = 0;
87 
90  public: virtual void IGN_DEPRECATED(4)
91  SetSimTime(const common::Time &_time) = 0;
92 
95  public: virtual void SetTime(
96  const std::chrono::steady_clock::duration &_time) = 0;
97 
103  public: virtual VisualPtr RootVisual() const = 0;
104 
109  public: virtual VisualPtr VisualAt(const CameraPtr &_camera,
110  const math::Vector2i &_mousePos) = 0;
111 
114  public: virtual math::Color AmbientLight() const = 0;
115 
121  public: virtual void SetAmbientLight(double _r, double _g, double _b,
122  double _a = 1.0) = 0;
123 
126  public: virtual void SetAmbientLight(const math::Color &_color) = 0;
127 
130  public: virtual math::Color BackgroundColor() const = 0;
131 
137  public: virtual void SetBackgroundColor(double _r, double _g, double _b,
138  double _a = 1.0) = 0;
139 
142  public: virtual void SetBackgroundColor(const math::Color &_color) = 0;
143 
146  public: virtual bool IsGradientBackgroundColor() const = 0;
147 
151  public: virtual std::array<math::Color, 4>
152  GradientBackgroundColor() const = 0;
153 
167  public: virtual void SetGradientBackgroundColor(
168  const std::array<math::Color, 4> &_colors) = 0;
169 
173  public: virtual void RemoveGradientBackgroundColor() = 0;
174 
178  public: virtual MaterialPtr BackgroundMaterial() const = 0;
179 
183  public: virtual void SetBackgroundMaterial(MaterialPtr _material) = 0;
184 
188  public: virtual unsigned int NodeCount() const = 0;
189 
193  public: virtual bool HasNode(ConstNodePtr _node) const = 0;
194 
199  public: virtual bool HasNodeId(unsigned int _id) const = 0;
200 
205  public: virtual bool HasNodeName(const std::string &_name) const = 0;
206 
211  public: virtual NodePtr NodeById(unsigned int _id) const = 0;
212 
217  public: virtual NodePtr NodeByName(const std::string &_name) const = 0;
218 
223  public: virtual NodePtr NodeByIndex(unsigned int _index) const = 0;
224 
232  public: virtual void DestroyNode(NodePtr _node,
233  bool _recursive = false) = 0;
234 
239  public: virtual void DestroyNodeById(unsigned int _id) = 0;
240 
245  public: virtual void DestroyNodeByName(const std::string &_name) = 0;
246 
251  public: virtual void DestroyNodeByIndex(unsigned int _index) = 0;
252 
254  public: virtual void DestroyNodes() = 0;
255 
259  public: virtual unsigned int LightCount() const = 0;
260 
264  public: virtual bool HasLight(ConstLightPtr _light) const = 0;
265 
270  public: virtual bool HasLightId(unsigned int _id) const = 0;
271 
276  public: virtual bool HasLightName(const std::string &_name) const = 0;
277 
282  public: virtual LightPtr LightById(unsigned int _id) const = 0;
283 
288  public: virtual LightPtr LightByName(
289  const std::string &_name) const = 0;
290 
295  public: virtual LightPtr LightByIndex(unsigned int _index) const = 0;
296 
304  public: virtual void DestroyLight(LightPtr _light,
305  bool _recursive = false) = 0;
306 
311  public: virtual void DestroyLightById(unsigned int _id) = 0;
312 
317  public: virtual void DestroyLightByName(const std::string &_name) = 0;
318 
323  public: virtual void DestroyLightByIndex(unsigned int _index) = 0;
324 
326  public: virtual void DestroyLights() = 0;
327 
331  public: virtual unsigned int SensorCount() const = 0;
332 
336  public: virtual bool HasSensor(ConstSensorPtr _sensor) const = 0;
337 
342  public: virtual bool HasSensorId(unsigned int _id) const = 0;
343 
348  public: virtual bool HasSensorName(const std::string &_name) const = 0;
349 
354  public: virtual SensorPtr SensorById(unsigned int _id) const = 0;
355 
360  public: virtual SensorPtr SensorByName(
361  const std::string &_name) const = 0;
362 
367  public: virtual SensorPtr SensorByIndex(unsigned int _index) const = 0;
368 
376  public: virtual void DestroySensor(SensorPtr _sensor,
377  bool _recursive = false) = 0;
378 
383  public: virtual void DestroySensorById(unsigned int _id) = 0;
384 
389  public: virtual void DestroySensorByName(const std::string &_name) = 0;
390 
395  public: virtual void DestroySensorByIndex(unsigned int _index) = 0;
396 
398  public: virtual void DestroySensors() = 0;
399 
403  public: virtual unsigned int VisualCount() const = 0;
404 
408  public: virtual bool HasVisual(ConstVisualPtr _node) const = 0;
409 
414  public: virtual bool HasVisualId(unsigned int _id) const = 0;
415 
420  public: virtual bool HasVisualName(const std::string &_name) const = 0;
421 
426  public: virtual VisualPtr VisualById(unsigned int _id) const = 0;
427 
432  public: virtual VisualPtr VisualByName(
433  const std::string &_name) const = 0;
434 
439  public: virtual VisualPtr VisualByIndex(unsigned int _index) const = 0;
440 
449  public: virtual void DestroyVisual(VisualPtr _node,
450  bool _recursive = false) = 0;
451 
456  public: virtual void DestroyVisualById(unsigned int _id) = 0;
457 
462  public: virtual void DestroyVisualByName(const std::string &_name) = 0;
463 
468  public: virtual void DestroyVisualByIndex(unsigned int _index) = 0;
469 
471  public: virtual void DestroyVisuals() = 0;
472 
476  public: virtual bool MaterialRegistered(
477  const std::string &_name) const = 0;
478 
483  public: virtual MaterialPtr Material(
484  const std::string &_name) const = 0;
485 
490  public: virtual void RegisterMaterial(const std::string &_name,
491  MaterialPtr _material) = 0;
492 
496  public: virtual void UnregisterMaterial(const std::string &_name) = 0;
497 
499  public: virtual void UnregisterMaterials() = 0;
500 
503  public: virtual void DestroyMaterial(MaterialPtr _material) = 0;
504 
506  public: virtual void DestroyMaterials() = 0;
507 
511  public: virtual DirectionalLightPtr CreateDirectionalLight() = 0;
512 
518  public: virtual DirectionalLightPtr CreateDirectionalLight(
519  unsigned int _id) = 0;
520 
526  public: virtual DirectionalLightPtr CreateDirectionalLight(
527  const std::string &_name) = 0;
528 
534  public: virtual DirectionalLightPtr CreateDirectionalLight(
535  unsigned int _id, const std::string &_name) = 0;
536 
540  public: virtual PointLightPtr CreatePointLight() = 0;
541 
547  public: virtual PointLightPtr CreatePointLight(
548  unsigned int _id) = 0;
549 
555  public: virtual PointLightPtr CreatePointLight(
556  const std::string &_name) = 0;
557 
563  public: virtual PointLightPtr CreatePointLight(
564  unsigned int _id, const std::string &_name) = 0;
565 
569  public: virtual SpotLightPtr CreateSpotLight() = 0;
570 
576  public: virtual SpotLightPtr CreateSpotLight(
577  unsigned int _id) = 0;
578 
584  public: virtual SpotLightPtr CreateSpotLight(
585  const std::string &_name) = 0;
586 
592  public: virtual SpotLightPtr CreateSpotLight(
593  unsigned int _id, const std::string &_name) = 0;
594 
598  public: virtual CameraPtr CreateCamera() = 0;
599 
605  public: virtual CameraPtr CreateCamera(
606  unsigned int _id) = 0;
607 
613  public: virtual CameraPtr CreateCamera(
614  const std::string &_name) = 0;
615 
621  public: virtual CameraPtr CreateCamera(
622  unsigned int _id, const std::string &_name) = 0;
623 
627  public: virtual DepthCameraPtr CreateDepthCamera() = 0;
628 
634  public: virtual DepthCameraPtr CreateDepthCamera(
635  unsigned int _id) = 0;
636 
642  public: virtual DepthCameraPtr CreateDepthCamera(
643  const std::string &_name) = 0;
644 
650  public: virtual DepthCameraPtr CreateDepthCamera(
651  unsigned int _id, const std::string &_name) = 0;
652 
656  public: virtual ThermalCameraPtr CreateThermalCamera() = 0;
657 
663  public: virtual ThermalCameraPtr CreateThermalCamera(
664  unsigned int _id) = 0;
665 
671  public: virtual ThermalCameraPtr CreateThermalCamera(
672  const std::string &_name) = 0;
673 
679  public: virtual ThermalCameraPtr CreateThermalCamera(
680  unsigned int _id, const std::string &_name) = 0;
681 
685  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera() = 0;
686 
692  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
693  unsigned int _id) = 0;
694 
700  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
701  const std::string &_name) = 0;
702 
708  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
709  unsigned int _id, const std::string &_name) = 0;
710 
714  public: virtual SegmentationCameraPtr CreateSegmentationCamera() = 0;
715 
721  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
722  unsigned int _id) = 0;
723 
729  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
730  const std::string &_name) = 0;
731 
737  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
738  unsigned int _id, const std::string &_name) = 0;
739 
743  public: virtual GpuRaysPtr CreateGpuRays() = 0;
744 
750  public: virtual GpuRaysPtr CreateGpuRays(unsigned int _id) = 0;
751 
757  public: virtual GpuRaysPtr CreateGpuRays(
758  const std::string &_name) = 0;
759 
765  public: virtual GpuRaysPtr CreateGpuRays(
766  unsigned int _id, const std::string &_name) = 0;
767 
771  public: virtual VisualPtr CreateVisual() = 0;
772 
778  public: virtual VisualPtr CreateVisual(
779  unsigned int _id) = 0;
780 
786  public: virtual VisualPtr CreateVisual(
787  const std::string &_name) = 0;
788 
794  public: virtual VisualPtr CreateVisual(
795  unsigned int _id, const std::string &_name) = 0;
796 
800  public: virtual ArrowVisualPtr CreateArrowVisual() = 0;
801 
807  public: virtual ArrowVisualPtr CreateArrowVisual(
808  unsigned int _id) = 0;
809 
815  public: virtual ArrowVisualPtr CreateArrowVisual(
816  const std::string &_name) = 0;
817 
823  public: virtual ArrowVisualPtr CreateArrowVisual(
824  unsigned int _id, const std::string &_name) = 0;
825 
829  public: virtual AxisVisualPtr CreateAxisVisual() = 0;
830 
836  public: virtual AxisVisualPtr CreateAxisVisual(
837  unsigned int _id) = 0;
838 
844  public: virtual AxisVisualPtr CreateAxisVisual(
845  const std::string &_name) = 0;
846 
852  public: virtual AxisVisualPtr CreateAxisVisual(
853  unsigned int _id, const std::string &_name) = 0;
854 
858  public: virtual GizmoVisualPtr CreateGizmoVisual() = 0;
859 
865  public: virtual GizmoVisualPtr CreateGizmoVisual(
866  unsigned int _id) = 0;
867 
873  public: virtual GizmoVisualPtr CreateGizmoVisual(
874  const std::string &_name) = 0;
875 
881  public: virtual GizmoVisualPtr CreateGizmoVisual(
882  unsigned int _id, const std::string &_name) = 0;
883 
887  public: virtual COMVisualPtr CreateCOMVisual() = 0;
888 
894  public: virtual COMVisualPtr CreateCOMVisual(
895  unsigned int _id) = 0;
896 
902  public: virtual COMVisualPtr CreateCOMVisual(
903  const std::string &_name) = 0;
904 
910  public: virtual COMVisualPtr CreateCOMVisual(
911  unsigned int _id, const std::string &_name) = 0;
912 
916  public: virtual InertiaVisualPtr CreateInertiaVisual() = 0;
917 
923  public: virtual InertiaVisualPtr CreateInertiaVisual(
924  unsigned int _id) = 0;
925 
931  public: virtual InertiaVisualPtr CreateInertiaVisual(
932  const std::string &_name) = 0;
933 
939  public: virtual InertiaVisualPtr CreateInertiaVisual(
940  unsigned int _id, const std::string &_name) = 0;
941 
945  public: virtual JointVisualPtr CreateJointVisual() = 0;
946 
952  public: virtual JointVisualPtr CreateJointVisual(
953  unsigned int _id) = 0;
954 
960  public: virtual JointVisualPtr CreateJointVisual(
961  const std::string &_name) = 0;
962 
968  public: virtual JointVisualPtr CreateJointVisual(
969  unsigned int _id, const std::string &_name) = 0;
970 
974  public: virtual LightVisualPtr CreateLightVisual() = 0;
975 
981  public: virtual LightVisualPtr CreateLightVisual(
982  unsigned int _id) = 0;
983 
989  public: virtual LightVisualPtr CreateLightVisual(
990  const std::string &_name) = 0;
991 
997  public: virtual LightVisualPtr CreateLightVisual(
998  unsigned int _id, const std::string &_name) = 0;
999 
1002  public: virtual GeometryPtr CreateBox() = 0;
1003 
1006  public: virtual CapsulePtr CreateCapsule() = 0;
1007 
1010  public: virtual GeometryPtr CreateCone() = 0;
1011 
1014  public: virtual GeometryPtr CreateCylinder() = 0;
1015 
1018  public: virtual GeometryPtr CreatePlane() = 0;
1019 
1024  public: virtual GeometryPtr CreateSphere() = 0;
1025 
1032  public: virtual MeshPtr CreateMesh(const std::string &_meshName) = 0;
1033 
1039  public: virtual MeshPtr CreateMesh(const common::Mesh *_mesh) = 0;
1040 
1046  public: virtual MeshPtr CreateMesh(const MeshDescriptor &_desc) = 0;
1047 
1050  public: virtual GridPtr CreateGrid() = 0;
1051 
1054  public: virtual WireBoxPtr CreateWireBox() = 0;
1055 
1058  public: virtual MarkerPtr CreateMarker() = 0;
1059 
1063  public: virtual LidarVisualPtr CreateLidarVisual() = 0;
1064 
1070  public: virtual LidarVisualPtr CreateLidarVisual(unsigned int _id) = 0;
1071 
1077  public: virtual LidarVisualPtr CreateLidarVisual(
1078  const std::string &_name) = 0;
1079 
1085  public: virtual LidarVisualPtr CreateLidarVisual(
1086  unsigned int _id, const std::string &_name) = 0;
1087 
1092  public: virtual HeightmapPtr CreateHeightmap(
1093  const HeightmapDescriptor &_desc) = 0;
1094 
1097  public: virtual TextPtr CreateText() = 0;
1098 
1103  public: virtual MaterialPtr CreateMaterial(const std::string &_name = "")
1104  = 0;
1105 
1109  public: virtual MaterialPtr CreateMaterial(
1110  const common::Material &_material) = 0;
1111 
1114  public: virtual RenderTexturePtr CreateRenderTexture() = 0;
1115 
1120  public: virtual RenderWindowPtr CreateRenderWindow() = 0;
1121 
1124  public: virtual RayQueryPtr CreateRayQuery() = 0;
1125 
1129  public: virtual ParticleEmitterPtr CreateParticleEmitter() = 0;
1130 
1136  public: virtual ParticleEmitterPtr CreateParticleEmitter(
1137  unsigned int _id) = 0;
1138 
1144  public: virtual ParticleEmitterPtr CreateParticleEmitter(
1145  const std::string &_name) = 0;
1146 
1152  public: virtual ParticleEmitterPtr CreateParticleEmitter(
1153  unsigned int _id, const std::string &_name) = 0;
1154 
1157  public: virtual void SetSkyEnabled(bool _enabled) = 0;
1158 
1161  public: virtual bool SkyEnabled() const = 0;
1162 
1165  public: virtual void PreRender() = 0;
1166 
1172  public: virtual void PostRender() = 0;
1173 
1267  public: virtual void SetCameraPassCountPerGpuFlush(uint8_t _numPass) = 0;
1268 
1273  public: virtual uint8_t CameraPassCountPerGpuFlush() const = 0;
1274 
1279  public: virtual bool LegacyAutoGpuFlush() const = 0;
1280 
1284  public: virtual void Clear() = 0;
1285 
1289  public: virtual void Destroy() = 0;
1290  };
1291  }
1292  }
1293 }
1294 #endif
virtual VisualPtr RootVisual() const =0
Get root Visual node. All nodes that are desired to be rendered in a scene should be added to this Vi...
virtual MaterialPtr CreateMaterial(const std::string &_name="")=0
Create new material with the given name. Created material will have default properties.
virtual bool HasNodeName(const std::string &_name) const =0
Determine if a given node with the given name is managed by this Scene.
virtual void UnregisterMaterial(const std::string &_name)=0
Unregister material registered under the given name. If no material is registered under this name,...
virtual bool LegacyAutoGpuFlush() const =0
Checks if SetCameraPassCountPerGpuFlush is 0.
virtual JointVisualPtr CreateJointVisual()=0
Create new joint visual. A unique ID and name will automatically be assigned to the Joint visual.
virtual PointLightPtr CreatePointLight()=0
Create new point light. A unique ID and name will automatically be assigned to the light.
virtual void RemoveGradientBackgroundColor()=0
Remove the scene gradient background color.
virtual void DestroySensorByName(const std::string &_name)=0
Destroy sensor with the given name. If no sensor exists with the given name, no work will be done....
STL class.
STL class.
virtual RenderTexturePtr CreateRenderTexture()=0
Create new render texture.
virtual unsigned int VisualCount() const =0
Get the number of nodes managed by this scene. Note these nodes may not be directly or indirectly att...
virtual bool HasSensorId(unsigned int _id) const =0
Determine if a given sensor with the given id is managed by this Scene.
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:146
virtual RayQueryPtr CreateRayQuery()=0
Create new ray query.
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
virtual SensorPtr SensorByName(const std::string &_name) const =0
Get sensor with the given name. If no sensor exists with the given name, NULL will be returned.
virtual void DestroySensors()=0
Destroy all sensors manages by this scene.
virtual GeometryPtr CreateSphere()=0
Create new sphere or ellipsoid geometry This method allow to create ellipsoid too,...
virtual void DestroyNodeByIndex(unsigned int _index)=0
Destroy node at the given index. If no node exists at the given index, no work will be done....
virtual void DestroyVisualByName(const std::string &_name)=0
Destroy node with the given name. If no node exists with the given name, no work will be done....
virtual math::Color BackgroundColor() const =0
Get the scene background color.
virtual void SetGradientBackgroundColor(const std::array< math::Color, 4 > &_colors)=0
Set a custom gradient background color on top of the regular background. Default should be black.
virtual SpotLightPtr CreateSpotLight()=0
Create new spotlight. A unique ID and name will automatically be assigned to the light.
virtual void UnregisterMaterials()=0
Unregister all registered materials.
virtual void DestroyNodeByName(const std::string &_name)=0
Destroy node with the given name. If no node exists with the given name, no work will be done....
virtual RenderWindowPtr CreateRenderWindow()=0
Create new render window. This feature is render engine dependent. If the engine does not support att...
virtual HeightmapPtr CreateHeightmap(const HeightmapDescriptor &_desc)=0
Create new heightmap geomerty. The rendering::Heightmap will be created from the given HeightmapDescr...
virtual bool HasNode(ConstNodePtr _node) const =0
Determine if the given node is managed by this Scene.
virtual SensorPtr SensorByIndex(unsigned int _index) const =0
Get sensor at the given index. If no sensor exists at the given index, NULL will be returned.
virtual CapsulePtr CreateCapsule()=0
Create new capsule geometry.
virtual void Destroy()=0
Completely destroy the scene an all its resources. Continued use of this scene after its destruction ...
virtual RenderEngine * Engine() const =0
Get the creating render-engine of the scene.
virtual GeometryPtr CreatePlane()=0
Create new plane geometry.
Vector2< int > Vector2i
virtual ~Scene()
Deconstructor.
Definition: gz/rendering/Scene.hh:52
virtual void SetBackgroundColor(double _r, double _g, double _b, double _a=1.0)=0
Set the scene background color.
virtual ParticleEmitterPtr CreateParticleEmitter()=0
Create new particle emitter. A unique ID and name will automatically be assigned to the visual.
virtual CameraPtr CreateCamera()=0
Create new camera. A unique ID and name will automatically be assigned to the camera.
virtual void Clear()=0
Remove and destroy all objects from the scene graph. This does not completely destroy scene resources...
virtual void DestroyVisualByIndex(unsigned int _index)=0
Destroy node at the given index. If no node exists at the given index, no work will be done....
virtual void SetSkyEnabled(bool _enabled)=0
Enable sky in the scene.
virtual VisualPtr VisualByIndex(unsigned int _index) const =0
Get node at the given index. If no node exists at the given index, NULL will be returned.
virtual void DestroyNodes()=0
Destroy all nodes manages by this scene.
virtual VisualPtr CreateVisual()=0
Create new visual. A unique ID and name will automatically be assigned to the visual.
virtual bool HasLight(ConstLightPtr _light) const =0
Determine if the given light is managed by this Scene.
virtual GeometryPtr CreateBox()=0
Create new box geometry.
virtual bool IsGradientBackgroundColor() const =0
Whether the scene has a gradient background or not (solid)
virtual bool SkyEnabled() const =0
Get whether the sky is enabled in the scene.
virtual bool HasLightId(unsigned int _id) const =0
Determine if a given light with the given id is managed by this Scene.
virtual VisualPtr VisualAt(const CameraPtr &_camera, const math::Vector2i &_mousePos)=0
Get a visual at a mouse position.
virtual bool IsInitialized() const =0
Determine if the scene is initialized.
Manages a single scene-graph. This class updates scene-wide properties and holds the root scene node....
Definition: gz/rendering/Scene.hh:49
virtual void DestroyLightByIndex(unsigned int _index)=0
Destroy light at the given index. If no light exists at the given index, no work will be done....
virtual std::array< math::Color, 4 > GradientBackgroundColor() const =0
Get the scene gradient background color.
virtual GpuRaysPtr CreateGpuRays()=0
Create new gpu rays caster. A unique ID and name will automatically be assigned to the gpu rays caste...
virtual bool HasNodeId(unsigned int _id) const =0
Determine if a given node with the given id is managed by this Scene.
virtual NodePtr NodeById(unsigned int _id) const =0
Get node with the given id. If no node exists with the given id, NULL will be returned.
virtual void DestroyNode(NodePtr _node, bool _recursive=false)=0
Destroy given node. If the given node is not managed by this scene, no work will be done....
Represents a collection of mesh geometries.
Definition: gz/rendering/Mesh.hh:37
virtual GeometryPtr CreateCone()=0
Create new cone geometry.
virtual void DestroyMaterials()=0
Unregister and destroys all registered materials.
virtual DepthCameraPtr CreateDepthCamera()=0
Create new depth camera. A unique ID and name will automatically be assigned to the camera.
virtual void SetAmbientLight(double _r, double _g, double _b, double _a=1.0)=0
Set the scene ambient light color.
virtual ThermalCameraPtr CreateThermalCamera()=0
Create new thermal camera. A unique ID and name will automatically be assigned to the camera.
virtual SensorPtr SensorById(unsigned int _id) const =0
Get sensor with the given id. If no sensor exists with the given id, NULL will be returned.
virtual GridPtr CreateGrid()=0
Create new grid geometry.
virtual void PreRender()=0
Prepare scene for rendering. The scene will flushing any scene changes by traversing scene-graph,...
STL class.
virtual VisualPtr VisualById(unsigned int _id) const =0
Get node with the given id. If no node exists with the given id, NULL will be returned.
virtual GizmoVisualPtr CreateGizmoVisual()=0
Create new gizmo visual. A unique ID and name will automatically be assigned to the visual.
virtual bool HasSensorName(const std::string &_name) const =0
Determine if a given sensor with the given name is managed by this Scene.
virtual void DestroyVisual(VisualPtr _node, bool _recursive=false)=0
Destroy given node. If the given node is not managed by this scene, no work will be done....
virtual bool HasVisualId(unsigned int _id) const =0
Determine if a given node with the given id is managed by this Scene.
virtual bool HasVisualName(const std::string &_name) const =0
Determine if a given node with the given name is managed by this Scene.
virtual common::Time SimTime() const =0
Get the last simulation update time.
virtual MaterialPtr Material(const std::string &_name) const =0
Get material registered under the given name. If no material is registered under the given name,...
virtual LightPtr LightById(unsigned int _id) const =0
Get light with the given id. If no light exists with the given id, NULL will be returned.
virtual std::chrono::steady_clock::duration Time() const =0
Get the last simulation update time.
virtual std::string Name() const =0
Get the name of the scene.
virtual void Init()=0
Initialize the scene.
virtual void DestroyNodeById(unsigned int _id)=0
Destroy node with the given id. If no node exists with the given id, no work will be done....
virtual void DestroySensorById(unsigned int _id)=0
Destroy sensor with the given id. If no sensor exists with the given id, no work will be done....
virtual unsigned int SensorCount() const =0
Get the number of sensors managed by this scene. Note these sensors may not be directly or indirectly...
virtual SegmentationCameraPtr CreateSegmentationCamera()=0
Create new segmentation camera. A unique ID and name will automatically be assigned to the camera.
virtual LightPtr LightByName(const std::string &_name) const =0
Get light with the given name. If no light exists with the given name, NULL will be returned.
virtual DirectionalLightPtr CreateDirectionalLight()=0
Create new directional light. A unique ID and name will automatically be assigned to the light.
virtual unsigned int NodeCount() const =0
Get the number of nodes managed by this scene. Note these nodes may not be directly or indirectly att...
virtual MeshPtr CreateMesh(const std::string &_meshName)=0
Create new mesh geomerty. The rendering::Mesh will be created from a common::Mesh retrieved from comm...
virtual bool HasVisual(ConstVisualPtr _node) const =0
Determine if the given node is managed by this Scene.
virtual bool HasLightName(const std::string &_name) const =0
Determine if a given light with the given name is managed by this Scene.
virtual void SetTime(const std::chrono::steady_clock::duration &_time)=0
Set the last simulation update time.
virtual void DestroySensor(SensorPtr _sensor, bool _recursive=false)=0
Destroy given sensor. If the given sensor is not managed by this scene, no work will be done....
virtual void DestroyLightById(unsigned int _id)=0
Destroy light with the given id. If no light exists with the given id, no work will be done....
STL namespace.
virtual void DestroyVisualById(unsigned int _id)=0
Destroy node with the given id. If no node exists with the given id, no work will be done....
virtual TextPtr CreateText()=0
Create new text geometry.
virtual ArrowVisualPtr CreateArrowVisual()=0
Create new arrow visual. A unique ID and name will automatically be assigned to the visual.
virtual void DestroyLightByName(const std::string &_name)=0
Destroy light with the given name. If no light exists with the given name, no work will be done....
virtual void Load()=0
Load scene-specific resources.
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: gz/rendering/RenderEngine.hh:36
virtual void SetBackgroundMaterial(MaterialPtr _material)=0
Set the scene background material e.g. a material with skybox cubemap texture.
virtual void SetCameraPassCountPerGpuFlush(uint8_t _numPass)=0
The ideal render loop is as follows:
virtual COMVisualPtr CreateCOMVisual()=0
Create new CoM visual. A unique ID and name will automatically be assigned to the CoM visual.
virtual void SetSimTime(const common::Time &_time)=0
Set the last simulation update time.
virtual GeometryPtr CreateCylinder()=0
Create new cylinder geometry.
virtual void DestroySensorByIndex(unsigned int _index)=0
Destroy sensor at the given index. If no sensor exists at the given index, no work will be done....
virtual LightPtr LightByIndex(unsigned int _index) const =0
Get light at the given index. If no light exists at the given index, NULL will be returned.
virtual VisualPtr VisualByName(const std::string &_name) const =0
Get node with the given name. If no node exists with the given name, NULL will be returned.
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
virtual bool MaterialRegistered(const std::string &_name) const =0
Determine if a material is registered under the given name.
virtual bool HasSensor(ConstSensorPtr _sensor) const =0
Determine if the given sensor is managed by this Scene.
virtual void PostRender()=0
Call this function after you're done updating ALL cameras.
virtual math::Color AmbientLight() const =0
Get the scene ambient light color.
virtual WireBoxPtr CreateWireBox()=0
Create new wire box geometry.
virtual void DestroyVisuals()=0
Destroy all nodes manages by this scene.
virtual BoundingBoxCameraPtr CreateBoundingBoxCamera()=0
Create new BoundingBox camera. A unique ID and name will automatically be assigned to the camera.
virtual unsigned int Id() const =0
Get the ID of the scene.
virtual void RegisterMaterial(const std::string &_name, MaterialPtr _material)=0
Register a new material under the given name. If the name is already in use, no work will be done.
virtual MarkerPtr CreateMarker()=0
Create new marker geometry.
virtual void DestroyLight(LightPtr _light, bool _recursive=false)=0
Destroy given light. If the given light is not managed by this scene, no work will be done....
virtual unsigned int LightCount() const =0
Get the number of lights managed by this scene. Note these lights may not be directly or indirectly a...
virtual NodePtr NodeByName(const std::string &_name) const =0
Get node with the given name. If no node exists with the given name, NULL will be returned.
virtual MaterialPtr BackgroundMaterial() const =0
Get the scene background material e.g. a material with skybox cubemap texture.
virtual AxisVisualPtr CreateAxisVisual()=0
Create new axis visual. A unique ID and name will automatically be assigned to the visual.
virtual uint8_t CameraPassCountPerGpuFlush() const =0
Returns the value set in SetCameraPassCountPerGpuFlush.
virtual void DestroyLights()=0
Destroy all lights manages by this scene.
virtual LidarVisualPtr CreateLidarVisual()=0
Create new lidar visual. A unique ID and name will automatically be assigned to the lidar visual.
virtual InertiaVisualPtr CreateInertiaVisual()=0
Create new inertia visual. A unique ID and name will automatically be assigned to the inertia visual.
virtual NodePtr NodeByIndex(unsigned int _index) const =0
Get node at the given index. If no node exists at the given index, NULL will be returned.
virtual void DestroyMaterial(MaterialPtr _material)=0
Unregister and destroy a material.
virtual LightVisualPtr CreateLightVisual()=0
Create new light visual. A unique ID and name will automatically be assigned to the light visual.