dpoint4d.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 
17 struct GEOMDLLIMPEXP DPoint4d
18 {
20 double x;
22 double y;
24 double z;
26 double w;
27 
28 #ifdef __cplusplus
29 
30 
31 
37 static DPoint4d From
38 (
39 double x,
40 double y,
41 double z,
42 double w
43 );
44 
48 static DPoint4d From
49 (
50 DPoint3dCR xyz,
51 double w
52 );
53 
55 static DPoint4d FromSumOf
56 (
57 DPoint4dCR xyzw0,
58 double scale0,
59 DPoint4dCR xyzw1,
60 double scale1,
61 DPoint4dCR xyzw2,
62 double scale2
63 );
64 
65 
69 static DPoint4d FromMultiply
70 (
71 DMatrix4dCP matrix,
72 DPoint3dCR point
73 );
74 
78 static DPoint4d FromMultiply
79 (
80 DMatrix4dCP matrix,
81 DPoint4dCR point
82 );
83 
85 void Zero ();
86 
93 void SetComponents
94 (
95 double xComponent,
96 double yComponent,
97 double zComponent,
98 double wComponent
99 );
100 
109 void Init
110 (
111 DPoint3dCR source,
112 double w
113 );
114 
126 void Init (double x, double y, double z, double w);
127 
128 
129 
135 void InitFromArray
136 (
137 double *pArray
138 );
139 
149 void GetComponents
150 (
151 double &xCoord,
152 double &yCoord,
153 double &zCoord,
154 double &wCoord
155 ) const;
156 
163 void SetComponent
164 (
165 double a,
166 int index
167 );
168 
173 double GetComponent (int index) const;
174 
178 double MagnitudeXYZW () const;
179 
186 double DotProduct (DPoint4dCR point) const;
187 
193 double DotProductXY (DPoint4dCR point) const;
194 
201 double DotProductXYZ (DPoint4dCR point2) const;
202 
209 double DotProductXYW (DPoint4dCR point) const;
210 
219 double DotProduct
220 (
221 double x,
222 double y,
223 double z,
224 double w
225 ) const;
226 
233 double DotProduct
234 (
235 DPoint3dCR point2,
236 double w
237 ) const;
238 
260 double EyePlaneTest
261 (
262 DPoint3dCR origin,
263 DPoint3dCR normal
264 ) const;
265 
270 double RealDistance (DPoint4dCR vec2) const;
271 
277 bool RealDistanceSquaredXY
278 (
279 double *pDistanceSquared,
280 DPoint3dCR vec2
281 ) const;
282 
287 bool RealDistanceXY
288 (
289 double &distance,
290 DPoint4dCR pointB
291 ) const;
292 
298 bool RealDistanceSquared
299 (
300 double *pDistanceSquared,
301 DPoint3dCR vec2
302 ) const;
303 
309 bool RealDistanceSquared
310 (
311 double *pDistanceSquared,
312 DPoint4dCR vec2
313 ) const;
314 
322 void Interpolate
323 (
324 DPoint4dCR point0,
325 double s,
326 DPoint4dCR point1
327 );
328 
336 static DPoint4d FromInterpolate
337 (
338 DPoint4dCR point0,
339 double s,
340 DPoint4dCR point1
341 );
342 
343 
352 void InitFrom
353 (
354 DPoint3dCR point,
355 double w
356 );
357 
364 void GetXYZ (DPoint3dR point) const;
365 
372 void GetXYW (DPoint3dR point) const;
373 
383 void GetXYZ
384 (
385 DPoint3dR point,
386 int xIndex,
387 int yIndex,
388 int zIndex
389 ) const;
390 
400 bool PlaneFromOriginAndNormal
401 (
402 DPoint3dCR origin,
403 DPoint3dCR normal
404 );
405 
415 bool PlaneFrom3Points
416 (
417 DPoint3dCR origin,
418 DPoint3dCR point1,
419 DPoint3dCR point2
420 );
421 
431 bool PlaneFromOriginAndVectors
432 (
433 DPoint4dCR origin,
434 DPoint3dCR vector0,
435 DPoint3dCR vector1
436 );
437 
443 bool OriginAndNormalFromPlane
444 (
445 DPoint3dR origin,
446 DPoint3dR normal
447 ) const;
448 
455 void SumOf
456 (
457 DPoint4dCR pt1,
458 DPoint4dCR pt2
459 );
460 
465 void WeightedDifferenceOf
466 (
467 DPoint4dCR A,
468 DPoint4dCR B
469 );
470 
476 void WeightedDifferenceOf
477 (
478 DPoint4dCR A,
479 DPoint3dCR B,
480 double wB
481 );
482 
488 void WeightedDifferenceOf
489 (
490 DPoint3dCR A,
491 double wA,
492 DPoint4dCR B
493 );
494 
500 void Add (DPoint4dCR vector);
501 
507 void Subtract (DPoint4dCR vector);
508 
515 void DifferenceOf
516 (
517 DPoint4dCR point1,
518 DPoint4dCR point2
519 );
520 
530 void SumOf
531 (
532 DPoint4dCR point0,
533 DPoint4dCR point1,
534 double scale1,
535 DPoint4dCR point2,
536 double scale2
537 );
538 
547 void SumOf
548 (
549 DPoint4dCR point1,
550 double scale1,
551 DPoint4dCR point2,
552 double scale2
553 );
554 
566 void SumOf
567 (
568 DPoint4dCR point0,
569 DPoint4dCR point1,
570 double scale1,
571 DPoint4dCR point2,
572 double scale2,
573 DPoint4dCR point3,
574 double scale3
575 );
576 
587 void SumOf
588 (
589 DPoint4dCR point1,
590 double scale1,
591 DPoint4dCR point2,
592 double scale2,
593 DPoint4dCR point3,
594 double scale3
595 );
596 
597 
605 void SumOf
606 (
607 DPoint4dCR point0,
608 DPoint4dCR point1,
609 double scale1
610 );
611 
618 bool GetProjectedXYZ (DPoint3dR rPoint) const;
619 
625 bool InitWithNormalizedWeight (DPoint4dCR source);
626 
632 bool NormalizeWeightInPlace ();
633 
641 bool NormalizePlaneOf (DPoint4dCR plane0);
642 
649 void Scale
650 (
651 DPoint4dCR point,
652 double scale
653 );
654 
660 void Scale (double scale);
661 
667 void Negate (DPoint4dCR point);
668 
672 void Negate ();
673 
682 bool IsEqual (DPoint4dCR vec2) const;
683 
689 bool IsEqual
690 (
691 DPoint4dCR vec2,
692 double tolerance
693 ) const;
694 
702 bool IsEqual
703 (
704 DPoint4dCR vec2,
705 double xyzTol,
706 double wTol
707 ) const;
708 
710 static bool AlmostEqual
711 (
712 bvector<DPoint4d> const &dataA,
713 bvector<DPoint4d> const &dataB,
714 double xyzTol,
715 double wTol
716 );
717 
719 static bool AlmostEqualReversed
720 (
721 bvector<DPoint4d> const &dataA,
722 bvector<DPoint4d> const &dataB,
723 double xyzTol,
724 double wTol
725 );
726 
728 static bool AlmostEqual
729 (
730 DPoint4dCP dataA,
731 DPoint4dCP dataB,
732 size_t n,
733 double xyzTol,
734 double wTol
735 );
736 
738 static bool AlmostEqualReversed
739 (
740 DPoint4dCP dataA,
741 DPoint4dCP dataB,
742 size_t n,
743 double xyzTol,
744 double wTol
745 );
746 
747 
751 double MaxAbs () const;
752 
754 double MaxAbsUnnormalizedXYZ () const;
755 
757 double MaxUnnormalizedXYZDiff (DPoint4dCR other) const;
758 
772 double GetRotationAngleAndVectorFromQuaternion (DPoint3dR axis) const;
773 
778 bool IsDisconnect () const;
779 
783 void InitDisconnect ();
784 
786 static DPoint4d FromCrossProduct (DPoint4dCR pointA, DPoint4dCR pointB, DPoint4dCR pointC);
787 
793 static ValidatedDPlane3dByVectors TryNormalizePointAndDerivatives
794 (
795 DPoint4dCR homogeneousPoint,
796 DPoint4dCR homogeneousDerivative1,
797 DPoint4dCR homogeneousDerivative2
798 );
799 
800 
801 };
802 #endif
803 
805 
double w
w coordinate. 1 is a simple point. 0 is a vector. For other values, dividing through by w gives the s...
Definition: dpoint4d.h:26
double z
z coordinate
Definition: dpoint4d.h:24
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
4d point coordinates.
Definition: dpoint4d.h:17
double y
y coordinate
Definition: dpoint4d.h:22
A Bentley supplied implementation std::vector.
Definition: stdcxx/bvector.h:77
struct DPoint3d & DPoint3dR
Definition: msgeomstructs_typedefs.h:79
struct DMatrix4d const * DMatrix4dCP
Definition: msgeomstructs_typedefs.h:97
double x
x coordinate
Definition: dpoint4d.h:20
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
ValidatedValue< DPlane3dByVectors > ValidatedDPlane3dByVectors
Definition: GeomApi.h:363
struct DPoint4d const * DPoint4dCP
Definition: msgeomstructs_typedefs.h:96
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96

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