sofa::simulation::tree::ExportDotVisitor Class Reference

#include <ExportDotVisitor.h>

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

Inheritance graph
[legend]
Collaboration diagram for sofa::simulation::tree::ExportDotVisitor:

Collaboration graph
[legend]

Public Member Functions

 ExportDotVisitor (std::ostream *out)
 ~ExportDotVisitor ()
void processObject (GNode *node, core::objectmodel::BaseObject *obj)
virtual Result processNodeTopDown (GNode *node)
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE.
virtual void processNodeBottomUp (GNode *node)
 Callback method called after child node have been processed and before going back to the parent node.

Data Fields

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

Protected Member Functions

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

Protected Attributes

std::map
< core::objectmodel::Base
*, std::string > 
names
 None names in output.
std::map< std::string, int > nextIndex
 Next indice available for duplicated names.

Detailed Description

Definition at line 42 of file ExportDotVisitor.h.


Constructor & Destructor Documentation

sofa::simulation::tree::ExportDotVisitor::ExportDotVisitor ( std::ostream *  out  ) 

Definition at line 40 of file ExportDotVisitor.cpp.

sofa::simulation::tree::ExportDotVisitor::~ExportDotVisitor (  ) 

Definition at line 66 of file ExportDotVisitor.cpp.

References out.


Member Function Documentation

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

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

Test if a node should be displayed.

Definition at line 72 of file ExportDotVisitor.cpp.

References sofa::simulation::Colors::COLOR, sofa::simulation::Colors::NODE, and showNode.

Referenced by getParentName(), processNodeTopDown(), and processObject().

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

Compute the name of a given object.

Definition at line 199 of file ExportDotVisitor.cpp.

References getName().

std::string sofa::simulation::tree::ExportDotVisitor::getName ( GNode *  node  )  [protected]

Compute the name of a given node.

Definition at line 193 of file ExportDotVisitor.cpp.

References getName().

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

Compute the name of a given node or object.

Definition at line 166 of file ExportDotVisitor.cpp.

References sofa::core::objectmodel::Base::getName(), names, and nextIndex.

Referenced by getName(), getParentName(), processNodeTopDown(), and processObject().

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.

This is the parent node if it is displayed, otherwise it is the attached MechanicalState or Solver. Returns an empty string if not found.

Todo:
consider all solvers instead of the first one (FF)

Definition at line 137 of file ExportDotVisitor.cpp.

References sofa::simulation::Node::collisionPipeline, display(), sofa::core::objectmodel::BaseObject::getContext(), getName(), sofa::simulation::Node::masterSolver, sofa::simulation::Node::mechanicalMapping, sofa::simulation::Node::mechanicalState, sofa::simulation::tree::GNode::parent, and sofa::simulation::Node::solver.

Referenced by processObject().

void sofa::simulation::tree::ExportDotVisitor::processNodeBottomUp ( GNode *   )  [virtual]

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

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

Definition at line 308 of file ExportDotVisitor.cpp.

simulation::Visitor::Result sofa::simulation::tree::ExportDotVisitor::processNodeTopDown ( GNode *   )  [virtual]

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

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

Definition at line 270 of file ExportDotVisitor.cpp.

References display(), sofa::core::objectmodel::Base::getName(), getName(), sofa::helper::gettypename(), labelNodeClass, labelNodeName, sofa::simulation::Node::object, out, sofa::simulation::tree::GNode::parent, processObject(), and sofa::simulation::Visitor::RESULT_CONTINUE.

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


Field Documentation

Definition at line 65 of file ExportDotVisitor.h.

Referenced by sofa::gui::qt::GenGraphForm::doExport(), and processNodeTopDown().

Definition at line 64 of file ExportDotVisitor.h.

Referenced by sofa::gui::qt::GenGraphForm::doExport(), and processNodeTopDown().

Definition at line 67 of file ExportDotVisitor.h.

Referenced by sofa::gui::qt::GenGraphForm::doExport(), and processObject().

Definition at line 66 of file ExportDotVisitor.h.

Referenced by sofa::gui::qt::GenGraphForm::doExport(), and processObject().

None names in output.

Definition at line 81 of file ExportDotVisitor.h.

Referenced by getName().

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

Next indice available for duplicated names.

Definition at line 83 of file ExportDotVisitor.h.

Referenced by getName().

Definition at line 45 of file ExportDotVisitor.h.

Referenced by processNodeTopDown(), processObject(), and ~ExportDotVisitor().

Definition at line 49 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 50 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 54 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 59 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 53 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 57 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 58 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 52 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 60 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 62 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 56 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 47 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 48 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 55 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 61 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().

Definition at line 51 of file ExportDotVisitor.h.

Referenced by display(), and sofa::gui::qt::GenGraphForm::doExport().


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

Generated on Sun Nov 23 04:24:38 2008 for Sofa by  doxygen 1.5.7.1