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
31namespace 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.
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 // \todo(iche033) commented out for ABI compatibility
542 // public: virtual FrustumVisualPtr CreateFrustumVisual() override;
543
544 // Documentation inherited.
545 // \todo(iche033) commented out for ABI compatibility
546 // public: virtual FrustumVisualPtr CreateFrustumVisual(
547 // unsigned int _id) override;
548
549 // Documentation inherited.
550 // \todo(iche033) commented out for ABI compatibility
551 // public: virtual FrustumVisualPtr CreateFrustumVisual(
552 // const std::string &_name) override;
553
554 // Documentation inherited.
555 // \todo(iche033) commented out for ABI compatibility
556 // public: virtual FrustumVisualPtr CreateFrustumVisual(unsigned int _id,
557 // const std::string &_name) override;
558
559 // Documentation inherited.
561 const HeightmapDescriptor &_desc) override;
562
563 // Documentation inherited.
564 public: virtual WireBoxPtr CreateWireBox() override;
565
566 // Documentation inherited.
567 public: virtual TextPtr CreateText() override;
568
569 public: virtual MaterialPtr CreateMaterial(const std::string &_name = "")
570 override;
571
573 const common::Material &_material) override;
574
575 public: virtual RenderTexturePtr CreateRenderTexture() override;
576
577 // Documentation inherited.
578 public: virtual RenderWindowPtr CreateRenderWindow() override;
579
580 public: virtual RayQueryPtr CreateRayQuery() override;
581
582 // Documentation inherited.
583 public: virtual ParticleEmitterPtr CreateParticleEmitter() override;
584
585 // Documentation inherited.
586 public: virtual ParticleEmitterPtr CreateParticleEmitter(unsigned int _id)
587 override;
588
589 // Documentation inherited.
591 const std::string &_name) override;
592
593 // Documentation inherited.
595 unsigned int _id, const std::string &_name) override;
596
597 // Documentation inherited.
598 public: virtual ProjectorPtr CreateProjector() override;
599
600 // Documentation inherited.
601 public: virtual ProjectorPtr CreateProjector(unsigned int _id)
602 override;
603
604 // Documentation inherited.
606 const std::string &_name) override;
607
608 // Documentation inherited.
610 unsigned int _id, const std::string &_name) override;
611
612 // Documentation inherited.
613 public: virtual GlobalIlluminationVctPtr
615
616 // Documentation inherited.
618 unsigned int _id) override;
619
620 // Documentation inherited.
622 const std::string &_name) override;
623
624 // Documentation inherited.
626 unsigned int _id, const std::string &_name) override;
627
628 // Documentation inherited.
629 public: virtual GlobalIlluminationCiVctPtr
631
632 // Documentation inherited.
634 unsigned int _id) override;
635
636 // Documentation inherited.
638 const std::string &_name) override;
639
640 // Documentation inherited.
642 unsigned int _id, const std::string &_name) override;
643
644 // Documentation inherited.
645 public: virtual void SetSkyEnabled(bool _enabled) override;
646
647 // Documentation inherited.
648 public: virtual bool SkyEnabled() const override;
649
650 // Documentation inherited.
651 public: virtual bool SetShadowTextureSize(LightType _lightType,
652 unsigned int _textureSize) override;
653
654 // Documentation inherited.
655 public: virtual unsigned int ShadowTextureSize(LightType _lightType) const
656 override;
657
658 // Documentation inherited.
659 public: virtual void SetActiveGlobalIllumination(
660 GlobalIlluminationBasePtr _gi) override;
661
662 public: virtual void PreRender() override;
663
664 public: virtual void Clear() override;
665
666 public: virtual void Destroy() override;
667
668 // Documentation inherited.
669 public: virtual void PostRender() override;
670
671 // Documentation inherited.
672 public: virtual void SetCameraPassCountPerGpuFlush(
673 uint8_t _numPass) override;
674
675 // Documentation inherited.
676 public: virtual uint8_t CameraPassCountPerGpuFlush() const override;
677
678 // Documentation inherited.
679 public: virtual bool LegacyAutoGpuFlush() const override;
680
681 protected: virtual unsigned int CreateObjectId();
682
683 protected: virtual std::string CreateObjectName(unsigned int _id,
684 const std::string &_prefix);
685
686 protected: virtual bool RegisterLight(LightPtr _light);
687
688 protected: virtual bool RegisterSensor(SensorPtr _vensor);
689
690 protected: virtual bool RegisterVisual(VisualPtr _visual);
691
693 unsigned int _id, const std::string &_name) = 0;
694
695 protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
696 const std::string &_name) = 0;
697
698 protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
699 const std::string &_name) = 0;
700
701 protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
702 const std::string &_name) = 0;
703
704 protected: virtual DepthCameraPtr CreateDepthCameraImpl(unsigned int _id,
705 const std::string &_name) = 0;
706
711 unsigned int _id, const std::string &_name)
712 {
713 // The following two lines will avoid doxygen warnings
714 (void)_id;
715 (void)_name;
716 gzerr << "Thermal camera not supported by: "
717 << this->Engine()->Name() << std::endl;
718 return ThermalCameraPtr();
719 }
720
726 unsigned int _id, const std::string &_name)
727 {
728 // The following two lines will avoid doxygen warnings
729 (void)_id;
730 (void)_name;
731 gzerr << "BoundingBox camera not supported by: "
732 << this->Engine()->Name() << std::endl;
733 return BoundingBoxCameraPtr();
734 }
735
741 unsigned int _id,
742 const std::string &_name)
743 {
744 // The following two lines will avoid doxygen warnings
745 (void)_id;
746 (void)_name;
747 gzerr << "Segmentation camera not supported by: "
748 << this->Engine()->Name() << std::endl;
749 return SegmentationCameraPtr();
750 }
751
757 unsigned int _id,
758 const std::string &_name)
759 {
760 // The following two lines will avoid doxygen warnings
761 (void)_id;
762 (void)_name;
763 gzerr << "Wide angle camera not supported by: "
764 << this->Engine()->Name() << std::endl;
765 return WideAngleCameraPtr();
766 }
767
771 protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id,
772 const std::string & _name)
773 {
774 (void)_id;
775 (void)_name;
776 gzerr << "GpuRays not supported by: "
777 << this->Engine()->Name() << std::endl;
778 return GpuRaysPtr();
779 }
780
781 protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
782 const std::string &_name) = 0;
783
784 protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
785 const std::string &_name) = 0;
786
787 protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
788 const std::string &_name) = 0;
789
793 protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
794 const std::string &_name)
795 {
796 (void)_id;
797 (void)_name;
798 gzerr << "GizmoVisual not supported by: "
799 << this->Engine()->Name() << std::endl;
800 return GizmoVisualPtr();
801 }
802
803 protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
804 const std::string &_name) = 0;
805
806 protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
807 const std::string &_name) = 0;
808
809 protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
810 const std::string &_name) = 0;
811
812 protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
813 const std::string &_name) = 0;
814
815 protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
816 const std::string &_name) = 0;
817
818 protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
819 const std::string &_name,
820 const MeshDescriptor &_desc) = 0;
821
826 protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
827 const std::string &_name) = 0;
828
833 protected: virtual GridPtr CreateGridImpl(unsigned int _id,
834 const std::string &_name) = 0;
835
840 protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
841 const std::string &_name) = 0;
842
847 protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
848 const std::string &_name) = 0;
849
867
873 protected: virtual HeightmapPtr CreateHeightmapImpl(unsigned int _id,
874 const std::string &_name,
875 const HeightmapDescriptor &_desc) = 0;
876
881 protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
882 const std::string &_name) = 0;
883
888 protected: virtual TextPtr CreateTextImpl(unsigned int _id,
889 const std::string &_name);
890
891 protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
892 const std::string &_name) = 0;
893
895 unsigned int _id, const std::string &_name) = 0;
896
903 unsigned int _id, const std::string &_name) = 0;
904
905 protected: virtual RayQueryPtr CreateRayQueryImpl(
906 unsigned int _id, const std::string &_name) = 0;
907
913 unsigned int _id, const std::string &_name)
914 {
915 (void)_id;
916 (void)_name;
917 gzerr << "ParticleEmitter not supported by: "
918 << this->Engine()->Name() << std::endl;
919 return ParticleEmitterPtr();
920 }
921
927 unsigned int _id, const std::string &_name)
928 {
929 (void)_id;
930 (void)_name;
931 gzerr << "Projector not supported by: "
932 << this->Engine()->Name() << std::endl;
933 return ProjectorPtr();
934 }
935
940 protected: virtual GlobalIlluminationVctPtr
942 unsigned int _id, const std::string &_name)
943 {
944 (void)_id;
945 (void)_name;
946 gzerr << "GlobalIlluminationVct not supported by: "
947 << this->Engine()->Name() << std::endl;
949 }
950
955 protected: virtual GlobalIlluminationCiVctPtr
957 unsigned int _id, const std::string &_name)
958 {
959 (void)_id;
960 (void)_name;
961 gzerr << "GlobalIlluminationCiVct not supported by: "
962 << this->Engine()->Name() << std::endl;
964 }
965
966 protected: virtual LightStorePtr Lights() const = 0;
967
968 protected: virtual SensorStorePtr Sensors() const = 0;
969
970 protected: virtual VisualStorePtr Visuals() const = 0;
971
972 protected: virtual MaterialMapPtr Materials() const = 0;
973
974 protected: virtual bool LoadImpl() = 0;
975
976 protected: virtual bool InitImpl() = 0;
977
978 private: virtual void CreateNodeStore();
979
980 private: virtual void CreateMaterials();
981
987 private: void DestroyNodeRecursive(NodePtr _node,
988 std::set<unsigned int> &_nodeIds);
989
990 protected: unsigned int id;
991
992 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
993 protected: std::string name;
994 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
995
996 protected: std::chrono::steady_clock::duration time =
997 std::chrono::steady_clock::duration::zero();
998
999 protected: bool loaded;
1000
1001 protected: bool initialized;
1002
1005
1014
1016 protected: bool isGradientBackgroundColor = false;
1017
1020
1021 private: unsigned int nextObjectId;
1022
1023 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
1024 private: NodeStorePtr nodes;
1025 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
1026 };
1027 }
1028 }
1029}
1030#endif