argos::CFloorEntity Class Reference

#include <floor_entity.h>

Inheritance diagram for argos::CFloorEntity:
Collaboration diagram for argos::CFloorEntity:

Classes

class  CFloorColorSource
 

Public Types

enum  EColorSource { UNSET = 0, FROM_IMAGE, FROM_LOOP_FUNCTIONS }
 
- Public Types inherited from argos::CEntity
typedef std::vector< CEntity * > TVector
 A vector of entities. More...
 
typedef unordered_map< std::string, CEntity * > TMap
 A map of entities. More...
 
typedef std::multimap< std::string, CEntity * > TMultiMap
 A multi-map of entities. More...
 

Public Member Functions

 ENABLE_VTABLE ()
 
 CFloorEntity ()
 Class constructor. More...
 
 CFloorEntity (const std::string &str_id, UInt32 un_pixels_per_meter)
 Class constructor. More...
 
virtual ~CFloorEntity ()
 Class destructor. More...
 
virtual void Init (TConfigurationNode &t_tree)
 Initializes the entity from an XML tree. More...
 
virtual void Reset ()
 Restores the initial state of the floor. More...
 
CColor GetColorAtPoint (Real f_x, Real f_y)
 Returns the color at the given point. More...
 
bool HasChanged () const
 Returns true if the floor color has changed. More...
 
void SetChanged ()
 Marks the floor color as changed. More...
 
void ClearChanged ()
 Marks the floor color as not changed. More...
 
virtual std::string GetTypeDescription () const
 Saves the current floor color to the given file. More...
 
- Public Member Functions inherited from argos::CEntity
 ENABLE_VTABLE ()
 
 CEntity (CComposableEntity *pc_parent)
 Class constructor. More...
 
 CEntity (CComposableEntity *pc_parent, const std::string &str_id)
 Class constructor. More...
 
virtual ~CEntity ()
 Class destructor. More...
 
virtual void Destroy ()
 Destroys the entity, undoing whatever was done by Init() or by the standalone constructor. More...
 
const std::string & GetId () const
 Returns the id of this entity. More...
 
std::string GetContext () const
 Returns the context of this entity. More...
 
bool HasParent () const
 Returns true if this entity has a parent. More...
 
CEntityGetRootEntity ()
 Returns the root entity containing this entity. More...
 
const CEntityGetRootEntity () const
 Returns the root entity containing this entity. More...
 
CComposableEntityGetParent ()
 Returns this entity's parent. More...
 
const CComposableEntityGetParent () const
 Returns this entity's parent. More...
 
void SetParent (CComposableEntity &c_parent)
 Sets this entity's parent. More...
 
virtual void Update ()
 Updates the state of this entity. More...
 
ssize_t GetIndex () const
 Returns the entity index. More...
 
void SetIndex (ssize_t n_idx)
 Sets the entity index. More...
 
bool IsEnabled () const
 Returns true if the entity is enabled. More...
 
void Enable ()
 Enables the entity. More...
 
void Disable ()
 Disables the entity. More...
 
virtual void SetEnabled (bool b_enabled)
 Enables or disables an entity. More...
 
TConfigurationNodeGetConfigurationNode ()
 Returns a pointer to the configuration node that was used to create this entity. More...
 
- Public Member Functions inherited from argos::CBaseConfigurableResource
virtual ~CBaseConfigurableResource ()
 Class destructor. More...
 
- Public Member Functions inherited from argos::EnableVTableFor< CEntity >
size_t GetTagHelper (const DERIVED *) const
 

Detailed Description

Definition at line 21 of file floor_entity.h.

Member Enumeration Documentation

Enumerator
UNSET 
FROM_IMAGE 
FROM_LOOP_FUNCTIONS 

Definition at line 46 of file floor_entity.h.

Constructor & Destructor Documentation

argos::CFloorEntity::CFloorEntity ( )

Class constructor.

It is meant to be used in conjuction with the Init() method.

Definition at line 170 of file floor_entity.cpp.

argos::CFloorEntity::CFloorEntity ( const std::string &  str_id,
UInt32  un_pixels_per_meter 
)

Class constructor.

Creates a floor with the given id and the given image file as color source. The given path can include environment variables, which are expanded internally. Class constructor. Creates a floor with the given id, using the loop functions as color source.

Definition at line 195 of file floor_entity.cpp.

argos::CFloorEntity::~CFloorEntity ( )
virtual

Class destructor.

Definition at line 205 of file floor_entity.cpp.

Member Function Documentation

void argos::CFloorEntity::ClearChanged ( )
inline

Marks the floor color as not changed.

See also
HasChanged

Definition at line 129 of file floor_entity.h.

argos::CFloorEntity::ENABLE_VTABLE ( )
CColor argos::CFloorEntity::GetColorAtPoint ( Real  f_x,
Real  f_y 
)
inline

Returns the color at the given point.

Parameters
f_xThe x coordinate on the floor
f_yThe y coordinate on the floor
Returns
the color at the given point

Definition at line 99 of file floor_entity.h.

virtual std::string argos::CFloorEntity::GetTypeDescription ( ) const
inlinevirtual

Saves the current floor color to the given file.

Used by the OpenGL visualization to create a texture. The type of the file is inferred from the extension of the passed path.

Parameters
str_pathThe path of the output file.

Reimplemented from argos::CEntity.

Definition at line 143 of file floor_entity.h.

bool argos::CFloorEntity::HasChanged ( ) const
inline

Returns true if the floor color has changed.

It is mainly used by the OpenGL visualization to know when to create a new texture.

Returns
true if the floor color has changed.

Definition at line 113 of file floor_entity.h.

void argos::CFloorEntity::Init ( TConfigurationNode t_tree)
virtual

Initializes the entity from an XML tree.

Reimplemented from argos::CEntity.

Definition at line 214 of file floor_entity.cpp.

void argos::CFloorEntity::Reset ( )
virtual

Restores the initial state of the floor.

Reimplemented from argos::CEntity.

Definition at line 251 of file floor_entity.cpp.

void argos::CFloorEntity::SetChanged ( )
inline

Marks the floor color as changed.

See also
HasChanged

Definition at line 121 of file floor_entity.h.