-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathScene.hh
1035 lines (869 loc) · 47.8 KB
/
Scene.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_SCENE_HH_
#define IGNITION_RENDERING_SCENE_HH_
#include <array>
#include <string>
#include <limits>
#include <ignition/common/Material.hh>
#include <ignition/common/Mesh.hh>
#include <ignition/common/Time.hh>
#include <ignition/math/Color.hh>
#include "ignition/rendering/config.hh"
#include "ignition/rendering/HeightmapDescriptor.hh"
#include "ignition/rendering/MeshDescriptor.hh"
#include "ignition/rendering/RenderTypes.hh"
#include "ignition/rendering/Storage.hh"
#include "ignition/rendering/Export.hh"
namespace ignition
{
namespace rendering
{
inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
//
class RenderEngine;
/// \class Scene Scene.hh ignition/rendering/Scene.hh
/// \brief Manages a single scene-graph. This class updates scene-wide
/// properties and holds the root scene node. A Scene also serves as a
/// factory for all scene objects.
class IGNITION_RENDERING_VISIBLE Scene
{
/// \brief Destructor
public: virtual ~Scene() { }
/// \brief Load scene-specific resources
public: virtual void Load() = 0;
/// \brief Initialize the scene
public: virtual void Init() = 0;
// TODO(anyone): merge with Destroy
public: virtual void Fini() = 0;
/// \brief Determine if the scene is initialized
/// \return True if the scene is initialized
public: virtual bool IsInitialized() const = 0;
/// \brief Get the ID of the scene
/// \return The scene ID
public: virtual unsigned int Id() const = 0;
/// \brief Get the name of the scene
/// \return The scene name
public: virtual std::string Name() const = 0;
/// \brief Get the creating render-engine of the scene
/// \return The creating render-engine
public: virtual RenderEngine *Engine() const = 0;
/// \brief Get the last simulation update time
/// \return The last simulation update time
public: virtual common::Time IGN_DEPRECATED(4) SimTime() const = 0;
/// \brief Get the last simulation update time
/// \return The last simulation update time
public: virtual std::chrono::steady_clock::duration
Time() const = 0;
/// \brief Set the last simulation update time
/// \param[in] _time Latest simulation update time
public: virtual void IGN_DEPRECATED(4)
SetSimTime(const common::Time &_time) = 0;
/// \brief Set the last simulation update time
/// \param[in] _time Latest simulation update time
public: virtual void SetTime(
const std::chrono::steady_clock::duration &_time) = 0;
/// \brief Get root Visual node. All nodes that are desired to be
/// rendered in a scene should be added to this Visual or one of its
/// ancestors in the scene-graph. Nodes created by this Scene will not be
/// added to the scene by default.
/// \return The root Visual node
public: virtual VisualPtr RootVisual() const = 0;
/// \brief Get a visual at a mouse position.
/// \param[in] _camera Camera pointer being used
/// \param[in] _mousePos position of the mouse in pixels
/// \return Pointer to the visual, NULL if none found.
public: virtual VisualPtr VisualAt(const CameraPtr &_camera,
const math::Vector2i &_mousePos) = 0;
/// \brief Get the scene ambient light color
/// \return The scene ambient light color
public: virtual math::Color AmbientLight() const = 0;
/// \brief Set the scene ambient light color
/// \param[in] _r Red color
/// \param[in] _g Green color
/// \param[in] _b Blue color
/// \param[in] _a Alpha color
public: virtual void SetAmbientLight(double _r, double _g, double _b,
double _a = 1.0) = 0;
/// \brief Set the scene ambient light color
/// \param[in] _color The scene ambient light color
public: virtual void SetAmbientLight(const math::Color &_color) = 0;
/// \brief Get the scene background color
/// \return The scene background color
public: virtual math::Color BackgroundColor() const = 0;
/// \brief Set the scene background color
/// \param[in] _r Red color
/// \param[in] _g Green color
/// \param[in] _b Blue color
/// \param[in] _a Alpha color
public: virtual void SetBackgroundColor(double _r, double _g, double _b,
double _a = 1.0) = 0;
/// \brief Set the scene background color
/// \param[in] _color The scene background color
public: virtual void SetBackgroundColor(const math::Color &_color) = 0;
/// \brief Whether the scene has a gradient background or not (solid)
/// \return True if the scene has a gradient background or false otherwise
public: virtual bool IsGradientBackgroundColor() const = 0;
/// \brief Get the scene gradient background color
/// \return The scene gradient background color
/// \sa bool IsGradientBackgroundColor() const
public: virtual std::array<math::Color, 4>
GradientBackgroundColor() const = 0;
/// \brief Set a custom gradient background color on top of the regular
/// background. Default should be black.
///
/// Important note: Keep in mind that this object will always be rendered
/// on top of any existing scene or camera background.
///
/// \param[in] _colors The scene gradient background color.
/// Next is the description of how to interpret each value of the array:
/// 0: Top left corner color.
/// 1: Bottom left corner color.
/// 2: Top right corner color.
/// 3: Bottom right corner color.
/// \sa void RemoveGradientBackgroundColor()
public: virtual void SetGradientBackgroundColor(
const std::array<math::Color, 4> &_colors) = 0;
/// \brief Remove the scene gradient background color
/// \sa void SetGradientBackgroundColor(
/// const std::array<math::Color, 4> &_colors)
public: virtual void RemoveGradientBackgroundColor() = 0;
/// \brief Get the scene background material
/// e.g. a material with skybox cubemap texture
/// \return Material of the background
public: virtual MaterialPtr BackgroundMaterial() const = 0;
/// \brief Set the scene background material
/// e.g. a material with skybox cubemap texture
/// \param[in] _material Material to set the background to
public: virtual void SetBackgroundMaterial(MaterialPtr _material) = 0;
/// \brief Get the number of nodes managed by this scene. Note these
/// nodes may not be directly or indirectly attached to the root node.
/// \return The number of nodes managed by this scene
public: virtual unsigned int NodeCount() const = 0;
/// \brief Determine if the given node is managed by this Scene
/// \param[in] _node Node in question
/// \return True if a node is managed by this scene
public: virtual bool HasNode(ConstNodePtr _node) const = 0;
/// \brief Determine if a given node with the given id is managed by
/// this Scene
/// \param[in] _id ID of the node in question
/// \return True if a node is managed by this scene
public: virtual bool HasNodeId(unsigned int _id) const = 0;
/// \brief Determine if a given node with the given name is managed by
/// this Scene
/// \param[in] _name Name of the node in question
/// \return True if a node is managed by this scene
public: virtual bool HasNodeName(const std::string &_name) const = 0;
/// \brief Get node with the given id. If no node exists with the given
/// id, NULL will be returned.
/// \param[in] _id ID of the desired node
/// \return The desired node
public: virtual NodePtr NodeById(unsigned int _id) const = 0;
/// \brief Get node with the given name. If no node exists with the given
/// name, NULL will be returned.
/// \param[in] _name Name of the desired node
/// \return The desired node
public: virtual NodePtr NodeByName(const std::string &_name) const = 0;
/// \brief Get node at the given index. If no node exists at the given
/// index, NULL will be returned.
/// \param[in] _index Index of the desired node
/// \return The desired node
public: virtual NodePtr NodeByIndex(unsigned int _index) const = 0;
/// \brief Destroy given node. If the given node is not managed by this
/// scene, no work will be done. Depending on the _recursive argument,
/// this function will either detach all child nodes from the scene graph
/// or recursively destroy them.
/// \param[in] _node Node pointer to destroy
/// \param[in] _recursive True to recursively destroy the node and its
/// children, false to destroy only this node and detach the children
public: virtual void DestroyNode(NodePtr _node,
bool _recursive = false) = 0;
/// \brief Destroy node with the given id. If no node exists with the
/// given id, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _id ID of the node to destroy
public: virtual void DestroyNodeById(unsigned int _id) = 0;
/// \brief Destroy node with the given name. If no node exists with the
/// given name, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _name Name of the node to destroy
public: virtual void DestroyNodeByName(const std::string &_name) = 0;
/// \brief Destroy node at the given index. If no node exists at the
/// given index, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _index Index of the node to destroy
public: virtual void DestroyNodeByIndex(unsigned int _index) = 0;
/// \brief Destroy all nodes manages by this scene.
public: virtual void DestroyNodes() = 0;
/// \brief Get the number of lights managed by this scene. Note these
/// lights may not be directly or indirectly attached to the root light.
/// \return The number of lights managed by this scene
public: virtual unsigned int LightCount() const = 0;
/// \brief Determine if the given light is managed by this Scene
/// \param[in] _light Light in question
/// \return True if a light is managed by this scene
public: virtual bool HasLight(ConstLightPtr _light) const = 0;
/// \brief Determine if a given light with the given id is managed by
/// this Scene
/// \param[in] _id ID of the light in question
/// \return True if a light is managed by this scene
public: virtual bool HasLightId(unsigned int _id) const = 0;
/// \brief Determine if a given light with the given name is managed by
/// this Scene
/// \param[in] _name Name of the light in question
/// \return True if a light is managed by this scene
public: virtual bool HasLightName(const std::string &_name) const = 0;
/// \brief Get light with the given id. If no light exists with the given
/// id, NULL will be returned.
/// \param[in] _id ID of the desired light
/// \return The desired light
public: virtual LightPtr LightById(unsigned int _id) const = 0;
/// \brief Get light with the given name. If no light exists with the
/// given name, NULL will be returned.
/// \param[in] _name Name of the desired light
/// \return The desired light
public: virtual LightPtr LightByName(
const std::string &_name) const = 0;
/// \brief Get light at the given index. If no light exists at the given
/// index, NULL will be returned.
/// \param[in] _index Index of the desired light
/// \return The desired light
public: virtual LightPtr LightByIndex(unsigned int _index) const = 0;
/// \brief Destroy given light. If the given light is not managed by this
/// scene, no work will be done. Depending on the _recursive argument,
/// this function will either detach all child nodes from the scene graph
/// or recursively destroy them.
/// \param[in] _light Light pointer to destroy
/// \param[in] _recursive True to recursively destroy the node and its
/// children, false to destroy only this node and detach the children
public: virtual void DestroyLight(LightPtr _light,
bool _recursive = false) = 0;
/// \brief Destroy light with the given id. If no light exists with the
/// given id, no work will be done. All children of the light will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _id ID of the light to destroy
public: virtual void DestroyLightById(unsigned int _id) = 0;
/// \brief Destroy light with the given name. If no light exists with the
/// given name, no work will be done. All children of the light will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _name Name of the light to destroy
public: virtual void DestroyLightByName(const std::string &_name) = 0;
/// \brief Destroy light at the given index. If no light exists at the
/// given index, no work will be done. All children of the light will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _index Index of the light to destroy
public: virtual void DestroyLightByIndex(unsigned int _index) = 0;
/// \brief Destroy all lights manages by this scene.
public: virtual void DestroyLights() = 0;
/// \brief Get the number of sensors managed by this scene. Note these
/// sensors may not be directly or indirectly attached to the root sensor.
/// \return The number of sensors managed by this scene
public: virtual unsigned int SensorCount() const = 0;
/// \brief Determine if the given sensor is managed by this Scene
/// \param[in] _sensor Sensor in question
/// \return True if a sensor is managed by this scene
public: virtual bool HasSensor(ConstSensorPtr _sensor) const = 0;
/// \brief Determine if a given sensor with the given id is managed by
/// this Scene
/// \param[in] _id ID of the sensor in question
/// \return True if a sensor is managed by this scene
public: virtual bool HasSensorId(unsigned int _id) const = 0;
/// \brief Determine if a given sensor with the given name is managed by
/// this Scene
/// \param[in] _name Name of the sensor in question
/// \return True if a sensor is managed by this scene
public: virtual bool HasSensorName(const std::string &_name) const = 0;
/// \brief Get sensor with the given id. If no sensor exists with the
/// given id, NULL will be returned.
/// \param[in] _id ID of the desired sensor
/// \return The desired sensor
public: virtual SensorPtr SensorById(unsigned int _id) const = 0;
/// \brief Get sensor with the given name. If no sensor exists with the
/// given name, NULL will be returned.
/// \param[in] _name Name of the desired sensor
/// \return The desired sensor
public: virtual SensorPtr SensorByName(
const std::string &_name) const = 0;
/// \brief Get sensor at the given index. If no sensor exists at the given
/// index, NULL will be returned.
/// \param[in] _index Index of the desired sensor
/// \return The desired sensor
public: virtual SensorPtr SensorByIndex(unsigned int _index) const = 0;
/// \brief Destroy given sensor. If the given sensor is not managed by
/// this scene, no work will be done. Depending on the _recursive
/// argument, this function will either detach all child nodes from the
/// scene graph or recursively destroy them.
/// \param[in] _sensor Sensor pointer to destroy
/// \param[in] _recursive True to recursively destroy the node and its
/// children, false to destroy only this node and detach the children
public: virtual void DestroySensor(SensorPtr _sensor,
bool _recursive = false) = 0;
/// \brief Destroy sensor with the given id. If no sensor exists with the
/// given id, no work will be done. All children of the sensor will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _id ID of the sensor to destroy
public: virtual void DestroySensorById(unsigned int _id) = 0;
/// \brief Destroy sensor with the given name. If no sensor exists with
/// the given name, no work will be done. All children of the sensor will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _name Name of the sensor to destroy
public: virtual void DestroySensorByName(const std::string &_name) = 0;
/// \brief Destroy sensor at the given index. If no sensor exists at the
/// given index, no work will be done. All children of the sensor will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _index Index of the sensor to destroy
public: virtual void DestroySensorByIndex(unsigned int _index) = 0;
/// \brief Destroy all sensors manages by this scene.
public: virtual void DestroySensors() = 0;
/// \brief Get the number of nodes managed by this scene. Note these
/// nodes may not be directly or indirectly attached to the root node.
/// \return The number of nodes managed by this scene
public: virtual unsigned int VisualCount() const = 0;
/// \brief Determine if the given node is managed by this Scene
/// \param[in] _node Visual in question
/// \return True if a node is managed by this scene
public: virtual bool HasVisual(ConstVisualPtr _node) const = 0;
/// \brief Determine if a given node with the given id is managed by
/// this Scene
/// \param[in] _id ID of the node in question
/// \return True if a node is managed by this scene
public: virtual bool HasVisualId(unsigned int _id) const = 0;
/// \brief Determine if a given node with the given name is managed by
/// this Scene
/// \param[in] _name Name of the node in question
/// \return True if a node is managed by this scene
public: virtual bool HasVisualName(const std::string &_name) const = 0;
/// \brief Get node with the given id. If no node exists with the given
/// id, NULL will be returned.
/// \param[in] _id ID of the desired node
/// \return The desired node
public: virtual VisualPtr VisualById(unsigned int _id) const = 0;
/// \brief Get node with the given name. If no node exists with the given
/// name, NULL will be returned.
/// \param[in] _name Name of the desired node
/// \return The desired node
public: virtual VisualPtr VisualByName(
const std::string &_name) const = 0;
/// \brief Get node at the given index. If no node exists at the given
/// index, NULL will be returned.
/// \param[in] _index Index of the desired node
/// \return The desired node
public: virtual VisualPtr VisualByIndex(unsigned int _index) const = 0;
/// \brief Destroy given node. If the given node is not managed by this
/// scene, no work will be done. Depending on the _recursive argument,
/// this function will either detach all child nodes from the scene graph
/// or recursively destroy them.
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _node Visual pointer to destroy
/// \param[in] _recursive True to recursively destroy the node and its
/// children, false to destroy only this node and detach the children
public: virtual void DestroyVisual(VisualPtr _node,
bool _recursive = false) = 0;
/// \brief Destroy node with the given id. If no node exists with the
/// given id, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _id ID of the node to destroy
public: virtual void DestroyVisualById(unsigned int _id) = 0;
/// \brief Destroy node with the given name. If no node exists with the
/// given name, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _name Name of the node to destroy
public: virtual void DestroyVisualByName(const std::string &_name) = 0;
/// \brief Destroy node at the given index. If no node exists at the
/// given index, no work will be done. All children of the node will
/// consequently be detached from the scene graph, but not destroyed.
/// \param[in] _index Index of the node to destroy
public: virtual void DestroyVisualByIndex(unsigned int _index) = 0;
/// \brief Destroy all nodes manages by this scene.
public: virtual void DestroyVisuals() = 0;
/// \brief Determine if a material is registered under the given name
/// \param[in] _name Name of the material in question
/// \return True if a material is registered under the given name
public: virtual bool MaterialRegistered(
const std::string &_name) const = 0;
/// \brief Get material registered under the given name. If no material
/// is registered under the given name, NULL will be returned.
/// \param[in] _name Name of the desired material
/// \return The specified material
public: virtual MaterialPtr Material(
const std::string &_name) const = 0;
/// \brief Register a new material under the given name. If the name is
/// already in use, no work will be done.
/// \param[in] _name Name which the material will be registered under
/// \param[in] _material Material to register
public: virtual void RegisterMaterial(const std::string &_name,
MaterialPtr _material) = 0;
/// \brief Unregister material registered under the given name. If no
/// material is registered under this name, no work will be done.
/// \param[in] _name Name of the material to unregistered
public: virtual void UnregisterMaterial(const std::string &_name) = 0;
/// \brief Unregister all registered materials
public: virtual void UnregisterMaterials() = 0;
/// \brief Unregister and destroy a material
/// \param[in] _material Material to be unregistered and destroyed
public: virtual void DestroyMaterial(MaterialPtr _material) = 0;
/// \brief Unregister and destroys all registered materials
public: virtual void DestroyMaterials() = 0;
/// \brief Create new directional light. A unique ID and name will
/// automatically be assigned to the light.
/// \return The created light
public: virtual DirectionalLightPtr CreateDirectionalLight() = 0;
/// \brief Create new directional light with the given ID. A unique name
/// will automatically be assigned to the light. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \return The created light
public: virtual DirectionalLightPtr CreateDirectionalLight(
unsigned int _id) = 0;
/// \brief Create new directional light with the given name. A unique ID
/// will automatically be assigned to the light. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual DirectionalLightPtr CreateDirectionalLight(
const std::string &_name) = 0;
/// \brief Create new directional light with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual DirectionalLightPtr CreateDirectionalLight(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new point light. A unique ID and name will
/// automatically be assigned to the light.
/// \return The created light
public: virtual PointLightPtr CreatePointLight() = 0;
/// \brief Create new point light with the given ID. A unique name
/// will automatically be assigned to the light. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \return The created light
public: virtual PointLightPtr CreatePointLight(
unsigned int _id) = 0;
/// \brief Create new point light with the given name. A unique ID
/// will automatically be assigned to the light. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual PointLightPtr CreatePointLight(
const std::string &_name) = 0;
/// \brief Create new point light with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual PointLightPtr CreatePointLight(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new spotlight. A unique ID and name will
/// automatically be assigned to the light.
/// \return The created light
public: virtual SpotLightPtr CreateSpotLight() = 0;
/// \brief Create new spotlight with the given ID. A unique name
/// will automatically be assigned to the light. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \return The created light
public: virtual SpotLightPtr CreateSpotLight(
unsigned int _id) = 0;
/// \brief Create new spotlight with the given name. A unique ID
/// will automatically be assigned to the light. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual SpotLightPtr CreateSpotLight(
const std::string &_name) = 0;
/// \brief Create new spotlight with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new light
/// \param[in] _name Name of the new light
/// \return The created light
public: virtual SpotLightPtr CreateSpotLight(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new camera. A unique ID and name will
/// automatically be assigned to the camera.
/// \return The created camera
public: virtual CameraPtr CreateCamera() = 0;
/// \brief Create new camera with the given ID. A unique name
/// will automatically be assigned to the camera. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \return The created camera
public: virtual CameraPtr CreateCamera(
unsigned int _id) = 0;
/// \brief Create new camera with the given name. A unique ID
/// will automatically be assigned to the camera. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual CameraPtr CreateCamera(
const std::string &_name) = 0;
/// \brief Create new camera with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual CameraPtr CreateCamera(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new depth camera. A unique ID and name will
/// automatically be assigned to the camera.
/// \return The created camera
public: virtual DepthCameraPtr CreateDepthCamera() = 0;
/// \brief Create new depth camera with the given ID. A unique name
/// will automatically be assigned to the camera. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \return The created camera
public: virtual DepthCameraPtr CreateDepthCamera(
unsigned int _id) = 0;
/// \brief Create new depth camera with the given name. A unique ID
/// will automatically be assigned to the camera. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual DepthCameraPtr CreateDepthCamera(
const std::string &_name) = 0;
/// \brief Create new depth camera with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual DepthCameraPtr CreateDepthCamera(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new thermal camera. A unique ID and name will
/// automatically be assigned to the camera.
/// \return The created camera
public: virtual ThermalCameraPtr CreateThermalCamera() = 0;
/// \brief Create new thermal camera with the given ID. A unique name
/// will automatically be assigned to the camera. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \return The created camera
public: virtual ThermalCameraPtr CreateThermalCamera(
unsigned int _id) = 0;
/// \brief Create new thermal camera with the given name. A unique ID
/// will automatically be assigned to the camera. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual ThermalCameraPtr CreateThermalCamera(
const std::string &_name) = 0;
/// \brief Create new thermal camera with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new camera
/// \param[in] _name Name of the new camera
/// \return The created camera
public: virtual ThermalCameraPtr CreateThermalCamera(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new gpu rays caster. A unique ID and name will
/// automatically be assigned to the gpu rays caster.
/// \return The created gpu rays caster
public: virtual GpuRaysPtr CreateGpuRays() = 0;
/// \brief Create new gpu rays caster with the given ID. A unique name
/// will automatically be assigned to the gpu rays caster. If the given
/// ID is already in use, NULL will be returned.
/// \param[in] _id ID of the new gpu rays caster
/// \return The created gpu rays caster
public: virtual GpuRaysPtr CreateGpuRays(unsigned int _id) = 0;
/// \brief Create new gpu rays caster with the given name. A unique ID
/// will automatically be assigned to the gpu rays caster. If the given
/// name is already in use, NULL will be returned.
/// \param[in] _name Name of the new gpu rays caster
/// \return The created gpu ray caster
public: virtual GpuRaysPtr CreateGpuRays(
const std::string &_name) = 0;
/// \brief Create new gpu rays caster with the given name. If either
/// the given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the gpu ray caster
/// \param[in] _name Name of the new gpu ray caster
/// \return The created Gpu ray caster
public: virtual GpuRaysPtr CreateGpuRays(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new visual. A unique ID and name will
/// automatically be assigned to the visual.
/// \return The created visual
public: virtual VisualPtr CreateVisual() = 0;
/// \brief Create new visual with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new visual
/// \return The created visual
public: virtual VisualPtr CreateVisual(
unsigned int _id) = 0;
/// \brief Create new visual with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new visual
/// \return The created visual
public: virtual VisualPtr CreateVisual(
const std::string &_name) = 0;
/// \brief Create new visual with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new visual
/// \param[in] _name Name of the new visual
/// \return The created visual
public: virtual VisualPtr CreateVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new arrow visual. A unique ID and name will
/// automatically be assigned to the visual.
/// \return The created arrow visual
public: virtual ArrowVisualPtr CreateArrowVisual() = 0;
/// \brief Create new arrow visual with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new arrow visual
/// \return The created arrow visual
public: virtual ArrowVisualPtr CreateArrowVisual(
unsigned int _id) = 0;
/// \brief Create new arrow visual with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new arrow visual
/// \return The created arrow visual
public: virtual ArrowVisualPtr CreateArrowVisual(
const std::string &_name) = 0;
/// \brief Create new arrow visual with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new arrow visual
/// \param[in] _name Name of the new arrow visual
/// \return The created arrow visual
public: virtual ArrowVisualPtr CreateArrowVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new axis visual. A unique ID and name will
/// automatically be assigned to the visual.
/// \return The created axis visual
public: virtual AxisVisualPtr CreateAxisVisual() = 0;
/// \brief Create new axis visual with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new axis visual
/// \return The created axis visual
public: virtual AxisVisualPtr CreateAxisVisual(
unsigned int _id) = 0;
/// \brief Create new axis visual with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new axis visual
/// \return The created axis visual
public: virtual AxisVisualPtr CreateAxisVisual(
const std::string &_name) = 0;
/// \brief Create new axis visual with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new axis visual
/// \param[in] _name Name of the new axis visual
/// \return The created axis visual
public: virtual AxisVisualPtr CreateAxisVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new gizmo visual. A unique ID and name will
/// automatically be assigned to the visual.
/// \return The created gizmo visual
public: virtual GizmoVisualPtr CreateGizmoVisual() = 0;
/// \brief Create new gizmo visual with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new gizmo visual
/// \return The created gizmo visual
public: virtual GizmoVisualPtr CreateGizmoVisual(
unsigned int _id) = 0;
/// \brief Create new gizmo visual with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new gizmo visual
/// \return The created gizmo visual
public: virtual GizmoVisualPtr CreateGizmoVisual(
const std::string &_name) = 0;
/// \brief Create new gizmo visual with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new gizmo visual
/// \param[in] _name Name of the new gizmo visual
/// \return The created gizmo visual
public: virtual GizmoVisualPtr CreateGizmoVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new light visual. A unique ID and name will
/// automatically be assigned to the light visual.
/// \return The created light visual
public: virtual LightVisualPtr CreateLightVisual() = 0;
/// \brief Create new light visual with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new light visual
/// \return The created light visual
public: virtual LightVisualPtr CreateLightVisual(
unsigned int _id) = 0;
/// \brief Create new light visual with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new light visual
/// \return The created light visual
public: virtual LightVisualPtr CreateLightVisual(
const std::string &_name) = 0;
/// \brief Create new light visual with the given name. If either the
/// given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the new light visual
/// \param[in] _name Name of the new light visual
/// \return The created light visual
public: virtual LightVisualPtr CreateLightVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new box geometry
/// \return The created box
public: virtual GeometryPtr CreateBox() = 0;
/// \brief Create new capsule geometry
/// \return The created capsule
public: virtual CapsulePtr CreateCapsule() = 0;
/// \brief Create new cone geometry
/// \return The created cone
public: virtual GeometryPtr CreateCone() = 0;
/// \brief Create new cylinder geometry
/// \return The created cylinder
public: virtual GeometryPtr CreateCylinder() = 0;
/// \brief Create new plane geometry
/// \return The created plane
public: virtual GeometryPtr CreatePlane() = 0;
/// \brief Create new sphere or ellipsoid geometry
/// This method allow to create ellipsoid too, because it can be scaled
/// in 3 dimensions.
/// \return The created sphere
public: virtual GeometryPtr CreateSphere() = 0;
/// \brief Create new mesh geomerty. The rendering::Mesh will be created
/// from a common::Mesh retrieved from common::MeshManager using the given
/// mesh name. If no mesh exists by this name, NULL will be returned. All
/// sub-meshes will be loaded into the created mesh, uncentered.
/// \param[in] _meshName Name of the reference mesh
/// \return The created mesh
public: virtual MeshPtr CreateMesh(const std::string &_meshName) = 0;
/// \brief Create new mesh geomerty. The rendering::Mesh will be created
/// from the given common::Mesh. All sub-meshes will be loaded into this
/// created mesh, uncentered.
/// \param[in] _mesh Reference mesh
/// \return The created mesh
public: virtual MeshPtr CreateMesh(const common::Mesh *_mesh) = 0;
/// \brief Create new mesh geometry. The rendering::Mesh will be created
/// from the given common::Mesh specified in the MeshDescriptor.
/// Sub-meshes will be loaded and centered according to the descriptor.
/// \param[in] _desc Descriptor of the mesh to load
/// \return The created mesh
public: virtual MeshPtr CreateMesh(const MeshDescriptor &_desc) = 0;
/// \brief Create new grid geometry.
/// \return The created grid
public: virtual GridPtr CreateGrid() = 0;
/// \brief Create new wire box geometry.
/// \return The created wire box
public: virtual WireBoxPtr CreateWireBox() = 0;
/// \brief Create new marker geometry.
/// \return The created marker
public: virtual MarkerPtr CreateMarker() = 0;
/// \brief Create new lidar visual. A unique ID and name will
/// automatically be assigned to the lidar visual.
/// \return The created lidar visual
public: virtual LidarVisualPtr CreateLidarVisual() = 0;
/// \brief Create new lidar visual with the given ID. A unique name
/// will automatically be assigned to the lidar visual. If the given
/// ID is already in use, NULL will be returned.
/// \param[in] _id ID of the new lidar visual
/// \return The created lidar visual
public: virtual LidarVisualPtr CreateLidarVisual(unsigned int _id) = 0;
/// \brief Create new lidar visual with the given name. A unique ID
/// will automatically be assigned to the lidar visual. If the given
/// name is already in use, NULL will be returned.
/// \param[in] _name Name of the new lidar visual
/// \return The created lidar visual
public: virtual LidarVisualPtr CreateLidarVisual(
const std::string &_name) = 0;
/// \brief Create new lidar visual with the given name. If either
/// the given ID or name is already in use, NULL will be returned.
/// \param[in] _id ID of the lidar visual.
/// \param[in] _name Name of the new lidar visual.
/// \return The created lidar visual
public: virtual LidarVisualPtr CreateLidarVisual(
unsigned int _id, const std::string &_name) = 0;
/// \brief Create new heightmap geomerty. The rendering::Heightmap will be
/// created from the given HeightmapDescriptor.
/// \param[in] _desc Data about the heightmap
/// \return The created heightmap
public: virtual HeightmapPtr CreateHeightmap(
const HeightmapDescriptor &_desc) = 0;
/// \brief Create new text geometry.
/// \return The created text
public: virtual TextPtr CreateText() = 0;
/// \brief Create new material with the given name. Created material will
/// have default properties.
/// \param[in] _name Name for the new material.
/// \return The created material
public: virtual MaterialPtr CreateMaterial(const std::string &_name = "")
= 0;
/// \brief Create new material from the reference common::Material
/// \param[in] _material Reference material
/// \return The created material
public: virtual MaterialPtr CreateMaterial(
const common::Material &_material) = 0;
/// \brief Create new render texture
/// \return The created render texture
public: virtual RenderTexturePtr CreateRenderTexture() = 0;
/// \brief Create new render window. This feature is render engine
/// dependent. If the engine does not support attaching to a windowing
/// system then it should behave as a a render texture.
/// \return The created render window
public: virtual RenderWindowPtr CreateRenderWindow() = 0;
/// \brief Create new ray query
/// \return The created ray query
public: virtual RayQueryPtr CreateRayQuery() = 0;
/// \brief Create new particle emitter. A unique ID and name will
/// automatically be assigned to the visual.
/// \return The created particle emitter
public: virtual ParticleEmitterPtr CreateParticleEmitter() = 0;
/// \brief Create new particle emitter with the given ID. A unique name
/// will automatically be assigned to the visual. If the given ID is
/// already in use, NULL will be returned.
/// \param[in] _id ID of the new particle emitter
/// \return The created particle emitter
public: virtual ParticleEmitterPtr CreateParticleEmitter(
unsigned int _id) = 0;
/// \brief Create new particle emitter with the given name. A unique ID
/// will automatically be assigned to the visual. If the given name is
/// already in use, NULL will be returned.
/// \param[in] _name Name of the new particle emitter
/// \return The created particle emitter
public: virtual ParticleEmitterPtr CreateParticleEmitter(
const std::string &_name) = 0;