#include <OSGStripeGraphOp.h>
Public Member Functions | |
Constructors | |
| StripeGraphOp (const char *name="Stripe") | |
| GraphOp * | create () |
Destructors | |
| virtual | ~StripeGraphOp (void) |
Main methods | |
| void | setParams (const std::string params) |
| std::string | usage (void) |
Main methods | |
| virtual bool | traverse (NodePtr &root) |
| const std::string & | getName (void) |
| void | setName (const char *name) |
Exclusion | |
| void | addToExcludeList (const NodePtr &node) |
| void | addToExcludeList (const std::string &name) |
| void | removeFromExcludeList (NodePtr &node) |
| void | removeFromExcludeList (const std::string &name) |
| void | clearExcludeList (void) |
| bool | isInExcludeListNodes (const 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 | |
| bool | travNodeEnter (NodePtr node) |
| bool | travNodeLeave (NodePtr node) |
Protected Attributes | |
| std::list< NodePtr > | _excludeListNodes |
| std::list< std::string > | _excludeListNames |
Private Attributes | |
| bool | _force |
| bool | _stitch |
A base class used to traverse geometries.
Definition at line 59 of file OSGStripeGraphOp.h.
| StripeGraphOp::StripeGraphOp | ( | const char * | name = "Stripe" |
) |
Definition at line 71 of file OSGStripeGraphOp.cpp.
Referenced by create().
00071 : 00072 SingleTypeGraphOpGeo(name), 00073 _force(false), 00074 _stitch(false) 00075 { 00076 }
| StripeGraphOp::~StripeGraphOp | ( | void | ) | [virtual] |
Definition at line 78 of file OSGStripeGraphOp.cpp.
| static const char* osg::StripeGraphOp::getClassname | ( | void | ) | [inline, static] |
Reimplemented from osg::SingleTypeGraphOp< Geometry >.
Definition at line 68 of file OSGStripeGraphOp.h.
| GraphOp * StripeGraphOp::create | ( | void | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 82 of file OSGStripeGraphOp.cpp.
References StripeGraphOp().
00083 { 00084 StripeGraphOp *inst = new StripeGraphOp(); 00085 return inst; 00086 }
| void StripeGraphOp::setParams | ( | const std::string | params | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 88 of file OSGStripeGraphOp.cpp.
References _force, _stitch, FWARNING, and osg::GraphOp::ParamSet::getUnusedParams().
| std::string StripeGraphOp::usage | ( | void | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 103 of file OSGStripeGraphOp.cpp.
| bool StripeGraphOp::travNodeEnter | ( | NodePtr | node | ) | [protected, virtual] |
Implements osg::SingleTypeGraphOp< Geometry >.
Definition at line 112 of file OSGStripeGraphOp.cpp.
References _force, _stitch, osg::createOptimizedPrimitives(), osg::createSharedIndex(), osg::AttachmentContainerPtr::dcast(), osg::NodePtr::getCore(), and osg::NullFC.
00113 { 00114 GeometryPtr geo = GeometryPtr::dcast(node->getCore()); 00115 00116 if(geo != NullFC) 00117 { 00118 // Check if it's striped already 00119 if (!_force) 00120 { 00121 GeoPTypesPtr t = geo->getTypes(); 00122 00123 if(t != NullFC) 00124 { 00125 for(UInt32 i = 0; i < t->size(); ++i) 00126 { 00127 if(t->getValue(i) == GL_TRIANGLE_STRIP) 00128 { 00129 return true; 00130 } 00131 } 00132 } 00133 } 00134 createSharedIndex(geo); 00135 createOptimizedPrimitives(geo, 1, true, true, 16, false, _stitch); 00136 } 00137 00138 return true; 00139 }
| bool StripeGraphOp::travNodeLeave | ( | NodePtr | node | ) | [protected, virtual] |
Implements osg::SingleTypeGraphOp< Geometry >.
Definition at line 141 of file OSGStripeGraphOp.cpp.
| bool GraphOp::traverse | ( | NodePtr & | root | ) | [virtual, inherited] |
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(), osg::GraphOp::traverseEnter(), and osg::GraphOp::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 | ) | [inherited] |
Definition at line 112 of file OSGGraphOp.cpp.
References osg::GraphOp::_name.
Referenced by osg::GraphOpFactory::registerOp(), osg::VerifyGraphOp::repairGeometry(), and osg::GraphOpFactory::unRegisterOp().
00113 { 00114 return _name; 00115 };
| void GraphOp::setName | ( | const char * | name | ) | [inherited] |
Definition at line 117 of file OSGGraphOp.cpp.
References osg::GraphOp::_name.
Referenced by osg::VerifyGraphOp::repairGeometry(), and osg::VerifyGraphOp::traverseEnter().
| void GraphOp::addToExcludeList | ( | const NodePtr & | node | ) | [inherited] |
Definition at line 124 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNodes, and osg::GraphOp::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 | ) | [inherited] |
Definition at line 130 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNames, and osg::GraphOp::isInExcludeListNames().
00131 { 00132 if (!isInExcludeListNames(name)) 00133 _excludeListNames.push_back(name); 00134 }
| void GraphOp::removeFromExcludeList | ( | NodePtr & | node | ) | [inherited] |
Definition at line 136 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNodes.
00137 { 00138 _excludeListNodes.remove(node); 00139 }
| void GraphOp::removeFromExcludeList | ( | const std::string & | name | ) | [inherited] |
Definition at line 141 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNames.
00142 { 00143 _excludeListNames.remove(name); 00144 }
| void GraphOp::clearExcludeList | ( | void | ) | [inherited] |
Definition at line 146 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNames, and osg::GraphOp::_excludeListNodes.
00147 { 00148 _excludeListNames.clear(); 00149 _excludeListNodes.clear(); 00150 }
| bool GraphOp::isInExcludeListNodes | ( | const NodePtr & | node | ) | [inherited] |
Definition at line 152 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNodes.
Referenced by osg::GraphOp::addToExcludeList(), and osg::GraphOp::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 | ) | [inherited] |
Definition at line 163 of file OSGGraphOp.cpp.
References osg::GraphOp::_excludeListNames.
Referenced by osg::GraphOp::addToExcludeList(), and osg::GraphOp::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 | ) | [inherited] |
Definition at line 174 of file OSGGraphOp.cpp.
References osg::getName(), osg::GraphOp::isInExcludeListNames(), and osg::GraphOp::isInExcludeListNodes().
Referenced by osg::MergeGraphOp::processGeometries(), osg::MergeGraphOp::processGroups(), osg::MergeGraphOp::processTransformations(), osg::SplitGraphOp::splitNode(), osg::MakeTransparentGraphOp::traverseEnter(), 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 }
bool osg::StripeGraphOp::_force [private] |
Definition at line 106 of file OSGStripeGraphOp.h.
Referenced by setParams(), and travNodeEnter().
bool osg::StripeGraphOp::_stitch [private] |
Definition at line 107 of file OSGStripeGraphOp.h.
Referenced by setParams(), and travNodeEnter().
std::list<NodePtr> osg::GraphOp::_excludeListNodes [protected, inherited] |
Definition at line 161 of file OSGGraphOp.h.
Referenced by osg::GraphOp::addToExcludeList(), osg::GraphOp::clearExcludeList(), osg::GraphOp::isInExcludeListNodes(), osg::MergeGraphOp::mergeOnce(), and osg::GraphOp::removeFromExcludeList().
std::list<std::string> osg::GraphOp::_excludeListNames [protected, inherited] |
Definition at line 162 of file OSGGraphOp.h.
Referenced by osg::GraphOp::addToExcludeList(), osg::GraphOp::clearExcludeList(), osg::GraphOp::isInExcludeListNames(), and osg::GraphOp::removeFromExcludeList().
1.6.1