CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
OdGePoint2d Class Reference

#include <GePoint2d.h>

Public Member Functions

 OdGePoint2d ()
 
 OdGePoint2d (double xx, double yy)
 
OdGePoint2dsetToProduct (const OdGeMatrix2d &matrix, const OdGePoint2d &point)
 
OdGePoint2dtransformBy (const OdGeMatrix2d &xfm)
 
OdGePoint2drotateBy (double angle, const OdGePoint2d &basePoint=kOrigin)
 
OdGePoint2dmirror (const OdGeLine2d &line)
 
OdGePoint2dscaleBy (double scaleFactor, const OdGePoint2d &basePoint=kOrigin)
 
OdGePoint2d operator* (double scale) const
 
OdGePoint2doperator*= (double scale)
 
OdGePoint2d operator/ (double scale) const
 
OdGePoint2doperator/= (double scale)
 
OdGePoint2d operator+ (const OdGeVector2d &vect) const
 
OdGePoint2doperator+= (const OdGeVector2d &vect)
 
OdGePoint2d operator- (const OdGeVector2d &vect) const
 
OdGePoint2doperator-= (const OdGeVector2d &vect)
 
OdGePoint2dsetToSum (const OdGePoint2d &point, const OdGeVector2d &vect)
 
OdGeVector2d operator- (const OdGePoint2d &point) const
 
const OdGeVector2dasVector () const
 
OdGeVector2dasVector ()
 
double distanceTo (const OdGePoint2d &point) const
 
double distanceSqrdTo (const OdGePoint2d &point) const
 
bool operator== (const OdGePoint2d &point) const
 
bool operator!= (const OdGePoint2d &point) const
 
bool isEqualTo (const OdGePoint2d &point, const OdGeTol &tol=OdGeContext::gTol) const
 
double & operator[] (unsigned int i)
 
double operator[] (unsigned int i) const
 
OdGePoint2dset (double xx, double yy)
 

Public Attributes

double x
 
double y
 

Static Public Attributes

static GE_STATIC_EXPORT const OdGePoint2d kOrigin
 

Friends

GE_TOOLKIT_EXPORT OdGePoint2d operator* (const OdGeMatrix2d &matrix, const OdGePoint2d &point)
 
OdGePoint2d operator* (double scale, const OdGePoint2d &point)
 

Detailed Description

This class represents points (locations) in 2D space.

Remarks
OdGePoint2d may be viewed as an array[2] of doubles.

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

See also
<link ge_BasicTypes, Working with Basic Geometry Types>

Definition at line 62 of file GePoint2d.h.

Constructor & Destructor Documentation

◆ OdGePoint2d() [1/2]

OdGePoint2d::OdGePoint2d ( )
inline

Default constructor for the OdGePoint2d class.

Remarks
The default constructor constructs a point at the origin.

Definition at line 72 of file GePoint2d.h.

◆ OdGePoint2d() [2/2]

OdGePoint2d::OdGePoint2d ( double  xx,
double  yy 
)
inline

Constructor for the OdGePoint2d class.

Parameters
xx[in] The X-coordinate of this point.
yy[in] The Y-coordinate of this point.
Remarks
Constructs a 2D point with specified coordinates.

Definition at line 86 of file GePoint2d.h.

Member Function Documentation

◆ asVector() [1/2]

OdGeVector2d & OdGePoint2d::asVector ( )
inline

Returns this point as a vector.

Definition at line 459 of file GePoint2d.h.

◆ asVector() [2/2]

const OdGeVector2d & OdGePoint2d::asVector ( ) const
inline

Returns this point as a vector.

Definition at line 452 of file GePoint2d.h.

◆ distanceSqrdTo()

double OdGePoint2d::distanceSqrdTo ( const OdGePoint2d point) const
inline

Returns the squared distance from this point to the specified point.

Parameters
point[in] Any 2D point to which a squared distance is measured.

Definition at line 317 of file GePoint2d.h.

◆ distanceTo()

double OdGePoint2d::distanceTo ( const OdGePoint2d point) const
inline

