Public Types | Public Member Functions | List of all members
i3d::CVector3d Class Reference

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

#include <CVector3d.h>

Inheritance diagram for i3d::CVector3d:
imath::TVector< 3 >

Public Types

typedef imath::TVector< 3 > BaseClass
 
- Public Types inherited from imath::TVector< 3 >
typedef double ElementType
 
typedef double Elements [Size]
 

Public Member Functions

 CVector3d ()
 Default constructor. More...
 
 CVector3d (double x, double y, double z)
 Construct initializing elements to specified values. More...
 
 CVector3d (const imath::TVector< 3 > &vector)
 Copy constructor. More...
 
 CVector3d (const i2d::CVector2d &vector, double z=0)
 Contructs 3D vector from 2D. More...
 
double GetX () const
 Get X position of this vector. More...
 
void SetX (double value)
 Set X position of this vector. More...
 
double GetY () const
 Get Y position of this vector. More...
 
void SetY (double value)
 Set Y position of this vector. More...
 
double GetZ () const
 Get Y position of this vector. More...
 
void SetZ (double value)
 Set Y position of this vector. More...
 
CVector3d GetTranslated (const imath::TVector< 3 > &vector)
 Get translated point. More...
 
CVector3d GetCrossProduct (const imath::TVector< 3 > &vector) const
 Return Z coordinate of two vectors cross product. More...
 
CVector3d GetNormalized (double length=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
i2d::CVector2d GetPlaneCasted () const
 Get XY part of this 3D vector. More...
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive. More...
 
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. More...
 
 TVector (const TVector< Size, double > &vector)
 Copy constructor. More...
 
const double & GetElement (int i) const
 Get element at specified i. More...
 
double & GetElementRef (int i)
 Get reference to element at specified i. More...
 
void SetElement (int i, const double &value)
 Set element at specified i. More...
 
void SetAllElements (const double &value)
 Set some value to all elements. More...
 
void Reset ()
 Set all coordinates to zero. More...
 
void Clear ()
 Set all coordinates to zero. More...
 
const TVector< Size, double >
::Elements
GetElements () const
 Get read-only access to internal element container. More...
 
TVector< Size, double >::ElementsGetElementsRef ()
 Get access to internal element container. More...
 
void Translate (const TVector< Size, double > &vector)
 Translate the point. More...
 
TVector< Size, double > GetTranslated (const TVector< Size, double > &vector)
 Get translated point. More...
 
void GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result)
 /overloaded More...
 
void ScaledCumulate (const TVector< Size, double > &vector, doublescale)
 Add second vector scaled by specified factor. More...
 
bool IsNull (doubletolerance=I_BIG_EPSILON) const
 Check if this vector is null. More...
 
double GetDotProduct (const TVector< Size, double > &vector) const
 Return dot product of two vectors. More...
 
double GetLength2 () const
 Return euclidian length square. More...
 
double GetLength () const
 Return euclidian length. More...
 
double GetDistance2 (const TVector< Size, double > &vector) const
 Return distance square between two vectors. More...
 
double GetDistance (const TVector< Size, double > &vector) const
 Return distance between two vectors. More...
 
double GetElementsSum () const
 Get simple sum of all elements. More...
 
bool Normalize (doublelength=1.0)
 Normalize vector to specified length. More...
 
bool GetNormalized (TVector< Size, double > &result, doublelength=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
void GetMinimal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with minimal elements values. More...
 
void GetMaximal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with maximal elements values. More...
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive. More...
 
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* (doublescalar) const
 
TVector< Size, double > operator/ (doublescalar) const
 
TVector< Size, double > & operator+= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator-= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator*= (doublescalar)
 
TVector< Size, double > & operator/= (doublescalar)
 
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. More...
 
static bool SetElementsCount (int count)
 Set number of elements. More...
 
static const TVector< Size,
double > & 
GetZero ()
 Get vector with all coordinates set to 0. More...
 
- Protected Attributes inherited from imath::TVector< 3 >
Elements m_elements
 

Detailed Description

Definition of position or mathematical vector in 3D space.

Definition at line 21 of file CVector3d.h.

Member Typedef Documentation

Definition at line 24 of file CVector3d.h.

Constructor & Destructor Documentation

i3d::CVector3d::CVector3d ( )
inline

Default constructor.

Please note, elements will be not initilized.

Definition at line 113 of file CVector3d.h.

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

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

Construct initializing elements to specified values.

Definition at line 118 of file CVector3d.h.

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

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

Copy constructor.

Definition at line 126 of file CVector3d.h.

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

Contructs 3D vector from 2D.

Definition at line 132 of file CVector3d.h.

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

Member Function Documentation

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

Return Z coordinate of two vectors cross product.

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

Return normalized vector with the same direction and specified length.

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

Get XY part of this 3D vector.

Definition at line 182 of file CVector3d.h.

References GetX(), and GetY().

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

Get translated point.

Definition at line 176 of file CVector3d.h.

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

Get X position of this vector.

Definition at line 140 of file CVector3d.h.

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

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

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

Get Y position of this vector.

Definition at line 152 of file CVector3d.h.

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

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

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

Get Y position of this vector.

Definition at line 164 of file CVector3d.h.

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

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

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

Definition at line 209 of file CVector3d.h.

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

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

Definition at line 244 of file CVector3d.h.

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

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

Definition at line 195 of file CVector3d.h.

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

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

Definition at line 227 of file CVector3d.h.

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

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

Definition at line 188 of file CVector3d.h.

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

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

Definition at line 202 of file CVector3d.h.

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

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

Definition at line 236 of file CVector3d.h.

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

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

Definition at line 216 of file CVector3d.h.

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

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

Definition at line 252 of file CVector3d.h.

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

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

Serialize this vector to specified archive.

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

Set X position of this vector.

Definition at line 146 of file CVector3d.h.

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

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

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

Set Y position of this vector.

Definition at line 158 of file CVector3d.h.

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

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

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

Set Y position of this vector.

Definition at line 170 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:

© 2007-2017 Witold Gantzke and Kirill Lepskiy