From Paul Martz, fixed get/set methods API

This commit is contained in:
Robert Osfield
2008-02-27 11:43:58 +00:00
parent 335eed204b
commit 3b4af26136
4 changed files with 104 additions and 23 deletions

View File

@@ -654,22 +654,68 @@ OcclusionQueryNode::getDebugDisplay() const
void
OcclusionQueryNode::setQueryStateSets( osg::StateSet* ss, osg::StateSet* ssDebug )
OcclusionQueryNode::setQueryStateSet( osg::StateSet* ss )
{
if (!_queryGeode.valid() || !_debugGeode.valid())
if (!_queryGeode)
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid support node(s)." << std::endl;
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl;
return;
}
_queryGeode->setStateSet( ss );
_debugGeode->setStateSet( ssDebug );
}
void
OcclusionQueryNode::getQueryStateSets( osg::StateSet* ss, osg::StateSet* ssDebug )
osg::StateSet*
OcclusionQueryNode::getQueryStateSet()
{
ss = _queryGeode->getStateSet();
ssDebug = _debugGeode->getStateSet();
if (!_queryGeode)
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl;
return NULL;
}
return _queryGeode->getStateSet();
}
const osg::StateSet*
OcclusionQueryNode::getQueryStateSet() const
{
if (!_queryGeode)
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl;
return NULL;
}
return _queryGeode->getStateSet();
}
void
OcclusionQueryNode::setDebugStateSet( osg::StateSet* ss )
{
if (!_debugGeode)
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl;
return;
}
_debugGeode->setStateSet( ss );
}
osg::StateSet*
OcclusionQueryNode::getDebugStateSet()
{
if (!_debugGeode.valid())
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl;
return NULL;
}
return _debugGeode->getStateSet();
}
const osg::StateSet*
OcclusionQueryNode::getDebugStateSet() const
{
if (!_debugGeode.valid())
{
osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl;
return NULL;
}
return _debugGeode->getStateSet();
}
bool
@@ -724,7 +770,8 @@ OcclusionQueryNode::createSupportNodes()
// Creste state sets. Note that the osgOQ visitors (which place OQNs throughout
// the scene graph) create a single instance of these StateSets shared
// between all OQNs for efficiency.
setQueryStateSets( initOQState(), initOQDebugState() );
setQueryStateSet( initOQState() );
setDebugStateSet( initOQDebugState() );
}

View File

@@ -117,14 +117,34 @@ BEGIN_OBJECT_REFLECTOR(osg::OcclusionQueryNode)
__bool__getDebugDisplay,
"",
"");
I_Method2(void, setQueryStateSets, IN, osg::StateSet *, ss, IN, osg::StateSet *, ssDebug,
I_Method1(void, setQueryStateSet, IN, osg::StateSet *, ss,
Properties::NON_VIRTUAL,
__void__setQueryStateSets__osg_StateSet_P1__osg_StateSet_P1,
__void__setQueryStateSet__osg_StateSet_P1,
"",
"");
I_Method2(void, getQueryStateSets, IN, osg::StateSet *, ss, IN, osg::StateSet *, ssDebug,
I_Method0(osg::StateSet *, getQueryStateSet,
Properties::NON_VIRTUAL,
__void__getQueryStateSets__osg_StateSet_P1__osg_StateSet_P1,
__osg_StateSet_P1__getQueryStateSet,
"",
"");
I_Method0(const osg::StateSet *, getQueryStateSet,
Properties::NON_VIRTUAL,
__C5_osg_StateSet_P1__getQueryStateSet,
"",
"");
I_Method1(void, setDebugStateSet, IN, osg::StateSet *, ss,
Properties::NON_VIRTUAL,
__void__setDebugStateSet__osg_StateSet_P1,
"",
"");
I_Method0(osg::StateSet *, getDebugStateSet,
Properties::NON_VIRTUAL,
__osg_StateSet_P1__getDebugStateSet,
"",
"");
I_Method0(const osg::StateSet *, getDebugStateSet,
Properties::NON_VIRTUAL,
__C5_osg_StateSet_P1__getDebugStateSet,
"",
"");
I_Method0(bool, getPassed,
@@ -164,6 +184,9 @@ BEGIN_OBJECT_REFLECTOR(osg::OcclusionQueryNode)
I_SimpleProperty(bool, DebugDisplay,
__bool__getDebugDisplay,
__void__setDebugDisplay__bool);
I_SimpleProperty(osg::StateSet *, DebugStateSet,
__osg_StateSet_P1__getDebugStateSet,
__void__setDebugStateSet__osg_StateSet_P1);
I_SimpleProperty(bool, Passed,
__bool__getPassed,
0);
@@ -173,6 +196,9 @@ BEGIN_OBJECT_REFLECTOR(osg::OcclusionQueryNode)
I_SimpleProperty(int, QueryFrameCount,
__int__getQueryFrameCount,
__void__setQueryFrameCount__int);
I_SimpleProperty(osg::StateSet *, QueryStateSet,
__osg_StateSet_P1__getQueryStateSet,
__void__setQueryStateSet__osg_StateSet_P1);
I_SimpleProperty(unsigned int, VisibilityThreshold,
__unsigned_int__getVisibilityThreshold,
__void__setVisibilityThreshold__unsigned_int);