ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
#include <floor_entity.h>
Classes | |
class | CFloorColorSource |
Public Types | |
enum | EColorSource { UNSET = 0, FROM_IMAGE, FROM_LOOP_FUNCTIONS } |
Public Member Functions | |
ENABLE_VTABLE () | |
CFloorEntity () | |
Class constructor. | |
CFloorEntity (const std::string &str_id, const std::string &str_file_name) | |
Class constructor. | |
CFloorEntity (const std::string &str_id, UInt32 un_pixels_per_meter) | |
Class constructor. | |
virtual | ~CFloorEntity () |
Class destructor. | |
virtual void | Init (TConfigurationNode &t_tree) |
Initializes the entity from an XML tree. | |
virtual void | Reset () |
Restores the initial state of the floor. | |
CColor | GetColorAtPoint (Real f_x, Real f_y) |
Returns the color at the given point. | |
bool | HasChanged () const |
Returns true if the floor color has changed. | |
void | SetChanged () |
Marks the floor color as changed. | |
void | ClearChanged () |
Marks the floor color as not changed. | |
void | SaveAsImage (const std::string &str_path) |
Saves the current floor color to the given file. | |
virtual std::string | GetTypeDescription () const |
Returns a string label for this class. |
Definition at line 21 of file floor_entity.h.
Definition at line 44 of file floor_entity.h.
Class constructor.
It is meant to be used in conjuction with the Init() method.
Definition at line 154 of file floor_entity.cpp.
argos::CFloorEntity::CFloorEntity | ( | const std::string & | str_id, |
const std::string & | str_file_name | ||
) |
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.
Definition at line 163 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, using the loop functions as color source.
Definition at line 177 of file floor_entity.cpp.
argos::CFloorEntity::~CFloorEntity | ( | ) | [virtual] |
Class destructor.
Definition at line 187 of file floor_entity.cpp.
void argos::CFloorEntity::ClearChanged | ( | ) | [inline] |
Marks the floor color as not changed.
Definition at line 125 of file floor_entity.h.
Reimplemented from argos::CEntity.
CColor argos::CFloorEntity::GetColorAtPoint | ( | Real | f_x, |
Real | f_y | ||
) | [inline] |
Returns the color at the given point.
f_x | The x coordinate on the floor |
f_y | The y coordinate on the floor |
Definition at line 95 of file floor_entity.h.
virtual std::string argos::CFloorEntity::GetTypeDescription | ( | ) | const [inline, virtual] |
Returns a string label for this class.
Reimplemented from argos::CEntity.
Definition at line 139 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.
true
if the floor color has changed. Definition at line 109 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 196 of file floor_entity.cpp.
void argos::CFloorEntity::Reset | ( | ) | [virtual] |
Restores the initial state of the floor.
Reimplemented from argos::CEntity.
Definition at line 227 of file floor_entity.cpp.
void argos::CFloorEntity::SaveAsImage | ( | const std::string & | str_path | ) | [inline] |
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.
str_path | The path of the output file. |
Definition at line 135 of file floor_entity.h.
void argos::CFloorEntity::SetChanged | ( | ) | [inline] |
Marks the floor color as changed.
Definition at line 117 of file floor_entity.h.