You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.4 KiB
C++

#ifndef OSGUTIL_XJSimplePolytopeIntersector
#define OSGUTIL_XJSimplePolytopeIntersector
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/PolytopeIntersector>
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