Gazebo Rendering

API Reference

10.0.0~pre1
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 public: virtual FrustumVisualPtr CreateFrustumVisual() override;
542
543 // Documentation inherited.
545 unsigned int _id) override;
546
547 // Documentation inherited.
549 const std::string &_name) override;
550
551 // Documentation inherited.
552 public: virtual FrustumVisualPtr CreateFrustumVisual(unsigned int _id,
553 const std::string &_name) override;
554
555 // Documentation inherited.
557 const HeightmapDescriptor &_desc) override;
558
559 // Documentation inherited.
560 public: virtual WireBoxPtr CreateWireBox() override;
561
562 // Documentation inherited.
563 public: virtual TextPtr CreateText() override;
564
565 public: virtual MaterialPtr CreateMaterial(const std::string &_name = "")
566 override;
567
569 const common::Material &_material) override;
570
571 public: virtual RenderTexturePtr CreateRenderTexture() override;
572
573 // Documentation inherited.
574 public: virtual RenderWindowPtr CreateRenderWindow() override;
575
576 public: virtual RayQueryPtr CreateRayQuery() override;
577
578 // Documentation inherited.
579 public: virtual ParticleEmitterPtr CreateParticleEmitter() override;
580
581 // Documentation inherited.
582 public: virtual ParticleEmitterPtr CreateParticleEmitter(unsigned int _id)
583 override;
584
585 // Documentation inherited.
587 const std::string &_name) override;
588
589 // Documentation inherited.
591 unsigned int _id, const std::string &_name) override;
592
593 // Documentation inherited.
594 public: virtual ProjectorPtr CreateProjector() override;
595
596 // Documentation inherited.
597 public: virtual ProjectorPtr CreateProjector(unsigned int _id)
598 override;
599
600 // Documentation inherited.
602 const std::string &_name) override;
603
604 // Documentation inherited.
606 unsigned int _id, const std::string &_name) override;
607
608 // Documentation inherited.
609 public: virtual GlobalIlluminationVctPtr
611
612 // Documentation inherited.
614 unsigned int _id) override;
615
616 // Documentation inherited.
618 const std::string &_name) override;
619
620 // Documentation inherited.
622 unsigned int _id, const std::string &_name) override;
623
624 // Documentation inherited.
625 public: virtual GlobalIlluminationCiVctPtr
627
628 // Documentation inherited.
630 unsigned int _id) override;
631
632 // Documentation inherited.
634 const std::string &_name) override;
635
636 // Documentation inherited.
638 unsigned int _id, const std::string &_name) override;
639
640 // Documentation inherited.
641 public: virtual void SetSkyEnabled(bool _enabled) override;
642
643 // Documentation inherited.
644 public: virtual bool SkyEnabled() const override;
645
646 // Documentation inherited.
647 public: virtual bool SetShadowTextureSize(LightType _lightType,
648 unsigned int _textureSize) override;
649
650 // Documentation inherited.
651 public: virtual unsigned int ShadowTextureSize(LightType _lightType) const
652 override;
653
654 // Documentation inherited.
655 public: virtual void SetActiveGlobalIllumination(
656 GlobalIlluminationBasePtr _gi) override;
657
658 public: virtual void PreRender() override;
659
660 public: virtual void Clear() override;
661
662 public: virtual void Destroy() override;
663
664 // Documentation inherited.
665 public: virtual void PostRender() override;
666
667 // Documentation inherited.
668 public: virtual void SetCameraPassCountPerGpuFlush(
669 uint8_t _numPass) override;
670
671 // Documentation inherited.
672 public: virtual uint8_t CameraPassCountPerGpuFlush() const override;
673
674 // Documentation inherited.
675 public: virtual bool LegacyAutoGpuFlush() const override;
676
677 protected: virtual unsigned int CreateObjectId();
678
679 protected: virtual std::string CreateObjectName(unsigned int _id,
680 const std::string &_prefix);
681
682 protected: virtual bool RegisterLight(LightPtr _light);
683
684 protected: virtual bool RegisterSensor(SensorPtr _vensor);
685
686 protected: virtual bool RegisterVisual(VisualPtr _visual);
687
689 unsigned int _id, const std::string &_name) = 0;
690
691 protected: virtual PointLightPtr CreatePointLightImpl(unsigned int _id,
692 const std::string &_name) = 0;
693
694 protected: virtual SpotLightPtr CreateSpotLightImpl(unsigned int _id,
695 const std::string &_name) = 0;
696
697 protected: virtual CameraPtr CreateCameraImpl(unsigned int _id,
698 const std::string &_name) = 0;
699
700 protected: virtual DepthCameraPtr CreateDepthCameraImpl(unsigned int _id,
701 const std::string &_name) = 0;
702
707 unsigned int _id, const std::string &_name)
708 {
709 // The following two lines will avoid doxygen warnings
710 (void)_id;
711 (void)_name;
712 gzerr << "Thermal camera not supported by: "
713 << this->Engine()->Name() << std::endl;
714 return ThermalCameraPtr();
715 }
716
722 unsigned int _id, const std::string &_name)
723 {
724 // The following two lines will avoid doxygen warnings
725 (void)_id;
726 (void)_name;
727 gzerr << "BoundingBox camera not supported by: "
728 << this->Engine()->Name() << std::endl;
729 return BoundingBoxCameraPtr();
730 }
731
737 unsigned int _id,
738 const std::string &_name)
739 {
740 // The following two lines will avoid doxygen warnings
741 (void)_id;
742 (void)_name;
743 gzerr << "Segmentation camera not supported by: "
744 << this->Engine()->Name() << std::endl;
745 return SegmentationCameraPtr();
746 }
747
753 unsigned int _id,
754 const std::string &_name)
755 {
756 // The following two lines will avoid doxygen warnings
757 (void)_id;
758 (void)_name;
759 gzerr << "Wide angle camera not supported by: "
760 << this->Engine()->Name() << std::endl;
761 return WideAngleCameraPtr();
762 }
763
767 protected: virtual GpuRaysPtr CreateGpuRaysImpl(unsigned int _id,
768 const std::string & _name)
769 {
770 (void)_id;
771 (void)_name;
772 gzerr << "GpuRays not supported by: "
773 << this->Engine()->Name() << std::endl;
774 return GpuRaysPtr();
775 }
776
777 protected: virtual VisualPtr CreateVisualImpl(unsigned int _id,
778 const std::string &_name) = 0;
779
780 protected: virtual ArrowVisualPtr CreateArrowVisualImpl(unsigned int _id,
781 const std::string &_name) = 0;
782
783 protected: virtual AxisVisualPtr CreateAxisVisualImpl(unsigned int _id,
784 const std::string &_name) = 0;
785
789 protected: virtual GizmoVisualPtr CreateGizmoVisualImpl(unsigned int _id,
790 const std::string &_name)
791 {
792 (void)_id;
793 (void)_name;
794 gzerr << "GizmoVisual not supported by: "
795 << this->Engine()->Name() << std::endl;
796 return GizmoVisualPtr();
797 }
798
799 protected: virtual GeometryPtr CreateBoxImpl(unsigned int _id,
800 const std::string &_name) = 0;
801
802 protected: virtual GeometryPtr CreateConeImpl(unsigned int _id,
803 const std::string &_name) = 0;
804
805 protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
806 const std::string &_name) = 0;
807
808 protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
809 const std::string &_name) = 0;
810
811 protected: virtual GeometryPtr CreateSphereImpl(unsigned int _id,
812 const std::string &_name) = 0;
813
814 protected: virtual MeshPtr CreateMeshImpl(unsigned int _id,
815 const std::string &_name,
816 const MeshDescriptor &_desc) = 0;
817
822 protected: virtual CapsulePtr CreateCapsuleImpl(unsigned int _id,
823 const std::string &_name) = 0;
824
829 protected: virtual GridPtr CreateGridImpl(unsigned int _id,
830 const std::string &_name) = 0;
831
836 protected: virtual MarkerPtr CreateMarkerImpl(unsigned int _id,
837 const std::string &_name) = 0;
838
843 protected: virtual LidarVisualPtr CreateLidarVisualImpl(unsigned int _id,
844 const std::string &_name) = 0;
845
851 unsigned int _id, const std::string &_name) = 0;
852
858 protected: virtual HeightmapPtr CreateHeightmapImpl(unsigned int _id,
859 const std::string &_name,
860 const HeightmapDescriptor &_desc) = 0;
861
866 protected: virtual WireBoxPtr CreateWireBoxImpl(unsigned int _id,
867 const std::string &_name) = 0;
868
873 protected: virtual TextPtr CreateTextImpl(unsigned int _id,
874 const std::string &_name);
875
876 protected: virtual MaterialPtr CreateMaterialImpl(unsigned int _id,
877 const std::string &_name) = 0;
878
880 unsigned int _id, const std::string &_name) = 0;
881
888 unsigned int _id, const std::string &_name) = 0;
889
890 protected: virtual RayQueryPtr CreateRayQueryImpl(
891 unsigned int _id, const std::string &_name) = 0;
892
898 unsigned int _id, const std::string &_name)
899 {
900 (void)_id;
901 (void)_name;
902 gzerr << "ParticleEmitter not supported by: "
903 << this->Engine()->Name() << std::endl;
904 return ParticleEmitterPtr();
905 }
906
912 unsigned int _id, const std::string &_name)
913 {
914 (void)_id;
915 (void)_name;
916 gzerr << "Projector not supported by: "
917 << this->Engine()->Name() << std::endl;
918 return ProjectorPtr();
919 }
920
925 protected: virtual GlobalIlluminationVctPtr
927 unsigned int _id, const std::string &_name)
928 {
929 (void)_id;
930 (void)_name;
931 gzerr << "GlobalIlluminationVct not supported by: "
932 << this->Engine()->Name() << std::endl;
934 }
935
940 protected: virtual GlobalIlluminationCiVctPtr
942 unsigned int _id, const std::string &_name)
943 {
944 (void)_id;
945 (void)_name;
946 gzerr << "GlobalIlluminationCiVct not supported by: "
947 << this->Engine()->Name() << std::endl;
949 }
950
951 protected: virtual LightStorePtr Lights() const = 0;
952
953 protected: virtual SensorStorePtr Sensors() const = 0;
954
955 protected: virtual VisualStorePtr Visuals() const = 0;
956
957 protected: virtual MaterialMapPtr Materials() const = 0;
958
959 protected: virtual bool LoadImpl() = 0;
960
961 protected: virtual bool InitImpl() = 0;
962
963 private: virtual void CreateNodeStore();
964
965 private: virtual void CreateMaterials();
966
972 private: void DestroyNodeRecursive(NodePtr _node,
973 std::set<unsigned int> &_nodeIds);
974
975 protected: unsigned int id;
976
977 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
978 protected: std::string name;
979 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
980
981 protected: std::chrono::steady_clock::duration time =
982 std::chrono::steady_clock::duration::zero();
983
984 protected: bool loaded;
985
986 protected: bool initialized;
987
990
999
1001 protected: bool isGradientBackgroundColor = false;
1002
1005
1006 private: unsigned int nextObjectId;
1007
1008 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
1009 private: NodeStorePtr nodes;
1010 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
1011 };
1012 }
1013 }
1014}
1015#endif