20 #include <osgUtil/LineSegmentIntersector>
21 #include <osgUtil/IntersectVisitor>
25 #include <matrix/vlVector.h>
42 class DtOsgIntersectionVisitor;
100 virtual bool findNearestIntersectionToPoint(
double x,
double y,
double z,
101 double vx,
double vy,
double vz,
104 std::vector<DtElementID>* ignoreList=0,
105 bool returnTriangle=
false,
106 double maxIsectorLength=-1.,
bool useHighLod=
false )
const override;
115 virtual bool findAllIntersectionsThroughPoint(
double x,
double y,
double z,
118 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false )
const override;
126 virtual bool findFirstIntersectWithLineSegment(
127 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
130 std::vector<DtElementID>* ignoreList=0,
bool useHighLod=
false)
const override;
138 virtual bool findAllIntersectWithLineSegment(
139 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
142 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false )
const override;
149 virtual bool pick(
DtChannel& channel,
double mx,
double my,
152 std::vector<DtElementID>* ignoreList=0)
override;
158 virtual bool pickAll(
DtChannel* channel,
double mx,
double my,
160 std::vector<DtElementID>* ignoreList=0)
override;
204 virtual bool findNearestIntersection(
double x,
double y,
double z,
209 double maxIsectorLength=-1.0,
bool useHighLod=
false )
const;
224 virtual bool findIntersectionsThroughPoint(
double x,
double y,
double z,
225 double vx,
double vy,
double vz,
230 double maxIsectorLength=-1.0,
bool sort=
true,
bool useHighLod=
false )
const;
237 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
238 double end_x,
double end_y,
double end_z,
243 bool returnHitTriangle=
false,
bool useHighLod=
false )
const;
250 virtual bool intersectLineSegmentWithScene(
double x,
double y,
double z,
251 double end_x,
double end_y,
double end_z,
256 bool returnHitTriangle=
false,
bool sort=
true,
bool useHighLod=
false )
const;
260 virtual bool pick(
const osgViewer::View& view,
double mx,
double my,
264 bool returnHitTriangle=
false );
268 virtual bool pick(
const osgViewer::View& view,
double mx,
double my,
272 bool returnHitTriangle=
false );
276 static osg::Node::NodeMask nodeMaskFromIntersectProperties(
279 static bool anyNodeInNodePath(std::list<osg::Node*>* n,
280 osg::NodePath
const& path);
287 virtual bool calcEndpointsFromDirectionAndLength(
double x,
double y,
288 double z,
double vx,
double vy,
double vz,
double length,
290 DtVector& endPoint )
const;
292 virtual void calculateStartEnd(DtVector& start, DtVector& end
293 ,
const osgViewer::View& view,
double mx,
double my)
const;
295 virtual void calculateStartEnd(DtVector& start, DtVector& end
296 ,
const osg::Camera* osgCamera,
double mx,
double my)
const;
300 virtual const osg::Camera * getActiveCamera(
const osgViewer::View& view)
const;
302 void getExcludeNodesFromIgnoreList( std::vector<DtUniqueID>* ignoreList,
307 osg::Vec3d worldIntersectPoint(
const osgUtil::Hit& hit )
const;
309 osg::Vec3d worldIntersectPoint(
310 const osgUtil::LineSegmentIntersector::Intersection& hit )
const;
312 osg::Vec3d localToWorld(
const osg::Vec3& local,
const osg::Matrix& localToWorld )
const;
314 bool findIdFromNodePath(
const osg::NodePath& nodePath,
DtUniqueID&
id )
const;
322 const osgUtil::LineSegmentIntersector::Intersection& hit,
323 bool returnHitTriangle )
const;
327 void doLineSegmentIntersections(
328 osgUtil::IntersectionVisitor& collisionVisitor,
329 const DtSceneRootList& intersectionRoots, osg::Node::NodeMask mask)
const;
332 bool processLineSegmentIntersection(
333 osgUtil::LineSegmentIntersector::Intersections& hitList,
338 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
339 osgUtil::LineSegmentIntersector::Intersections& hitList,
344 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
345 osgUtil::LineSegmentIntersector::Intersections& hitList,
350 bool processPickIntersection(
351 osgUtil::LineSegmentIntersector::Intersections& hitList,
356 bool processPickIntersection(
357 osgUtil::LineSegmentIntersector::Intersections& hitList,
367 bool shouldInstanceIntersect(osg::Node::NodeMask nodeMask)
const;
384 return diffA.length2() < diffB.length2();
IntersectProperties
The IntersectProperties enum is a flag set that indicates the types of nodes to be considered for int...
Definition: DtIntersector.h:31
DtOsgIntersectorSorter(const osg::Vec3d &reference)
Definition: DtOsgIntersector.h:376
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:135
DtOsgIntersectVisitor checks to see if it is visiting a a DtTerrainPatchGroup and if so...
Definition: DtOsgIntersectionVisitor.h:24
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:25
Contains makVrv:DtOsgNodeTraversalFlags class.
DtOsgIntersector is the OSG-specific implementation of the DtIntersector class. It provides a variety...
Definition: DtOsgIntersector.h:66
DtOsgIntersectorResult is the OSG-specific implementation of DtIntersectorResult; it is a container c...
Definition: DtOsgIntersectorResult.h:25
osg::Vec3d myReference
Definition: DtOsgIntersector.h:387
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
std::vector< DtOsgIntersectorResult > DtOsgIntersections
Note that even with intersection debug drawing enabled, these OSG-specific functions do not result in...
Definition: DtOsgIntersector.h:181
std::vector< DtIntersectorResult > DtIntersections
A vector of DtIntersectionRecords.
Definition: DtIntersector.h:50
bool operator()(const DtOsgIntersectorResult &a, const DtOsgIntersectorResult &b) const
Definition: DtOsgIntersector.h:379
Contains makVrv::DtIntersectorCreator class.
double y
y coordinate, in database coordinates of the intersection
Definition: DtIntersectorResult.h:57
static const unsigned int FlagAllOn
Nodemask bitflag definitions.
Definition: DtOsgNodeTraversalFlags.h:19
The abstract Channel Class.
Definition: DtChannel.h:35
Contains makVrv:DtIntersector class.
double z
z coordinate, in database coordinates of the intersection
Definition: DtIntersectorResult.h:60
DtOsgItersectorExclusions is a list of osg nodes from the scene graph and a list of element IDs to ex...
Definition: DtOsgIntersector.h:53
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::list< DtUniqueID > myExcludeIds
Definition: DtOsgIntersector.h:56
DT_DLL_vrfutil bool intersection(const DtRailSegment *currentSegment, const DtRailSegment *nextSegment)
Given two segments, determine if where they meet is an intersection or just a bend in the road...
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
Abstract creator base class.
Definition: DtOsgIntersector.h:392
double x
x coordinate, in database coordinates of the intersection
Definition: DtIntersectorResult.h:54
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Abstract creator base class.
Definition: DtIntersectorCreator.h:24
DtModelSetId
Definition: DtModelSetEnums.h:19
Contains makVrv::DtOsgRenderer class.
std::list< osg::Node * > myExcludeNodes
Definition: DtOsgIntersector.h:57
DtOsgIntersectorSorter provides an operator for comparing the the distances between 2 osg::vectors an...
Definition: DtOsgIntersector.h:373