magnet_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef MAGNET_EQUIPPED_ENTITY_H
8 #define MAGNET_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CMagnetEquippedEntity;
12  class CMagnetEntity;
13 }
14 
15 #include <argos3/core/simulator/entity/composable_entity.h>
16 #include <argos3/plugins/simulator/entities/magnet_entity.h>
17 #include <vector>
18 
19 namespace argos {
20 
31 
32  public:
33 
34  ENABLE_VTABLE();
35 
36  public:
37 
38  struct SInstance {
42  SInstance(CMagnetEntity& c_magnet,
43  SAnchor& s_anchor,
44  const CVector3& c_position_offset);
45  using TVector = std::vector<SInstance>;
46  };
47 
48  public:
49 
55 
62  const std::string& str_id);
63 
65 
66  virtual void Init(TConfigurationNode& t_tree);
67 
68  virtual void Enable();
69 
70  virtual void Disable();
71 
78  CMagnetEntity& GetMagnet(UInt32 un_index);
79 
81  return m_vecInstances;
82  }
83 
84  virtual std::string GetTypeDescription() const {
85  return "magnets";
86  }
87 
88  protected:
89 
90  virtual void UpdateComponents() {}
91 
92  protected:
93 
96  };
97 
98 }
99 
100 #endif
A 3D vector class.
Definition: vector3.h:29
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
virtual void UpdateComponents()
Calls the Update() method on all the components.
SInstance(CMagnetEntity &c_magnet, SAnchor &s_anchor, const CVector3 &c_position_offset)
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
Basic class for an entity that contains other entities.
CMagnetEntity & GetMagnet(UInt32 un_index)
Returns an magnet by numeric index.
An anchor related to the body of an entity.
Definition: physics_model.h:38
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
SInstance::TVector m_vecInstances
A list of the magnets managed by this entity.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
A container of CMagnetEntity.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
CMagnetEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
SInstance::TVector & GetInstances()