ICF 3.0.5.47
Technical documentation of ICF Libraries
i3d::CVector3d Class Reference

Definition of position or mathematical vector in 3D space. More...

#include <CVector3d.h>

Inheritance diagram for i3d::CVector3d:
Collaboration diagram for i3d::CVector3d:

Public Types

typedef imath::TVector< 3 > BaseClass
 
- Public Types inherited from imath::TVector< 3 >
typedef double ElementType
 
typedef std::array< double, Size > Elements
 

Public Member Functions

 CVector3d ()
 Default constructor.
 
 CVector3d (double x, double y, double z)
 Construct initializing elements to specified values.
 
 CVector3d (const imath::TVector< 3 > &vector)
 Copy constructor.
 
 CVector3d (const i2d::CVector2d &vector, double z=0)
 Contructs 3D vector from 2D.
 
double GetX () const
 Get X position of this vector.
 
void SetX (double value)
 Set X position of this vector.
 
double GetY () const
 Get Y position of this vector.
 
void SetY (double value)
 Set Y position of this vector.
 
double GetZ () const
 Get Y position of this vector.
 
void SetZ (double value)
 Set Y position of this vector.
 
CVector3d GetTranslated (const imath::TVector< 3 > &vector)
 Get translated point.
 
CVector3d GetCrossProduct (const imath::TVector< 3 > &vector) const
 Return Z coordinate of two vectors cross product.
 
CVector3d GetNormalized (double length=1.0) const
 Return normalized vector with the same direction and specified length.
 
i2d::CVector2d GetPlaneCasted () const
 Get XY part of this 3D vector.
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive.
 
CVector3d operator- () const
 
CVector3d operator+ (const imath::TVector< 3 > &vector) const
 
CVector3d operator- (const imath::TVector< 3 > &vector) const
 
CVector3d operator* (double scalar) const
 
CVector3d operator/ (double scalar) const
 
CVector3doperator+= (const imath::TVector< 3 > &vector)
 
CVector3doperator-= (const imath::TVector< 3 > &vector)
 
CVector3doperator*= (double scalar)
 
CVector3doperator/= (double scalar)
 
- Public Member Functions inherited from imath::TVector< 3 >
 TVector ()
 Create an uninitialized point.
 
 TVector (const TVector< Size, double > &vector)
 Copy constructor.
 
 TVector (TVector< Size, double > &&vector) noexcept
 Move constructor.
 
const double & GetElement (int i) const
 Get element at specified i.
 
double & GetElementRef (int i)
 Get reference to element at specified i.
 
void SetElement (int i, const double &value)
 Set element at specified i.
 
void SetAllElements (const double &value)
 Set some value to all elements.
 
void Reset ()
 Set all coordinates to zero.
 
void Clear ()
 Set all coordinates to zero.
 
const TVector< Size, double >::ElementsGetElements () const
 Get read-only access to internal element container.
 
TVector< Size, double >::ElementsGetElementsRef ()
 Get access to internal element container.
 
void Translate (const TVector< Size, double > &vector)
 Translate the point.
 
TVector< Size, double > GetTranslated (const TVector< Size, double > &vector)
 Get translated point.
 
void GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result)
 /overloaded
 
void ScaledCumulate (const TVector< Size, double > &vector, double scale)
 Add second vector scaled by specified factor.
 
bool IsNull (double tolerance=I_BIG_EPSILON) const
 Check if this vector is null.
 
double GetDotProduct (const TVector< Size, double > &vector) const
 Return dot product of two vectors.
 
double GetLength2 () const
 Return euclidian length square.
 
double GetLength () const
 Return euclidian length.
 
double GetDistance2 (const TVector< Size, double > &vector) const
 Return distance square between two vectors.
 
double GetDistance (const TVector< Size, double > &vector) const
 Return distance between two vectors.
 
double GetElementsSum () const
 Get simple sum of all elements.
 
bool Normalize (double length=1.0)
 Normalize vector to specified length.
 
bool GetNormalized (TVector< Size, double > &result, double length=1.0) const
 Return normalized vector with the same direction and specified length.
 
void GetMinimal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with minimal elements values.
 
void GetMaximal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with maximal elements values.
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive.
 
bool operator== (const TVector< Size, double > &vector) const
 
bool operator!= (const TVector< Size, double > &vector) const
 
bool operator< (const TVector< Size, double > &vector) const
 
bool operator> (const TVector< Size, double > &vector) const
 
bool operator<= (const TVector< Size, double > &vector) const
 
