VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIntersector.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
15 
16 #include <vector>
17 
18 namespace makVrv
19 {
20  class DtDe;
21  class DtChannel;
22 
27  {
28  public:
29 
33  {
34  AllNodes = 0,
35  PickableNodes = 1,
36  SupportNodes = 2,
37  NodesThatReceivesShadows = 4,
38  NodesThatCastsShadows = 8,
39  OsgEarthTerrainSkin = 16,
40  TerrainPatchInsetNotOsgEarth = 32
41  };
42 
44  {
45  DynamicOceanPropertyMsl = 0,
46  DynamicOceanPropertyWaves = 1,
47  DynamicOceanPropertyIgnore = 2
48  };
49 
51  typedef std::vector<DtIntersectorResult> DtIntersections;
52 
54  DtIntersector( DtDe& de, DtModelSetId modelSet );
55 
57  virtual ~DtIntersector();
58 
61  virtual void setDynamicOceanProperties( DynamicOceanProperties properties );
62 
65  virtual void slot_setDynamicOceanProperties( int type, bool onOff );
66 
68  virtual DynamicOceanProperties dynamicOceanProperties() const;
69 
84  virtual bool findNearestIntersectionToPoint(double x, double y, double z,
85  double vx, double vy, double vz, DtIntersectorResult& intersection,
86  IntersectProperties properties = AllNodes,
87  std::vector<DtElementID>* ignoreList = 0, bool returnTriangle = false,
88  double maxIsectorLength = -1., bool useHighLod = false ) const = 0;
89 
97  virtual bool findAllIntersectionsThroughPoint( double x, double y, double z,
98  double vx, double vy, double vz, DtIntersections& intersections,
99  IntersectProperties properties = AllNodes,
100  std::vector<DtElementID>* ignoreList = 0, bool sort = true,
101  bool useHighLod = false ) const = 0;
102 
109  virtual bool findFirstIntersectWithLineSegment(
110  double x, double y, double z, double end_x, double end_y, double end_z,
112  IntersectProperties properties=AllNodes,
113  std::vector<DtElementID>* ignoreList=0,
114  bool useHighLod = false) const = 0;
115 
122  virtual bool findAllIntersectWithLineSegment(
123  double x, double y, double z, double end_x, double end_y, double end_z,
124  DtIntersections& intersections,
125  IntersectProperties properties=AllNodes,
126  std::vector<DtElementID>* ignoreList=0, bool sort=true,
127  bool useHighLod = false ) const = 0;
128 
134  virtual bool pick( DtChannel& channel, double mx, double my,
136  IntersectProperties properties=AllNodes,
137  std::vector<DtElementID>* ignoreList=0) = 0;
138 
143  virtual bool pickAll( DtChannel* channel, double mx, double my,
144  DtIntersections& intersections,
145  IntersectProperties properties=AllNodes,
146  std::vector<DtElementID>* ignoreList=0) = 0;
147 
149  virtual void setDefaultMaxClamp(double maximumIsectorLength);
157  virtual double defaultMaxClamp() const;
159 
160  virtual DtModelSetId modelSet(void) const;
161 
162  protected:
165 
168  struct CachedPick
169  {
171  : simTime(0.0)
172  , channel(0)
173  , mx(0)
174  , my(0)
175  , properties(DtIntersector::AllNodes)
176  , ignoreList(0)
177  {
178  }
179 
180  bool operator==(const CachedPick& b) const
181  {
182  return simTime == b.simTime &&
183  channel == b.channel &&
184  mx == b.mx &&
185  my == b.my &&
186  properties == b.properties &&
187  ignoreList == b.ignoreList;
188  }
189 
190  double simTime;
192  double mx;
193  double my;
195  std::vector<DtElementID>* ignoreList;
196  };
197 
202 
204 
207 
208  };
209 }
IntersectProperties
The IntersectProperties enum is a flag set that indicates the types of nodes to be considered for int...
Definition: DtIntersector.h:32
IntersectProperties properties
Definition: DtIntersector.h:194
DtIntersectorResult myLastResult
Definition: DtIntersector.h:200
CachedPick()
Definition: DtIntersector.h:170
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:26
CachedPick myLastPick
Definition: DtIntersector.h:198
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
std::vector< DtIntersectorResult > DtIntersections
A vector of DtIntersectionRecords.
Definition: DtIntersector.h:51
Contains makVrv::DtIntersectorCreator class.
DtDe & myDe
Definition: DtIntersector.h:163
DtSignalConnectionManager myConnections
Auto-disconnects on destruction; avoids singleton lookups in the DTOR.
Definition: DtIntersector.h:206
const DtModelSetId myModelSet
Definition: DtIntersector.h:203
DynamicOceanProperties
Definition: DtIntersector.h:43
bool myLastPickSucceeded
Definition: DtIntersector.h:199
The abstract Channel Class.
Definition: DtChannel.h:35
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double simTime
Definition: DtIntersector.h:190
double mx
Definition: DtIntersector.h:192
DynamicOceanProperties myDynamicOceanProperties
Definition: DtIntersector.h:164
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...
Base class to provide boost signal/slot management.
CachedPick is a container class for the information to cache a pick request.
Definition: DtIntersector.h:168
double myDefaultMaxClamp
Definition: DtIntersector.h:201
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
double my
Definition: DtIntersector.h:193
DtModelSetId
Definition: DtModelSetEnums.h:19
bool operator==(const CachedPick &b) const
Definition: DtIntersector.h:180
std::vector< DtElementID > * ignoreList
Definition: DtIntersector.h:195
DtChannel * channel
Definition: DtIntersector.h:191
Contains DLL export macros.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)