#ifndef OSGUTIL_XJSimplePolytopeIntersector #define OSGUTIL_XJSimplePolytopeIntersector #include #include namespace osgUtil { //此求交器只用来计算多边形内部选中的对象,更深层的信息不计算 class XJSimplePolytopeIntersector : public PolytopeIntersector { public: /** Construct a XJPolytopeIntersector using specified polytope in MODEL coordinates.*/ XJSimplePolytopeIntersector(const osg::Polytope& polytope); /** Construct a XJPolytopeIntersector using specified polytope in specified coordinate frame.*/ XJSimplePolytopeIntersector(CoordinateFrame cf, const osg::Polytope& polytope); /** Convenience constructor for supporting picking in WINDOW, or PROJECTION coordinates * In WINDOW coordinates (clip space cube) creates a five sided polytope box that has a front face at 0.0 and sides around box xMin, yMin, xMax, yMax. * In PROJECTION coordinates (clip space cube) creates a five sided polytope box that has a front face at -1 and sides around box xMin, yMin, xMax, yMax. * In VIEW and MODEL coordinates (clip space cube) creates a five sided polytope box that has a front face at 0.0 and sides around box xMin, yMin, xMax, yMax.*/ XJSimplePolytopeIntersector(CoordinateFrame cf, double xMin, double yMin, double xMax, double yMax); virtual void intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable); private: int m_num; }; } // end namespace #endif