dpoint3d.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 
10 #ifndef dpoint3d_H_
11 #define dpoint3d_H_
12 
15 
19 struct GEOMDLLIMPEXP DPoint3d
20 {
22 double x;
24 double y;
26 double z;
27 
28 #ifdef __cplusplus
29 //BEGIN_FROM_METHODS
30 
32 static DPoint3d From (double x, double y, double z = 0.0);
34 static DPoint3d From (DPoint2dCR xy);
36 static DPoint3d FromZero();
38 static DPoint3d FromOne();
39 
40 
43 static DPoint3d FromArray (const double *pXyz);
44 //END_FROM_METHODS
45 
46 
49 void Swap (DPoint3dR other);
50 
55 double CrossProductToPointsXY (DPoint3dCR target1, DPoint3dCR target2) const;
56 
61 double DotProductToPoints (DPoint3dCR target1, DPoint3dCR target2) const;
62 
67 double DotProductToPointsXY (DPoint3dCR target1, DPoint3dCR target2) const;
68 
78 double DotDifference (DPoint3dCR origin, DVec3dCR vector) const;
79 
87 double TripleProductToPoints (DPoint3dCR target1, DPoint3dCR target2, DPoint3dCR target3) const;
88 
92 void Zero ();
93 
97 void One ();
98 
105 void InitFromArray (const double *pXyz);
106 
107 
113 void Init (DPoint2dCR source);
114 
115 
123 void Init (double ax, double ay, double az);
124 
132 void Init (double ax, double ay);
133 
140 void XyzOf (DPoint4dCR hPoint);
141 
148 void SetComponent (double a, int index);
149 
158 double GetComponent (int index) const;
159 
167 void GetComponents (double &xCoord, double &yCoord, double &zCoord) const;
168 
178 void Interpolate (DPoint3dCR point0, double fractionParameter, DPoint3dCR point1);
179 
188 bool IsPointInSmallerSector (DPoint3dCR origin, DPoint3dCR target1, DPoint3dCR target2) const;
189 
200 bool IsPointInCCWector (DPoint3dCR origin, DPoint3dCR target0, DPoint3dCR target1, DVec3dCR upVector) const;
201 
208 double Distance (DPoint3dCR point2) const;
209 
216 double DistanceSquared (DPoint3dCR point2) const;
217 
226 double DistanceSquaredXY (DPoint3dCR point2) const;
227 
236 double DistanceXY (DPoint3dCR point2) const;
237 
245 bool DistanceXY (DPoint3dCR otherPoint, DMatrix4dCP matrix, double &distance) const;
246 
249 double MaxAbs () const;
250 
253 double MinAbs () const;
254 
256 int MaxAbsIndex () const;
257 
259 int MinAbsIndex () const;
260 
261 
263 DRange1d ComponentRange () const;
264 
270 bool IsEqual (DPoint3dCR point2) const;
271 
282 bool IsEqual (DPoint3dCR point2, double tolerance) const;
283 
291 void NpcCoordinatesOf (DPoint3dCR point, DRange3dCR cube);
292 
297 bool IsDisconnect () const;
298 
302 void InitDisconnect ();
303 
308 void Init (DVec3dCR vector);
309 
316 void Subtract (DPoint3dCR base, DVec3dCR vector);
317 
323 void Add (DVec3dCR vector);
324 
326 static void AddToArray (DPoint3dP points, int n, DPoint3dCR delta);
334 void SumOf (DPoint3dCR origin, DVec3dCR vector, double scale);
335 
345 void SumOf (DPoint3dCR origin, DVec3dCR point1, double scale1, DVec3dCR point2, double scale2);
346 
358 void SumOf (DPoint3dCR origin, DVec3dCR point1, double scale1, DVec3dCR point2, double scale2, DVec3dCR point3, double scale3);
359 
365 void CrossProduct (DPoint3dCR point1, DPoint3dCR point2);
366 
374 void CrossProductToPoints (DPoint3dCR origin, DPoint3dCR target1, DPoint3dCR target2);
375 
381 double CrossProductXY (DPoint3dCR point2) const;
382 
391 double NormalizedCrossProduct (DPoint3dCR point1, DPoint3dCR point2);
392 
403 double SizedCrossProduct (DPoint3dCR point1, DPoint3dCR point2, double productLength);
404 
415 double GeometricMeanCrossProduct (DPoint3dCR point1, DPoint3dCR point2);
416 
422 double DotProduct (DPoint3dCR point2) const;
423 
429 double DotProductXY (DPoint3dCR point2) const;
430 
439 double DotProduct (double ax, double ay, double az) const;
440 
441 
451 double NormalizedDifference (DPoint3dCR target, DPoint3dCR origin);
452 
461 double AngleTo (DPoint3dCR point2) const;
462 
466 double AngleXY () const;
475 double SmallerUnorientedAngleTo (DPoint3dCR point2) const;
476 
497 bool IsVectorInSmallerSector (DPoint3dCR point0, DPoint3dCR point1) const;
498 
510 bool IsVectorInCCWSector (DPoint3dCR point0, DPoint3dCR point1, DPoint3dCR upVector) const;
511 
519 double AngleToXY (DPoint3dCR point2) const;
520 
529 double SmallerUnorientedAngleToXY (DPoint3dCR point2) const;
530 
536 void RotateXY (DPoint3dCR vector, double theta);
537 
542 void RotateXY (double theta);
543 
556 double SignedAngleTo (DPoint3dCR point2, DPoint3dCR orientationVector) const;
557 
566 double PlanarAngleTo (DPoint3dCR point2, DPoint3dCR planeNormal) const;
567 
576 void WeightedDifferenceOf (DPoint4dCR point1, DPoint4dCR point2);
577 
585 void WeightedDifferenceCrossProduct (DPoint4dCR basePoint, DPoint4dCR target1, DPoint4dCR target2);
586 
592 double MagnitudeSquared () const;
593 
598 double MagnitudeXY () const;
599 
604 double MagnitudeSquaredXY () const;
605 
611 bool UnitPerpendicularXY (DPoint3dCR vector);
612 
617 double Magnitude () const;
618 
624 void Scale (DPoint3dCR vector, double scale);
625 
630 void Scale (double scale);
631 
637 void Negate (DPoint3dCR vector);
638 
643 void Negate ();
644 
653 double Normalize (DPoint3dCR vector);
654 
664 double ScaleToLength (DPoint3dCR vector, double length);
665 
675 double ScaleToLength (double length);
676 
685 double Normalize ();
686 
693 bool IsParallelTo (DPoint3dCR point2) const;
694 
701 bool IsPerpendicularTo (DPoint3dCR point2) const;
702 
711 bool SafeDivide (DPoint3dCR vector, double denominator);
712 
734 double TripleProduct (DPoint3dCR point2, DPoint3dCR point3) const;
735 
742 void Subtract (DPoint3dCR point2);
743 
750 void DifferenceOf (DPoint3dCR point1, DPoint3dCR point2);
751 
759 void SumOf (DPoint3dCR origin, DPoint3dCR vector, double scale);
760 
770 void SumOf (DPoint3dCR origin, DPoint3dCR point1, double scale1, DPoint3dCR point2, double scale2);
771 
783 void SumOf (DPoint3dCR origin, DPoint3dCR point1, double scale1, DPoint3dCR point2, double scale2, DPoint3dCR point3, double scale3);
784 
791 
792 void SumOf (DPoint3dCR point1, double a1, DPoint3dCR point2, double a2);
793 
802 void SumOf (DPoint3dCR point1, double a1, DPoint3dCR point2, double a2, DPoint3dCR point3, double a3);
803 
804 
810 void Add (DPoint3dCR vector);
811 
818 void SumOf (DPoint3dCR point1, DPoint3dCR point2);
819 
827 static void MultiplyArrayByScales (DPoint3dP pDest, DPoint3dCP pSource, double *pScales, int n);
828 
829 
838 static void DivideArrayByScales (DPoint3dP pDest, DPoint3dCP pSource, double *pScales, int n);
839 
845 static DPoint3d FromProduct (TransformCR transform, double x, double y, double z);
846 
850 static DPoint3d FromProduct (TransformCR transform, DPoint3dCR point);
851 
856 static DPoint3d FromInterpolate (DPoint3dCR pointA, double fraction, DPoint3dCR pointB);
857 
865 static DPoint3d FromInterpolateBilinear (DPoint3dCR point00, DPoint3dCR point10, DPoint3dCR point01, DPoint3dCR point11, double u, double v);
866 
870 static DPoint3d FromSumOf (DPoint3dCR origin, DPoint3dCR vector);
871 
876 static DPoint3d FromSumOf (DPoint3dCR origin, DPoint3dCR vector, double scaleFactor);
877 
884 static DPoint3d FromSumOf (DPoint3dCR origin, DPoint3dCR point0, double scaleFactor0, DPoint3dCR point1, double scaleFactor1);
885 
894 static DPoint3d FromSumOf (DPoint3dCR origin, DPoint3dCR point0, double scaleFactor0, DPoint3dCR point1, double scaleFactor1, DPoint3dCR point2, double scaleFactor2);
895 
899 static DPoint3d FromScale (DPoint3d point, double scale);
900 
906 static DPoint3d FromSumOf (DPoint3dCR point0, double scale0, DPoint3dCR point1, double scale1);
907 
915 static DPoint3d FromSumOf (DPoint3dCR point0, double scale0, DPoint3dCR point1, double scale1, DPoint3dCR point2, double scale2);
916 
917 
924 static DPoint3d FromProduct (DPoint3dCR point, RotMatrixCR matrix, double x, double y, double z);
925 
930 static DPoint3d FromProduct (DPoint3dCR point, RotMatrixCR matrix, DVec3dCR vector);
931 
938 bool AlmostEqual (DPoint3d const & dataB) const;
939 
946 bool AlmostEqualXY (DPoint3d const & dataB) const;
947 
955 bool AlmostEqual (DPoint3d const & dataB, double abstol) const;
956 
964 bool AlmostEqualXY (DPoint3d const & dataB, double abstol) const;
965 
966 
967 
968 
969 
974 static bool AlmostEqual (bvector<DPoint3d> const &left, bvector<DPoint3d> const &right, double tolerance = 0.0);
975 
980 static bool AlmostEqualXY (bvector<DPoint3d> const &left, bvector<DPoint3d> const &right, double tolerance = 0.0);
981 
982 
983 
984 #endif // __cplusplus
985 
986 };
987 
989 
990 #endif // dpoint3d_H_
991 
Distance dimensional constraint.
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
struct RotMatrix const & RotMatrixCR
Definition: msgeomstructs_typedefs.h:135
double x
x coordinate
Definition: dpoint3d.h:22
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
3d point coordinates.
Definition: dpoint3d.h:19
struct DRange3d const & DRange3dCR
Definition: msgeomstructs_typedefs.h:108
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
double y
y coordinate
Definition: dpoint3d.h:24
A 1d interval with low and high values.
Definition: DRange1d.h:41
struct DMatrix4d const * DMatrix4dCP
Definition: msgeomstructs_typedefs.h:97
double z
z coordinate
Definition: dpoint3d.h:26
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96

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