20 #include <osgUtil/IntersectVisitor>
23 #include <osgUtil/LineSegmentIntersector>
40 class DtOsgIntersectVisitor;
69 DtOsgDrawnIntersector(
DtDe& de );
70 virtual ~DtOsgDrawnIntersector();
110 virtual bool findNearestIntersectionToPoint(
double x,
double y,
double z,
111 double vx,
double vy,
double vz,
114 std::vector<DtElementID>* ignoreList=0,
115 bool returnTriangle=
false,
116 double maxIsectorLength=-1.,
bool useHighLod=
false );
125 virtual bool findAllIntersectionsThroughPoint(
double x,
double y,
double z,
128 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
136 virtual bool findFirstIntersectWithLineSegment(
137 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
140 std::vector<DtElementID>* ignoreList=0,
bool useHighLod=
false);
148 virtual bool findAllIntersectWithLineSegment(
149 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
152 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
159 virtual bool pick(
DtChannel& channel,
double mx,
double my,
162 std::vector<DtElementID>* ignoreList=0);
168 virtual bool pickAll(
DtChannel* channel,
double mx,
double my,
170 std::vector<DtElementID>* ignoreList=0);
198 virtual bool findNearestIntersection(
double x,
double y,
double z,
202 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
203 double maxIsectorLength=-1.0,
bool useHighLod=
false );
218 virtual bool findIntersectionsThroughPoint(
double x,
double y,
double z,
219 double vx,
double vy,
double vz,
223 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
224 double maxIsectorLength=-1.0,
bool sort=
true,
bool useHighLod=
false );
231 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
232 double end_x,
double end_y,
double end_z,
236 std::list<osg::Node*>* excludeNodeList=0,
237 bool returnHitTriangle=
false,
bool useHighLod=
false );
244 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
245 double end_x,
double end_y,
double end_z,
249 std::list<osg::Node*>* excludeNodeList=0,
250 bool returnHitTriangle=
false,
bool sort=
true,
bool useHighLod=
false );
254 virtual bool pick( osgViewer::View& view,
double mx,
double my,
257 std::list<osg::Node*>* excludeNodeList=0,
258 bool returnHitTriangle=
false );
262 virtual bool pick( osgViewer::View& view,
double mx,
double my,
265 std::list<osg::Node*>* excludeNodeList=0,
266 bool returnHitTriangle=
false );
270 static osg::Node::NodeMask nodeMaskFromIntersectProperties(
273 static bool anyNodeInNodePath(std::list<osg::Node*>* n,
274 osg::NodePath
const& path);
281 virtual bool calcEndpointsFromDirectionAndLength(
double x,
double y,
282 double z,
double vx,
double vy,
double vz,
double length,
286 void getExcludeNodesFromIgnoreList( std::vector<DtUniqueID>* ignoreList,
287 std::list<osg::Node*>& excludeNodes );
291 osg::Vec3d worldIntersectPoint(
const osgUtil::Hit& hit );
293 osg::Vec3d worldIntersectPoint(
294 const osgUtil::LineSegmentIntersector::Intersection& hit );
296 osg::Vec3d localToWorld(
const osg::Vec3& local,
const osg::Matrix& localToWorld );
298 bool findIdFromNodePath(
const osg::NodePath& nodePath,
DtUniqueID&
id );
302 osg::Camera * getActiveCamera(osgViewer::View& view);
310 bool returnHitTriangle ) ;
314 const osgUtil::LineSegmentIntersector::Intersection& hit,
315 bool returnHitTriangle ) ;
319 osgUtil::IntersectVisitor::HitList& getLineSegmentIntersection(
320 osgUtil::IntersectVisitor& collisionVisitor,
double x,
double y,
double z,
321 double end_x,
double end_y,
double end_z,
325 bool processLineSegmentIntersection(
326 osgUtil::IntersectVisitor::HitList& hitList,
327 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
331 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
332 osgUtil::IntersectVisitor::HitList& hitList,
333 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
337 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
338 osgUtil::IntersectVisitor::HitList& hitList,
339 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
343 bool processPickIntersection(
344 osgUtil::LineSegmentIntersector::Intersections& hitList,
345 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
349 bool processPickIntersection(
350 osgUtil::LineSegmentIntersector::Intersections& hitList,
351 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
360 bool shouldInstanceIntersect(osg::Node::NodeMask nodeMask);
380 return diffA.length2() < diffB.length2();