Gazebo Rendering

API Reference

8.2.1
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.
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 
245  unsigned int _id) override;
246 
248  const std::string &_name) override;
249 
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 
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 
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.
326  const unsigned int _id) override;
327 
328  // Documentation inherited.
330  const std::string &_name) override;
331 
332  // Documentation inherited.
334  const unsigned int _id, const std::string &_name) override;
335 
336  // Documentation inherited.
337  public: virtual BoundingBoxCameraPtr CreateBoundingBoxCamera() override;
338 
339  // Documentation inherited.
341  const unsigned int _id) override;
342 
343  // Documentation inherited.
345  const std::string &_name) override;
346 
347  // Documentation inherited.
349  const unsigned int _id, const std::string &_name) override;
350 
351  // Documentation inherited.
353 
354  // Documentation inherited.
356  const unsigned int _id) override;
357 
358  // Documentation inherited.
360  const std::string &_name) override;
361 
362  // Documentation inherited.
364  const unsigned int _id, const std::string &_name) override;
365 
366  // Documentation inherited.
367  public: virtual WideAngleCameraPtr CreateWideAngleCamera() override;
368 
369  // Documentation inherited.
371  const unsigned int _id) override;
372 
373  // Documentation inherited.
375  const std::string &_name) override;
376 
377  // Documentation inherited.
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 
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
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
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.
530  unsigned int _id) override;
531 
532  // Documentation inherited.
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.
572  const std::string &_name) override;
573 
574  // Documentation inherited.
576  unsigned int _id, const std::string &_name) override;
577 
578  // Documentation inherited.
579  public: virtual ProjectorPtr CreateProjector() override;
580 
581  // Documentation inherited.
582  public: virtual ProjectorPtr CreateProjector(unsigned int _id)
583  override;
584 
585  // Documentation inherited.
586  public: virtual ProjectorPtr CreateProjector(
587  const std::string &_name) override;
588 
589  // Documentation inherited.
590  public: virtual ProjectorPtr CreateProjector(
591  unsigned int _id, const std::string &_name) override;
592 
593  // Documentation inherited.
594  public: virtual GlobalIlluminationVctPtr
596 
597  // Documentation inherited.
599  unsigned int _id) override;
600 
601  // Documentation inherited.
603  const std::string &_name) override;
604 
605  // Documentation inherited.
607  unsigned int _id, const std::string &_name) override;
608 
609  // Documentation inherited.
610  public: virtual GlobalIlluminationCiVctPtr
612 
613  // Documentation inherited.
615  unsigned int _id) override;
616 
617  // Documentation inherited.
619  const std::string &_name) override;
620 
621  // Documentation inherited.
623  unsigned int _id, const std::string &_name) override;
624 
625  // Documentation inherited.
626  public: virtual void SetSkyEnabled(bool _enabled) override;
627 
628  // Documentation inherited.
629  public: virtual bool SkyEnabled() const override;
630 
631  // Documentation inherited.
632  public: virtual void SetActiveGlobalIllumination(
633  GlobalIlluminationBasePtr _gi) override;
634 
635  public: virtual void PreRender() override;
636 
637  public: virtual void Clear() override;
638 
639  public: virtual void Destroy() override;
640 
641  // Documentation inherited.
642  public: virtual void PostRender() override;
643 
644  // Documentation inherited.
645  public: virtual void SetCameraPassCountPerGpuFlush(
646  uint8_t _numPass) override;
647 
648  // Documentation inherited.
649  public: virtual uint8_t CameraPassCountPerGpuFlush() const override;
650 
651  // Documentation inherited.
652  public: virtual bool LegacyAutoGpuFlush() const override;
653 
654  protected: virtual unsigned int CreateObjectId();
655 
656  protected: virtual std::string CreateObjectName(unsigned int _id,
657  const std::string &_prefix);
658 
659  protected: virtual bool RegisterLight(LightPtr _light);
660 
661  protected: virtual bool RegisterSensor(SensorPtr _vensor);
662 
663  protected: virtual bool RegisterVisual(VisualPtr _visual);
664 
666  unsigned int _id, const std::string &_name) = 0;
667 
668  protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
669  const std::string &_name) = 0;
670 
671  protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
672  const std::string &_name) = 0;
673 
674  protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
675  const std::string &_name) = 0;
676 
677  protected: virtual DepthCameraPtr CreateDepthCameraImpl(unsigned int _id,
678  const std::string &_name) = 0;
679 
684  unsigned int _id, const std::string &_name)
685  {
686  // The following two lines will avoid doxygen warnings
687  (void)_id;
688  (void)_name;
689  gzerr << "Thermal camera not supported by: "
690  << this->Engine()->Name() << std::endl;
691  return ThermalCameraPtr();
692  }
693 
699  unsigned int _id, const std::string &_name)
700  {
701  // The following two lines will avoid doxygen warnings
702  (void)_id;
703  (void)_name;
704  gzerr << "BoundingBox camera not supported by: "
705  << this->Engine()->Name() << std::endl;
706  return BoundingBoxCameraPtr();
707  }
708 
714  unsigned int _id,
715  const std::string &_name)
716  {
717  // The following two lines will avoid doxygen warnings
718  (void)_id;
719  (void)_name;
720  gzerr << "Segmentation camera not supported by: "
721  << this->Engine()->Name() << std::endl;
722  return SegmentationCameraPtr();
723  }
724 
730  unsigned int _id,
731  const std::string &_name)
732  {
733  // The following two lines will avoid doxygen warnings
734  (void)_id;
735  (void)_name;
736  gzerr << "Wide angle camera not supported by: "
737  << this->Engine()->Name() << std::endl;
738  return WideAngleCameraPtr();
739  }
740 
744  protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id,
745  const std::string & _name)
746  {
747  (void)_id;
748  (void)_name;
749  gzerr << "GpuRays not supported by: "
750  << this->Engine()->Name() << std::endl;
751  return GpuRaysPtr();
752  }
753 
754  protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
755  const std::string &_name) = 0;
756 
757  protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
758  const std::string &_name) = 0;
759 
760  protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
761  const std::string &_name) = 0;
762 
766  protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
767  const std::string &_name)
768  {
769  (void)_id;
770  (void)_name;
771  gzerr << "GizmoVisual not supported by: "
772  << this->Engine()->Name() << std::endl;
773  return GizmoVisualPtr();
774  }
775 
776  protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
777  const std::string &_name) = 0;
778 
779  protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
780  const std::string &_name) = 0;
781 
782  protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
783  const std::string &_name) = 0;
784 
785  protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
786  const std::string &_name) = 0;
787 
788  protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
789  const std::string &_name) = 0;
790 
791  protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
792  const std::string &_name,
793  const MeshDescriptor &_desc) = 0;
794 
799  protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
800  const std::string &_name) = 0;
801 
806  protected: virtual GridPtr CreateGridImpl(unsigned int _id,
807  const std::string &_name) = 0;
808 
813  protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
814  const std::string &_name) = 0;
815 
820  protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
821  const std::string &_name) = 0;
822 
828  protected: virtual HeightmapPtr CreateHeightmapImpl(unsigned int _id,
829  const std::string &_name,
830  const HeightmapDescriptor &_desc) = 0;
831 
836  protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
837  const std::string &_name) = 0;
838 
843  protected: virtual TextPtr CreateTextImpl(unsigned int _id,
844  const std::string &_name);
845 
846  protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
847  const std::string &_name) = 0;
848 
850  unsigned int _id, const std::string &_name) = 0;
851 
858  unsigned int _id, const std::string &_name) = 0;
859 
860  protected: virtual RayQueryPtr CreateRayQueryImpl(
861  unsigned int _id, const std::string &_name) = 0;
862 
868  unsigned int _id, const std::string &_name)
869  {
870  (void)_id;
871  (void)_name;
872  gzerr << "ParticleEmitter not supported by: "
873  << this->Engine()->Name() << std::endl;
874  return ParticleEmitterPtr();
875  }
876 
881  protected: virtual ProjectorPtr CreateProjectorImpl(
882  unsigned int _id, const std::string &_name)
883  {
884  (void)_id;
885  (void)_name;
886  gzerr << "Projector not supported by: "
887  << this->Engine()->Name() << std::endl;
888  return ProjectorPtr();
889  }
890 
895  protected: virtual GlobalIlluminationVctPtr
897  unsigned int _id, const std::string &_name)
898  {
899  (void)_id;
900  (void)_name;
901  gzerr << "GlobalIlluminationVct not supported by: "
902  << this->Engine()->Name() << std::endl;
903  return GlobalIlluminationVctPtr();
904  }
905 
910  protected: virtual GlobalIlluminationCiVctPtr
912  unsigned int _id, const std::string &_name)
913  {
914  (void)_id;
915  (void)_name;
916  gzerr << "GlobalIlluminationCiVct not supported by: "
917  << this->Engine()->Name() << std::endl;
919  }
920 
921  protected: virtual LightStorePtr Lights() const = 0;
922 
923  protected: virtual SensorStorePtr Sensors() const = 0;
924 
925  protected: virtual VisualStorePtr Visuals() const = 0;
926 
927  protected: virtual MaterialMapPtr Materials() const = 0;
928 
929  protected: virtual bool LoadImpl() = 0;
930 
931  protected: virtual bool InitImpl() = 0;
932 
933  private: virtual void CreateNodeStore();
934 
935  private: virtual void CreateMaterials();
936 
942  private: void DestroyNodeRecursive(NodePtr _node,
943  std::set<unsigned int> &_nodeIds);
944 
945  protected: unsigned int id;
946 
947  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
948  protected: std::string name;
949  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
950 
951  protected: std::chrono::steady_clock::duration time =
952  std::chrono::steady_clock::duration::zero();
953 
954  protected: bool loaded;
955 
956  protected: bool initialized;
957 
960 
969 
971  protected: bool isGradientBackgroundColor = false;
972 
975 
976  private: unsigned int nextObjectId;
977 
978  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
979  private: NodeStorePtr nodes;
980  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
981  };
982  }
983  }
984 }
985 #endif