drange2d.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
11 
12 #define MS_DRANGE2D_DEFINED
13 
21 struct GEOMDLLIMPEXP DRange2d
22 {
24 DPoint2d low;
26 DPoint2d high;
27 
28 #ifdef __cplusplus
29 //BEGIN_FROM_METHODS
30 
31 
33 static DRange2d NullRange ();
35 void Init ();
36 
37 
39 static DRange2d From (DPoint2dCR point);
41 static DRange2d From (DRange3dCR range);
43 static DRange2d From (bvector<DPoint3d> const &point);
44 
46 void InitFrom (DPoint2dCR point);
47 
55 void Extend (DPoint2dCR point);
56 
64 void Extend (DPoint3dCR point);
70 static DRange2d From (double x, double y);
71 
77 void InitFrom (double x, double y);
78 
83 void Extend (double x, double y);
84 
88 void Extend (DPoint4dCR point4d);
89 
90 
94 static DRange2d From (DPoint2dCR point0, DPoint2dCR point1);
95 
99 void InitFrom (DPoint2dCR point0, DPoint2dCR point1);
100 
101 
110 static DRange2d From (double x0, double y0, double x1, double y1);
111 
120 void InitFrom (double x0, double y0, double x1, double y1);
121 
127 static DRange2d From (DPoint2dCR point0, DPoint2dCR point1, DPoint2dCR point2);
128 
135 void InitFrom (DPoint2dCR point0, DPoint2dCR point1, DPoint2dCR point2);
136 
137 
138 
139 
143 static DRange2d FromUnitArcSweep (double theta0, double sweep);
147 void InitFromUnitArcSweep (double theta0, double sweep);
148 
149 
154 static DRange2d From (DPoint2dCP point, int n);
159 void InitFrom (DPoint2dCP point, int n);
160 
164 void Extend (DPoint2dCP array, int n);
165 
170 static DRange2d From (bvector<DPoint2d> const &points);
171 
175 static DRange2d From (DPoint3dCP point, int n);
179 void InitFrom (DPoint3dCP point, int n);
180 
181 
188 void Extend (double extend);
189 
193 void Extend (DRange2dCR rangeB);
194 
195 
205 bool IntersectionOf (DRange2dR range1, DRange2dR range2);
206 
214 void UnionOf (DRange2dCR range1, DRange2dCR range2);
215 
234 void RestrictToMinMax (DRange2dCR range0, DRange2dCR minMax);
235 
236 
237 
241 bool IsNull () const;
242 
245 double ExtentSquared () const;
246 
255 double IntersectionExtentSquared (DRange2dCR range2) const;
256 
260 bool IsEmpty () const;
261 
263 bool IsPoint () const;
264 
266 double Area () const;
267 
270 double LargestCoordinate () const;
271 
272 
274 double XLength () const;
276 double YLength () const;
277 
278 
279 
283 void Get4Lines (DPoint2dP originArray, DPoint2dP normalArray) const;
286 void Get4Corners (DPoint2dP box) const;
287 
288 
290 int IndexOfMaximalAxis () const;
291 
305 bool IntersectRay (double &param0, double &param1, DPoint2dR point0, DPoint2dR point1, DPoint2dCR start, DPoint2dCR direction) const;
306 
307 
314 bool IsEqual (DRange2dCR range1) const;
315 
323 bool IsEqual (DRange2dCR range1, double tolerance) const;
324 
329 bool TryFractionsToRangePoint (DPoint2dCR fractions, DPoint2dR xy) const;
330 
335 bool TryRangePointToFractions (DPoint2dCR xy, DPoint2dR fractions) const;
336 
337 
338 
339 
340 
344 bool IsContained (DRange2dCR outerRange) const;
345 
349 bool Contains (DPoint3dCR point) const;
350 
354 bool Contains (DPoint2dCR point) const;
355 
360 bool Contains (double x, double y) const;
361 
365 bool IntersectsWith (DRange2dCR range2) const;
366 
379 bool MoveChangesIntersection (DRange2dCR newRange, DRange2dCR outerRange) const;
380 
381 
382 #endif
383 
384 
385 };
struct DRange2d const & DRange2dCR
Definition: msgeomstructs_typedefs.h:110
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
Area dimensional constraint.
struct DPoint2d * DPoint2dP
Definition: msgeomstructs_typedefs.h:78
struct DPoint2d & DPoint2dR
Definition: msgeomstructs_typedefs.h:78
struct DRange2d & DRange2dR
Definition: msgeomstructs_typedefs.h:110
A 2d low and high corner pair for range boxes.
Definition: drange2d.h:21
struct DRange3d const & DRange3dCR
Definition: msgeomstructs_typedefs.h:108
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
DPoint2d high
high point of box
Definition: drange2d.h:26
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96
DPoint2d low
low point of box
Definition: drange2d.h:24

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