VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSimpleIntersector.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
10 
11 #pragma once
12 
13 #include <vrvCore/vrvCore.h>
14 #include <vrvCore/DtUniqueID.h>
15 #include <vrvCore/DtIntersector.h>
16 
19 
20 #include <vector>
21 
22 #include <matrix/vlVector.h>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtIntersectorsContainer;
28  class DtCoordinateSystem;
29 
34  {
35  public:
37 #if 0
38  DtSimpleIntersectorResult( double cx, double cy, double cz,
39  double cnormalX, double cnormalY, double cnormalZ,
40  const DtUniqueID& cid, unsigned int celementType);
41 #endif
43  DtSimpleIntersectorResult& operator=( const DtSimpleIntersectorResult& orig );
44 
45  public:
46  // Actually a DtElementEntry::ElementType
47  unsigned int elementType;
48  };
49 
56  {
57  public:
59  static DtSimpleIntersector& instance(DtDe& de);
60 
62  static void registerInstance(DtDe& de, DtSimpleIntersector* anInstance);
63 
65  virtual ~DtSimpleIntersector();
66 
69  virtual double heightAboveTerrain(
70  const DtVector& loc,
72  int modelSet=0,
73  bool useHighLod=false,
74  bool includeEntities=false,
75  std::vector<DtElementID>* ignoreList=0
76  );
77 
78  virtual double heightAboveTerrain(
79  DtElementID element,
81  int modelSet=0,
82  bool useHighLod=false,
83  bool includeEntities=false,
84  std::vector<DtElementID>* ignoreList=0
85  );
86 
90  virtual double heightOfTerrain(
91  const DtVector& loc,
93  int modelSet=0,
94  bool useHighLod=false);
95 
99  virtual bool hasLineOfSight(
100  const DtVector& fromLoc,
101  const DtVector& toLoc,
103  int modelSet=0,
104  bool useHighLod=false,
105  bool includeEntities=false,
106  std::vector<DtElementID>* ignoreList=0);
107 
108  virtual bool hasLineOfSight(
109  DtElementID fromElem,
110  DtElementID toElem,
112  int modelSet=0,
113  bool useHighLod=false,
114  bool includeEntities=false,
115  std::vector<DtElementID>* ignoreList=0);
116 
117  protected:
119 
121  virtual DtUniqueID sceneObjectIdFromElementId(
122  DtElementID element, int modelSet);
123 
125  virtual DtVector positionFromSceneObjectId(DtUniqueID sceneObjectId);
126 
129  virtual bool getTerrainIntersection(
130  const DtVector& loc,
131  DtIntersectorResult& result,
132  int modelSet=0,
133  bool useHighLod=false,
134  bool includeEntities=false,
135  std::vector<DtElementID>* ignoreList=0);
136 
137  virtual void fillInElementType(DtSimpleIntersectorResult& result);
138 
140  virtual void slot_coordinateSystemChanged();
141 
142 
143  protected:
145  DtIntersectorsContainer* myIntersectors = nullptr;
146 
148 
151  DtCoordinateSystem* myCoordinateSystem = nullptr;
152 
153  };
154 }
DtDe & myDe
Definition: DtSimpleIntersector.h:144
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Utility class that contains intersectors for all model sets in the system (3d, xr, 2d) Use an object of this class when all models sets can be possibly needed. When you know which model set you need, you can just use the DtIntersectorCreator to create an intersector for a model set Models sets corresponding to 3d, xr and 2d are created by default (these correspond to values of 0, 1 and 5) Additional model sets can be registered with DtIntersectorsContainer::registerModelSet.
Definition: DtIntersectorsContainer.h:36
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
DtSimpleIntersectorResult is the DtSimpleIntersector-specific result class. It adds the element type ...
Definition: DtSimpleIntersector.h:33
DtSignalConnectionManager myConnections
Definition: DtSimpleIntersector.h:147
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv:DtIntersector class.
unsigned int elementType
Definition: DtSimpleIntersector.h:47
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtSimpleIntersector is a higher-level intersector class which adds functions for line of sight...
Definition: DtSimpleIntersector.h:55
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:41
Base class to provide boost signal/slot management.
Contains makVrv::DtUniqueID type.
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:70
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)