Helios++
Helios software for LiDAR simulations
PyScenePartWrapper.h
1 #pragma once
2 
3 #ifdef PYTHON_BINDING
4 
5 #include <string>
6 #include <ScenePart.h>
7 #include <DynMovingObject.h>
8 
9 namespace pyhelios{
10 
19 public:
20  // *** ATTRIBUTES *** //
21  // ******************** //
22  ScenePart &sp;
23 
24  // *** CONSTRUCTION / DESTRUCTION *** //
25  // ************************************ //
26  PyScenePartWrapper(ScenePart &sp) : sp(sp) {}
27  virtual ~PyScenePartWrapper() {}
28 
29  // *** GETTERS and SETTERS *** //
30  // ***************************** //
31  std::string getId() {return sp.mId;};
32  void setId(std::string id) {sp.mId = id;}
33  PythonDVec3 * getOrigin() {return new PythonDVec3(sp.mOrigin);}
34  void setOrigin(double x, double y, double z)
35  {sp.mOrigin = glm::dvec3(x, y, z);}
36  Rotation & getRotation() {return sp.mRotation;}
37  void setRotation(double x, double y, double z, double angle)
38  {sp.mRotation = Rotation(glm::dvec3(x, y, z), angle);}
39  double getScale() {return sp.mScale;}
40  void setScale(double scale) {sp.mScale = scale;}
41  bool isDynamicMovingObject()
42  {return sp.getType() == ScenePart::ObjectType::DYN_MOVING_OBJECT;}
43  size_t getDynObjectStep() {return _asDynObject().getStepInterval();}
44  void setDynObjectStep(size_t const stepInterval)
45  {return _asDynObject().setStepInterval(stepInterval);}
46  size_t getObserverStep()
48  void setObserverStep(size_t const stepInterval)
50 
51 
52  // *** INTERNAL USE *** //
53  // ********************** //
64 };
65 
66 }
67 
68 #endif
Implementation of a dynamic object which supports dynamic motions (extended rigid motions)
Definition: DynMovingObject.h:39
void setObserverStepInterval(int const stepInterval)
Set the step interval between consecutive observer update notifications.
Definition: DynMovingObject.h:356
int getObserverStepInterval() const
Get the step interval between consecutive observer update notifications.
Definition: DynMovingObject.h:368
Dynamic object base implementation.
Definition: DynObject.h:23
void setStepInterval(int const stepInterval)
Set the step interval for the dynamic object.
Definition: DynObject.h:415
int getStepInterval() const
Obtain the current step interval for the dynamic object.
Definition: DynObject.h:406
Definition: Rotation.h:80
Class representing a scene part.
Definition: ScenePart.h:20
virtual ObjectType getType() const
Obtain the object type of the scene part.
Definition: ScenePart.h:314
glm::dvec3 mOrigin
Specify the origin for the scene part.
Definition: ScenePart.h:128
Rotation mRotation
Specify the rotation for the scene part.
Definition: ScenePart.h:132
double mScale
Specify the scale for the scene part.
Definition: ScenePart.h:136
std::string mId
Identifier for the scene part.
Definition: ScenePart.h:91
Wrapper for ScenePart class.
Definition: PyScenePartWrapper.h:18
DynObject & _asDynObject()
Obtain the scene part as a dynamic object. Use with caution as it might throw an exception.
Definition: PyScenePartWrapper.cpp:10
DynMovingObject & _asDynMovingObject()
Obtain the scene part as a dynamic moving object. Use with caution as it might throw an exception.
Definition: PyScenePartWrapper.cpp:20
Wrapper to communicate glm::dvec3 with python.
Definition: PythonDVec3.h:16