Returns the distance from this point to the specified point.

Parameters
point[in] Any 2D point to which a distance is measured.

Definition at line 306 of file GePoint2d.h.

◆ isEqualTo()

bool OdGePoint2d::isEqualTo ( const OdGePoint2d point,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if the distance from this point to point is within the specified tolerance.

Parameters
point[in] Any 2D point.
tol[in] Geometric tolerance.

◆ mirror()

OdGePoint2d & OdGePoint2d::mirror ( const OdGeLine2d line)

Mirrors this point about the specified 2D line.

Parameters
line[in] Mirror Line.

◆ operator!=()

bool OdGePoint2d::operator!= ( const OdGePoint2d point) const
inline

Inequality operator. Returns true if any of the coordinates of this point are not equal to the corresponding coordinates of the specified point.

Parameters
point[in] A 2D point to be checked for inequality with this point.

Definition at line 344 of file GePoint2d.h.

◆ operator*()

OdGePoint2d OdGePoint2d::operator* ( double  scale) const
inline

Multiplication operator for the OdGePoint2d class.

Parameters
scale[in] Input scale factor.
Remarks
Makes this point equal to the point scaled by a scale factor.

Definition at line 174 of file GePoint2d.h.

◆ operator*=()

OdGePoint2d & OdGePoint2d::operator*= ( double  scale)
inline

Multiplication operator for the OdGePoint2d class.

Parameters
scale[in] Input scale factor.
Remarks
Scales this point by a scale factor. Returns the reference to this point.

Definition at line 188 of file GePoint2d.h.

◆ operator+()

OdGePoint2d OdGePoint2d::operator+ ( const OdGeVector2d vect) const
inline

Addition operator for the OdGePoint2d class.

Parameters
vect[in] Input vector by which a point is translated.
Remarks
Translates this point by the specified vector.

Definition at line 418 of file GePoint2d.h.

◆ operator+=()

OdGePoint2d & OdGePoint2d::operator+= ( const OdGeVector2d vect)
inline

Addition operator for the OdGePoint2d class.

Parameters
vect[in] Input vector by which a point is translated.
Remarks
Returns a 2D point that is translated by the specified input vector.

Definition at line 424 of file GePoint2d.h.

◆ operator-() [1/2]

OdGeVector2d OdGePoint2d::operator- ( const OdGePoint2d point) const
inline

Subtraction operator for the OdGePoint2d class.

Parameters
point[in] Input 2D point, coordinates of which are subtracted from the coordinates of this point.
Remarks
Returns a vector formed as a result of this point's coordinates minus coordinates of the specified point.

Definition at line 446 of file GePoint2d.h.

◆ operator-() [2/2]

OdGePoint2d OdGePoint2d::operator- ( const OdGeVector2d vect) const
inline

Subtraction operator for the OdGePoint2d class.

Parameters
vect[in] Input vector by which a point is translated.
Remarks
Returns a point that is translated in the opposite direction and length of the specified input vector.

Definition at line 432 of file GePoint2d.h.

◆ operator-=()

OdGePoint2d & OdGePoint2d::operator-= ( const OdGeVector2d vect)
inline

Subtraction operator for the OdGePoint2d class.

Parameters
vect[in] Input vector by which a point is translated.
Remarks
Returns a reference to the point equal to this point translated by the vector opposite to the specified vector.

Definition at line 438 of file GePoint2d.h.

◆ operator/()

OdGePoint2d OdGePoint2d::operator/ ( double  scale) const
inline

Division operator for the OdGePoint2d class.

Parameters
scale[in] Input scale factor.
Remarks
Returns the point equal to this point scaled by a scale factor 1/scale.

Definition at line 204 of file GePoint2d.h.

◆ operator/=()

OdGePoint2d & OdGePoint2d::operator/= ( double  scale)
inline

Division operator for the OdGePoint2d class.

Parameters
scale[in] Input scale factor.
Remarks
Returns a reference to a point that is the result of scaling this point with respect to the origin by a scale factor.

Definition at line 218 of file GePoint2d.h.

◆ operator==()

bool OdGePoint2d::operator== ( const OdGePoint2d point) const
inline

Equality operator. Returns true if all the coordinates of this point are equal to the corresponding coordinates of the specified point.

Parameters
point[in] A 2D point to be checked for equality with this point.

Definition at line 332 of file GePoint2d.h.

◆ operator[]() [1/2]

double & OdGePoint2d::operator[] ( unsigned int  i)
inline

Returns ith coordinate of this point.

Parameters
i[in] Index of coordinate.
Remarks
0 returns the X-coordinate. 1 returns the Y-coordinate.

Definition at line 371 of file GePoint2d.h.

◆ operator[]() [2/2]

double OdGePoint2d::operator[] ( unsigned int  i) const
inline

References ith coordinate of this point.

Parameters
i[in] Index of coordinate.
Remarks
0 references the X-coordinate. 1 references the Y-coordinate.

Definition at line 387 of file GePoint2d.h.

◆ rotateBy()

OdGePoint2d & OdGePoint2d::rotateBy ( double  angle,
const OdGePoint2d basePoint = kOrigin 
)

Rotates this point about the specified basePoint by the specified angle.

Parameters
angle[in] Rotation angle in radians.
basePoint[in] Basepoint relative to which rotation is computed.

◆ scaleBy()

OdGePoint2d & OdGePoint2d::scaleBy ( double  scaleFactor,
const OdGePoint2d basePoint = kOrigin 
)

Scales this point by the scale factor about the basepoint.

Parameters
scaleFactor[in] Scale Factor. The scale factor must be greater than zero.
basePoint[in] Basepoint relative to which scaling is computed.

◆ set()

OdGePoint2d & OdGePoint2d::set ( double  xx,
double  yy 
)
inline

Sets this point to the specified X and Y coordinates. Returns a reference to this point.

Parameters
xx[in] The X-coordinate of this point.
yy[in] The Y-coordinate of this point.

Definition at line 400 of file GePoint2d.h.

◆ setToProduct()

OdGePoint2d & OdGePoint2d::setToProduct ( const OdGeMatrix2d matrix,
const OdGePoint2d point 
)

Sets this point to the result of the matrix multiplication (matrix * point). Returns a reference to this point.

Parameters
matrix[in] A 2D matrix with which a specified point is multiplied.
point[in] The point to be multiplied.

◆ setToSum()

OdGePoint2d & OdGePoint2d::setToSum ( const OdGePoint2d point,
const OdGeVector2d vect 
)

Sets this point to point + vect, and returns a reference to this point.

Parameters
point[in] Any 2D point.
vect[in] A 2D vector.

◆ transformBy()

OdGePoint2d & OdGePoint2d::transformBy ( const OdGeMatrix2d xfm)

Sets this point to the result of the matrix multiplication of xfm * this point. Returns a reference to this point.

Parameters
xfm[in] A 2D matrix with which this point is multiplied.

Friends And Related Function Documentation

◆ operator* [1/2]

GE_TOOLKIT_EXPORT OdGePoint2d operator* ( const OdGeMatrix2d matrix,
const OdGePoint2d point 
)
friend
Remarks
Sets this point to the result of the matrix multiplication of matrix * point.
Parameters
matrix[in] Any 2D matrix.
point[in] The point to be multiplied.

◆ operator* [2/2]

OdGePoint2d operator* ( double  scale,
const OdGePoint2d point 
)
friend
Remarks
Sets this point to the result of the matrix multiplication of the point and a scale factor.
Parameters
scale[in] Scale factor.
point[in] The point to be multiplied.

Definition at line 111 of file GePoint2d.h.

Member Data Documentation

◆ kOrigin

GE_STATIC_EXPORT const OdGePoint2d OdGePoint2d::kOrigin
static

Definition at line 93 of file GePoint2d.h.

◆ x

double OdGePoint2d::x

Definition at line 409 of file GePoint2d.h.

◆ y

double OdGePoint2d::y

Definition at line 410 of file GePoint2d.h.


The documentation for this class was generated from the following file: