19 #include <osgUtil/IntersectVisitor>
22 #include <osgUtil/LineSegmentIntersector>
24 #include <matrix/vlVector.h>
39 class DtOsgIntersectionVisitor;
108 virtual bool findNearestIntersectionToPoint(
double x,
double y,
double z,
109 double vx,
double vy,
double vz,
112 std::vector<DtElementID>* ignoreList=0,
113 bool returnTriangle=
false,
114 double maxIsectorLength=-1.,
bool useHighLod=
false );
123 virtual bool findAllIntersectionsThroughPoint(
double x,
double y,
double z,
126 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
134 virtual bool findFirstIntersectWithLineSegment(
135 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
138 std::vector<DtElementID>* ignoreList=0,
bool useHighLod=
false);
146 virtual bool findAllIntersectWithLineSegment(
147 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
150 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
157 virtual bool pick(
DtChannel& channel,
double mx,
double my,
160 std::vector<DtElementID>* ignoreList=0);
166 virtual bool pickAll(
DtChannel* channel,
double mx,
double my,
168 std::vector<DtElementID>* ignoreList=0);
212 virtual bool findNearestIntersection(
double x,
double y,
double z,
217 double maxIsectorLength=-1.0,
bool useHighLod=
false );
232 virtual bool findIntersectionsThroughPoint(
double x,
double y,
double z,
233 double vx,
double vy,
double vz,
238 double maxIsectorLength=-1.0,
bool sort=
true,
bool useHighLod=
false );
245 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
246 double end_x,
double end_y,
double end_z,
251 bool returnHitTriangle=
false,
bool useHighLod=
false );
258 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
259 double end_x,
double end_y,
double end_z,
264 bool returnHitTriangle=
false,
bool sort=
true,
bool useHighLod=
false );
268 virtual bool pick( osgViewer::View& view,
double mx,
double my,
272 bool returnHitTriangle=
false );
276 virtual bool pick( osgViewer::View& view,
double mx,
double my,
280 bool returnHitTriangle=
false );
284 static osg::Node::NodeMask nodeMaskFromIntersectProperties(
287 static bool anyNodeInNodePath(std::list<osg::Node*>* n,
288 osg::NodePath
const& path);
295 virtual bool calcEndpointsFromDirectionAndLength(
double x,
double y,
296 double z,
double vx,
double vy,
double vz,
double length,
300 void getExcludeNodesFromIgnoreList( std::vector<DtUniqueID>* ignoreList,
305 osg::Vec3d worldIntersectPoint(
const osgUtil::Hit& hit );
307 osg::Vec3d worldIntersectPoint(
308 const osgUtil::LineSegmentIntersector::Intersection& hit );
310 osg::Vec3d localToWorld(
const osg::Vec3& local,
const osg::Matrix& localToWorld );
312 bool findIdFromNodePath(
const osg::NodePath& nodePath,
DtUniqueID&
id );
316 osg::Camera * getActiveCamera(osgViewer::View& view);
324 const osgUtil::LineSegmentIntersector::Intersection& hit,
325 bool returnHitTriangle ) ;
329 void doLineSegmentIntersections(
330 osgUtil::IntersectionVisitor& collisionVisitor,
334 bool processLineSegmentIntersection(
335 osgUtil::LineSegmentIntersector::Intersections& hitList,
340 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
341 osgUtil::LineSegmentIntersector::Intersections& hitList,
346 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
347 osgUtil::LineSegmentIntersector::Intersections& hitList,
352 bool processPickIntersection(
353 osgUtil::LineSegmentIntersector::Intersections& hitList,
358 bool processPickIntersection(
359 osgUtil::LineSegmentIntersector::Intersections& hitList,
369 bool shouldInstanceIntersect(osg::Node::NodeMask nodeMask);
389 return diffA.length2() < diffB.length2();