CFx SDK Documentation  2023 SP0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OdGeVector3d Class Reference

#include <GeVector3d.h>

Public Member Functions

 OdGeVector3d ()
 
 OdGeVector3d (double xx, double yy, double zz)
 
 OdGeVector3d (const OdGePlanarEnt &plane, const OdGeVector2d &vector2d)
 
OdGeVector3dsetToProduct (const OdGeMatrix3d &matrix, const OdGeVector3d &vect)
 
OdGeVector3dsetToProduct (const OdGeVector3d &vect, double scale)
 
OdGeVector3dtransformBy (const OdGeMatrix3d &xfm)
 
OdGeVector3drotateBy (double angle, const OdGeVector3d &axis)
 
OdGeVector3dmirror (const OdGeVector3d &normalToPlane)
 
OdGeVector2d convert2d (const OdGePlanarEnt &plane) const
 
OdGeVector2d convert2d () const
 
OdGeVector3d operator* (double scale) const
 
OdGeVector3doperator*= (double scale)
 
OdGeVector3d operator/ (double scale) const
 
OdGeVector3doperator/= (double scale)
 
OdGeVector3d operator+ (const OdGeVector3d &vect) const
 
OdGeVector3d operator+= (const OdGeVector3d &vect)
 
OdGeVector3d operator- (const OdGeVector3d &vect) const
 
OdGeVector3d operator-= (const OdGeVector3d &vect)
 
OdGeVector3dsetToSum (const OdGeVector3d &vector1, const OdGeVector3d &vector2)
 
OdGeVector3d operator- () const
 
OdGeVector3dnegate ()
 
OdGeVector3d perpVector () const
 
double angleTo (const OdGeVector3d &vect) const
 
double angleTo (const OdGeVector3d &vect, const OdGeVector3d &refVector) const
 
double angleOnPlane (const OdGePlanarEnt &plane) const
 
OdGeVector3d normal (const OdGeTol &tol=OdGeContext::gTol) const
 
OdGeVector3dnormalize (const OdGeTol &tol=OdGeContext::gTol)
 
OdGeVector3dnormalize (const OdGeTol &tol, OdGe::ErrorCondition &status)
 
double normalizeGetLength (double tol=1.e-300)
 
double length () const
 
void setLength (double length)
 
double lengthSqrd () const
 
bool isUnitLength (const OdGeTol &tol=OdGeContext::gTol) const
 
bool isZeroLength (const OdGeTol &tol=OdGeContext::gTol) const
 
