ARGoS  3
A parallel, multi-engine simulator for swarm robotics
argos::CLEDEntity Class Reference

#include <led_entity.h>

+ Inheritance diagram for argos::CLEDEntity:

List of all members.

Public Types

typedef std::vector< CLEDEntity * > TList
typedef CSet< CLEDEntity * > TSet

Public Member Functions

 ENABLE_VTABLE ()
 CLEDEntity (CComposableEntity *pc_parent)
 CLEDEntity (CComposableEntity *pc_parent, const std::string &str_id, const CVector3 &c_position, const CColor &c_color)
virtual ~CLEDEntity ()
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 called.
virtual void SetEnabled (bool b_enabled)
 Enables or disables an entity.
const CColorGetColor () const
 Returns the current color of the LED.
const CColorGetInitColor () const
 Returns the color with which the LED was initialized.
void SetColor (const CColor &c_color)
 Sets the current color of the LED.
void SetInitColor (const CColor &c_color)
 Sets the initialization color for this LED.
virtual std::string GetTypeDescription () const
 Returns a string label for this class.
void AddToMedium (CLEDMedium &c_medium)
 Adds the LEDs to the wanted LED medium.
void RemoveFromMedium (CLEDMedium &c_medium)
 Removes the LEDs from the wanted LED medium.

Protected Attributes

CColor m_cColor
CColor m_cInitColor

Detailed Description

Definition at line 24 of file led_entity.h.


Member Typedef Documentation

typedef std::vector<CLEDEntity*> argos::CLEDEntity::TList

Definition at line 30 of file led_entity.h.

Definition at line 31 of file led_entity.h.


Constructor & Destructor Documentation

Definition at line 16 of file led_entity.cpp.

argos::CLEDEntity::CLEDEntity ( CComposableEntity pc_parent,
const std::string &  str_id,
const CVector3 c_position,
const CColor c_color 
)

Definition at line 22 of file led_entity.cpp.

virtual argos::CLEDEntity::~CLEDEntity ( ) [inline, virtual]

Definition at line 42 of file led_entity.h.


Member Function Documentation

Adds the LEDs to the wanted LED medium.

Parameters:
c_mediumThe LED medium.
See also:
CLEDMedium

Definition at line 66 of file led_entity.cpp.

const CColor& argos::CLEDEntity::GetColor ( ) const [inline]

Returns the current color of the LED.

Returns:
the current color of the LED.
See also:
GetInitColor()
SetColor()

Definition at line 56 of file led_entity.h.

const CColor& argos::CLEDEntity::GetInitColor ( ) const [inline]

Returns the color with which the LED was initialized.

When the simulation is reset, the LED color is set to this value.

Returns:
the color with which the LED was initialized.
See also:
GetColor()
SetInitColor()

Definition at line 67 of file led_entity.h.

virtual std::string argos::CLEDEntity::GetTypeDescription ( ) const [inline, virtual]

Returns a string label for this class.

Returns:
A string label for this class.

Reimplemented from argos::CPositionalEntity.

Reimplemented in argos::CLightEntity.

Definition at line 91 of file led_entity.h.

void argos::CLEDEntity::Init ( TConfigurationNode t_tree) [virtual]

Initializes the state of the entity from the XML configuration tree.

If the id of the entity has not been set yet, this method sets an id for the entity. If the entity has no parent, this method parses the passed XML tree and looks for the id attribute, setting its value as id. If, instead, this entity has a parent, the id is set as GetParent().GetId() + "." + GetTypeDescription().

Exceptions:
CARGoSExceptionif a parse error occurred

Reimplemented from argos::CPositionalEntity.

Reimplemented in argos::CLightEntity.

Definition at line 33 of file led_entity.cpp.

Removes the LEDs from the wanted LED medium.

Parameters:
c_mediumThe LED medium.
See also:
CLEDMedium

Definition at line 73 of file led_entity.cpp.

void argos::CLEDEntity::Reset ( ) [virtual]

Resets the state of the entity to whatever it was after Init() or the standalone constructor was called.

The default implementation of this method does nothing.

Reimplemented from argos::CPositionalEntity.

Definition at line 48 of file led_entity.cpp.

void argos::CLEDEntity::SetColor ( const CColor c_color) [inline]

Sets the current color of the LED.

Parameters:
c_colorthe wanted color.
See also:
GetColor()

Definition at line 76 of file led_entity.h.

void argos::CLEDEntity::SetEnabled ( bool  b_enabled) [virtual]

Enables or disables an entity.

Parameters:
b_enabledtrue if the entity is enabled, false otherwise
See also:
m_bEnabled
m_bCanBeEnabledIfDisabled

Reimplemented from argos::CEntity.

Definition at line 56 of file led_entity.cpp.

void argos::CLEDEntity::SetInitColor ( const CColor c_color) [inline]

Sets the initialization color for this LED.

When the simulation is reset, the LED color is set to this value.

Parameters:
c_colorthe initialization color for this LED.
See also:
GetInitColor()
SetColor()

Definition at line 87 of file led_entity.h.


Member Data Documentation

Definition at line 111 of file led_entity.h.

Definition at line 112 of file led_entity.h.


The documentation for this class was generated from the following files: