Added NodeVisitor::INTERSECTION_VISITOR VisitorType
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14395 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -82,7 +82,8 @@ class OSG_EXPORT NodeVisitor : public virtual Object
|
|||||||
UPDATE_VISITOR,
|
UPDATE_VISITOR,
|
||||||
EVENT_VISITOR,
|
EVENT_VISITOR,
|
||||||
COLLECT_OCCLUDER_VISITOR,
|
COLLECT_OCCLUDER_VISITOR,
|
||||||
CULL_VISITOR
|
CULL_VISITOR,
|
||||||
|
INTERSECTION_VISITOR
|
||||||
};
|
};
|
||||||
|
|
||||||
NodeVisitor(TraversalMode tm=TRAVERSE_NONE);
|
NodeVisitor(TraversalMode tm=TRAVERSE_NONE);
|
||||||
|
|||||||
@@ -114,8 +114,13 @@ void Widget::updateFocus(osg::NodeVisitor& nv)
|
|||||||
|
|
||||||
if (checkWithinWidget)
|
if (checkWithinWidget)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
osgUtil::LineSegmentIntersector::Intersections intersections;
|
osgUtil::LineSegmentIntersector::Intersections intersections;
|
||||||
bool withinWidget = aa->computeIntersections(*ea, nv.getNodePath(), intersections);
|
bool withinWidget = aa->computeIntersections(*ea, nv.getNodePath(), intersections);
|
||||||
|
#else
|
||||||
|
Intersections intersections;
|
||||||
|
bool withinWidget = computeIntersections( ev, ea, intersections);
|
||||||
|
#endif
|
||||||
|
|
||||||
_hasEventFocus = withinWidget;
|
_hasEventFocus = withinWidget;
|
||||||
}
|
}
|
||||||
@@ -227,7 +232,8 @@ void Widget::traverseImplementation(osg::NodeVisitor& nv)
|
|||||||
osg::Group::traverse(nv);
|
osg::Group::traverse(nv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_visible || (nv.getVisitorType()!=osg::NodeVisitor::UPDATE_VISITOR && nv.getVisitorType()!=osg::NodeVisitor::CULL_VISITOR))
|
else if (_visible ||
|
||||||
|
(nv.getVisitorType()!=osg::NodeVisitor::UPDATE_VISITOR && nv.getVisitorType()!=osg::NodeVisitor::CULL_VISITOR && nv.getVisitorType()!=osg::NodeVisitor::INTERSECTION_VISITOR) )
|
||||||
{
|
{
|
||||||
GraphicsSubgraphMap::iterator itr = _graphicsSubgraphMap.begin();
|
GraphicsSubgraphMap::iterator itr = _graphicsSubgraphMap.begin();
|
||||||
while(itr!= _graphicsSubgraphMap.end() && itr->first<=0)
|
while(itr!= _graphicsSubgraphMap.end() && itr->first<=0)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ inline int EQUAL_F(float a, float b)
|
|||||||
|
|
||||||
|
|
||||||
CullVisitor::CullVisitor():
|
CullVisitor::CullVisitor():
|
||||||
NodeVisitor(CULL_VISITOR,TRAVERSE_ACTIVE_CHILDREN),
|
osg::NodeVisitor(CULL_VISITOR,TRAVERSE_ACTIVE_CHILDREN),
|
||||||
_currentStateGraph(NULL),
|
_currentStateGraph(NULL),
|
||||||
_currentRenderBin(NULL),
|
_currentRenderBin(NULL),
|
||||||
_traversalNumber(0),
|
_traversalNumber(0),
|
||||||
|
|||||||
@@ -179,7 +179,8 @@ void IntersectVisitor::IntersectState::addLineSegment(osg::LineSegment* seg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IntersectVisitor::IntersectVisitor()
|
IntersectVisitor::IntersectVisitor():
|
||||||
|
osg::NodeVisitor(osg::NodeVisitor::INTERSECTION_VISITOR, osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
|
||||||
{
|
{
|
||||||
|
|
||||||
// override the default node visitor mode.
|
// override the default node visitor mode.
|
||||||
|
|||||||
@@ -151,11 +151,9 @@ bool IntersectorGroup::containsIntersections()
|
|||||||
// IntersectionVisitor
|
// IntersectionVisitor
|
||||||
//
|
//
|
||||||
|
|
||||||
IntersectionVisitor::IntersectionVisitor(Intersector* intersector, ReadCallback* readCallback)
|
IntersectionVisitor::IntersectionVisitor(Intersector* intersector, ReadCallback* readCallback):
|
||||||
|
osg::NodeVisitor(osg::NodeVisitor::INTERSECTION_VISITOR, osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
|
||||||
{
|
{
|
||||||
// override the default node visitor mode.
|
|
||||||
setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
|
|
||||||
|
|
||||||
_useKdTreesWhenAvailable = true;
|
_useKdTreesWhenAvailable = true;
|
||||||
_dummyTraversal = false;
|
_dummyTraversal = false;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
using namespace osg;
|
using namespace osg;
|
||||||
using namespace osgUtil;
|
using namespace osgUtil;
|
||||||
|
|
||||||
UpdateVisitor::UpdateVisitor():NodeVisitor(UPDATE_VISITOR,TRAVERSE_ALL_CHILDREN)
|
UpdateVisitor::UpdateVisitor():
|
||||||
|
osg::NodeVisitor(osg::NodeVisitor::UPDATE_VISITOR, osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ REGISTER_OBJECT_WRAPPER( NodeVistor,
|
|||||||
ADD_ENUM_VALUE( EVENT_VISITOR );
|
ADD_ENUM_VALUE( EVENT_VISITOR );
|
||||||
ADD_ENUM_VALUE( COLLECT_OCCLUDER_VISITOR );
|
ADD_ENUM_VALUE( COLLECT_OCCLUDER_VISITOR );
|
||||||
ADD_ENUM_VALUE( CULL_VISITOR );
|
ADD_ENUM_VALUE( CULL_VISITOR );
|
||||||
|
ADD_ENUM_VALUE( INTERSECTION_VISITOR );
|
||||||
END_ENUM_SERIALIZER();
|
END_ENUM_SERIALIZER();
|
||||||
|
|
||||||
ADD_UINT_SERIALIZER(TraversalMask, 0xffffffff);
|
ADD_UINT_SERIALIZER(TraversalMask, 0xffffffff);
|
||||||
|
|||||||
Reference in New Issue
Block a user