dplane3d.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
9 
11 
18 struct GEOMDLLIMPEXP DPlane3d
19 {
21 DPoint3d origin;
23 DVec3d normal;
24 
25 #ifdef __cplusplus
26 
27 //BEGIN_FROM_METHODS
28 
39 static DPlane3d FromOriginAndNormal
40 (
41 double x0,
42 double y0,
43 double z0,
44 double ux,
45 double uy,
46 double uz
47 );
48 
55 static DPlane3d FromOriginAndNormal
56 (
57 DPoint3dCR origin,
58 DVec3dCR normal
59 );
60 
67 static ValidatedDPlane3d FromNormalAndDistance
68 (
69 DVec3dCR normal,
70 double distance
71 );
80 static DPlane3d From3Points
81 (
82 DPoint3dCR origin,
83 DPoint3dCR xPoint,
84 DPoint3dCR yPoint
85 );
86 
87 
88 //END_FROM_METHODS
89 
100 void InitFromOriginAndNormal
101 (
102 double x0,
103 double y0,
104 double z0,
105 double ux,
106 double uy,
107 double uz
108 );
109 
116 void InitFromOriginAndNormal
117 (
118 DPoint3dCR origin,
119 DVec3dCR normal
120 );
121 
127 bool Normalize ();
128 
137 void InitFrom3Points
138 (
139 DPoint3dCR origin,
140 DPoint3dCR xPoint,
141 DPoint3dCR yPoint
142 );
143 
151 bool Init (DPoint4dCR hPlane);
152 
159 void GetDPoint4d (DPoint4dR hPlane) const;
160 
173 bool Init
174 (
175 double a,
176 double b,
177 double c,
178 double d
179 );
180 
192 void GetCoefficients
193 (
194 double &coffA,
195 double &coffB,
196 double &coffC,
197 double &coffD
198 ) const;
199 
200 
205 void Zero ();
206 
212 bool IsZero () const;
213 
221 bool ProjectPoint
222 (
223 DPoint3dR projection,
224 DPoint3dCR point
225 ) const;
226 
235 double Evaluate (DPoint3dCR point) const;
236 
245 double EvaluateVector (DVec3dCR vector) const;
246 
250 double EvaluateMaxAbs (DPoint3dCP points, size_t n) const;
251 
254 double EvaluateMaxAbs (bvector <DPoint3d> const &points) const;
255 
261 DRange1d EvaluateRange (DPoint3dCP points, size_t n, size_t &minIndex, size_t &maxIndex) const;
262 
267 DRange1d EvaluateRange (bvector <DPoint3d> const &points, size_t &minIndex, size_t &maxIndex) const;
268 
269 
270 
277 bool InitFromArray (bvector<DPoint3d> const &points);
285 bool InitFromArray (DPoint3dCP pointArray, int numPoint);
286 
296 bool InitFromArray (bvector<DPoint3d> const &points, double &maxAbsDistance);
307 bool InitFromArray (DPoint3dCP pointArray, int numPoint, double &maxAbsDistance);
308 
309 
310 
314 //</ul>
316 static ValidatedDPoint3d Intersect3Planes
317 (
318 DVec3dCR unitNormalA,
319 double distanceA,
320 DVec3dCR unitNormalB,
321 double distanceB,
322 DVec3dCR unitNormalC,
323 double distanceC
324 );
325 
328 static ValidatedDPoint3d Intersect3Planes
329 (
330 DPlane3dCR planeA,
331 DPlane3dCR planeB,
332 DPlane3dCR planeC
333 );
334 
335 
336 
337 #endif
338 };
struct DPoint4d & DPoint4dR
Definition: msgeomstructs_typedefs.h:96
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
DPoint3d origin
reference point on plane.
Definition: dplane3d.h:21
ValidatedValue< struct DPlane3d > ValidatedDPlane3d
Definition: GeomApi.h:352
Origin and normal vector for a plane.
Definition: dplane3d.h:18
struct DPlane3d const & DPlane3dCR
Definition: msgeomstructs_typedefs.h:113
struct DPoint3d & DPoint3dR
Definition: msgeomstructs_typedefs.h:79
A 1d interval with low and high values.
Definition: DRange1d.h:41
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
ValidatedValue< struct DPoint3d > ValidatedDPoint3d
Definition: GeomApi.h:349
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96
DVec3d normal
vector perpendicular to the plane. NOT necessarily a unit vector.
Definition: dplane3d.h:23

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