g2o
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
g2o::DrawAction Class Reference

draw actions More...

#include <hyper_graph_action.h>

Inheritance diagram for g2o::DrawAction:
Inheritance graph
[legend]
Collaboration diagram for g2o::DrawAction:
Collaboration graph
[legend]

Classes

class  Parameters
 

Public Member Functions

 DrawAction (const std::string &typeName_)
 
- Public Member Functions inherited from g2o::HyperGraphElementAction
 HyperGraphElementAction (const std::string &typeName_="")
 
virtual HyperGraphElementActionoperator() (HyperGraph::HyperGraphElement *element, Parameters *parameters)
 redefine this to do the action stuff. If successful, the action returns a pointer to itself More...
 
virtual HyperGraphElementActionoperator() (const HyperGraph::HyperGraphElement *element, Parameters *parameters)
 redefine this to do the action stuff. If successful, the action returns a pointer to itself More...
 
virtual ~HyperGraphElementAction ()
 destroyed actions release the memory More...
 
const std::string & typeName () const
 returns the typeid name of the action More...
 
const std::string & name () const
 returns the name of an action, e.g "draw" More...
 
void setTypeName (const std::string &typeName_)
 sets the type on which an action has to operate More...
 

Protected Member Functions

virtual bool refreshPropertyPtrs (HyperGraphElementAction::Parameters *params_)
 
void initializeDrawActionsCache ()
 
void drawCache (CacheContainer *caches, HyperGraphElementAction::Parameters *params_)
 
void drawUserData (HyperGraph::Data *data, HyperGraphElementAction::Parameters *params_)
 

Protected Attributes

Parameters_previousParams
 
BoolProperty_show
 
BoolProperty_showId
 
HyperGraphElementAction_cacheDrawActions
 
- Protected Attributes inherited from g2o::HyperGraphElementAction
std::string _typeName
 
std::string _name
 

Additional Inherited Members

- Public Types inherited from g2o::HyperGraphElementAction
typedef std::map< std::string, HyperGraphElementAction * > ActionMap
 

Detailed Description

draw actions

Definition at line 180 of file hyper_graph_action.h.

Constructor & Destructor Documentation

g2o::DrawAction::DrawAction ( const std::string &  typeName_)

Definition at line 230 of file hyper_graph_action.cpp.

References _cacheDrawActions, g2o::HyperGraphElementAction::_name, _previousParams, and refreshPropertyPtrs().

231  : HyperGraphElementAction(typeName_)
232  {
233  _name="draw";
234  _previousParams = (Parameters*)0x42;
236  _cacheDrawActions = 0;
237  }
Parameters * _previousParams
HyperGraphElementAction * _cacheDrawActions
HyperGraphElementAction(const std::string &typeName_="")
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)

Member Function Documentation

void g2o::DrawAction::drawCache ( CacheContainer caches,
HyperGraphElementAction::Parameters params_ 
)
protected

Definition at line 261 of file hyper_graph_action.cpp.

261  {
262  if (caches){
263  for (CacheContainer::iterator it=caches->begin(); it!=caches->end(); it++){
264  Cache* c = it->second;
265  (*_cacheDrawActions)(c, params_);
266  }
267  }
268  }
void g2o::DrawAction::drawUserData ( HyperGraph::Data data,
HyperGraphElementAction::Parameters params_ 
)
protected

Definition at line 270 of file hyper_graph_action.cpp.

References _cacheDrawActions.

270  {
271  while (data && _cacheDrawActions ){
272  (*_cacheDrawActions)(data, params_);
273  data=data->next();
274  }
275  }
HyperGraphElementAction * _cacheDrawActions
void g2o::DrawAction::initializeDrawActionsCache ( )
protected

Definition at line 255 of file hyper_graph_action.cpp.

References _cacheDrawActions, g2o::HyperGraphActionLibrary::actionByName(), and g2o::HyperGraphActionLibrary::instance().

255  {
256  if (! _cacheDrawActions){
258  }
259  }
HyperGraphElementAction * _cacheDrawActions
static HyperGraphActionLibrary * instance()
return the single instance of the HyperGraphActionLibrary
HyperGraphElementAction * actionByName(const std::string &name)
bool g2o::DrawAction::refreshPropertyPtrs ( HyperGraphElementAction::Parameters params_)
protectedvirtual

Definition at line 239 of file hyper_graph_action.cpp.

References _previousParams, _show, _showId, g2o::HyperGraphElementAction::_typeName, and g2o::PropertyMap::makeProperty().

Referenced by DrawAction(), g2o::VertexSE2WriteGnuplotAction::operator()(), g2o::VertexPointXYWriteGnuplotAction::operator()(), g2o::VertexSegment2DWriteGnuplotAction::operator()(), g2o::EdgeSE2WriteGnuplotAction::operator()(), g2o::deprecated::VertexSE3WriteGnuplotAction::operator()(), g2o::VertexSE3WriteGnuplotAction::operator()(), g2o::RobotLaser::setOdomPose(), g2o::CacheSE3Offset::setOffsetParam(), g2o::deprecated::CacheSE3Offset::setOffsetParam(), g2o::VertexPointXYZ::write(), g2o::VertexPlane::write(), g2o::deprecated::VertexPointXYZ::write(), g2o::VertexEllipse::write(), g2o::VertexTag::write(), g2o::EdgeSE3PlaneSensorCalib::write(), and g2o::VertexLine2D::write().

239  {
240  if (_previousParams == params_)
241  return false;
242  DrawAction::Parameters* p=dynamic_cast<DrawAction::Parameters*>(params_);
243  if (! p){
244  _previousParams = 0;
245  _show = 0;
246  _showId = 0;
247  } else {
248  _previousParams = p;
249  _show = p->makeProperty<BoolProperty>(_typeName+"::SHOW", true);
250  _showId = p->makeProperty<BoolProperty>(_typeName+"::SHOW_ID", false);
251  }
252  return true;
253  }
Parameters * _previousParams
BoolProperty * _showId
Property< bool > BoolProperty
Definition: property.h:153
BoolProperty * _show

Member Data Documentation

HyperGraphElementAction* g2o::DrawAction::_cacheDrawActions
protected

Definition at line 195 of file hyper_graph_action.h.

Referenced by DrawAction(), drawUserData(), and initializeDrawActionsCache().

Parameters* g2o::DrawAction::_previousParams
protected

Definition at line 192 of file hyper_graph_action.h.

Referenced by DrawAction(), and refreshPropertyPtrs().

BoolProperty* g2o::DrawAction::_show
protected

Definition at line 193 of file hyper_graph_action.h.

Referenced by refreshPropertyPtrs().

BoolProperty* g2o::DrawAction::_showId
protected

Definition at line 194 of file hyper_graph_action.h.

Referenced by refreshPropertyPtrs().


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