dray3d.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 
13 
14 #define MS_DRAY3D_DEFINED
15 
16 
21 struct GEOMDLLIMPEXP DRay3d
22 {
24 DPoint3d origin;
26 DVec3d direction;
27 #ifdef __cplusplus
28 //BEGIN_FROM_METHODS
29 
31 static DRay3d From (DSegment3dCR segment);
32 
34 static DRay3d FromOriginAndVector (DPoint3dCR origin, DVec3dCR vector);
35 
37 static DRay3d FromOriginAndTarget (DPoint2dCR point0, DPoint2dCR point1);
38 
40 static DRay3d FromOriginAndTarget (DPoint3dCR point0, DPoint3dCR point1);
41 
43 static DRay3d FromIinterpolateWithScaledDifference (DPoint3dCR point0, double fraction, DPoint3dCR point1, double vectorScale);
44 
46 ValidatedDRay3d ValidatedNormalize () const;
47 
48 //END_FROM_METHODS
50 void InitFrom (DSegment3dCR segment);
51 
53 void InitFromOriginAndVector (DPoint3dCR origin, DVec3dCR vector);
54 
56 void InitFromOriginAndTarget (DPoint2dCR point0, DPoint2dCR point1);
57 
59 void InitFromOriginAndTarget (DPoint3dCR point0, DPoint3dCR point1);
60 
63 bool InitFromPlanePlaneIntersection (DPlane3dCR planeA, DPlane3dCR planeB);
64 
66 void EvaluateEndPoints (DPoint3dR point0, DPoint3dR point1) const;
67 
70 DPoint3d FractionParameterToPoint
71 (
72 double param
73 ) const;
74 
75 
78 double DirectionDotVectorToTarget (DPoint3dCR target) const;
79 
82 double DirectionDotVector (DVec3d vector) const;
83 
89 bool ProjectPointBounded
90 (
91 DPoint3dR closestPoint,
92 double &closestParam,
93 DPoint3dCR point
94 ) const;
95 
100 bool ProjectPointUnbounded
101 (
102 DPoint3dR closestPoint,
103 double &closestParam,
104 DPoint3dCR point
105 ) const;
106 
113 static void ClosestApproachUnboundedRayBoundedSegment
114 (
115 double &fractionRay,
116 double &fractionSegment,
117 DPoint3dR pointRay,
118 DPoint3dR pointSegment,
119 DRay3dCR ray,
120 DSegment3dCR segment
121 );
122 
130 static bool ClosestApproachUnboundedRayUnboundedRay
131 (
132 double &fractionA,
133 double &fractionB,
134 DPoint3dR pointA,
135 DPoint3dR pointB,
136 DRay3dCR rayA,
137 DRay3dCR rayB
138 );
139 
147 bool Intersect
148 (
149 DPoint3dR intPoint,
150 double &intParam,
151 DPlane3dCR plane
152 ) const;
153 
160 bool IntersectZPlane
161 (
162 TransformR frame,
163 double localZ,
164 DPoint3dR uvw,
165 double &t
166 ) const;
167 
177 int IntersectCircleXY
178 (
179 DPoint3dP intPoint,
180 double *pIntParam,
181 DPoint3dCR center,
182 double radius
183 ) const;
184 
185 
186 #endif
187 };
DVec3d direction
Direction vector. This is NOT necessarily a unit vector.
Definition: dray3d.h:26
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
struct Transform & TransformR
Definition: msgeomstructs_typedefs.h:134
struct DPoint3d * DPoint3dP
Definition: msgeomstructs_typedefs.h:79
DPoint3d origin
Start point of ray.
Definition: dray3d.h:24
ValidatedValue< DRay3d > ValidatedDRay3d
Definition: GeomApi.h:360
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
struct DPlane3d const & DPlane3dCR
Definition: msgeomstructs_typedefs.h:113
struct DPoint3d & DPoint3dR
Definition: msgeomstructs_typedefs.h:79
Start point and direction (NOT necessarily unit) for a 3D ray.
Definition: dray3d.h:21
struct DSegment3d const & DSegment3dCR
Definition: msgeomstructs_typedefs.h:115
#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

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