20 #include <osgUtil/IntersectVisitor>
23 #include <osgUtil/LineSegmentIntersector>
40 class DtOsgIntersectVisitor;
52 double normalY,
double normalZ,
const DtUniqueID&
id,
53 std::vector<osg::Vec3> triangle, osg::Matrixd localToWorld );
97 virtual bool findNearestIntersectionToPoint(
double x,
double y,
double z,
98 double vx,
double vy,
double vz,
101 std::vector<DtElementID>* ignoreList=0,
102 bool returnTriangle=
false,
103 double maxIsectorLength=-1.,
bool useHighLod=
false );
112 virtual bool findAllIntersectionsThroughPoint(
double x,
double y,
double z,
115 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
123 virtual bool findFirstIntersectWithLineSegment(
124 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
127 std::vector<DtElementID>* ignoreList=0,
bool useHighLod=
false);
135 virtual bool findAllIntersectWithLineSegment(
136 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
139 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
146 virtual bool pick(
DtChannel& channel,
double mx,
double my,
149 std::vector<DtElementID>* ignoreList=0);
155 virtual bool pickAll(
DtChannel* channel,
double mx,
double my,
157 std::vector<DtElementID>* ignoreList=0);
185 virtual bool findNearestIntersection(
double x,
double y,
double z,
189 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
190 double maxIsectorLength=-1.0,
bool useHighLod=
false );
205 virtual bool findIntersectionsThroughPoint(
double x,
double y,
double z,
206 double vx,
double vy,
double vz,
210 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
211 double maxIsectorLength=-1.0,
bool sort=
true,
bool useHighLod=
false );
218 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
219 double end_x,
double end_y,
double end_z,
223 std::list<osg::Node*>* excludeNodeList=0,
224 bool returnHitTriangle=
false,
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 sort=
true,
bool useHighLod=
false );
241 virtual bool pick( osgViewer::View& view,
double mx,
double my,
244 std::list<osg::Node*>* excludeNodeList=0,
245 bool returnHitTriangle=
false );
249 virtual bool pick( osgViewer::View& view,
double mx,
double my,
252 std::list<osg::Node*>* excludeNodeList=0,
253 bool returnHitTriangle=
false );
257 static osg::Node::NodeMask nodeMaskFromIntersectProperties(
260 static bool anyNodeInNodePath(std::list<osg::Node*>* n,
261 osg::NodePath
const& path);
268 virtual bool calcEndpointsFromDirectionAndLength(
double x,
double y,
269 double z,
double vx,
double vy,
double vz,
double length,
273 void getExcludeNodesFromIgnoreList( std::vector<DtUniqueID>* ignoreList,
274 std::list<osg::Node*>& excludeNodes );
278 osg::Vec3d worldIntersectPoint(
const osgUtil::Hit& hit );
280 osg::Vec3d worldIntersectPoint(
281 const osgUtil::LineSegmentIntersector::Intersection& hit );
283 osg::Vec3d localToWorld(
const osg::Vec3& local,
const osg::Matrix& localToWorld );
285 bool findIdFromNodePath(
const osg::NodePath& nodePath,
DtUniqueID&
id );
289 osg::Camera * getActiveCamera(osgViewer::View& view);
297 bool returnHitTriangle ) ;
301 const osgUtil::LineSegmentIntersector::Intersection& hit,
302 bool returnHitTriangle ) ;
306 osgUtil::IntersectVisitor::HitList& getLineSegmentIntersection(
307 osgUtil::IntersectVisitor& collisionVisitor,
double x,
double y,
double z,
308 double end_x,
double end_y,
double end_z,
312 bool processLineSegmentIntersection(
313 osgUtil::IntersectVisitor::HitList& hitList,
314 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
318 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
319 osgUtil::IntersectVisitor::HitList& hitList,
320 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
324 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
325 osgUtil::IntersectVisitor::HitList& hitList,
326 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
330 bool processPickIntersection(
331 osgUtil::LineSegmentIntersector::Intersections& hitList,
332 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
336 bool processPickIntersection(
337 osgUtil::LineSegmentIntersector::Intersections& hitList,
338 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
347 bool shouldInstanceIntersect(osg::Node::NodeMask nodeMask);
367 return diffA.length2() > diffB.length2();