27#ifndef G2O_HYPER_GRAPH_ACTION_H
28#define G2O_HYPER_GRAPH_ACTION_H
80 typedef std::map<std::string, HyperGraphElementActionPtr>
ActionMap;
104 void setTypeName(
const std::string& typeName_);
137 bool unregisterAction(
184 const std::string& typeName =
"");
227#ifdef G2O_DEBUG_ACTIONLIB
228 std::cout << __FUNCTION__ <<
": Registering action of type "
229 <<
typeid(T).name() << std::endl;
241#define G2O_REGISTER_ACTION(classname) \
242 extern "C" void g2o_action_##classname(void) {} \
243 static g2o::RegisterActionProxy<classname> g_action_proxy_##classname;
void initializeDrawActionsCache()
HyperGraphElementAction * _cacheDrawActions
void drawCache(CacheContainer *caches, HyperGraphElementAction::Parameters *params_)
DrawAction(const std::string &typeName_)
void drawUserData(HyperGraph::Data *data, HyperGraphElementAction::Parameters *params_)
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
Parameters * _previousParams
bool registerAction(const HyperGraphElementAction::HyperGraphElementActionPtr &action)
static HyperGraphActionLibrary * instance()
return the single instance of the HyperGraphActionLibrary
HyperGraphActionLibrary(HyperGraphActionLibrary const &)=delete
HyperGraphActionLibrary & operator=(HyperGraphActionLibrary const &)=delete
static void destroy()
free the instance
HyperGraphActionLibrary()=default
HyperGraphElementAction * actionByName(const std::string &name)
static std::unique_ptr< HyperGraphActionLibrary > actionLibInstance
HyperGraphElementAction::ActionMap & actionMap()
bool unregisterAction(const HyperGraphElementAction::HyperGraphElementActionPtr &action)
HyperGraphElementAction::ActionMap _actionMap
ParametersIteration(int iter)
Abstract action that operates on an entire graph.
virtual HyperGraphAction * operator()(const HyperGraph *graph, Parameters *parameters=0)
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, Parameters *parameters)
HyperGraphElementActionCollection(const std::string &name_)
constructor. name_ is the name of the action e.g.draw).
Abstract action that operates on a graph entity.
HyperGraphElementAction(const std::string &typeName_="")
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, Parameters *parameters)
std::map< std::string, HyperGraphElementActionPtr > ActionMap
const std::string & name() const
returns the name of an action, e.g "draw"
const std::string & typeName() const
returns the typeid name of the action
std::shared_ptr< HyperGraphElementAction > HyperGraphElementActionPtr
data packet for a vertex. Extend this class to store in the vertices the potential additional informa...
a collection of properties mapping from name to the property itself
HyperGraphElementAction::HyperGraphElementActionPtr _action
WriteGnuplotAction(const std::string &typeName_)
Property< bool > BoolProperty
void applyAction(HyperGraph *graph, HyperGraphElementAction *action, HyperGraphElementAction::Parameters *params, const std::string &typeName)