Public Types | Public Member Functions | Static Public Member Functions | List of all members
i2d::CVector2d Class Reference

Definition of position or mathematical vector on 2D plane. More...

#include <CVector2d.h>

Inheritance diagram for i2d::CVector2d:
imath::TVector< 2 >

Public Types

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

Public Member Functions

 CVector2d ()
 Default constructor. More...
 
 CVector2d (double x, double y)
 Construct initializing elements to specified values. More...
 
 CVector2d (const istd::CIndex2d &index)
 
 CVector2d (const QPointF &point)
 
 CVector2d (const imath::TVector< 2 > &vector)
 Copy constructor. More...
 
double GetX () const
 Get X position of this vector. More...
 
void SetX (double x)
 Set X position of this vector. More...
 
double GetY () const
 Get Y position of this vector. More...
 
void SetY (double y)
 Set Y position of this vector. More...
 
void Init (double angle, double length=1.0)
 Init this vector using angle and vector length. More...
 
CVector2d GetTranslated (const imath::TVector< 2 > &vector)
 Get translated point. More...
 
CVector2d GetHorizontalTranslated (double offsetX) const
 Get horizontal translated point. More...
 
CVector2d GetVerticalTranslated (double offsetY) const
 Get vertical translated point. More...
 
double GetCrossProductZ (const imath::TVector< 2 > &vector) const
 Return Z coordinate of two vectors cross product. More...
 
double GetDotProduct (const CVector2d &vector) const
 
double GetAngle () const
 Get angle of this vector. More...
 
CVector2d GetOrthogonal () const
 Get orthogonal vector. More...
 
istd::CIndex2d ToIndex2d () const
 Get vector converted to 2D index. More...
 
CVector2d GetNormalized (double length=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive. More...
 
CVector2d operator- () const
 
CVector2d operator+ (const imath::TVector< 2 > &vector) const
 
CVector2d operator- (const imath::TVector< 2 > &vector) const
 
CVector2d operator* (double scalar) const
 
CVector2d operator/ (double scalar) const
 
CVector2doperator+= (const imath::TVector< 2 > &vector)
 
CVector2doperator-= (const imath::TVector< 2 > &vector)
 
CVector2doperator*= (double scalar)
 
CVector2doperator/= (double scalar)
 
 operator QPointF () const
 
- Public Member Functions inherited from imath::TVector< 2 >
 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)
 

Static Public Member Functions

static const CVector2dGetZero ()
 
- Static Public Member Functions inherited from imath::TVector< 2 >
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...
 

Additional Inherited Members

- Protected Attributes inherited from imath::TVector< 2 >
Elements m_elements
 

Detailed Description

Definition of position or mathematical vector on 2D plane.

Definition at line 28 of file CVector2d.h.

Member Typedef Documentation

Definition at line 31 of file CVector2d.h.

Constructor & Destructor Documentation

i2d::CVector2d::CVector2d ( )
inline

Default constructor.

Please note, elements will be not initialized.

Definition at line 147 of file CVector2d.h.

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

i2d::CVector2d::CVector2d ( double  x,
double  y 
)
inline

Construct initializing elements to specified values.

Definition at line 152 of file CVector2d.h.

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

i2d::CVector2d::CVector2d ( const istd::CIndex2d index)
inline
i2d::CVector2d::CVector2d ( const QPointF &  point)
inline

Definition at line 140 of file CVector2d.h.

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

i2d::CVector2d::CVector2d ( const imath::TVector< 2 > &  vector)
inline

Copy constructor.

Definition at line 159 of file CVector2d.h.

Member Function Documentation

double i2d::CVector2d::GetAngle ( ) const
inline

Get angle of this vector.

Definition at line 226 of file CVector2d.h.

References GetX(), and GetY().

double i2d::CVector2d::GetCrossProductZ ( const imath::TVector< 2 > &  vector) const
inline

Return Z coordinate of two vectors cross product.

Definition at line 214 of file CVector2d.h.

References GetX(), and GetY().

Referenced by i2d::CLine2d::GetAlphaAndCastDistance(), and i2d::CLine2d::GetCutAlpha().

double i2d::CVector2d::GetDotProduct ( const CVector2d vector) const
inline

Definition at line 220 of file CVector2d.h.

References GetX(), and GetY().

Referenced by i2d::CLine2d::GetAlphaAndCastDistance(), and i2d::CLine2d::GetCastAlpha().

CVector2d i2d::CVector2d::GetHorizontalTranslated ( double  offsetX) const
inline

Get horizontal translated point.

Definition at line 202 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

CVector2d i2d::CVector2d::GetNormalized ( double  length = 1.0) const

Return normalized vector with the same direction and specified length.

CVector2d i2d::CVector2d::GetOrthogonal ( ) const

Get orthogonal vector.

CVector2d i2d::CVector2d::GetTranslated ( const imath::TVector< 2 > &  vector)
inline

Get translated point.

Definition at line 196 of file CVector2d.h.

CVector2d i2d::CVector2d::GetVerticalTranslated ( double  offsetY) const
inline

Get vertical translated point.

Definition at line 208 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

double i2d::CVector2d::GetX ( ) const
inline
double i2d::CVector2d::GetY ( ) const
inline
const CVector2d & i2d::CVector2d::GetZero ( )
inlinestatic
void i2d::CVector2d::Init ( double  angle,
double  length = 1.0 
)

Init this vector using angle and vector length.

i2d::CVector2d::operator QPointF ( ) const
inline

Definition at line 298 of file CVector2d.h.

CVector2d i2d::CVector2d::operator* ( double  scalar) const
inline

Definition at line 250 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

CVector2d & i2d::CVector2d::operator*= ( double  scalar)
inline

Definition at line 282 of file CVector2d.h.

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

CVector2d i2d::CVector2d::operator+ ( const imath::TVector< 2 > &  vector) const
inline

Definition at line 238 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

CVector2d & i2d::CVector2d::operator+= ( const imath::TVector< 2 > &  vector)
inline

Definition at line 266 of file CVector2d.h.

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

CVector2d i2d::CVector2d::operator- ( ) const
inline

Definition at line 232 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

CVector2d i2d::CVector2d::operator- ( const imath::TVector< 2 > &  vector) const
inline

Definition at line 244 of file CVector2d.h.

References CVector2d(), GetX(), and GetY().

CVector2d & i2d::CVector2d::operator-= ( const imath::TVector< 2 > &  vector)
inline

Definition at line 274 of file CVector2d.h.

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

CVector2d i2d::CVector2d::operator/ ( double  scalar) const
inline

Definition at line 256 of file CVector2d.h.

References CVector2d(), GetX(), GetY(), and I_BIG_EPSILON.

CVector2d & i2d::CVector2d::operator/= ( double  scalar)
inline

Definition at line 290 of file CVector2d.h.

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

bool i2d::CVector2d::Serialize ( iser::IArchive archive)

Serialize this vector to specified archive.

void i2d::CVector2d::SetX ( double  x)
inline

Set X position of this vector.

Definition at line 178 of file CVector2d.h.

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

Referenced by i2d::CMatrix2d::GetAxesLengths().

void i2d::CVector2d::SetY ( double  y)
inline

Set Y position of this vector.

Definition at line 190 of file CVector2d.h.

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

Referenced by i2d::CMatrix2d::GetAxesLengths().

istd::CIndex2d i2d::CVector2d::ToIndex2d ( ) const

Get vector converted to 2D index.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy