#include <OSGGraphOp.h>

Public Member Functions | |
Constructors | |
| GraphOp (const char *name="") | |
| virtual GraphOp * | create (void)=0 |
Destructors | |
| virtual | ~GraphOp (void) |
Parameters | |
| virtual void | setParams (const std::string params)=0 |
| virtual std::string | usage (void)=0 |
Main methods | |
| virtual bool | traverse (NodePtr &root) |
| const std::string & | getName (void) |
| void | setName (const char *name) |
Exclusion | |
| void | addToExcludeList (NodePtr &node) |
| void | addToExcludeList (const std::string &name) |
| void | removeFromExcludeList (NodePtr &node) |
| void | removeFromExcludeList (const std::string &name) |
| void | clearExcludeList (void) |
| bool | isInExcludeListNodes (NodePtr &node) |
| bool | isInExcludeListNames (const std::string &name) |
| bool | isInExcludeList (NodePtr &node) |
Static Public Member Functions | |
Class Get | |
| static const char * | getClassname (void) |
Protected Member Functions | |
| virtual Action::ResultE | traverseEnter (NodePtr &node)=0 |
| virtual Action::ResultE | traverseLeave (NodePtr &node, Action::ResultE res)=0 |
Protected Attributes | |
| std::list< NodePtr > | _excludeListNodes |
| std::list< std::string > | _excludeListNames |
Private Attributes | |
| std::string | _name |
Classes | |
| class | ParamSet |
A base class used to traverse geometries.
Parameters are generally passed using the setParams() method (or indirectly from constructing a GraphOpSeq via string) and follow the following conventions:
Calling usage() gives a short textual desription of the purpose and parameters of a GraphOp.
Definition at line 60 of file OSGGraphOp.h.
| GraphOp::GraphOp | ( | const char * | name = "" |
) |
Definition at line 85 of file OSGGraphOp.cpp.
00085 : 00086 _name(name), _excludeListNodes(), _excludeListNames() 00087 { 00088 }
| GraphOp::~GraphOp | ( | void | ) | [virtual] |
| static const char* osg::GraphOp::getClassname | ( | void | ) | [inline, static] |
Reimplemented in osg::GeoTypeGraphOp, osg::MakeTransparentGraphOp, osg::MaterialMergeGraphOp, osg::MergeGraphOp, osg::PruneGraphOp, osg::SharePtrGraphOp, osg::SingleTypeGraphOp< Type >, osg::SplitGraphOp, osg::StripeGraphOp, osg::VerifyGeoGraphOp, osg::VerifyGraphOp, and osg::SingleTypeGraphOp< osg::Geometry >.
Definition at line 69 of file OSGGraphOp.h.
| virtual GraphOp* osg::GraphOp::create | ( | void | ) | [pure virtual] |
| virtual void osg::GraphOp::setParams | ( | const std::string | params | ) | [pure virtual] |
| virtual std::string osg::GraphOp::usage | ( | void | ) | [pure virtual] |
| bool GraphOp::traverse | ( | NodePtr & | root | ) | [virtual] |
Reimplemented in osg::MakeTransparentGraphOp, osg::MaterialMergeGraphOp, osg::MergeGraphOp, osg::SharePtrGraphOp, osg::SplitGraphOp, and osg::VerifyGraphOp.
Definition at line 94 of file OSGGraphOp.cpp.
References osg::Action::Continue, osg::osgTypedMethodFunctor1ObjPtrCPtrRef(), osg::osgTypedMethodFunctor2ObjPtrCPtrRef(), traverseEnter(), and traverseLeave().
Referenced by osg::VerifyGraphOp::traverse(), osg::MaterialMergeGraphOp::traverse(), and osg::MakeTransparentGraphOp::traverse().
00095 { 00096 Action::ResultE res; 00097 res = ::traverse(node, 00098 osgTypedMethodFunctor1ObjPtrCPtrRef<Action::ResultE, 00099 GraphOp, 00100 NodePtr>(this,&GraphOp::traverseEnter), 00101 osgTypedMethodFunctor2ObjPtrCPtrRef<Action::ResultE, 00102 GraphOp, 00103 NodePtr, 00104 Action::ResultE>(this,&GraphOp::traverseLeave)); 00105 00106 if (res == Action::Continue) 00107 return true; 00108 else 00109 return false; 00110 }
| const std::string & GraphOp::getName | ( | void | ) |
Definition at line 112 of file OSGGraphOp.cpp.
References _name.
Referenced by osg::GraphOpFactory::registerOp(), and osg::GraphOpFactory::unRegisterOp().
00113 { 00114 return _name; 00115 };
| void GraphOp::setName | ( | const char * | name | ) |
| void GraphOp::addToExcludeList | ( | NodePtr & | node | ) |
Definition at line 124 of file OSGGraphOp.cpp.
References _excludeListNodes, and isInExcludeListNodes().
Referenced by osg::MergeGraphOp::excludeListLeave(), and osg::GraphOpSeq::setGraphOps().
00125 { 00126 if (!isInExcludeListNodes(node)) 00127 _excludeListNodes.push_back(node); 00128 }
| void GraphOp::addToExcludeList | ( | const std::string & | name | ) |
Definition at line 130 of file OSGGraphOp.cpp.
References _excludeListNames, and isInExcludeListNames().
00131 { 00132 if (!isInExcludeListNames(name)) 00133 _excludeListNames.push_back(name); 00134 }
| void GraphOp::removeFromExcludeList | ( | NodePtr & | node | ) |
Definition at line 136 of file OSGGraphOp.cpp.
References _excludeListNodes.
00137 { 00138 _excludeListNodes.remove(node); 00139 }
| void GraphOp::removeFromExcludeList | ( | const std::string & | name | ) |
Definition at line 141 of file OSGGraphOp.cpp.
References _excludeListNames.
00142 { 00143 _excludeListNames.remove(name); 00144 }
| void GraphOp::clearExcludeList | ( | void | ) |
Definition at line 146 of file OSGGraphOp.cpp.
References _excludeListNames, and _excludeListNodes.
00147 { 00148 _excludeListNames.clear(); 00149 _excludeListNodes.clear(); 00150 }
| bool GraphOp::isInExcludeListNodes | ( | NodePtr & | node | ) |
Definition at line 152 of file OSGGraphOp.cpp.
References _excludeListNodes.
Referenced by addToExcludeList(), and isInExcludeList().
00153 { 00154 std::list<NodePtr>::iterator list_iter; 00155 list_iter = std::find(_excludeListNodes.begin(),_excludeListNodes.end(),node); 00156 00157 if (list_iter==_excludeListNodes.end()) 00158 return false; 00159 else 00160 return true; 00161 }
| bool GraphOp::isInExcludeListNames | ( | const std::string & | name | ) |
Definition at line 163 of file OSGGraphOp.cpp.
References _excludeListNames.
Referenced by addToExcludeList(), and isInExcludeList().
00164 { 00165 std::list<std::string>::iterator namelist_iter; 00166 namelist_iter = std::find(_excludeListNames.begin(),_excludeListNames.end(),name); 00167 00168 if (namelist_iter==_excludeListNames.end()) 00169 return false; 00170 else 00171 return true; 00172 }
| bool GraphOp::isInExcludeList | ( | NodePtr & | node | ) |
Definition at line 174 of file OSGGraphOp.cpp.
References osg::getName(), isInExcludeListNames(), and isInExcludeListNodes().
Referenced by osg::MergeGraphOp::processGeometries(), osg::MergeGraphOp::processGroups(), osg::MergeGraphOp::processTransformations(), osg::SplitGraphOp::splitNode(), and osg::SplitGraphOp::traverseLeave().
00175 { 00176 if (isInExcludeListNodes(node) || (OSG::getName(node)!=NULL && isInExcludeListNames(OSG::getName(node)))) 00177 return true; 00178 else 00179 return false; 00180 }
| virtual Action::ResultE osg::GraphOp::traverseEnter | ( | NodePtr & | node | ) | [protected, pure virtual] |
| virtual Action::ResultE osg::GraphOp::traverseLeave | ( | NodePtr & | node, | |
| Action::ResultE | res | |||
| ) | [protected, pure virtual] |
std::list<NodePtr> osg::GraphOp::_excludeListNodes [protected] |
Definition at line 161 of file OSGGraphOp.h.
Referenced by addToExcludeList(), clearExcludeList(), isInExcludeListNodes(), osg::MergeGraphOp::mergeOnce(), and removeFromExcludeList().
std::list<std::string> osg::GraphOp::_excludeListNames [protected] |
Definition at line 162 of file OSGGraphOp.h.
Referenced by addToExcludeList(), clearExcludeList(), isInExcludeListNames(), and removeFromExcludeList().
std::string osg::GraphOp::_name [private] |
1.5.5