#include <OSGSplitGraphOp.h>

Public Member Functions | |
Constructors | |
| SplitGraphOp (const char *name="Split", UInt16 max_polygons=1000) | |
| GraphOp * | create () |
Destructors | |
| virtual | ~SplitGraphOp (void) |
Main methods | |
| bool | traverse (NodePtr &root) |
Parameters | |
| void | setParams (const std::string params) |
| void | setMaxPolygons (UInt16 max_polygons) |
| std::string | usage (void) |
Main methods | |
| 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 Attributes | |
| std::list< NodePtr > | _excludeListNodes |
| std::list< std::string > | _excludeListNames |
Private Member Functions | |
| bool | isLeaf (NodePtr &node) |
| bool | isGroup (NodePtr &node) |
| bool | splitNode (NodePtr &node, std::vector< NodePtr > &split) |
| Action::ResultE | traverseEnter (NodePtr &node) |
| Action::ResultE | traverseLeave (NodePtr &node, Action::ResultE res) |
Private Attributes | |
| UInt16 | _max_polygons |
A class used to optimize geometries a bit.
Definition at line 57 of file OSGSplitGraphOp.h.
| SplitGraphOp::SplitGraphOp | ( | const char * | name = "Split", |
|
| UInt16 | max_polygons = 1000 | |||
| ) |
Definition at line 81 of file OSGSplitGraphOp.cpp.
Referenced by create().
00081 : 00082 GraphOp(name), _max_polygons(max_polygons) 00083 { 00084 }
| SplitGraphOp::~SplitGraphOp | ( | void | ) | [virtual] |
| static const char* osg::SplitGraphOp::getClassname | ( | void | ) | [inline, static] |
| GraphOp * SplitGraphOp::create | ( | void | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 90 of file OSGSplitGraphOp.cpp.
References SplitGraphOp().
00091 { 00092 SplitGraphOp * inst = new SplitGraphOp(); 00093 return inst; 00094 }
| bool SplitGraphOp::traverse | ( | NodePtr & | root | ) | [virtual] |
Reimplemented from osg::GraphOp.
Definition at line 96 of file OSGSplitGraphOp.cpp.
References osg::beginEditCP(), osg::GroupBase::create(), osg::endEditCP(), osg::NodePtr::getCore(), isLeaf(), osg::makeNodeFor(), and osg::traverse().
00097 { 00098 // If the root node is not a Group, make it one 00099 if (isLeaf(root)) 00100 { 00101 NodePtr n = makeNodeFor(root->getCore()); 00102 00103 beginEditCP(root); 00104 root->setCore(Group::create()); 00105 root->addChild(n); 00106 endEditCP(root); 00107 } 00108 00109 return GraphOp::traverse(root); 00110 }
| void SplitGraphOp::setParams | ( | const std::string | params | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 112 of file OSGSplitGraphOp.cpp.
References _max_polygons, FWARNING, and osg::GraphOp::ParamSet::getUnusedParams().
00113 { 00114 ParamSet ps(params); 00115 00116 ps("max_polygons", _max_polygons); 00117 00118 std::string out = ps.getUnusedParams(); 00119 if(out.length()) 00120 { 00121 FWARNING(("SplitGraphOp doesn't have parameters '%s'.\n", 00122 out.c_str())); 00123 } 00124 }
| void SplitGraphOp::setMaxPolygons | ( | UInt16 | max_polygons | ) |
Definition at line 134 of file OSGSplitGraphOp.cpp.
References _max_polygons.
00135 { 00136 _max_polygons = max_polygons; 00137 }
| std::string SplitGraphOp::usage | ( | void | ) | [virtual] |
Implements osg::GraphOp.
Definition at line 126 of file OSGSplitGraphOp.cpp.
00127 { 00128 return 00129 "Split: Split large geometries into smaller ones\n" 00130 "Params: name (type, default)\n" 00131 " max_polygons (UInt32, 1000): maximum number of polygons allowed per Geo\n"; 00132 }
| bool SplitGraphOp::isLeaf | ( | NodePtr & | node | ) | [private] |
Definition at line 750 of file OSGSplitGraphOp.cpp.
Referenced by splitNode(), traverse(), traverseEnter(), and traverseLeave().
00751 { 00752 if (node->getMFChildren()->getValues().begin()== 00753 node->getMFChildren()->getValues().end()) return true; 00754 else return false; 00755 }
| bool SplitGraphOp::isGroup | ( | NodePtr & | node | ) | [private] |
checks whether a node is a group and nothing else
Definition at line 759 of file OSGSplitGraphOp.cpp.
References osg::BillboardBase::getClassType(), osg::DistanceLODBase::getClassType(), osg::MaterialGroupBase::getClassType(), osg::SwitchBase::getClassType(), osg::ComponentTransformBase::getClassType(), osg::TransformBase::getClassType(), osg::GroupBase::getClassType(), osg::NodePtr::getCore(), osg::NodeCore::getType(), and osg::FieldContainerType::isDerivedFrom().
00760 { 00761 if( node->getCore()->getType().isDerivedFrom( Group::getClassType() ) && 00762 !node->getCore()->getType().isDerivedFrom( Transform::getClassType() ) && 00763 !node->getCore()->getType().isDerivedFrom( ComponentTransform::getClassType() ) && 00764 !node->getCore()->getType().isDerivedFrom( Switch::getClassType() ) && 00765 !node->getCore()->getType().isDerivedFrom( MaterialGroup::getClassType() ) && 00766 !node->getCore()->getType().isDerivedFrom( DistanceLOD::getClassType() ) && 00767 !node->getCore()->getType().isDerivedFrom( Billboard::getClassType() )) 00768 return true; 00769 else return false; 00770 }
Definition at line 321 of file OSGSplitGraphOp.cpp.
References _max_polygons, addPoints, osg::beginEditCP(), osg::Node::CoreFieldMask, osg::Node::create(), osg::GeometryBase::create(), osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::AttachmentContainerPtr::dcast(), osg::endEditCP(), osg::GeometryBase::getClassType(), osg::NodePtr::getCore(), osg::PrimitiveIterator::getLength(), osg::PrimitiveIterator::getPosition(), osg::PrimitiveIterator::getType(), osg::NodeCore::getType(), osg::PrimitiveIterator::isAtEnd(), osg::FieldContainerType::isDerivedFrom(), osg::GraphOp::isInExcludeList(), isLeaf(), osg::NullFC, osg::PrimitiveIterator::setToBegin(), setupAttr, and SWARNING.
Referenced by traverseLeave().
00322 { 00323 //split it only if it is a non special geometry leaf 00324 if (!isLeaf(node) || isInExcludeList(node) || 00325 !node->getCore()->getType().isDerivedFrom(Geometry::getClassType())) return false; 00326 00327 GeometryPtr geo = GeometryPtr::dcast(node->getCore()); 00328 00329 if ( geo->getPositions() == NullFC || geo->getPositions()->size() == 0 || 00330 geo->getLengths() == NullFC || geo->getLengths()->size() == 0 || 00331 geo->getTypes() == NullFC || geo->getTypes()->size() == 0 ) return false; 00332 00333 //get all center points 00334 std::vector<Pnt3f> centers; 00335 int ind; 00336 00337 PrimitiveIterator it(geo); 00338 00339 while (!it.isAtEnd()) 00340 { 00341 switch(it.getType()) 00342 { 00343 case GL_POINTS: 00344 case GL_LINES: 00345 case GL_LINE_STRIP: 00346 case GL_LINE_LOOP: 00347 case GL_TRIANGLE_FAN: 00348 case GL_TRIANGLE_STRIP: 00349 case GL_QUAD_STRIP: 00350 case GL_POLYGON: 00351 { 00352 Pnt3f center(0,0,0); 00353 for (UInt32 i=0; i<it.getLength(); i++) 00354 center+=(Vec3f)it.getPosition(i); 00355 center/=Real32(it.getLength()); 00356 centers.push_back(center); 00357 } 00358 break; 00359 00360 case GL_TRIANGLES: 00361 ind=0; 00362 while(it.getLength()-ind>=3) 00363 { 00364 Pnt3f center(0,0,0); 00365 for (UInt32 i=0; i<3; i++, ind++) 00366 center+=(Vec3f)it.getPosition(ind); 00367 center/=3; 00368 centers.push_back(center); 00369 } 00370 break; 00371 00372 case GL_QUADS: 00373 ind=0; 00374 while(it.getLength()-ind>=4) 00375 { 00376 Pnt3f center(0,0,0); 00377 for (UInt32 i=0; i<4; i++, ind++) 00378 center+=(Vec3f)it.getPosition(ind); 00379 center/=4; 00380 centers.push_back(center); 00381 } 00382 break; 00383 00384 00385 default: 00386 SWARNING << "SplitGraphOp::splitLeave: encountered " 00387 << "unknown primitive type " 00388 << it.getType() 00389 << ", ignoring!" << std::endl; 00390 break; 00391 } 00392 00393 ++it; 00394 } 00395 00396 std::vector<int> order; 00397 for (UInt32 i=0; i<centers.size(); i++) 00398 order.push_back(i); 00399 00400 Pnt3fComparator comp(centers); 00401 std::sort(order.begin(), order.end(), comp); 00402 00403 //now we need (centers.size()/_max_polygons) amount of new geometries 00404 int ngeos=int(ceil((double)centers.size()/(double)_max_polygons)); 00405 00406 if (ngeos<=1) return false; 00407 00408 GeometryPtr *geos = new GeometryPtr[ngeos]; 00409 GeoPTypesPtr *types = new GeoPTypesPtr[ngeos]; 00410 GeoPLengthsPtr *lens = new GeoPLengthsPtr[ngeos]; 00411 GeoPositionsPtr *pnts = new GeoPositionsPtr[ngeos]; 00412 GeoNormalsPtr *normals = new GeoNormalsPtr[ngeos]; 00413 GeoColorsPtr *colors = new GeoColorsPtr[ngeos]; 00414 GeoColorsPtr *scolors = new GeoColorsPtr[ngeos]; 00415 GeoTexCoordsPtr *tex = new GeoTexCoordsPtr[ngeos]; 00416 GeoTexCoordsPtr *tex1 = new GeoTexCoordsPtr[ngeos]; 00417 GeoTexCoordsPtr *tex2 = new GeoTexCoordsPtr[ngeos]; 00418 GeoTexCoordsPtr *tex3 = new GeoTexCoordsPtr[ngeos]; 00419 GeoIndicesPtr *indices = new GeoIndicesPtr[ngeos]; 00420 00421 int **pni = new int*[ngeos]; 00422 int **nni = new int*[ngeos]; 00423 int **cni = new int*[ngeos]; 00424 int **sni = new int*[ngeos]; 00425 int **tni = new int*[ngeos]; 00426 int **t1ni = new int*[ngeos]; 00427 int **t2ni = new int*[ngeos]; 00428 int **t3ni = new int*[ngeos]; 00429 00430 for (Int32 i=0; i<ngeos; i++) 00431 { 00432 geos[i] = Geometry::create(); 00433 00434 beginEditCP(geos[i]); // Keep open until the end 00435 00436 geos[i]->setMaterial(geo->getMaterial()); 00437 00438 if(geo->getMFIndexMapping() != NULL) 00439 geos[i]->getMFIndexMapping()->setValues(*(geo->getMFIndexMapping())); 00440 00441 types[i] = GeoPTypesPtr::dcast(geo->getTypes()->getType().createFieldContainer()); 00442 lens[i] = GeoPLengthsPtr::dcast(geo->getLengths()->getType().createFieldContainer()); 00443 00444 if (geo->getIndices()!=NullFC) 00445 { 00446 indices[i] = GeoIndicesPtr::dcast(geo->getIndices()->getType().createFieldContainer()); 00447 beginEditCP(indices[i]); // Keep open until the end 00448 } 00449 else 00450 indices[i] = NullFC; 00451 00452 beginEditCP(types[i]); // Keep open until the end 00453 beginEditCP(lens[i]); // Keep open until the end 00454 00455 setupAttr( GeoPositionsPtr , pnts , pni , getPositions ); 00456 setupAttr( GeoNormalsPtr , normals , nni , getNormals ); 00457 setupAttr( GeoColorsPtr , colors , cni , getColors ); 00458 setupAttr( GeoColorsPtr , scolors , sni , getSecondaryColors ); 00459 setupAttr( GeoTexCoordsPtr , tex , tni , getTexCoords ); 00460 setupAttr( GeoTexCoordsPtr , tex1 , t1ni , getTexCoords1 ); 00461 setupAttr( GeoTexCoordsPtr , tex2 , t2ni , getTexCoords2 ); 00462 setupAttr( GeoTexCoordsPtr , tex3 , t3ni , getTexCoords3 ); 00463 } 00464 00465 ind=0; 00466 it.setToBegin(); 00467 00468 while (!it.isAtEnd()) 00469 { 00470 switch(it.getType()) 00471 { 00472 case GL_POINTS: 00473 case GL_LINES: 00474 case GL_LINE_STRIP: 00475 case GL_LINE_LOOP: 00476 case GL_TRIANGLE_FAN: 00477 case GL_TRIANGLE_STRIP: 00478 case GL_QUAD_STRIP: 00479 case GL_POLYGON: 00480 { 00481 int geoIndex=order[ind]/_max_polygons; 00482 00483 types[geoIndex]->push_back(it.getType()); 00484 lens[geoIndex]->push_back(it.getLength()); 00485 00486 addPoints( 0 , it.getLength() ); 00487 ++ind; 00488 } break; 00489 00490 case GL_TRIANGLES: 00491 { 00492 UInt32 i=0; 00493 while(it.getLength()-i>=3) 00494 { 00495 i+=3; 00496 ++ind; 00497 } 00498 } break; 00499 00500 case GL_QUADS: 00501 { 00502 UInt32 i=0; 00503 while(it.getLength()-i>=4) 00504 { 00505 i+=4; 00506 ++ind; 00507 } 00508 } break; 00509 00510 00511 default: 00512 SWARNING << "SplitGraphOp::splitLeave: encountered " 00513 << "unknown primitive type " 00514 << it.getType() 00515 << ", ignoring!" << std::endl; 00516 break; 00517 } 00518 ++it; 00519 } 00520 00521 ind=0; 00522 it.setToBegin(); 00523 00524 while (!it.isAtEnd()) 00525 { 00526 switch(it.getType()) 00527 { 00528 case GL_POINTS: 00529 case GL_LINES: 00530 case GL_LINE_STRIP: 00531 case GL_LINE_LOOP: 00532 case GL_TRIANGLE_FAN: 00533 case GL_TRIANGLE_STRIP: 00534 case GL_QUAD_STRIP: 00535 case GL_POLYGON: 00536 { 00537 ++ind; 00538 } break; 00539 00540 case GL_TRIANGLES: 00541 { 00542 UInt32 i=0; 00543 int geoIndex; 00544 while(it.getLength()-i>=3) 00545 { 00546 geoIndex = order[ind]/_max_polygons; 00547 if (types[geoIndex]->size()>0 && types[geoIndex]->getValue(types[geoIndex]->size()-1) == GL_TRIANGLES) 00548 { 00549 int lind; 00550 if ((lind=lens[geoIndex]->size()-1)>=0) 00551 lens[geoIndex]->setValue(lens[geoIndex]->getValue(lind)+3, lind); 00552 else 00553 lens[geoIndex]->push_back(3); 00554 } 00555 else 00556 { 00557 types[geoIndex]->push_back(GL_TRIANGLES); 00558 lens[geoIndex]->push_back(3); 00559 } 00560 00561 addPoints( i ,3 ); 00562 i+=3; 00563 ++ind; 00564 } 00565 } break; 00566 00567 case GL_QUADS: 00568 { 00569 UInt32 i=0; 00570 while(it.getLength()-i>=4) 00571 { 00572 i+=4; 00573 ++ind; 00574 } 00575 } break; 00576 00577 00578 default: 00579 SWARNING << "SplitGraphOp::splitLeave: encountered " 00580 << "unknown primitive type " 00581 << it.getType() 00582 << ", ignoring!" << std::endl; 00583 break; 00584 } 00585 ++it; 00586 } 00587 00588 ind=0; 00589 it.setToBegin(); 00590 00591 while (!it.isAtEnd()) 00592 { 00593 switch(it.getType()) 00594 { 00595 case GL_POINTS: 00596 case GL_LINES: 00597 case GL_LINE_STRIP: 00598 case GL_LINE_LOOP: 00599 case GL_TRIANGLE_FAN: 00600 case GL_TRIANGLE_STRIP: 00601 case GL_QUAD_STRIP: 00602 case GL_POLYGON: 00603 { 00604 ++ind; 00605 } break; 00606 00607 case GL_TRIANGLES: 00608 { 00609 UInt32 i=0; 00610 while(it.getLength()-i>=3) 00611 { 00612 i+=3; 00613 ++ind; 00614 } 00615 } break; 00616 00617 case GL_QUADS: 00618 { 00619 UInt32 i=0; 00620 int geoIndex; 00621 while(it.getLength()-i>=4) 00622 { 00623 geoIndex = order[ind]/_max_polygons; 00624 if (types[geoIndex]->size()>0 && types[geoIndex]->getValue(types[geoIndex]->size()-1) == GL_QUADS) 00625 { 00626 int lind; 00627 if ((lind=lens[geoIndex]->size()-1)>=0) 00628 lens[geoIndex]->setValue(lens[geoIndex]->getValue(lind)+4, lind); 00629 else 00630 lens[geoIndex]->push_back(4); 00631 } 00632 else 00633 { 00634 types[geoIndex]->push_back(GL_QUADS); 00635 lens[geoIndex]->push_back(4); 00636 } 00637 00638 addPoints( i , 4 ); 00639 i+=4; 00640 ++ind; 00641 } 00642 } break; 00643 00644 default: 00645 SWARNING << "SplitGraphOp::splitLeave: encountered " 00646 << "unknown primitive type " 00647 << it.getType() 00648 << ", ignoring!" << std::endl; 00649 break; 00650 } 00651 ++it; 00652 } 00653 00654 for (Int32 i=0; i<ngeos; i++) 00655 { 00656 geos[i]->setTypes(types[i]); 00657 geos[i]->setLengths(lens[i]); 00658 geos[i]->setPositions(pnts[i]); 00659 00660 // Now close the open FCs 00661 00662 endEditCP(types[i]); 00663 endEditCP(lens[i]); 00664 endEditCP(pnts[i]); 00665 00666 if (indices[i]!=NullFC) 00667 { 00668 geos[i]->setIndices(indices[i]); 00669 endEditCP(indices[i]); 00670 } 00671 00672 if (normals[i]!=NullFC) 00673 { 00674 geos[i]->setNormals(normals[i]); 00675 endEditCP(normals[i]); 00676 } 00677 00678 if (colors[i]!=NullFC) 00679 { 00680 geos[i]->setColors(colors[i]); 00681 endEditCP(colors[i]); 00682 } 00683 00684 if (scolors[i]!=NullFC) 00685 { 00686 geos[i]->setSecondaryColors(scolors[i]); 00687 endEditCP(scolors[i]); 00688 } 00689 00690 if (tex[i]!=NullFC) 00691 { 00692 geos[i]->setTexCoords(tex[i]); 00693 endEditCP(tex[i]); 00694 } 00695 00696 if (tex1[i]!=NullFC) 00697 { 00698 geos[i]->setTexCoords1(tex1[i]); 00699 endEditCP(tex1[i]); 00700 } 00701 00702 if (tex2[i]!=NullFC) 00703 { 00704 geos[i]->setTexCoords2(tex2[i]); 00705 endEditCP(tex2[i]); 00706 } 00707 00708 if (tex3[i]!=NullFC) 00709 { 00710 geos[i]->setTexCoords3(tex3[i]); 00711 endEditCP(tex3[i]); 00712 } 00713 00714 endEditCP(geos[i]); 00715 00716 if (node->getParent()!=NullFC) 00717 { 00718 NodePtr n=Node::create(); 00719 beginEditCP(n, Node::CoreFieldMask); 00720 n->setCore(geos[i]); 00721 endEditCP (n, Node::CoreFieldMask); 00722 split.push_back(n); 00723 } 00724 } 00725 00726 for (Int32 i=0; i<ngeos; i++) 00727 { 00728 if (pni[i]) delete [] pni[i]; 00729 if (nni[i]) delete [] nni[i]; 00730 if (cni[i]) delete [] cni[i]; 00731 if (sni[i]) delete [] sni[i]; 00732 if (tni[i]) delete [] tni[i]; 00733 if (t1ni[i]) delete [] t1ni[i]; 00734 if (t2ni[i]) delete [] t2ni[i]; 00735 if (t3ni[i]) delete [] t3ni[i]; 00736 } 00737 00738 delete [] pni; 00739 delete [] nni; 00740 delete [] cni; 00741 delete [] sni; 00742 delete [] tni; 00743 delete [] t1ni; 00744 delete [] t2ni; 00745 delete [] t3ni; 00746 00747 return true; 00748 }
| Action::ResultE SplitGraphOp::traverseEnter | ( | NodePtr & | node | ) | [private, virtual] |
Implements osg::GraphOp.
Definition at line 148 of file OSGSplitGraphOp.cpp.
References osg::Action::Continue, osg::AttachmentContainerPtr::dcast(), osg::NodePtr::getCore(), isLeaf(), osg::NullFC, and osg::Action::Skip.
00149 { 00150 if (isLeaf(node)) return Action::Skip; 00151 00152 SwitchPtr switch_ = SwitchPtr::dcast(node->getCore()); 00153 if (switch_!=NullFC) return Action::Skip; 00154 00155 DistanceLODPtr dlod = DistanceLODPtr::dcast(node->getCore()); 00156 if (dlod!=NullFC) return Action::Skip; 00157 00158 return Action::Continue; 00159 }
| Action::ResultE SplitGraphOp::traverseLeave | ( | NodePtr & | node, | |
| Action::ResultE | res | |||
| ) | [private, virtual] |
Implements osg::GraphOp.
Definition at line 279 of file OSGSplitGraphOp.cpp.
References osg::addRefCP(), osg::beginEditCP(), osg::Node::ChildrenFieldMask, osg::endEditCP(), osg::GraphOp::isInExcludeList(), isLeaf(), and splitNode().
00280 { 00281 std::vector<NodePtr>::iterator it = node->getMFChildren()->getValues().begin(); 00282 std::vector<NodePtr>::iterator en = node->getMFChildren()->getValues().end (); 00283 std::vector<NodePtr> toAdd; 00284 std::vector<NodePtr> toSub; 00285 00286 for ( ; it != en; ++it ) 00287 { 00288 bool special=isInExcludeList(*it); 00289 bool leaf=isLeaf(*it); 00290 00291 if (!special && leaf) 00292 { 00293 if (splitNode(*it, toAdd)) 00294 toSub.push_back(*it); 00295 } 00296 } 00297 00298 it = toAdd.begin(); 00299 en = toAdd.end (); 00300 00301 for ( ; it != en; ++it ) 00302 { 00303 beginEditCP(node, Node::ChildrenFieldMask); 00304 node->addChild(*it); 00305 endEditCP (node, Node::ChildrenFieldMask); 00306 } 00307 00308 it = toSub.begin(); 00309 en = toSub.end (); 00310 00311 for ( ; it != en; ++it ) 00312 { 00313 beginEditCP(node, Node::ChildrenFieldMask); 00314 addRefCP(*it); 00315 node->subChild(*it); 00316 endEditCP (node, Node::ChildrenFieldMask); 00317 } 00318 return res; 00319 }
| const std::string & GraphOp::getName | ( | void | ) | [inherited] |
Definition at line 112 of file OSGGraphOp.cpp.
References osg::GraphOp::_name.
Referenced by osg::GraphOpFactory::registerOp(), and osg::GraphOpFactory::unRegisterOp().
00113 { 00114 return _name; 00115 };
| void GraphOp::setName | ( | const char * | name | ) | [inherited] |
| void GraphOp::addToExcludeList | ( | 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 | ( | 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(), splitNode(), and traverseLeave().
00175 { 00176 if (isInExcludeListNodes(node) || (OSG::getName(node)!=NULL && isInExcludeListNames(OSG::getName(node)))) 00177 return true; 00178 else 00179 return false; 00180 }
UInt16 osg::SplitGraphOp::_max_polygons [private] |
Definition at line 109 of file OSGSplitGraphOp.h.
Referenced by setMaxPolygons(), setParams(), and splitNode().
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.5.5