g2o
Loading...
Searching...
No Matches
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)
 
virtual HyperGraphElementActionoperator() (const HyperGraph::HyperGraphElement *element, Parameters *parameters)
 
virtual ~HyperGraphElementAction ()
 
const std::string & typeName () const
 returns the typeid name of the action
 
const std::string & name () const
 returns the name of an action, e.g "draw"
 
void setTypeName (const std::string &typeName_)
 sets the type on which an action has to operate
 

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
 
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::shared_ptr< HyperGraphElementActionHyperGraphElementActionPtr
 
typedef std::map< std::string, HyperGraphElementActionPtrActionMap
 

Detailed Description

draw actions

Definition at line 201 of file hyper_graph_action.h.

Constructor & Destructor Documentation

◆ DrawAction()

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

Definition at line 213 of file hyper_graph_action.cpp.

214 : HyperGraphElementAction(typeName_) {
215 _name = "draw";
216 _previousParams = (Parameters*)0x42;
219}
HyperGraphElementAction * _cacheDrawActions
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
Parameters * _previousParams
HyperGraphElementAction(const std::string &typeName_="")

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

Member Function Documentation

◆ drawCache()

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

Definition at line 242 of file hyper_graph_action.cpp.

243 {
244 if (caches) {
245 for (CacheContainer::iterator it = caches->begin(); it != caches->end();
246 ++it) {
247 Cache* c = it->second;
248 (*_cacheDrawActions)(c, params_);
249 }
250 }
251}

◆ drawUserData()

void g2o::DrawAction::drawUserData ( HyperGraph::Data data,
HyperGraphElementAction::Parameters params_ 
)
protected

Definition at line 253 of file hyper_graph_action.cpp.

254 {
255 while (data && _cacheDrawActions) {
256 (*_cacheDrawActions)(data, params_);
257 data = data->next();
258 }
259}

References _cacheDrawActions.

◆ initializeDrawActionsCache()

void g2o::DrawAction::initializeDrawActionsCache ( )
protected

Definition at line 235 of file hyper_graph_action.cpp.

235 {
236 if (!_cacheDrawActions) {
239 }
240}
static HyperGraphActionLibrary * instance()
return the single instance of the HyperGraphActionLibrary
HyperGraphElementAction * actionByName(const std::string &name)

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

◆ refreshPropertyPtrs()

bool g2o::DrawAction::refreshPropertyPtrs ( HyperGraphElementAction::Parameters params_)
protectedvirtual

Definition at line 221 of file hyper_graph_action.cpp.

222 {
223 if (_previousParams == params_) return false;
224 DrawAction::Parameters* p = dynamic_cast<DrawAction::Parameters*>(params_);
225 if (!p) {
226 _previousParams = 0;
227 _show = 0;
228 } else {
229 _previousParams = p;
230 _show = p->makeProperty<BoolProperty>(_typeName + "::SHOW", true);
231 }
232 return true;
233}
BoolProperty * _show
Property< bool > BoolProperty
Definition property.h:149

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

Referenced by DrawAction().

Member Data Documentation

◆ _cacheDrawActions

HyperGraphElementAction* g2o::DrawAction::_cacheDrawActions
protected

Definition at line 220 of file hyper_graph_action.h.

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

◆ _previousParams

Parameters* g2o::DrawAction::_previousParams
protected

Definition at line 218 of file hyper_graph_action.h.

Referenced by DrawAction(), and refreshPropertyPtrs().

◆ _show

BoolProperty* g2o::DrawAction::_show
protected

Definition at line 219 of file hyper_graph_action.h.

Referenced by refreshPropertyPtrs().


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