CFx SDK Documentation  2020SP3
GePoint3d.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 #ifndef OD_GEPNT3D_H
26 #define OD_GEPNT3D_H
28 #include "Ge/GeVector3d.h"
29 #include "Ge/GePoint2d.h"
30 #include "OdArray.h"
31 
32 class OdGeMatrix3d;
33 class OdGeLinearEnt3d;
34 class OdGePlane;
35 class OdGePlanarEnt;
36 class OdGeVector3d;
37 class OdGePoint2d;
38 
39 #include "TD_PackPush.h"
40 
55 {
56 public:
74  : x (0.0), y (0.0), z (0.0)
75  {
76  }
78  double xx,
79  double yy,
80  double zz)
81  : x (xx), y (yy), z (zz)
82  {
83  }
84 
86  const OdGePlanarEnt& plane,
87  const OdGePoint2d& pnt2d);
88 
89  GE_STATIC_EXPORT static const OdGePoint3d kOrigin; // Origin (0,0,0).
90 
92  const OdGeMatrix3d& matrix,
93  const OdGePoint3d& point);
94 
96  double scale,
97  const OdGePoint3d& point)
98  {
99  return OdGePoint3d(point.x * scale, point.y * scale, point.z * scale);
100  }
101 
109  const OdGeMatrix3d& xfm,
110  const OdGePoint3d& point);
111 
119  const OdGeMatrix3d& xfm);
120 
129  double angle,
130  const OdGeVector3d& vect,
131  const OdGePoint3d& basePoint = OdGePoint3d::kOrigin);
132 
139  const OdGePlane& plane);
140 
148  double scaleFactor,
149  const OdGePoint3d& basePoint = OdGePoint3d::kOrigin);
150 
160  const OdGePlanarEnt& plane) const;
161 
163  {
164  return OdGePoint2d(x, y);
165  }
166 
168  double scale) const
169  {
170  return OdGePoint3d (x * scale, y * scale, z * scale);
171  }
172 
173  OdGePoint3d& operator *=(
174  double scale)
175  {
176  x *= scale;
177  y *= scale;
178  z *= scale;
179  return *this;
180  }
181 
182  OdGePoint3d operator /(
183  double scale) const
184  {
185  return OdGePoint3d (x / scale, y / scale, z / scale);
186  }
187 
188  OdGePoint3d& operator /=(
189  double scale)
190  {
191  x /= scale;
192  y /= scale;
193  z /= scale;
194  return *this;
195  }
196 
197  OdGePoint3d operator +(
198  const OdGeVector3d& vect) const
199  {
200  return OdGePoint3d (x + vect.x, y + vect.y, z + vect.z);
201  }
202 
203  OdGePoint3d& operator +=(
204  const OdGeVector3d& vect)
205  {
206  x += vect.x;
207  y += vect.y;
208  z += vect.z;
209  return *this;
210  }
211 
212  OdGePoint3d operator -(
213  const OdGeVector3d& vect) const
214  {
215  return OdGePoint3d (x - vect.x, y - vect.y, z - vect.z);
216  }
217 
218  OdGePoint3d& operator -=(
219  const OdGeVector3d& vect)
220  {
221  x -= vect.x;
222  y -= vect.y;
223  z -= vect.z;
224  return *this;
225  }
226 
234  const OdGePoint3d& point,
235  const OdGeVector3d& vect);
236 
237  OdGeVector3d operator -(
238  const OdGePoint3d& point) const
239  {
240  return OdGeVector3d (x - point.x, y - point.y, z - point.z);
241  }
242 
246  const OdGeVector3d& asVector() const
247  {
248  return *reinterpret_cast<const OdGeVector3d*>(this);
249  }
250 
256  double distanceTo(
257  const OdGePoint3d& point) const;
258 
266  const OdGePlane& plane,
267  const OdGeVector3d& vect) const;
268 
275  const OdGePlane& plane) const;
276 
278  const OdGePoint3d& point) const
279  {
280  return isEqualTo (point);
281  }
282 
284  const OdGePoint3d& point) const
285  {
286  return !isEqualTo (point);
287  }
288 
296  bool isEqualTo(
297  const OdGePoint3d& point,
298  const OdGeTol& tol = OdGeContext::gTol) const;
299 
309  double operator [](
310  unsigned int i) const
311  {
312  return * (&x+i);
313  }
314 
315  double& operator [](
316  unsigned int i)
317  {
318  return * (&x+i);
319  }
320 
338  double xx,
339  double yy,
340  double zz)
341  {
342  x = xx;
343  y = yy;
344  z = zz;
345  return *this;
346  }
347 
364  const OdGePlanarEnt& plane,
365  const OdGePoint2d& point);
366 
367  double x; // X-coordinate
368  double y; // Y-coordinate
369  double z; // Z-coordinate
370 
372  OdGePoint3d& point);
373 };
374 
375 #include "TD_PackPop.h"
376 
377 #endif
378 
OdGePoint3d::orthoProject
OdGePoint3d orthoProject(const OdGePlane &plane) const
OdGePlane
Definition: GePlane.h:45
OdGeVector3d
Definition: GeVector3d.h:54
OdGePoint3d::OdGePoint3d
OdGePoint3d(double xx, double yy, double zz)
Definition: GePoint3d.h:77
OdGePoint3d::convert2d
OdGePoint2d convert2d() const
Definition: GePoint3d.h:162
OdGePoint3d::project
OdGePoint3d project(const OdGePlane &plane, const OdGeVector3d &vect) const
scale
scale
Definition: DimVarDefs.h:1684
tol
tol
Definition: DimVarDefs.h:2287
OdGeVector3d::x
double x
Definition: GeVector3d.h:601
OdGePoint3d::swapWithPoint
OdGePoint3d & swapWithPoint(OdGePoint3d &point)
OdGeVector3d::z
double z
Definition: GeVector3d.h:603
OdGePoint3d::y
double y
Definition: GePoint3d.h:368
OdGePoint3d::x
double x
Definition: GePoint3d.h:367
TD_PackPop.h
OdGePoint3d::set
OdGePoint3d & set(double xx, double yy, double zz)
Definition: GePoint3d.h:337
x
GLfloat x
Definition: gles2_ext.h:314
OdGePoint3d::set
OdGePoint3d & set(const OdGePlanarEnt &plane, const OdGePoint2d &point)
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdGePoint3d::rotateBy
OdGePoint3d & rotateBy(double angle, const OdGeVector3d &vect, const OdGePoint3d &basePoint=OdGePoint3d::kOrigin)
operator*
GE_TOOLKIT_EXPORT OdGeVector3d operator*(const OdGeMatrix3d &matrix, const OdGeVector3d &vect)
OdArray.h
OdGePlanarEnt
Definition: GePlanarEnt.h:62
OdGePoint3d::setToProduct
OdGePoint3d & setToProduct(const OdGeMatrix3d &xfm, const OdGePoint3d &point)
OdGePoint3d::asVector
const OdGeVector3d & asVector() const
Definition: GePoint3d.h:246
OdGePoint3d
Definition: GePoint3d.h:55
OdDAI::operator!=
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
OdGePoint3d::convert2d
OdGePoint2d convert2d(const OdGePlanarEnt &plane) const
y
GLfloat GLfloat y
Definition: gles2_ext.h:316
OdGePoint3d::kOrigin
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition: GePoint3d.h:89
TD_PackPush.h
OdGePoint3d::mirror
OdGePoint3d & mirror(const OdGePlane &plane)
OdGePoint3d::scaleBy
OdGePoint3d & scaleBy(double scaleFactor, const OdGePoint3d &basePoint=OdGePoint3d::kOrigin)
OdGePoint3d::OdGePoint3d
OdGePoint3d()
Definition: GePoint3d.h:73
OdGePoint3d::OdGePoint3d
OdGePoint3d(const OdGePlanarEnt &plane, const OdGePoint2d &pnt2d)
OdGePoint3d::z
double z
Definition: GePoint3d.h:369
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
GE_TOOLKIT_EXPORT
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdGeLinearEnt3d
Definition: GeLinearEnt3d.h:44
OdGePoint3d::transformBy
OdGePoint3d & transformBy(const OdGeMatrix3d &xfm)
OdGePoint3d::isEqualTo
bool isEqualTo(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
OdGePoint3d::distanceTo
double distanceTo(const OdGePoint3d &point) const
GE_STATIC_EXPORT
#define GE_STATIC_EXPORT
Definition: GeExport.h:53
OdGeTol
Definition: GeTol.h:49
OdGePoint3d::setToSum
OdGePoint3d & setToSum(const OdGePoint3d &point, const OdGeVector3d &vect)
OdGeVector3d::y
double y
Definition: GeVector3d.h:602
GePoint2d.h
z
GLfloat GLfloat GLfloat z
Definition: gles2_ext.h:318
OdGePoint2d
Definition: GePoint2d.h:60