bool operator>= (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator- () const
 
TVector< Size, double > operator- (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator+ (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator* (double scalar) const
 
TVector< Size, double > operator/ (double scalar) const
 
TVector< Size, double > & operator= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator= (TVector< Size, double > &&vector)
 
TVector< Size, double > & operator+= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator-= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator*= (double scalar)
 
TVector< Size, double > & operator/= (double scalar)
 
const double & operator[] (int i) const
 
double & operator[] (int i)
 

Additional Inherited Members

- Static Public Member Functions inherited from imath::TVector< 3 >
static int GetElementsCount ()
 Get number of elements.
 
static bool SetElementsCount (int count)
 Set number of elements.
 
static const TVector< Size, double > & GetZero ()
 Get vector with all coordinates set to 0.
 
- Protected Attributes inherited from imath::TVector< 3 >
Elements m_elements
 

Detailed Description

Definition of position or mathematical vector in 3D space.

Definition at line 25 of file CVector3d.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 28 of file CVector3d.h.

Constructor & Destructor Documentation

◆ CVector3d() [1/4]

i3d::CVector3d::CVector3d ( )
inline

Default constructor.

Please note, elements will be not initilized.

Definition at line 117 of file CVector3d.h.

Referenced by operator*(), operator+(), operator-(), operator-(), and operator/().

◆ CVector3d() [2/4]

i3d::CVector3d::CVector3d ( double x,
double y,
double z )
inline

Construct initializing elements to specified values.

Definition at line 122 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

◆ CVector3d() [3/4]

i3d::CVector3d::CVector3d ( const imath::TVector< 3 > & vector)
inline

Copy constructor.

Definition at line 130 of file CVector3d.h.

◆ CVector3d() [4/4]

i3d::CVector3d::CVector3d ( const i2d::CVector2d & vector,
double z = 0 )
inline

Contructs 3D vector from 2D.

Definition at line 136 of file CVector3d.h.

References i2d::CVector2d::GetX(), i2d::CVector2d::GetY(), and imath::TVector< 3 >::operator[]().

Member Function Documentation

◆ GetCrossProduct()

CVector3d i3d::CVector3d::GetCrossProduct ( const imath::TVector< 3 > & vector) const

Return Z coordinate of two vectors cross product.

◆ GetNormalized()

CVector3d i3d::CVector3d::GetNormalized ( double length = 1.0) const

Return normalized vector with the same direction and specified length.

◆ GetPlaneCasted()

i2d::CVector2d i3d::CVector3d::GetPlaneCasted ( ) const
inline

Get XY part of this 3D vector.

Definition at line 186 of file CVector3d.h.

References GetX(), and GetY().

◆ GetTranslated()

CVector3d i3d::CVector3d::GetTranslated ( const imath::TVector< 3 > & vector)
inline

Get translated point.

Definition at line 180 of file CVector3d.h.

◆ GetX()

double i3d::CVector3d::GetX ( ) const
inline

Get X position of this vector.

Definition at line 144 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by GetPlaneCasted(), operator*(), operator+(), operator-(), operator-(), and operator/().

◆ GetY()

double i3d::CVector3d::GetY ( ) const
inline

Get Y position of this vector.

Definition at line 156 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by GetPlaneCasted(), operator*(), operator+(), operator-(), operator-(), and operator/().

◆ GetZ()

double i3d::CVector3d::GetZ ( ) const
inline

Get Y position of this vector.

Definition at line 168 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by operator*(), operator+(), operator-(), operator-(), and operator/().

◆ operator*()

CVector3d i3d::CVector3d::operator* ( double scalar) const
inline

Definition at line 213 of file CVector3d.h.

References CVector3d(), GetX(), GetY(), and GetZ().

◆ operator*=()

CVector3d & i3d::CVector3d::operator*= ( double scalar)
inline

Definition at line 248 of file CVector3d.h.

References imath::TVector< 3 >::operator*=().

◆ operator+()

CVector3d i3d::CVector3d::operator+ ( const imath::TVector< 3 > & vector) const
inline

Definition at line 199 of file CVector3d.h.

References CVector3d(), GetX(), GetY(), and GetZ().

◆ operator+=()

CVector3d & i3d::CVector3d::operator+= ( const imath::TVector< 3 > & vector)
inline

Definition at line 231 of file CVector3d.h.

References imath::TVector< 3 >::operator+=().

◆ operator-() [1/2]

CVector3d i3d::CVector3d::operator- ( ) const
inline

Definition at line 192 of file CVector3d.h.

References CVector3d(), GetX(), GetY(), and GetZ().

◆ operator-() [2/2]

CVector3d i3d::CVector3d::operator- ( const imath::TVector< 3 > & vector) const
inline

Definition at line 206 of file CVector3d.h.

References CVector3d(), GetX(), GetY(), and GetZ().

◆ operator-=()

CVector3d & i3d::CVector3d::operator-= ( const imath::TVector< 3 > & vector)
inline

Definition at line 240 of file CVector3d.h.

References imath::TVector< 3 >::operator-=().

◆ operator/()

CVector3d i3d::CVector3d::operator/ ( double scalar) const
inline

Definition at line 220 of file CVector3d.h.

References CVector3d(), GetX(), GetY(), and GetZ().

◆ operator/=()

CVector3d & i3d::CVector3d::operator/= ( double scalar)
inline

Definition at line 256 of file CVector3d.h.

References imath::TVector< 3 >::operator/=().

◆ Serialize()

bool i3d::CVector3d::Serialize ( iser::IArchive & archive)

Serialize this vector to specified archive.

◆ SetX()

void i3d::CVector3d::SetX ( double value)
inline

Set X position of this vector.

Definition at line 150 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by i3d::CMatrix3d::GetAxesLengths().

◆ SetY()

void i3d::CVector3d::SetY ( double value)
inline

Set Y position of this vector.

Definition at line 162 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by i3d::CMatrix3d::GetAxesLengths().

◆ SetZ()

void i3d::CVector3d::SetZ ( double value)
inline

Set Y position of this vector.

Definition at line 174 of file CVector3d.h.

References imath::TVector< 3 >::operator[]().

Referenced by i3d::CMatrix3d::GetAxesLengths().


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

© Witold Gantzke and Kirill Lepskiy