directional_led_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef DIRECTIONAL_LED_EQUIPPED_ENTITY_H
8 #define DIRECTIONAL_LED_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CDirectionalLEDEquippedEntity;
12  class CDirectionalLEDEntity;
13 }
14 
15 #include <argos3/core/simulator/entity/composable_entity.h>
16 #include <argos3/plugins/simulator/entities/directional_led_entity.h>
17 #include <vector>
18 
19 namespace argos {
20 
31 
32  public:
33 
34  ENABLE_VTABLE();
35 
36  public:
37 
38  struct SInstance {
44  SAnchor& s_anchor,
45  const CVector3& c_position_offset,
46  const CQuaternion& c_orientation_offset);
47  using TVector = std::vector<SInstance>;
48  };
49 
50  public:
51 
57 
64  const std::string& str_id);
65 
66 
68 
69  virtual void Init(TConfigurationNode& t_tree);
70 
71  virtual void Enable();
72 
73  virtual void Disable();
74 
82 
89  return m_vecInstances;
90  }
91 
97  inline const SInstance::TVector& GetInstances() const {
98  return m_vecInstances;
99  }
100 
106  void SetLEDColor(UInt32 un_index, const CColor& c_color);
107 
113  void SetLEDColors(const CColor& c_color);
114 
122  void SetLEDColors(const std::vector<CColor>& vec_colors);
123 
129  void SetMedium(CDirectionalLEDMedium& c_medium);
130 
131  virtual std::string GetTypeDescription() const {
132  return "directional_leds";
133  }
134 
135  protected:
136 
137  virtual void UpdateComponents();
138 
139  protected:
140 
143  };
144 
145 }
146 
147 #endif
virtual void UpdateComponents()
Calls the Update() method on all the components.
A 3D vector class.
Definition: vector3.h:29
SInstance::TVector m_vecInstances
List of the LEDs managed by this entity.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
void SetLEDColor(UInt32 un_index, const CColor &c_color)
Sets the color of an LED.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
Basic class for an entity that contains other entities.
void SetLEDColors(const CColor &c_color)
Sets the color of all the LEDs to the same value.
An anchor related to the body of an entity.
Definition: physics_model.h:38
CDirectionalLEDEntity & GetLED(UInt32 un_index)
Returns an LED by numeric index.
The basic color type.
Definition: color.h:25
CDirectionalLEDEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
const SInstance::TVector & GetInstances() const
Returns the LEDs as a const reference.
A container of CDirectionalLEDEntity.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
SInstance::TVector & GetInstances()
Returns all the LEDs.
void SetMedium(CDirectionalLEDMedium &c_medium)
Sets the medium associated to this entity.
SInstance(CDirectionalLEDEntity &c_led, SAnchor &s_anchor, const CVector3 &c_position_offset, const CQuaternion &c_orientation_offset)
virtual std::string GetTypeDescription() const
Returns a string label for this class.