14 #ifndef OSGUTIL_INTERSECTIONVISITOR
15 #define OSGUTIL_INTERSECTIONVISITOR 1
17 #include <osg/NodeVisitor>
18 #include <osg/Drawable>
19 #include <osgUtil/Export>
27 class IntersectionVisitor;
72 virtual void leave() = 0;
133 virtual bool enter(
const osg::Node& node);
135 virtual void leave();
139 virtual void reset();
141 virtual bool containsIntersections();
171 virtual
void reset();
178 Intersector* getIntersector() {
return _intersectorStack.empty() ? 0 : _intersectorStack.front().get(); }
245 USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION
256 virtual float getDistanceToEyePoint(
const osg::Vec3& pos,
bool withLODScale)
const;
273 inline bool enter(
const osg::Node& node) {
return _intersectorStack.empty() ?
false : _intersectorStack.back()->enter(node); }
274 inline void leave() { _intersectorStack.back()->leave(); }
276 inline void push_clone() { _intersectorStack.push_back ( _intersectorStack.front()->clone(*
this) ); }
277 inline void pop_clone() {
if (_intersectorStack.size()>=2) _intersectorStack.pop_back(); }
bool getUseKdTreeWhenAvailable() const
CoordinateFrame _coordinateFrame
Intersector::CoordinateFrame _referenceEyePointCoordinateFrame
void pushModelMatrix(osg::RefMatrix *matrix)
unsigned int _disabledCount
void setPrecisionHint(PrecisionHint hint)
LODSelectionMode getLODSelectionMode() const
ReadCallback * getReadCallback()
void intersect(osg::Drawable *drawable)
void decrementDisabledCount()
std::vector< osg::ref_ptr< Intersector > > Intersectors
virtual Intersector * clone(osgUtil::IntersectionVisitor &iv)=0
PrecisionHint getPrecisionHint() const
osg::RefMatrix * getProjectionMatrix()
IntersectorStack _intersectorStack
MatrixStack _projectionStack
const osg::Matrix computeWindowMatrix() const
const ReadCallback * getReadCallback() const
Intersector(CoordinateFrame cf=MODEL, IntersectionLimit il=NO_LIMIT)
Intersectors _intersectors
const osg::RefMatrix * getViewMatrix() const
Intersector::CoordinateFrame getReferenceEyePointCoordinateFrame() const
virtual bool containsIntersections()=0
bool getDoDummyTraversal() const
virtual bool enter(const osg::Node &node)=0
T * clone(const T *t, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void intersect(osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)=0
void setReferenceEyePointCoordinateFrame(Intersector::CoordinateFrame cf)
void popProjectionMatrix()
void pushViewMatrix(osg::RefMatrix *matrix)
const osg::Vec3 & getReferenceEyePoint() const
const osg::RefMatrix * getProjectionMatrix() const
void pushWindowMatrix(osg::RefMatrix *matrix)
void setUseKdTreeWhenAvailable(bool useKdTrees)
Intersectors & getIntersectors()
void pushProjectionMatrix(osg::RefMatrix *matrix)
bool _useKdTreesWhenAvailable
void setDoDummyTraversal(bool dummy)
#define META_NodeVisitor(library, name)
std::list< osg::ref_ptr< Intersector > > IntersectorStack
IntersectionLimit getIntersectionLimit() const
void pushWindowMatrix(osg::Viewport *viewport)
const Intersector * getIntersector() const
const osg::RefMatrix * getWindowMatrix() const
osg::RefMatrix * getWindowMatrix()
bool enter(const osg::Node &node)
std::list< osg::ref_ptr< osg::RefMatrix > > MatrixStack
const osg::RefMatrix * getModelMatrix() const
void setCoordinateFrame(CoordinateFrame cf)
void setReferenceEyePoint(const osg::Vec3 &ep)
OSGDB_EXPORT osg::Node * readNodeFile(const std::string &filename, const Options *options)
void incrementDisabledCount()
osg::ref_ptr< ReadCallback > _readCallback
osg::RefMatrix * getModelMatrix()
CoordinateFrame getCoordinateFrame() const
PrecisionHint _precisionHint
osg::Vec3 _referenceEyePoint
void setReadCallback(ReadCallback *rc)
IntersectionLimit _intersectionLimit
LODSelectionMode _lodSelectionMode
void setIntersectionLimit(IntersectionLimit limit)
osg::RefMatrix * getViewMatrix()
void setLODSelectionMode(LODSelectionMode mode)
Shader generator framework.