bool isParallelTo (const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isParallelTo (const OdGeVector3d &vect, const OdGeTol &tol, OdGeError &status) const
 
bool isCodirectionalTo (const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isCodirectionalTo (const OdGeVector3d &vect, const OdGeTol &tol, OdGeError &status) const
 
bool isPerpendicularTo (const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isPerpendicularTo (const OdGeVector3d &vect, const OdGeTol &tol, OdGeError &status) const
 
double dotProduct (const OdGeVector3d &vect) const
 
OdGeVector3d crossProduct (const OdGeVector3d &vect) const
 
OdGeVector3d orthoProject (const OdGeVector3d &planeNormal) const
 
OdGeVector3d orthoProject (const OdGeVector3d &planeNormal, const OdGeTol &tol, OdGeError &flag) const
 
bool operator== (const OdGeVector3d &vect) const
 
bool operator!= (const OdGeVector3d &vect) const
 
bool isEqualTo (const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
 
double operator[] (unsigned int i) const
 
double & operator[] (unsigned int i)
 
unsigned int largestElement () const
 
OdGeVector3dset (double xx, double yy, double zz)
 
OdGeVector3dset (const OdGePlanarEnt &plane, const OdGeVector2d &vect)
 
 operator OdGeMatrix3d () const
 
const OdGePoint3dasPoint () const
 
OdGePoint3dasPoint ()
 

Public Attributes

double x
 
double y
 
double z
 

Static Public Attributes

static GE_STATIC_EXPORT const OdGeVector3d kIdentity
 
static GE_STATIC_EXPORT const OdGeVector3d kXAxis
 
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
 
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
 

Detailed Description

This class represents vectors in 3D space.

Remarks
OdGeVector3d may be viewed as an array[3] of doubles.

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

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

Definition at line 53 of file GeVector3d.h.

Constructor & Destructor Documentation

◆ OdGeVector3d() [1/3]

OdGeVector3d::OdGeVector3d ( )
inline
Parameters
source[in] Object to be cloned.
xx[in] X-coordinate.
yy[in] Y-coordinate.
zz[in] Z-coordinate.
vect[in] Any 2D vector.
plane[in] Any plane.
Remarks
When called with no arguments, constructs a zero-length vector.

When called with plane and vect, constructs the 3D vector correspoponding to the 2D vector in the coordinates of the plane:

    uAxis * vect.x + vAxis * vect.y

where uAxis and vAxis are returned by

    plane.get(origin, uAxis, vAxis)

The 3D vector will be parallel to the 2D vector.

Definition at line 78 of file GeVector3d.h.

◆ OdGeVector3d() [2/3]

OdGeVector3d::OdGeVector3d ( double  xx,
double  yy,
double  zz 
)
inline

Definition at line 80 of file GeVector3d.h.

◆ OdGeVector3d() [3/3]

OdGeVector3d::OdGeVector3d ( const OdGePlanarEnt plane,
const OdGeVector2d vector2d 
)

Member Function Documentation

◆ angleOnPlane()

double OdGeVector3d::angleOnPlane ( const OdGePlanarEnt plane) const

Returns the angle of this vector projected onto the specified plane

Parameters
plane[in] Any 3D plane.
Remarks
This vector is projected orthogonally onto the plane through its origin, and is measured with respect to axis1 as returned by
    plane.getCoordSystem(origin, axis1, axis2)

◆ angleTo() [1/2]

double OdGeVector3d::angleTo ( const OdGeVector3d vect) const

Returns the angle to the specified vector.

Parameters
vect[in] Any 3D vector.
Remarks
If refVector is not specified: Returns a value in the range [0.0 .. OdaPI]. This function is commutative.

◆ angleTo() [2/2]

double OdGeVector3d::angleTo ( const OdGeVector3d vect,
const OdGeVector3d refVector 
) const

Returns the angle to the specified vector.

Parameters
vect[in] Any 3D vector.
Remarks
If refVector is specified: Returns a value in the range [0.0 .. Oda2PI]. If (refVector.dotProduct(crossProduct(vect)) >= 0.0, the return value is angleTo(vect). If (refVector.dotProduct(crossProduct(vect)) < 0.0, the return value is Oda2PI - angleTo(vect)

◆ asPoint() [1/2]

OdGePoint3d & OdGeVector3d::asPoint ( )
inline

Returns this vector as a point.

Definition at line 647 of file GeVector3d.h.

◆ asPoint() [2/2]

const OdGePoint3d & OdGeVector3d::asPoint ( ) const
inline

Returns this vector as a point.

Definition at line 642 of file GeVector3d.h.

◆ convert2d() [1/2]

OdGeVector2d OdGeVector3d::convert2d ( ) const
inline

Returns the 2D vector, in the coordinate system of the plane, corresponding to the 3D vector.

Remarks
The 3D vector must be parallel to the plane.

If no plane is specified, the XY plane is used.

Definition at line 173 of file GeVector3d.h.

◆ convert2d() [2/2]

OdGeVector2d OdGeVector3d::convert2d ( const OdGePlanarEnt plane) const

Returns the 2D vector, in the coordinate system of the plane, corresponding to the 3D vector.

Remarks
The 3D vector must be parallel to the plane.

If no plane is specified, the XY plane is used.

◆ crossProduct()

OdGeVector3d OdGeVector3d::crossProduct ( const OdGeVector3d vect) const

Returns the cross product of this vector and the specified vector.

Parameters
vect[in] Any 3D vector.

◆ dotProduct()

double OdGeVector3d::dotProduct ( const OdGeVector3d vect) const
inline

Returns the dot product of this vector and the specified vector.

Parameters
vect[in] Any 3D vector.

Definition at line 487 of file GeVector3d.h.

◆ isCodirectionalTo() [1/2]

bool OdGeVector3d::isCodirectionalTo ( const OdGeVector3d vect,
const OdGeTol tol,
OdGeError status 
) const

Returns true if and only if the specified vector is codirectional to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.
status[out] Receives the status of test.
Remarks
If the length of either vector is < tol, kThis is returned in status.

Possible values for status are as follows:

@untitled table kOk
k0This
k0Arg1

◆ isCodirectionalTo() [2/2]

bool OdGeVector3d::isCodirectionalTo ( const OdGeVector3d vect,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if the specified vector is codirectional to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.

◆ isEqualTo()

bool OdGeVector3d::isEqualTo ( const OdGeVector3d vect,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if vect is identical to this vector, within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.

◆ isParallelTo() [1/2]

bool OdGeVector3d::isParallelTo ( const OdGeVector3d vect,
const OdGeTol tol,
OdGeError status 
) const

Returns true if and only if the specified vector is parallel to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.
status[out] Receives the status of test.
Remarks
If the length of either vector is < tol, kThis is returned in status.

Possible values for status are as follows:

@untitled table kOk
k0This
k0Arg1

◆ isParallelTo() [2/2]

bool OdGeVector3d::isParallelTo ( const OdGeVector3d vect,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if the specified vector is parallel to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.

◆ isPerpendicularTo() [1/2]

bool OdGeVector3d::isPerpendicularTo ( const OdGeVector3d vect,
const OdGeTol tol,
OdGeError status 
) const

Returns true if and only if the specified vector is perpendicular to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.
status[out] Receives the status of test.
Remarks
If the length of either vector is < tol, kThis is returned in status.

Possible values for status are as follows:

@untitled table kOk
k0This
k0Arg1

◆ isPerpendicularTo() [2/2]

bool OdGeVector3d::isPerpendicularTo ( const OdGeVector3d vect,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if the specified vector is perpendicular to this vector within the specified tolerance.

Parameters
vect[in] Any 3D vector.
tol[in] Geometric tolerance.

◆ isUnitLength()

bool OdGeVector3d::isUnitLength ( const OdGeTol tol = OdGeContext::gTol) const

Returns true if and only if the length of this vector is 1.0 within the specified tolerance.

Parameters
tol[in] Geometric tolerance.

◆ isZeroLength()

bool OdGeVector3d::isZeroLength ( const OdGeTol tol = OdGeContext::gTol) const

Returns true if and only if the length of this vector is 0.0 within the specified tolerance.

Parameters
tol[in] Geometric tolerance.

◆ largestElement()

unsigned int OdGeVector3d::largestElement ( ) const

Returns the index of the largest absolute coordinate of this vector.

◆ length()

double OdGeVector3d::length ( ) const

Returns the length of this vector.

◆ lengthSqrd()

double OdGeVector3d::lengthSqrd ( ) const
inline

Returns the square of the length of this vector.

Definition at line 366 of file GeVector3d.h.

◆ mirror()

OdGeVector3d& OdGeVector3d::mirror ( const OdGeVector3d normalToPlane)

Mirrors the entity about the plane passing through the origin with the specified normal, and returns a reference to the entity.

Parameters
normalToPlane[in] Normal to Plane.

◆ negate()

OdGeVector3d& OdGeVector3d::negate ( )
inline

Negates this vector (-x, -y, -z), and returns a reference to this vector.

Definition at line 239 of file GeVector3d.h.

◆ normal()

OdGeVector3d OdGeVector3d::normal ( const OdGeTol tol = OdGeContext::gTol) const

Returns the unit vector codirectional with this vector.

Parameters
tol[in] Geometric tolerance.
Remarks
If the length() <= tol, this vector is returned.

◆ normalize() [1/2]

OdGeVector3d& OdGeVector3d::normalize ( const OdGeTol tol,
OdGe::ErrorCondition status 
)

Sets this vector to the unit vector codirectional with this vector, and returns a reference to this vector

Parameters
tol[in] Geometric tolerance.
status[out] Receives the status of normalization.
Remarks
If this.length() <= tol, this vector is unchanged, and kThis is returned in status.

Possible values for status are as follows:

@untitled table kOk
k0This

◆ normalize() [2/2]

OdGeVector3d& OdGeVector3d::normalize ( const OdGeTol tol = OdGeContext::gTol)

Sets this vector to the unit vector codirectional with this vector, and returns a reference to this vector

Parameters
tol[in] Geometric tolerance.
Remarks
If this.length() <= tol, this vector is unchanged.

◆ normalizeGetLength()

double OdGeVector3d::normalizeGetLength ( double  tol = 1.e-300)

Sets this vector to the unit vector codirectional with this vector, and returns the length prior to normalization.

Remarks
If this.length() <= tol, this vector is unchanged zero length is returned.

◆ operator OdGeMatrix3d()

OdGeVector3d::operator OdGeMatrix3d ( ) const

Returns the equivalent 3D tranformation matrix.

◆ operator!=()

bool OdGeVector3d::operator!= ( const OdGeVector3d vect) const

◆ operator*()

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

Definition at line 175 of file GeVector3d.h.

◆ operator*=()

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

Definition at line 179 of file GeVector3d.h.

◆ operator+()

OdGeVector3d OdGeVector3d::operator+ ( const OdGeVector3d vect) const
inline

Definition at line 203 of file GeVector3d.h.

◆ operator+=()

OdGeVector3d OdGeVector3d::operator+= ( const OdGeVector3d vect)
inline

Definition at line 206 of file GeVector3d.h.

◆ operator-() [1/2]

OdGeVector3d OdGeVector3d::operator- ( ) const
inline

Definition at line 234 of file GeVector3d.h.

◆ operator-() [2/2]

OdGeVector3d OdGeVector3d::operator- ( const OdGeVector3d vect) const
inline

Definition at line 210 of file GeVector3d.h.

◆ operator-=()

OdGeVector3d OdGeVector3d::operator-= ( const OdGeVector3d vect)
inline

Definition at line 213 of file GeVector3d.h.

◆ operator/()

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

Definition at line 188 of file GeVector3d.h.

◆ operator/=()

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

Definition at line 194 of file GeVector3d.h.

◆ operator==()

bool OdGeVector3d::operator== ( const OdGeVector3d vect) const

◆ operator[]() [1/2]

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

Definition at line 540 of file GeVector3d.h.

◆ operator[]() [2/2]

double OdGeVector3d::operator[] ( unsigned int  i) const
inline
Parameters
i[in] Index of coordinate.

Returns or references the ith coordinate of this vector.

0 returns or references the X-coordinate. 1 returns or references the Y-coordinate. 2 returns or references the Z-coordinate.

Definition at line 538 of file GeVector3d.h.

◆ orthoProject() [1/2]

OdGeVector3d OdGeVector3d::orthoProject ( const OdGeVector3d planeNormal) const

◆ orthoProject() [2/2]

OdGeVector3d OdGeVector3d::orthoProject ( const OdGeVector3d planeNormal,
const OdGeTol tol,
OdGeError flag 
) const

◆ perpVector()

OdGeVector3d OdGeVector3d::perpVector ( ) const

Returns a vector perpendicular to this one.

Remarks
The orthogonal vector is determined by function OdGeContext::gOrthoVector()

◆ rotateBy()

OdGeVector3d& OdGeVector3d::rotateBy ( double  angle,
const OdGeVector3d axis 
)

Rotates this vector the specified angle about the specified axis, and returns a reference to this vector.

Parameters
angle[in] Rotation angle.
axis[in] Axis of rotation.

◆ set() [1/2]

OdGeVector3d& OdGeVector3d::set ( const OdGePlanarEnt plane,
const OdGeVector2d vect 
)

Sets this vector to the specified arguments, and returns a reference to this vector.

Parameters
vect[in] Any 2D vector.
plane[in] Any plane.
Remarks
When called with plane and vector, constructs the 3D vector correspoponding to the 2D vector in the coordinates of the plane:
    uAxis * vect.x + vAxis * vect.y
where uAxis and vAxis are returned by
    plane.get(origin, uAxis, vAxis)
The 3D vector will be parallel to the 2D vector.

◆ set() [2/2]

OdGeVector3d& OdGeVector3d::set ( double  xx,
double  yy,
double  zz 
)
inline

Sets this vector to the specified arguments, and returns a reference to this vector.

Parameters
xx[in] X-coordinate.
yy[in] Y-coordinate.
zz[in] Z-coordinate.

Definition at line 555 of file GeVector3d.h.

◆ setLength()

void OdGeVector3d::setLength ( double  length)

Sets the length of this vector.

◆ setToProduct() [1/2]

OdGeVector3d& OdGeVector3d::setToProduct ( const OdGeMatrix3d matrix,
const OdGeVector3d vect 
)

Sets this vector to the product matrix * vect and returns a reference to this vector.

Parameters
matrix[in] Any 3D matrix.
vect[in] Any 3D vector.

◆ setToProduct() [2/2]

OdGeVector3d& OdGeVector3d::setToProduct ( const OdGeVector3d vect,
double  scale 
)
inline

Sets this vector to the product scale * vect and returns a reference to this vector.

Parameters
vect[in] Any 3D vector.
scale[in] Scale factor.

Definition at line 111 of file GeVector3d.h.

◆ setToSum()

OdGeVector3d& OdGeVector3d::setToSum ( const OdGeVector3d vector1,
const OdGeVector3d vector2 
)
inline

Sets this vector to vector1 + vector1, and returns a reference to this vector.

Parameters
vector1[in] Any 3D vector.
vector2[in] Any 3D vector.

Definition at line 224 of file GeVector3d.h.

◆ transformBy()

OdGeVector3d& OdGeVector3d::transformBy ( const OdGeMatrix3d xfm)

Applies the 3D transformation matrix to this vector.

Parameters
xfm[in] 3D transformation matrix.

Member Data Documentation

◆ kIdentity

GE_STATIC_EXPORT const OdGeVector3d OdGeVector3d::kIdentity
static

Definition at line 88 of file GeVector3d.h.

◆ kXAxis

GE_STATIC_EXPORT const OdGeVector3d OdGeVector3d::kXAxis
static

Definition at line 89 of file GeVector3d.h.

◆ kYAxis

GE_STATIC_EXPORT const OdGeVector3d OdGeVector3d::kYAxis
static

Definition at line 90 of file GeVector3d.h.

◆ kZAxis

GE_STATIC_EXPORT const OdGeVector3d OdGeVector3d::kZAxis
static

Definition at line 91 of file GeVector3d.h.

◆ x

double OdGeVector3d::x

Definition at line 601 of file GeVector3d.h.

◆ y

double OdGeVector3d::y

Definition at line 602 of file GeVector3d.h.

◆ z

double OdGeVector3d::z

Definition at line 603 of file GeVector3d.h.


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