IDTM.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
10 
11 
13 
15 
16 /*=================================================================================**/
20 struct IDTMDrapedLinePoint abstract : IRefCounted
21 {
22 public:
26  BENTLEYDTM_EXPORT DTMStatusInt GetPointCoordinates (DPoint3d& coordP) const;
29  BENTLEYDTM_EXPORT double GetDistanceAlong () const;
33 };
34 
35 /*=================================================================================**/
39 struct IDTMDrapedLine abstract : IRefCounted
40 {
41 public:
53  BENTLEYDTM_EXPORT DTMStatusInt GetPointByIndex (DPoint3dR ptP, double* distanceP, DTMDrapedLineCode* codeP, unsigned int index) const;
56  BENTLEYDTM_EXPORT unsigned int GetPointCount() const;
57 };
58 
60  {
61  DTMRayIntersection() { isOnMesh = true; hasNormal = false; rayFraction = 0; }
62  DPoint3d point; // intersection point
63  DVec3d normal; // normal on point if exists
64  bool isOnMesh; // is it on the mesh or on Node
65  bool hasNormal; // normal exists ?
66  double rayFraction; // the distance from point to the Ray source along Ray direction
67  };
68 
72  return (pt1.rayFraction < pt2.rayFraction);
73  }
74  };
75 
76 /*=================================================================================**/
80 struct IDTMDraping abstract
81 {
82 public:
91 BENTLEYDTM_EXPORT DTMStatusInt DrapePoint (double* elevation, double* slope, double* aspect, DPoint3d triangle[3], int& drapedType, DPoint3dCR point);
97 BENTLEYDTM_EXPORT DTMStatusInt DrapeLinear(DTMDrapedLinePtr& ret, const DPoint3d pts[], int numPoints);
98 
103 BENTLEYDTM_EXPORT bool ProjectPoint(DPoint3dR pointOnDTM, DMatrix4dCR w2vMap, DPoint3dCR testPoint);
104 
109 BENTLEYDTM_EXPORT bool IntersectRay(DPoint3dR pointOnDTM, DVec3dCR direction, DPoint3dCR testPoint);
110 
115 BENTLEYDTM_EXPORT bool IntersectRay(bvector<DTMRayIntersection>& hitsOnDTM, DVec3dCR direction, DPoint3dCR testPoint);
116 
127 BENTLEYDTM_EXPORT bool DrapeAlongVector(DPoint3d* endPt, double *slope, double *aspect, DPoint3d triangle[3], int *drapedType, DPoint3dCR point, double directionOfVector, double slopeOfVector);
128 
129  };
130 
131 /*=================================================================================**/
135 struct IDTMDrainageFeature abstract : IRefCounted
136 {
137  public:
156 };
157 
158 /*=================================================================================**/
162 struct IDTMContouring abstract
163 {
164 public:
173 BENTLEYDTM_EXPORT DTMStatusInt ContourAtPoint (DTMPointArray& ret, DPoint3dCR pt,double contourInterval, DTMContourSmoothing smoothOption, double smoothFactor, int smoothDensity, const DTMFenceParams& fence);
181 BENTLEYDTM_EXPORT DTMStatusInt ContourAtPoint (DTMPointArray& ret, DPoint3dCR pt,double contourInterval, DTMContourSmoothing smoothOption, double smoothFactor, int smoothDensity);
182 };
183 
184 
185 /*=================================================================================**/
189 struct IDTMVolume abstract
190 {
191 public:
198  BENTLEYDTM_EXPORT DTMStatusInt ComputeCutFillVolume(double* cut, double* fill, double* volume, PolyfaceHeaderCP mesh);
199 
206  BENTLEYDTM_EXPORT DTMStatusInt ComputeCutFillVolumeClosed(double* cut, double* fill, double* volume, PolyfaceHeaderCP mesh);
207 
212 
215 };
216 /*=================================================================================**/
221 typedef std::function<void(DTMStatusInt status,double flatArea, double slopeArea)> DTMAreaValuesCallback;
222 typedef std::function<bool()> DTMCancelProcessCallback;
223 struct IDTM abstract : IRefCounted
224 {
225 private:
226  virtual void MakeClassAbstract() = 0;
227 public:
228 public:
232 
237 
238 
243 BENTLEYDTM_EXPORT DTMStatusInt GetTransformDTM (DTMPtr& transformedDtm, TransformCR transformation);
244 
248 BENTLEYDTM_EXPORT bool GetTransformation (TransformR transformation);
249 
253 BENTLEYDTM_EXPORT DTMStatusInt ExportToGeopakTinFile(WCharCP fileNameP, TransformCP transformation = nullptr);
254 
258 };
259 
BENTLEYDTM_EXPORT DTMStatusInt DrapeLinear(DTMDrapedLinePtr &ret, const DPoint3d pts[], int numPoints)
Drapes a linear feature on to the DTM.
RefCountedPtr< IDTMDrapedLine > DTMDrapedLinePtr
Definition: TerrainModel.h:72
BENTLEYDTM_EXPORT DTMStatusInt GetPointByIndex(DTMDrapedLinePointPtr &ret, unsigned int index) const
Gets the Draped Point by index.
bool operator()(DTMRayIntersection pt1, DTMRayIntersection pt2)
Definition: IDTM.h:71
BENTLEYDTM_EXPORT DTMStatusInt ExportToGeopakTinFile(WCharCP fileNameP, TransformCP transformation=nullptr)
Save this DTM to a geopak tin file.
BENTLEYDTM_EXPORT DTMStatusInt ComputeCutFillVolume(double *cut, double *fill, double *volume, PolyfaceHeaderCP mesh)
Compute volume between DTM and mesh.
bool isOnMesh
Definition: IDTM.h:64
DTMRayIntersection()
Definition: IDTM.h:61
long long int64_t
Definition: Bentley.r.h:94
bool hasNormal
Definition: IDTM.h:65
struct DMatrix4d const & DMatrix4dCR
Definition: msgeomstructs_typedefs.h:97
Interface implemented by DTM engines.
Definition: IDTM.h:80
BENTLEYDTM_EXPORT bool ProjectPoint(DPoint3dR pointOnDTM, DMatrix4dCR w2vMap, DPoint3dCR testPoint)
Projects point on the DTM.
BENTLEYDTM_EXPORT DTMStatusInt GetAscentTrace(DTMDrainageFeaturePtr &ret, DPoint3dCR pt, double minDepth)
Gets the AscentTrace.
BENTLEYDTM_EXPORT DTMStatusInt GetTransformDTM(DTMPtr &transformedDtm, TransformCR transformation)
Gets a Transformed copy of the DTM.
BENTLEYDTM_EXPORT DTMStatusInt ContourAtPoint(DTMPointArray &ret, DPoint3dCR pt, double contourInterval, DTMContourSmoothing smoothOption, double smoothFactor, int smoothDensity, const DTMFenceParams &fence)
Gets the Contour from a point.
std::function< bool()> DTMCancelProcessCallback
Definition: IDTM.h:222
BENTLEYDTM_EXPORT DTMStatusInt ComputeCutFillVolumeClosed(double *cut, double *fill, double *volume, PolyfaceHeaderCP mesh)
Compute volume between DTM and closed mesh.
BENTLEYDTM_EXPORT void RemoveAllRestrictions()
Use the whole DTM for further computations.
struct PolyfaceHeader const * PolyfaceHeaderCP
Definition: msgeomstructs_typedefs.h:177
double rayFraction
Definition: IDTM.h:66
BENTLEYDTM_EXPORT DTMStatusInt GetDescentTrace(DTMDrainageFeaturePtr &ret, DPoint3dCR pt, double minDepth)
Gets the DescentTrace.
BENTLEYDTM_EXPORT BcDTMP GetBcDTM()
Gets the BcDTM of the Current DTM if this is a BcDTM.
BENTLEYDTM_EXPORT double GetDistanceAlong() const
Gets the distance along for this Draped Point.
BENTLEYDTM_EXPORT DTMStatusInt DrapePoint(double *elevation, double *slope, double *aspect, DPoint3d triangle[3], int &drapedType, DPoint3dCR point)
Drapes a point onto the DTM.
BENTLEYDTM_EXPORT bool RestrictVolumeToRegion(uint64_t regionId)
Clips volume computations to a given region.
BENTLEYDTM_EXPORT bool GetTransformation(TransformR transformation)
Gets the Current Transformation for this DTM.
struct Transform & TransformR
Definition: msgeomstructs_typedefs.h:134
wchar_t const * WCharCP
Definition: Bentley.h:224
Interface implemented by DTM engines.
Definition: IDTM.h:162
DPoint3d point
Definition: IDTM.h:62
#define BEGIN_BENTLEY_TERRAINMODEL_NAMESPACE
Definition: TerrainModel.h:12
struct DRange3d & DRange3dR
Definition: msgeomstructs_typedefs.h:108
unsigned long long uint64_t
Definition: Bentley.r.h:95
Interface implemented by DTM engines.
Definition: IDTM.h:135
Definition: IDTM.h:223
struct Transform const * TransformCP
Definition: msgeomstructs_typedefs.h:134
BENTLEYDTM_EXPORT int64_t GetPointCount()
Gets the number of points of the DTM.
Interface implemented by DTM engines.
Definition: IDTM.h:39
BENTLEYDTM_EXPORT bool DrapeAlongVector(DPoint3d *endPt, double *slope, double *aspect, DPoint3d triangle[3], int *drapedType, DPoint3dCR point, double directionOfVector, double slopeOfVector)
Drapes a point onto the DTM along a vector.
Definition: IDTM.h:69
DVec3d normal
Definition: IDTM.h:63
BENTLEYDTM_EXPORT unsigned int GetPointCount() const
Gets the number of draped line points.
Definition: IDTM.h:59
struct DPoint3d & DPoint3dR
Definition: msgeomstructs_typedefs.h:79
BENTLEYDTM_EXPORT DTMStatusInt GetRange(DRange3dR range)
Gets the range of the DTM.
BENTLEYDTM_EXPORT DTMDrapedLineCode GetCode() const
Gets the Draped Point Code.
DTMDrapedLineCode
Definition: TerrainModel.h:179
RefCountedPtr< IDTMDrapedLinePoint > DTMDrapedLinePointPtr
Definition: TerrainModel.h:71
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
RefCountedPtr< IDTMDrainageFeature > DTMDrainageFeaturePtr
Definition: TerrainModel.h:70
struct Bentley::TerrainModel::BcDTM * BcDTMP
Definition: TerrainModel.h:49
DTMContourSmoothing
Definition: TerrainModel.h:196
BENTLEYDTM_EXPORT DTMStatusInt GetPointCoordinates(DPoint3d &coordP) const
Gets the Point Coordinates for this Draped Point.
BENTLEYDTM_EXPORT bool IntersectRay(DPoint3dR pointOnDTM, DVec3dCR direction, DPoint3dCR testPoint)
Projects point on the DTM along a given direction.
BEGIN_BENTLEY_TERRAINMODEL_NAMESPACE typedef bvector< DPoint3d > DTMPointArray
Definition: IDTM.h:14
DTMStatusInt
Definition: TerrainModel.h:190
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
Interface implemented by DTM engines.
Definition: IDTM.h:189
#define BENTLEYDTM_EXPORT
Definition: TerrainModel.h:81
std::function< void(DTMStatusInt status, double flatArea, double slopeArea)> DTMAreaValuesCallback
Interface implemented by DTM engines.
Definition: IDTM.h:221
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
#define END_BENTLEY_TERRAINMODEL_NAMESPACE
Definition: TerrainModel.h:13
BENTLEYDTM_EXPORT DTMStatusInt TraceCatchmentForPoint(DTMDrainageFeaturePtr &ret, DPoint3dCR pt, double maxpondDepth)
Gets the Trace Catchment.
Interface implemented by DTM engines.
Definition: IDTM.h:20
DTMIntersectionCompare()
Definition: IDTM.h:70
RefCountedPtr< IDTM > DTMPtr
Definition: TerrainModel.h:69

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.