Gazebo Rendering

API Reference

7.4.2
gz/rendering/base/BaseScene.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_BASE_BASESCENE_HH_
18 #define GZ_RENDERING_BASE_BASESCENE_HH_
19 
20 #include <array>
21 #include <set>
22 #include <string>
23 
24 #include <gz/common/Console.hh>
25 #include <gz/utils/SuppressWarning.hh>
26 
28 #include "gz/rendering/Scene.hh"
30 
31 namespace gz
32 {
33  namespace rendering
34  {
35  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
36  //
37  class GZ_RENDERING_VISIBLE BaseScene :
38  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
39  public std::enable_shared_from_this<BaseScene>,
40  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
41  public virtual Scene
42  {
43  protected: BaseScene(unsigned int _id, const std::string &_name);
44 
45  public: virtual ~BaseScene();
46 
47  public: virtual void Load() override;
48 
49  public: virtual void Init() override;
50 
51  public: virtual void Fini() override;
52 
53  public: virtual bool IsLoaded() const;
54 
55  public: virtual bool IsInitialized() const override;
56 
57  public: virtual unsigned int Id() const override;
58 
59  public: virtual std::string Name() const override;
60 
61  public: virtual std::chrono::steady_clock::duration Time()
62  const override;
63 
64  public: virtual void SetTime(
65  const std::chrono::steady_clock::duration &_time) override;
66 
67  public: virtual void SetAmbientLight(double _r, double _g, double _b,
68  double _a = 1.0) override;
69 
70  public: virtual void SetAmbientLight(const math::Color &_color)
71  override = 0;
72 
73  public: virtual math::Color BackgroundColor() const override;
74 
75  public: virtual void SetBackgroundColor(double _r, double _g, double _b,
76  double _a = 1.0) override;
77 
78  public: virtual void SetBackgroundColor(const math::Color &_color)
79  override;
80 
81  // Documentation inherited.
82  public: virtual bool IsGradientBackgroundColor() const override;
83 
84  // Documentation inherited.
85  public: virtual std::array<math::Color, 4> GradientBackgroundColor()
86  const override;
87 
88  // Documentation inherited.
89  public: virtual void SetGradientBackgroundColor(
90  const std::array<math::Color, 4> &_colors) override;
91 
92  // Documentation inherited.
93  public: virtual void RemoveGradientBackgroundColor() override;
94 
95  // Documentation inherited.
96  public: virtual MaterialPtr BackgroundMaterial() const override;
97 
98  // Documentation inherited.
99  public: virtual void SetBackgroundMaterial(MaterialPtr _material)
100  override;
101 
102  public: virtual unsigned int NodeCount() const override;
103 
104  public: virtual bool HasNode(ConstNodePtr _node) const override;
105 
106  public: virtual bool HasNodeId(unsigned int _id) const override;
107 
108  public: virtual bool HasNodeName(const std::string &_name) const override;
109 
110  public: virtual NodePtr NodeById(unsigned int _id) const override;
111 
112  public: virtual NodePtr NodeByName(const std::string &_name) const
113  override;
114 
115  public: virtual NodePtr NodeByIndex(unsigned int _index) const override;
116 
117  // Documentation inherited.
118  public: virtual void DestroyNode(NodePtr _node, bool _recursive = false)
119  override;
120 
121  public: virtual void DestroyNodeById(unsigned int _id) override;
122 
123  public: virtual void DestroyNodeByName(const std::string &_name) override;
124 
125  public: virtual void DestroyNodeByIndex(unsigned int _index) override;
126 
127  public: virtual void DestroyNodes() override;
128 
129  public: virtual unsigned int LightCount() const override;
130 
131  public: virtual bool HasLight(ConstLightPtr _light) const override;
132 
133  public: virtual bool HasLightId(unsigned int _id) const override;
134 
135  public: virtual bool HasLightName(const std::string &_name) const
136  override;
137 
138  public: virtual LightPtr LightById(unsigned int _id) const override;
139 
140  public: virtual LightPtr LightByName(const std::string &_name) const
141  override;
142 
143  public: virtual LightPtr LightByIndex(unsigned int _index) const override;
144 
145  // Documentation inherited.
146  public: virtual void DestroyLight(LightPtr _light,
147  bool _recursive = false) override;
148 
149  public: virtual void DestroyLightById(unsigned int _id) override;
150 
151  public: virtual void DestroyLightByName(const std::string &_name)
152  override;
153 
154  public: virtual void DestroyLightByIndex(unsigned int _index) override;
155 
156  public: virtual void DestroyLights() override;
157 
158  public: virtual unsigned int SensorCount() const override;
159 
160  public: virtual bool HasSensor(ConstSensorPtr _sensor) const override;
161 
162  public: virtual bool HasSensorId(unsigned int _id) const override;
163 
164  public: virtual bool HasSensorName(const std::string &_name) const
165  override;
166 
167  public: virtual SensorPtr SensorById(unsigned int _id) const override;
168 
169  public: virtual SensorPtr SensorByName(const std::string &_name) const
170  override;
171 
172  public: virtual SensorPtr SensorByIndex(unsigned int _index) const
173  override;
174 
175  // Documentation inherited.
176  public: virtual void DestroySensor(SensorPtr _sensor,
177  bool _recursive = false) override;
178 
179  public: virtual void DestroySensorById(unsigned int _id) override;
180 
181  public: virtual void DestroySensorByName(const std::string &_name)
182  override;
183 
184  public: virtual void DestroySensorByIndex(unsigned int _index) override;
185 
186  public: virtual void DestroySensors() override;
187 
188  public: virtual unsigned int VisualCount() const override;
189 
190  public: virtual bool HasVisual(ConstVisualPtr _visual) const override;
191 
192  public: virtual bool HasVisualId(unsigned int _id) const override;
193 
194  public: virtual bool HasVisualName(const std::string &_name) const
195  override;
196 
197  public: virtual VisualPtr VisualById(unsigned int _id) const override;
198 
199  public: virtual VisualPtr VisualByName(const std::string &_name) const
200  override;
201 
202  public: virtual VisualPtr VisualByIndex(unsigned int _index) const
203  override;
204 
205  // Documentation inherited
206  public: virtual VisualPtr VisualAt(const CameraPtr &_camera,
207  const gz::math::Vector2i &_mousePos) override;
208 
209  // Documentation inherited.
210  public: virtual void DestroyVisual(VisualPtr _visual,
211  bool _recursive = false) override;
212 
213  public: virtual void DestroyVisualById(unsigned int _id) override;
214 
215  public: virtual void DestroyVisualByName(const std::string &_name)
216  override;
217 
218  public: virtual void DestroyVisualByIndex(unsigned int _index) override;
219 
220  public: virtual void DestroyVisuals() override;
221 
222  public: virtual bool MaterialRegistered(const std::string &_name) const
223  override;
224 
225  public: virtual MaterialPtr Material(const std::string &_name) const
226  override;
227 
228  public: virtual void RegisterMaterial(const std::string &_name,
229  MaterialPtr _material) override;
230 
231  public: virtual void UnregisterMaterial(const std::string &_name)
232  override;
233 
234  public: virtual void UnregisterMaterials() override;
235 
236  // Documentation inherited
237  public: virtual void DestroyMaterial(MaterialPtr _material) override;
238 
239  // Documentation inherited
240  public: virtual void DestroyMaterials() override;
241 
242  public: virtual DirectionalLightPtr CreateDirectionalLight() override;
243 
244  public: virtual DirectionalLightPtr CreateDirectionalLight(
245  unsigned int _id) override;
246 
247  public: virtual DirectionalLightPtr CreateDirectionalLight(
248  const std::string &_name) override;
249 
250  public: virtual DirectionalLightPtr CreateDirectionalLight(
251  unsigned int _id, const std::string &_name) override;
252 
253  public: virtual PointLightPtr CreatePointLight() override;
254 
255  public: virtual PointLightPtr CreatePointLight(unsigned int _id) override;
256 
257  public: virtual PointLightPtr CreatePointLight(const std::string &_name)
258  override;
259 
260  public: virtual PointLightPtr CreatePointLight(unsigned int _id,
261  const std::string &_name) override;
262 
267  protected: virtual COMVisualPtr CreateCOMVisualImpl(unsigned int _id,
268  const std::string &_name) = 0;
269 
274  protected: virtual InertiaVisualPtr CreateInertiaVisualImpl(
275  unsigned int _id, const std::string &_name) = 0;
276 
281  protected: virtual JointVisualPtr CreateJointVisualImpl(unsigned int _id,
282  const std::string &_name) = 0;
283 
288  protected: virtual LightVisualPtr CreateLightVisualImpl(unsigned int _id,
289  const std::string &_name) = 0;
290 
291  public: virtual SpotLightPtr CreateSpotLight() override;
292 
293  public: virtual SpotLightPtr CreateSpotLight(unsigned int _id) override;
294 
295  public: virtual SpotLightPtr CreateSpotLight(const std::string &_name)
296  override;
297 
298  public: virtual SpotLightPtr CreateSpotLight(unsigned int _id,
299  const std::string &_name) override;
300 
301  public: virtual CameraPtr CreateCamera() override;
302 
303  public: virtual CameraPtr CreateCamera(unsigned int _id) override;
304 
305  public: virtual CameraPtr CreateCamera(const std::string &_name) override;
306 
307  public: virtual CameraPtr CreateCamera(unsigned int _id,
308  const std::string &_name) override;
309 
310  public: virtual DepthCameraPtr CreateDepthCamera() override;
311 
312  public: virtual DepthCameraPtr CreateDepthCamera(const unsigned int _id)
313  override;
314 
315  public: virtual DepthCameraPtr CreateDepthCamera(
316  const std::string &_name) override;
317 
318  public: virtual DepthCameraPtr CreateDepthCamera(const unsigned int _id,
319  const std::string &_name) override;
320 
321  // Documentation inherited.
322  public: virtual ThermalCameraPtr CreateThermalCamera() override;
323 
324  // Documentation inherited.
325  public: virtual ThermalCameraPtr CreateThermalCamera(
326  const unsigned int _id) override;
327 
328  // Documentation inherited.
329  public: virtual ThermalCameraPtr CreateThermalCamera(
330  const std::string &_name) override;
331 
332  // Documentation inherited.
333  public: virtual ThermalCameraPtr CreateThermalCamera(
334  const unsigned int _id, const std::string &_name) override;
335 
336  // Documentation inherited.
337  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera() override;
338 
339  // Documentation inherited.
340  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
341  const unsigned int _id) override;
342 
343  // Documentation inherited.
344  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
345  const std::string &_name) override;
346 
347  // Documentation inherited.
348  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera(
349  const unsigned int _id, const std::string &_name) override;
350 
351  // Documentation inherited.
352  public: virtual SegmentationCameraPtr CreateSegmentationCamera() override;
353 
354  // Documentation inherited.
355  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
356  const unsigned int _id) override;
357 
358  // Documentation inherited.
359  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
360  const std::string &_name) override;
361 
362  // Documentation inherited.
363  public: virtual SegmentationCameraPtr CreateSegmentationCamera(
364  const unsigned int _id, const std::string &_name) override;
365 
366  // Documentation inherited.
367  public: virtual WideAngleCameraPtr CreateWideAngleCamera() override;
368 
369  // Documentation inherited.
370  public: virtual WideAngleCameraPtr CreateWideAngleCamera(
371  const unsigned int _id) override;
372 
373  // Documentation inherited.
374  public: virtual WideAngleCameraPtr CreateWideAngleCamera(
375  const std::string &_name) override;
376 
377  // Documentation inherited.
378  public: virtual WideAngleCameraPtr CreateWideAngleCamera(
379  const unsigned int _id, const std::string &_name) override;
380 
381  // Documentation inherited.
382  public: virtual GpuRaysPtr CreateGpuRays() override;
383 
384  // Documentation inherited.
385  public: virtual GpuRaysPtr CreateGpuRays(const unsigned int _id) override;
386 
387  // Documentation inherited.
388  public: virtual GpuRaysPtr CreateGpuRays(
389  const std::string &_name) override;
390 
391  // Documentation inherited.
392  public: virtual GpuRaysPtr CreateGpuRays(const unsigned int _id,
393  const std::string &_name) override;
394 
395  public: virtual VisualPtr CreateVisual() override;
396 
397  public: virtual VisualPtr CreateVisual(unsigned int _id) override;
398 
399  public: virtual VisualPtr CreateVisual(const std::string &_name) override;
400 
401  public: virtual VisualPtr CreateVisual(unsigned int _id,
402  const std::string &_name) override;
403 
404  public: virtual ArrowVisualPtr CreateArrowVisual() override;
405 
406  public: virtual ArrowVisualPtr CreateArrowVisual(unsigned int _id)
407  override;
408 
409  public: virtual ArrowVisualPtr CreateArrowVisual(
410  const std::string &_name) override;
411 
412  public: virtual ArrowVisualPtr CreateArrowVisual(unsigned int _id,
413  const std::string &_name) override;
414 
415  public: virtual AxisVisualPtr CreateAxisVisual() override;
416 
417  public: virtual AxisVisualPtr CreateAxisVisual(unsigned int _id) override;
418 
419  public: virtual AxisVisualPtr CreateAxisVisual(const std::string &_name)
420  override;
421 
422  public: virtual AxisVisualPtr CreateAxisVisual(unsigned int _id,
423  const std::string &_name) override;
424 
425  // Documentation inherited
426  public: virtual COMVisualPtr CreateCOMVisual() override;
427 
428  // Documentation inherited
429  public: virtual COMVisualPtr CreateCOMVisual(unsigned int _id)
430  override;
431 
432  // Documentation inherited
433  public: virtual COMVisualPtr CreateCOMVisual(const std::string &_name)
434  override;
435 
436  // Documentation inherited
437  public: virtual COMVisualPtr CreateCOMVisual(unsigned int _id,
438  const std::string &_name) override;
439 
440  public: virtual InertiaVisualPtr CreateInertiaVisual() override;
441 
442  // Documentation inherited
443  public: virtual InertiaVisualPtr CreateInertiaVisual(unsigned int _id)
444  override;
445 
446  // Documentation inherited
447  public: virtual InertiaVisualPtr CreateInertiaVisual(
448  const std::string &_name) override;
449 
450  // Documentation inherited
451  public: virtual InertiaVisualPtr CreateInertiaVisual(unsigned int _id,
452  const std::string &_name) override;
453 
454  // Documentation inherited
455  public: virtual JointVisualPtr CreateJointVisual() override;
456 
457  // Documentation inherited
458  public: virtual JointVisualPtr CreateJointVisual(unsigned int _id)
459  override;
460 
461  // Documentation inherited
462  public: virtual JointVisualPtr CreateJointVisual(
463  const std::string &_name) override;
464 
465  // Documentation inherited
466  public: virtual JointVisualPtr CreateJointVisual(unsigned int _id,
467  const std::string &_name) override;
468 
469  // Documentation inherited
470  public: virtual LightVisualPtr CreateLightVisual() override;
471 
472  // Documentation inherited
473  public: virtual LightVisualPtr CreateLightVisual(unsigned int _id)
474  override;
475 
476  // Documentation inherited
477  public: virtual LightVisualPtr CreateLightVisual(const std::string &_name)
478  override;
479 
480  // Documentation inherited
481  public: virtual LightVisualPtr CreateLightVisual(unsigned int _id,
482  const std::string &_name) override;
483 
484  // Documentation inherited
485  public: virtual GizmoVisualPtr CreateGizmoVisual() override;
486 
487  // Documentation inherited
488  public: virtual GizmoVisualPtr CreateGizmoVisual(unsigned int _id)
489  override;
490 
491  // Documentation inherited
492  public: virtual GizmoVisualPtr CreateGizmoVisual(const std::string &_name)
493  override;
494 
495  // Documentation inherited
496  public: virtual GizmoVisualPtr CreateGizmoVisual(unsigned int _id,
497  const std::string &_name) override;
498 
499 
500  public: virtual GeometryPtr CreateBox() override;
501 
502  public: virtual GeometryPtr CreateCone() override;
503 
504  public: virtual GeometryPtr CreateCylinder() override;
505 
506  public: virtual GeometryPtr CreatePlane() override;
507 
508  public: virtual GeometryPtr CreateSphere() override;
509 
510  public: virtual MeshPtr CreateMesh(const std::string &_meshName) override;
511 
512  public: virtual MeshPtr CreateMesh(const common::Mesh *_mesh) override;
513 
514  public: virtual MeshPtr CreateMesh(const MeshDescriptor &_desc) override;
515 
516  // Documentation inherited.
517  public: virtual CapsulePtr CreateCapsule() override;
518 
519  // Documentation inherited.
520  public: virtual GridPtr CreateGrid() override;
521 
522  // Documentation inherited.
523  public: virtual MarkerPtr CreateMarker() override;
524 
525  // Documentation inherited.
526  public: virtual LidarVisualPtr CreateLidarVisual() override;
527 
528  // Documentation inherited.
529  public: virtual LidarVisualPtr CreateLidarVisual(
530  unsigned int _id) override;
531 
532  // Documentation inherited.
533  public: virtual LidarVisualPtr CreateLidarVisual(
534  const std::string &_name) override;
535 
536  // Documentation inherited.
537  public: virtual LidarVisualPtr CreateLidarVisual(unsigned int _id,
538  const std::string &_name) override;
539 
540  // Documentation inherited.
541  public: virtual HeightmapPtr CreateHeightmap(
542  const HeightmapDescriptor &_desc) override;
543 
544  // Documentation inherited.
545  public: virtual WireBoxPtr CreateWireBox() override;
546 
547  // Documentation inherited.
548  public: virtual TextPtr CreateText() override;
549 
550  public: virtual MaterialPtr CreateMaterial(const std::string &_name = "")
551  override;
552 
553  public: virtual MaterialPtr CreateMaterial(
554  const common::Material &_material) override;
555 
556  public: virtual RenderTexturePtr CreateRenderTexture() override;
557 
558  // Documentation inherited.
559  public: virtual RenderWindowPtr CreateRenderWindow() override;
560 
561  public: virtual RayQueryPtr CreateRayQuery() override;
562 
563  // Documentation inherited.
564  public: virtual ParticleEmitterPtr CreateParticleEmitter() override;
565 
566  // Documentation inherited.
567  public: virtual ParticleEmitterPtr CreateParticleEmitter(unsigned int _id)
568  override;
569 
570  // Documentation inherited.
571  public: virtual ParticleEmitterPtr CreateParticleEmitter(
572  const std::string &_name) override;
573 
574  // Documentation inherited.
575  public: virtual ParticleEmitterPtr CreateParticleEmitter(
576  unsigned int _id, const std::string &_name) override;
577 
578  // Documentation inherited.
579  // \todo(iche033) uncomment in gz-rendering8
580  // public: virtual ProjectorPtr CreateProjector() override;
581 
582  // Documentation inherited.
583  // \todo(iche033) uncomment in gz-rendering8
584  // public: virtual ProjectorPtr CreateProjector(unsigned int _id)
585  // override;
586 
587  // Documentation inherited.
588  // \todo(iche033) uncomment in gz-rendering8
589  // public: virtual ProjectorPtr CreateProjector(
590  // const std::string &_name) override;
591 
592  // Documentation inherited.
593  // \todo(iche033) uncomment in gz-rendering8
594  // public: virtual ProjectorPtr CreateProjector(
595  // unsigned int _id, const std::string &_name) override;
596 
597  // Documentation inherited.
598  public: virtual void SetSkyEnabled(bool _enabled) override;
599 
600  // Documentation inherited.
601  public: virtual bool SkyEnabled() const override;
602 
603  public: virtual void PreRender() override;
604 
605  public: virtual void Clear() override;
606 
607  public: virtual void Destroy() override;
608 
609  // Documentation inherited.
610  public: virtual void PostRender() override;
611 
612  // Documentation inherited.
613  public: virtual void SetCameraPassCountPerGpuFlush(
614  uint8_t _numPass) override;
615 
616  // Documentation inherited.
617  public: virtual uint8_t CameraPassCountPerGpuFlush() const override;
618 
619  // Documentation inherited.
620  public: virtual bool LegacyAutoGpuFlush() const override;
621 
622  protected: virtual unsigned int CreateObjectId();
623 
624  protected: virtual std::string CreateObjectName(unsigned int _id,
625  const std::string &_prefix);
626 
627  protected: virtual bool RegisterLight(LightPtr _light);
628 
629  protected: virtual bool RegisterSensor(SensorPtr _vensor);
630 
631  protected: virtual bool RegisterVisual(VisualPtr _visual);
632 
633  protected: virtual DirectionalLightPtr CreateDirectionalLightImpl(
634  unsigned int _id, const std::string &_name) = 0;
635 
636  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
637  const std::string &_name) = 0;
638 
639  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
640  const std::string &_name) = 0;
641 
642  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
643  const std::string &_name) = 0;
644 
645  protected: virtual DepthCameraPtr CreateDepthCameraImpl(unsigned int _id,
646  const std::string &_name) = 0;
647 
652  unsigned int _id, const std::string &_name)
653  {
654  // The following two lines will avoid doxygen warnings
655  (void)_id;
656  (void)_name;
657  gzerr << "Thermal camera not supported by: "
658  << this->Engine()->Name() << std::endl;
659  return ThermalCameraPtr();
660  }
661 
667  unsigned int _id, const std::string &_name)
668  {
669  // The following two lines will avoid doxygen warnings
670  (void)_id;
671  (void)_name;
672  gzerr << "BoundingBox camera not supported by: "
673  << this->Engine()->Name() << std::endl;
674  return BoundingBoxCameraPtr();
675  }
676 
682  unsigned int _id,
683  const std::string &_name)
684  {
685  // The following two lines will avoid doxygen warnings
686  (void)_id;
687  (void)_name;
688  gzerr << "Segmentation camera not supported by: "
689  << this->Engine()->Name() << std::endl;
690  return SegmentationCameraPtr();
691  }
692 
698  unsigned int _id,
699  const std::string &_name)
700  {
701  // The following two lines will avoid doxygen warnings
702  (void)_id;
703  (void)_name;
704  gzerr << "Wide angle camera not supported by: "
705  << this->Engine()->Name() << std::endl;
706  return WideAngleCameraPtr();
707  }
708 
712  protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id,
713  const std::string & _name)
714  {
715  (void)_id;
716  (void)_name;
717  gzerr << "GpuRays not supported by: "
718  << this->Engine()->Name() << std::endl;
719  return GpuRaysPtr();
720  }
721 
722  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
723  const std::string &_name) = 0;
724 
725  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
726  const std::string &_name) = 0;
727 
728  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
729  const std::string &_name) = 0;
730 
734  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
735  const std::string &_name)
736  {
737  (void)_id;
738  (void)_name;
739  gzerr << "GizmoVisual not supported by: "
740  << this->Engine()->Name() << std::endl;
741  return GizmoVisualPtr();
742  }
743 
744  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
745  const std::string &_name) = 0;
746 
747  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
748  const std::string &_name) = 0;
749 
750  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
751  const std::string &_name) = 0;
752 
753  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
754  const std::string &_name) = 0;
755 
756  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
757  const std::string &_name) = 0;
758 
759  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
760  const std::string &_name,
761  const MeshDescriptor &_desc) = 0;
762 
767  protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
768  const std::string &_name) = 0;
769 
774  protected: virtual GridPtr CreateGridImpl(unsigned int _id,
775  const std::string &_name) = 0;
776 
781  protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
782  const std::string &_name) = 0;
783 
788  protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
789  const std::string &_name) = 0;
790 
796  protected: virtual HeightmapPtr CreateHeightmapImpl(unsigned int _id,
797  const std::string &_name,
798  const HeightmapDescriptor &_desc) = 0;
799 
804  protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
805  const std::string &_name) = 0;
806 
811  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
812  const std::string &_name);
813 
814  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
815  const std::string &_name) = 0;
816 
817  protected: virtual RenderTexturePtr CreateRenderTextureImpl(
818  unsigned int _id, const std::string &_name) = 0;
819 
825  protected: virtual RenderWindowPtr CreateRenderWindowImpl(
826  unsigned int _id, const std::string &_name) = 0;
827 
828  protected: virtual RayQueryPtr CreateRayQueryImpl(
829  unsigned int _id, const std::string &_name) = 0;
830 
836  unsigned int _id, const std::string &_name)
837  {
838  (void)_id;
839  (void)_name;
840  gzerr << "ParticleEmitter not supported by: "
841  << this->Engine()->Name() << std::endl;
842  return ParticleEmitterPtr();
843  }
844 
849  // \todo(iche033) uncomment in gz-rendering8
850  // protected: virtual ProjectorPtr CreateProjectorImpl(
851  // unsigned int _id, const std::string &_name)
852  // {
853  // (void)_id;
854  // (void)_name;
855  // gzerr << "Projector not supported by: "
856  // << this->Engine()->Name() << std::endl;
857  // return ProjectorPtr();
858  // }
859 
860  protected: virtual LightStorePtr Lights() const = 0;
861 
862  protected: virtual SensorStorePtr Sensors() const = 0;
863 
864  protected: virtual VisualStorePtr Visuals() const = 0;
865 
866  protected: virtual MaterialMapPtr Materials() const = 0;
867 
868  protected: virtual bool LoadImpl() = 0;
869 
870  protected: virtual bool InitImpl() = 0;
871 
872  private: virtual void CreateNodeStore();
873 
874  private: virtual void CreateMaterials();
875 
881  private: void DestroyNodeRecursive(NodePtr _node,
882  std::set<unsigned int> &_nodeIds);
883 
884  protected: unsigned int id;
885 
886  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
887  protected: std::string name;
888  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
889 
890  protected: std::chrono::steady_clock::duration time =
891  std::chrono::steady_clock::duration::zero();
892 
893  protected: bool loaded;
894 
895  protected: bool initialized;
896 
899 
908 
910  protected: bool isGradientBackgroundColor = false;
911 
914 
915  private: unsigned int nextObjectId;
916 
917  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
918  private: NodeStorePtr nodes;
919  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
920  };
921  }
922  }
923 }
924 #endif