drange3d.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
20 struct GEOMDLLIMPEXP DRange3d
21 {
23 DPoint3d low;
25 DPoint3d high;
26 
27 #ifdef __cplusplus
28 //BEGIN_REFMETHODS
29 
31 static DRange3d NullRange ();
33 void Init ();
34 
39 static DRange3d From (DPoint3dCR point);
42 void InitFrom (DPoint3dCR point);
48 void Extend (DPoint3dCR point);
49 
56 void Extend
57 (
58 DPoint3dCR point,
59 double weight
60 );
61 
67 static DRange3d From (DPoint3dCR point0, DPoint3dCR point1);
71 void InitFrom (DPoint3dCR point0, DPoint3dCR point1);
72 
78 static DRange3d From
79 (
80 double x,
81 double y,
82 double z
83 );
84 
91 void InitFrom
92 (
93 double x,
94 double y,
95 double z
96 );
97 
98 
107 void Extend
108 (
109 double x,
110 double y,
111 double z
112 );
113 
122 static DRange3d From
123 (
124 double x0,
125 double y0,
126 double z0,
127 double x1,
128 double y1,
129 double z1
130 );
131 
142 void InitFrom
143 (
144 double x0,
145 double y0,
146 double z0,
147 double x1,
148 double y1,
149 double z1
150 );
151 
152 
159 static DRange3d FromMinMax
160 (
161 double v0,
162 double v1
163 );
164 
171 static DRange3d From
172 (
173 DPoint3dCR point0,
174 DPoint3dCR point1,
175 DPoint3dCR point2
176 );
177 
178 
185 void InitFrom
186 (
187 DPoint3dCR point0,
188 DPoint3dCR point1,
189 DPoint3dCR point2
190 );
191 
192 
193 
200 void InitFromMinMax
201 (
202 double v0,
203 double v1
204 );
205 
206 
216 static DRange3d From (DPoint3dCP point, int n);
217 
218 
219 
230 static DRange3d From
231 (
232 DPoint3dCP point,
233 const double *pWeight,
234 int n
235 );
236 
237 
248 static DRange3d From
249 (
250 TransformCR transform,
251 DPoint3dCP point,
252 const double *pWeight,
253 int n
254 );
255 
265 void InitFrom (DPoint3dCP point, int n);
270 void Extend (DPoint3dCP array, int n);
271 
272 
275 static DRange3d From (bvector<DPoint3d> const &points);
276 
279 static DRange3d From (bvector<bvector<DPoint3d>> const &points);
280 
283 static DRange3d From (bvector<bvector<bvector<DPoint3d>>> const &points);
284 
287 void InitFrom (bvector<DPoint3d> const &points);
288 
293 void Extend (bvector<DPoint3d> const &points);
294 
295 
304 void Extend
305 (
306 TransformCR transform,
307 DPoint3dCP points,
308 int n
309 );
310 
320 void Extend
321 (
322 TransformCR transform,
323 DPoint3dCP points,
324 double const* weights,
325 int n
326 );
327 
331 static DRange3d From (TransformCR transform, bvector<DPoint3d> const &points);
332 
336 static DRange3d From (TransformCR transform, bvector<DPoint4d> const &points);
337 
341 void InitFrom (TransformCR transform, bvector<DPoint3d> const &points);
342 
348 void Extend (TransformCR transform, bvector<DPoint3d> const &points);
349 
355 void Extend (TransformCR transform, bvector<DPoint4d> const &points);
356 
357 
368 void InitFrom
369 (
370 DPoint3dCP point,
371 const double *pWeight,
372 int n
373 );
374 
380 static DRange3d From (bvector<DPoint3d> const &points, bvector<double> const *weights);
381 
387 void InitFrom (bvector<DPoint3d> const &points, bvector<double> const *weights);
388 
394 void Extend (bvector<DPoint3d> const &points, bvector<double> const *weights);
395 
403 void Extend (DPoint4dCR point4d);
404 
413 void Extend
414 (
415 DPoint4dCP point4d,
416 int numPoint
417 );
418 
419 
424 static DRange3d From (bvector<DPoint4d> const &points);
425 
428 void InitFrom (bvector<DPoint4d> const &points);
429 
432 void Extend (bvector<DPoint4d> const &points);
433 
445 static DRange3d From
446 (
447 DPoint2dCP point,
448 int n,
449 double zVal
450 );
451 
463 void InitFrom
464 (
465 DPoint2dCP point,
466 int n,
467 double zVal
468 );
469 
474 static DRange3d From (bvector<DPoint2d> const &points, double zValue);
478 static DRange3d From (bvector<bvector<DPoint2d> > const &points, double zValue);
479 
485 void InitFrom (bvector<DPoint2d> const &points, double zValue);
486 
487 
493 void Extend (bvector<DPoint2d> const &points, double zValue);
494 
499 void Extend (double extend);
500 
506 void ExtendBySweep (DVec3dCR vector);
507 
510 void Extend (DRange3dCR range1);
511 
514 void Extend (DEllipse3dCR ellipse);
515 
516 
522 void UnionOf
523 (
524 DRange3dCR range0,
525 DRange3dCR range1
526 );
527 
535 void IntersectionOf
536 (
537 DRange3dCR range1,
538 DRange3dCR range2
539 );
540 
544 void IntersectIndependentComponentsOf
545 (
546 DRange3dCR range1,
547 DRange3dCR range2
548 );
549 
555 void ScaleAboutCenter
556 (
557 DRange3dCR rangeIn,
558 double scale
559 );
560 
561 
562 
567 bool IsNull () const;
568 
574 double ExtentSquared () const;
575 
579 bool IsEmpty () const;
580 
582 bool IsPoint () const;
583 
585 double Volume () const;
586 
588 double XLength () const;
590 double YLength () const;
592 double ZLength () const;
593 
595 double DiagonalDistance () const;
597 double DiagonalDistanceXY () const;
599 DVec3d DiagonalVector () const;
601 DVec3d DiagonalVectorXY () const;
602 
604 bool IsAlmostZeroZ () const;
606 bool IsAlmostZeroY () const;
608 bool IsAlmostZeroX () const;
609 
610 
616 double LargestCoordinate () const;
617 
618 
622 double MaxAbs () const;
623 
624 
630 double LargestCoordinateXY () const;
631 
639 void Get8Corners (DPoint3dP box) const;
647 void Get6Planes
648 (
649 DPoint3dP originArray,
650 DPoint3dP normalArray
651 ) const;
652 
659 DRange1d GetComponentDRange1d (int index) const;
660 
664 DRange1d GetCornerRange (DRay3dCR ray) const;
665 
669 DRange1d GetCornerRange (DPlane3dCR plane) const;
670 
676 int IndexOfMaximalAxis () const;
677 
678 
684 DPoint3d LocalToGlobal
685 (
686 double xFraction,
687 double yFraction,
688 double zFraction
689 ) const;
690 
696 bool IsContained (DRange3dCR outerRange) const;
697 
698 
705 double DistanceOutside (DPoint3dCR xyz) const;
706 
712 double DistanceSquaredOutside (DPoint3dCR xyz) const;
719 double DistanceSquaredTo (DRange3dCR other) const;
720 
726 bool IsContained (DPoint3dCR point) const;
727 
733 bool IsContainedXY (DPoint3dCR point) const;
734 
741 bool IsContained (DPoint3dCR point, int numDimensions) const;
742 
743 
751 bool IsContained
752 (
753 double x,
754 double y,
755 double z
756 ) const;
757 
758 
766 bool IntersectsWith (DRange3dCR range2) const;
767 
776 bool IntersectsWith (DRange3dCR range2, int numDimensions) const;
777 
787 bool IntersectsWith (DRange3dCR range2, double gapSize, int numDimensions) const;
788 
789 
790 
791 
797 bool IsEqual (DRange3dCR range1) const;
798 
805 bool IsEqual
806 (
807 DRange3dCR range1,
808 double tolerance
809 ) const;
810 
819 bool IsStrictlyContainedXY (DRange3dCR outerRange) const;
820 
839 void RestrictToMinMax
840 (
841 DRange3dCR range0,
842 DRange3dCR minMax
843 );
844 
860 bool IntersectRay
861 (
862 double &param0,
863 double &param1,
864 DPoint3dR point0,
865 DPoint3dR point1,
866 DPoint3dCR start,
867 DPoint3dCR direction
868 ) const;
869 
883 bool IntersectBounded
884 (
885 double &param0,
886 double &param1,
887 DSegment3dR clipped,
888 DSegment3dCR segment
889 ) const;
890 
891 
900 double IntersectionExtentSquared (DRange3dCR range2) const;
901 
902 
915 bool MoveChangesIntersection
916 (
917 DRange3dCR newRange,
918 DRange3dCR outerRange
919 ) const;
920 #endif
921 
922 };
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
struct DPoint3d * DPoint3dP
Definition: msgeomstructs_typedefs.h:79
struct DSegment3d & DSegment3dR
Definition: msgeomstructs_typedefs.h:115
DPoint3d high
high point of box
Definition: drange3d.h:25
struct DRange3d const & DRange3dCR
Definition: msgeomstructs_typedefs.h:108
struct DPlane3d const & DPlane3dCR
Definition: msgeomstructs_typedefs.h:113
struct DPoint3d & DPoint3dR
Definition: msgeomstructs_typedefs.h:79
struct DSegment3d const & DSegment3dCR
Definition: msgeomstructs_typedefs.h:115
A 1d interval with low and high values.
Definition: DRange1d.h:41
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
struct DEllipse3d const & DEllipse3dCR
Definition: msgeomstructs_typedefs.h:114
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
struct DRay3d const & DRay3dCR
Definition: msgeomstructs_typedefs.h:120
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
struct DPoint4d const * DPoint4dCP
Definition: msgeomstructs_typedefs.h:96
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96
DPoint3d low
low point of box
Definition: drange3d.h:23
A 3d low and high corner pair for range boxes.
Definition: drange3d.h:20

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