cylinder_entity.h
Go to the documentation of this file.
1 
8 #ifndef CYLINDER_ENTITY_H
9 #define CYLINDER_ENTITY_H
10 
11 namespace argos {
12  class CCylinderEntity;
13  class CEmbodiedEntity;
14  class CLEDEquippedEntity;
15 }
16 
17 #include <argos3/core/simulator/entity/embodied_entity.h>
18 #include <argos3/core/simulator/entity/composable_entity.h>
19 #include <argos3/plugins/simulator/entities/led_equipped_entity.h>
20 
21 namespace argos {
22 
24 
25  public:
26 
28 
30 
31  CCylinderEntity(const std::string& str_id,
32  const CVector3& c_position,
33  const CQuaternion& c_orientation,
34  bool b_movable,
35  Real f_radius,
36  Real f_height,
37  Real f_mass = 1.0f);
38 
39  virtual void Init(TConfigurationNode& t_tree);
40  virtual void Reset();
41 
42  /*
43  * Enables the LEDs for this entity.
44  * Adds the LED equipped entity to the given medium.
45  * If you don't call this method, the LEDs added with
46  * CCylinderEntity::AddLED() won't be updated correctly.
47  * @param c_medium The medium to which the LEDs must be associated.
48  * @see CCylinderEntity::AddLED()
49  */
50  void EnableLEDs(CLEDMedium& c_medium);
51 
52  /*
53  * Disables the LEDs for this entity.
54  */
55  void DisableLEDs();
56 
65  void AddLED(const CVector3& c_offset,
66  const CColor& c_color = CColor::BLACK);
67 
69  return *m_pcEmbodiedEntity;
70  }
71 
73  return *m_pcLEDEquippedEntity;
74  }
75 
76  inline Real GetRadius() const {
77  return m_fRadius;
78  }
79 
80  inline Real GetHeight() const {
81  return m_fHeight;
82  }
83 
84  void Resize(Real f_radius, Real f_height);
85 
86  inline Real GetMass() const {
87  return m_fMass;
88  }
89 
90  inline void SetMass(Real f_mass) {
91  m_fMass = f_mass;
92  }
93 
94  virtual std::string GetTypeDescription() const {
95  return "cylinder";
96  }
97 
98  private:
99 
100  CEmbodiedEntity* m_pcEmbodiedEntity;
101  CLEDEquippedEntity* m_pcLEDEquippedEntity;
102  Real m_fRadius;
103  Real m_fHeight;
104  Real m_fMass;
105  CLEDMedium* m_pcLEDMedium;
106 
107  };
108 
109 }
110 
111 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Basic class for an entity that contains other entities.
This entity is a link to a body in the physics engine.
The basic color type.
Definition: color.h:25
static CColor BLACK
Definition: color.h:29
A 3D vector class.
Definition: vector3.h:31
void AddLED(const CVector3 &c_offset, const CColor &c_color=CColor::BLACK)
Adds an LED to this entity.
void Resize(Real f_radius, Real f_height)
void EnableLEDs(CLEDMedium &c_medium)
CEmbodiedEntity & GetEmbodiedEntity()
CLEDEquippedEntity & GetLEDEquippedEntity()
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void SetMass(Real f_mass)
A container of CLEDEntity.