SOFA API  73d8bb95
Open source framework for multi-physics simuation
sofa::simulation::tree::ExportDotVisitor Class Reference

#include <ExportDotVisitor.h>

Inheritance diagram for sofa::simulation::tree::ExportDotVisitor:

Public Attributes

std::ostream * out
 
bool showNode
 
bool showObject
 
bool showBehaviorModel
 
bool showCollisionModel
 
bool showVisualModel
 
bool showMapping
 
bool showContext
 
bool showCollisionPipeline
 
bool showSolver
 
bool showMechanicalState
 
bool showForceField
 
bool showInteractionForceField
 
bool showConstraint
 
bool showMass
 
bool showTopology
 
bool showMechanicalMapping
 
bool labelNodeName
 
bool labelNodeClass
 
bool labelObjectName
 
bool labelObjectClass
 
- Public Attributes inherited from sofa::simulation::Visitor
TagSet subsetsToManage
 list of the subsets More...
 
bool canAccessSleepingNode
 Can the visitor access sleeping nodes? More...
 

Protected Attributes

std::map< core::objectmodel::Base *, std::string > names
 None names in output. More...
 
std::map< std::string, intnextIndex
 Next indice available for duplicated names. More...
 
- Protected Attributes inherited from sofa::simulation::Visitor
const core::ExecParamsparams
 

Public Member Functions

 ExportDotVisitor (const sofa::core::ExecParams *params, std::ostream *out)
 
 ~ExportDotVisitor () override
 
void processObject (GNode *node, core::objectmodel::BaseObject *obj)
 
Result processNodeTopDown (GNode *node) override
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More...
 
void processNodeBottomUp (GNode *node) override
 Callback method called after child node have been processed and before going back to the parent node. More...
 
const char * getClassName () const override
 
- Public Member Functions inherited from sofa::simulation::tree::GNodeVisitor
 GNodeVisitor (const sofa::core::ExecParams *params)
 
 ~GNodeVisitor () override
 
virtual Result processNodeTopDown (GNode *node, LocalStorage *)
 
virtual void processNodeBottomUp (GNode *node, LocalStorage *)
 
Result processNodeTopDown (simulation::Node *node) override
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More...
 
void processNodeBottomUp (simulation::Node *node) override
 Callback method called after child node have been processed and before going back to the parent node. More...
 
const char * getClassName () const override
 
