Changeset 7889
- Timestamp:
- 02/27/08 12:43:58 (5 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 4 modified
-
examples/osgocclusionquery/osgocclusionquery.cpp (modified) (2 diffs)
-
include/osg/OcclusionQueryNode (modified) (1 diff)
-
src/osg/OcclusionQueryNode.cpp (modified) (2 diffs)
-
src/osgWrappers/osg/OcclusionQueryNode.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgocclusionquery/osgocclusionquery.cpp
r7754 r7889 265 265 osg::ref_ptr<osg::OcclusionQueryNode> oqn = new osg::OcclusionQueryNode; 266 266 267 osg::StateSet* ss( NULL ); 268 osg::StateSet* ssDebug( NULL ); 269 oqn->getQueryStateSets( ss, ssDebug ); 270 _state = ss; 271 _debugState = ssDebug; 267 _state = oqn->getQueryStateSet(); 268 _debugState = oqn->getDebugStateSet(); 272 269 } 273 270 … … 355 352 // Set all OQNs to use the same query StateSets (instead of multiple copies 356 353 // of the same StateSet) for efficiency. 357 oqn->setQueryStateSets( _state.get(), _debugState.get() ); 354 oqn->setQueryStateSet( _state.get() ); 355 oqn->setDebugStateSet( _debugState.get() ); 358 356 } 359 357 } -
OpenSceneGraph/trunk/include/osg/OcclusionQueryNode
r7790 r7889 68 68 69 69 70 // Set the StateSets used by the OQN when rendering OQ geometry 71 // or debug bounding geometry. 72 void setQueryStateSets( osg::StateSet* ss, osg::StateSet* ssDebug ); 73 void getQueryStateSets( osg::StateSet* ss, osg::StateSet* ssDebug ); 70 // Set and get the StateSet used by the OcclusionQueryNode 71 // when rendering the query geometry. OQN creates its own by 72 // default, but if you use many OQNs you might want to use 73 // this method to set all OQNs to use the same StateSet 74 // for more efficient processing. 75 void setQueryStateSet( osg::StateSet* ss ); 76 osg::StateSet* getQueryStateSet(); 77 const osg::StateSet* getQueryStateSet() const; 78 79 // Set and get the StateSet used by the OcclusionQueryNode 80 // when rendering the debug query geometry (see setDebugDisplay). 81 void setDebugStateSet( osg::StateSet* ss ); 82 osg::StateSet* getDebugStateSet(); 83 const osg::StateSet* getDebugStateSet() const; 74 84 75 85 // For statistics gathering, e.g., by a NodeVisitor. -
OpenSceneGraph/trunk/src/osg/OcclusionQueryNode.cpp
r7857 r7889 655 655 656 656 void 657 OcclusionQueryNode::setQueryStateSet s( osg::StateSet* ss, osg::StateSet* ssDebug)658 { 659 if (!_queryGeode .valid() || !_debugGeode.valid())660 { 661 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid support node(s)." << std::endl;657 OcclusionQueryNode::setQueryStateSet( osg::StateSet* ss ) 658 { 659 if (!_queryGeode) 660 { 661 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; 662 662 return; 663 663 } 664 664 665 665 _queryGeode->setStateSet( ss ); 666 _debugGeode->setStateSet( ssDebug ); 667 } 668 void 669 OcclusionQueryNode::getQueryStateSets( osg::StateSet* ss, osg::StateSet* ssDebug ) 670 { 671 ss = _queryGeode->getStateSet(); 672 ssDebug = _debugGeode->getStateSet(); 666 } 667 osg::StateSet* 668 OcclusionQueryNode::getQueryStateSet() 669 { 670 if (!_queryGeode) 671 { 672 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; 673 return NULL; 674 } 675 return _queryGeode->getStateSet(); 676 } 677 678 const osg::StateSet* 679 OcclusionQueryNode::getQueryStateSet() const 680 { 681 if (!_queryGeode) 682 { 683 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; 684 return NULL; 685 } 686 return _queryGeode->getStateSet(); 687 } 688 689 void 690 OcclusionQueryNode::setDebugStateSet( osg::StateSet* ss ) 691 { 692 if (!_debugGeode) 693 { 694 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; 695 return; 696 } 697 _debugGeode->setStateSet( ss ); 698 } 699 700 osg::StateSet* 701 OcclusionQueryNode::getDebugStateSet() 702 { 703 if (!_debugGeode.valid()) 704 { 705 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; 706 return NULL; 707 } 708 return _debugGeode->getStateSet(); 709 } 710 const osg::StateSet* 711 OcclusionQueryNode::getDebugStateSet() const 712 { 713 if (!_debugGeode.valid()) 714 { 715 osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; 716 return NULL; 717 } 718 return _debugGeode->getStateSet(); 673 719 } 674 720 … … 725 771 // the scene graph) create a single instance of these StateSets shared 726 772 // between all OQNs for efficiency. 727 setQueryStateSets( initOQState(), initOQDebugState() ); 773 setQueryStateSet( initOQState() ); 774 setDebugStateSet( initOQDebugState() ); 728 775 } 729 776 -
OpenSceneGraph/trunk/src/osgWrappers/osg/OcclusionQueryNode.cpp
r7794 r7889 118 118 "", 119 119 ""); 120 I_Method2(void, setQueryStateSets, IN, osg::StateSet *, ss, IN, osg::StateSet *, ssDebug, 121 Properties::NON_VIRTUAL, 122 __void__setQueryStateSets__osg_StateSet_P1__osg_StateSet_P1, 123 "", 124 ""); 125 I_Method2(void, getQueryStateSets, IN, osg::StateSet *, ss, IN, osg::StateSet *, ssDebug, 126 Properties::NON_VIRTUAL, 127 __void__getQueryStateSets__osg_StateSet_P1__osg_StateSet_P1, 120 I_Method1(void, setQueryStateSet, IN, osg::StateSet *, ss, 121 Properties::NON_VIRTUAL, 122 __void__setQueryStateSet__osg_StateSet_P1, 123 "", 124 ""); 125 I_Method0(osg::StateSet *, getQueryStateSet, 126 Properties::NON_VIRTUAL, 127 __osg_StateSet_P1__getQueryStateSet, 128 "", 129 ""); 130 I_Method0(const osg::StateSet *, getQueryStateSet, 131 Properties::NON_VIRTUAL, 132 __C5_osg_StateSet_P1__getQueryStateSet, 133 "", 134 ""); 135 I_Method1(void, setDebugStateSet, IN, osg::StateSet *, ss, 136 Properties::NON_VIRTUAL, 137 __void__setDebugStateSet__osg_StateSet_P1, 138 "", 139 ""); 140 I_Method0(osg::StateSet *, getDebugStateSet, 141 Properties::NON_VIRTUAL, 142 __osg_StateSet_P1__getDebugStateSet, 143 "", 144 ""); 145 I_Method0(const osg::StateSet *, getDebugStateSet, 146 Properties::NON_VIRTUAL, 147 __C5_osg_StateSet_P1__getDebugStateSet, 128 148 "", 129 149 ""); … … 165 185 __bool__getDebugDisplay, 166 186 __void__setDebugDisplay__bool); 187 I_SimpleProperty(osg::StateSet *, DebugStateSet, 188 __osg_StateSet_P1__getDebugStateSet, 189 __void__setDebugStateSet__osg_StateSet_P1); 167 190 I_SimpleProperty(bool, Passed, 168 191 __bool__getPassed, … … 174 197 __int__getQueryFrameCount, 175 198 __void__setQueryFrameCount__int); 199 I_SimpleProperty(osg::StateSet *, QueryStateSet, 200 __osg_StateSet_P1__getQueryStateSet, 201 __void__setQueryStateSet__osg_StateSet_P1); 176 202 I_SimpleProperty(unsigned int, VisibilityThreshold, 177 203 __unsigned_int__getVisibilityThreshold,
