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

#include <floor_entity.h>

+ Inheritance diagram for argos::CFloorEntity:

List of all members.

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.

Detailed Description

Definition at line 21 of file floor_entity.h.


Member Enumeration Documentation

Enumerator:
UNSET 
FROM_IMAGE 
FROM_LOOP_FUNCTIONS 

Definition at line 44 of file floor_entity.h.


Constructor & Destructor Documentation

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.

Class destructor.

Definition at line 187 of file floor_entity.cpp.


Member Function Documentation

Marks the floor color as not changed.

See also:
HasChanged

Definition at line 125 of file floor_entity.h.

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 95 of file floor_entity.h.

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

Returns a string label for this class.

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.

Returns:
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.

Parameters:
str_pathThe path of the output file.

Definition at line 135 of file floor_entity.h.

Marks the floor color as changed.

See also:
HasChanged

Definition at line 117 of file floor_entity.h.


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