tag_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef TAG_EQUIPPED_ENTITY_H
8 #define TAG_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CTagEquippedEntity;
12  class CTagEntity;
13 }
14 
15 #include <argos3/core/simulator/entity/composable_entity.h>
16 #include <argos3/plugins/simulator/entities/tag_entity.h>
17 #include <vector>
18 
19 namespace argos {
20 
31 
32  public:
33 
35 
36  public:
37 
38  struct SInstance {
43  SInstance(CTagEntity& c_tag,
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  virtual ~CTagEquippedEntity() {}
67 
68  virtual void Init(TConfigurationNode& t_tree);
69 
70  virtual void Enable();
71 
72  virtual void Disable();
73 
86  void AddTag(const std::string& str_id,
87  const CVector3& c_position,
88  const CQuaternion& c_orientation,
89  SAnchor& s_anchor,
90  const CRadians& c_observable_angle,
91  Real f_side_length,
92  const std::string& str_payload);
93 
100  CTagEntity& GetTag(UInt32 un_index);
101 
108  return m_vecInstances;
109  }
110 
116  inline const SInstance::TVector& GetInstances() const {
117  return m_vecInstances;
118  }
119 
125  void SetTagPayload(UInt32 un_index,
126  const std::string& str_payload);
127 
133  void SetTagPayloads(const std::string& str_payload);
134 
142  void SetTagPayloads(const std::vector<std::string>& vec_payloads);
143 
149  void SetMedium(CTagMedium& c_medium);
150 
151  virtual std::string GetTypeDescription() const {
152  return "tags";
153  }
154 
155  protected:
156 
157  virtual void UpdateComponents();
158 
159  protected:
160 
163  };
164 
165 }
166 
167 #endif
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
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.
An anchor related to the body of an entity.
Definition: physics_model.h:38
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
A 3D vector class.
Definition: vector3.h:31
A container of CTagEntity.
virtual void UpdateComponents()
Calls the Update() method on all the components.
void SetMedium(CTagMedium &c_medium)
Sets the medium associated to this entity.
CTagEntity & GetTag(UInt32 un_index)
Returns a tag by numeric index.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void SetTagPayload(UInt32 un_index, const std::string &str_payload)
Sets the payload of a tag.
SInstance::TVector m_vecInstances
List of the tags managed by this entity.
SInstance::TVector & GetInstances()
Returns the tags.
void AddTag(const std::string &str_id, const CVector3 &c_position, const CQuaternion &c_orientation, SAnchor &s_anchor, const CRadians &c_observable_angle, Real f_side_length, const std::string &str_payload)
Programmatically creates a new tag.
const SInstance::TVector & GetInstances() const
Returns the tags as a const reference.
CTagEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
void SetTagPayloads(const std::string &str_payload)
Sets the payload of all the tags to the given payload.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
SInstance(CTagEntity &c_tag, SAnchor &s_anchor, const CVector3 &c_position_offset, const CQuaternion &c_orientation_offset)