template<class Visit , class Container , class Object >
void for_each (Visit *visitor, GNode *ctx, const Container &list, void(Visit::*fn)(GNode *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
template<class Visit , class Container , class Object >
Visitor::Result for_each_r (Visit *visitor, GNode *ctx, const Container &list, Visitor::Result(Visit::*fn)(GNode *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const core::ExecParams *params)
 
virtual ~Visitor ()
 
const core::ExecParamsexecParams () const
 
virtual bool childOrderReversed (simulation::Node *)
 Return true to reverse the order of traversal of child nodes. More...
 
virtual bool treeTraversal (TreeTraversalRepetition &repeat)
 
virtual const char * getCategoryName () const
 
virtual std::string getInfos () const
 
void debug_write_state_before (core::objectmodel::BaseObject *)
 
void debug_write_state_after (core::objectmodel::BaseObject *)
 
template<class Visit , class VContext , class Container , class Object >
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
template<class Visit , class VContext , class Container , class Object >
Visitor::Result for_each_r (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
bool testTags (core::objectmodel::BaseObject *obj)
 
virtual void execute (core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
ctime_t begin (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
void end (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual bool isThreadSafe () const
 Specify whether this visitor can be parallelized. More...
 
virtual Result processNodeTopDown (simulation::Node *node, LocalStorage *)
 
virtual void processNodeBottomUp (simulation::Node *node, LocalStorage *)
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 

Protected Member Functions

bool display (GNode *node, const char **color=nullptr)
 Test if a node should be displayed. More...
 
bool display (core::objectmodel::BaseObject *obj, const char **color=nullptr)
 Test if an object should be displayed. More...
 
std::string getParentName (core::objectmodel::BaseObject *obj)
 
std::string getName (core::objectmodel::Base *o, std::string prefix)
 Compute the name of a given node or object. More...
 
std::string getName (core::objectmodel::BaseNode *node)
 Compute the name of a given node. More...
 
std::string getName (core::objectmodel::BaseObject *obj)
 Compute the name of a given object. More...
 

Attribute details

bool sofa::simulation::tree::ExportDotVisitor::labelNodeClass
bool sofa::simulation::tree::ExportDotVisitor::labelNodeName
bool sofa::simulation::tree::ExportDotVisitor::labelObjectClass
bool sofa::simulation::tree::ExportDotVisitor::labelObjectName
std::map<core::objectmodel::Base*, std::string> sofa::simulation::tree::ExportDotVisitor::names
protected

None names in output.

std::map<std::string, int> sofa::simulation::tree::ExportDotVisitor::nextIndex
protected

Next indice available for duplicated names.

std::ostream* sofa::simulation::tree::ExportDotVisitor::out
bool sofa::simulation::tree::ExportDotVisitor::showBehaviorModel
bool sofa::simulation::tree::ExportDotVisitor::showCollisionModel
bool sofa::simulation::tree::ExportDotVisitor::showCollisionPipeline
bool sofa::simulation::tree::ExportDotVisitor::showConstraint
bool sofa::simulation::tree::ExportDotVisitor::showContext
bool sofa::simulation::tree::ExportDotVisitor::showForceField
bool sofa::simulation::tree::ExportDotVisitor::showInteractionForceField
bool sofa::simulation::tree::ExportDotVisitor::showMapping
bool sofa::simulation::tree::ExportDotVisitor::showMass
bool sofa::simulation::tree::ExportDotVisitor::showMechanicalMapping
bool sofa::simulation::tree::ExportDotVisitor::showMechanicalState
bool sofa::simulation::tree::ExportDotVisitor::showNode
bool sofa::simulation::tree::ExportDotVisitor::showObject
bool sofa::simulation::tree::ExportDotVisitor::showSolver
bool sofa::simulation::tree::ExportDotVisitor::showTopology
bool sofa::simulation::tree::ExportDotVisitor::showVisualModel

Constructor details

sofa::simulation::tree::ExportDotVisitor::ExportDotVisitor ( const sofa::core::ExecParams params,
std::ostream *  out 
)
sofa::simulation::tree::ExportDotVisitor::~ExportDotVisitor ( )
override

Function details

bool sofa::simulation::tree::ExportDotVisitor::display ( GNode node,
const char **  color = nullptr 
)
protected

Test if a node should be displayed.

bool sofa::simulation::tree::ExportDotVisitor::display ( core::objectmodel::BaseObject obj,
const char **  color = nullptr 
)
protected

Test if an object should be displayed.

const char* sofa::simulation::tree::ExportDotVisitor::getClassName ( ) const
inlineoverridevirtual

Return a class name for this visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::Visitor.

std::string sofa::simulation::tree::ExportDotVisitor::getName ( core::objectmodel::Base o,
std::string  prefix 
)
protected

Compute the name of a given node or object.

std::string sofa::simulation::tree::ExportDotVisitor::getName ( core::objectmodel::BaseNode node)
protected

Compute the name of a given node.

std::string sofa::simulation::tree::ExportDotVisitor::getName ( core::objectmodel::BaseObject obj)
protected

Compute the name of a given object.

std::string sofa::simulation::tree::ExportDotVisitor::getParentName ( core::objectmodel::BaseObject obj)
protected

Find the node or object a given object should be attached to. This is the parent node if it is displayed, otherwise it is the attached MechanicalState or Solver. Returns an empty string if not found.

void sofa::simulation::tree::ExportDotVisitor::processNodeBottomUp ( GNode )
overridevirtual

Callback method called after child node have been processed and before going back to the parent node.

Reimplemented from sofa::simulation::tree::GNodeVisitor.

simulation::Visitor::Result sofa::simulation::tree::ExportDotVisitor::processNodeTopDown ( GNode )
overridevirtual

Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE.

Reimplemented from sofa::simulation::tree::GNodeVisitor.

void sofa::simulation::tree::ExportDotVisitor::processObject ( GNode node,
core::objectmodel::BaseObject obj 
)