ICF 3.0.5.47
Technical documentation of ICF Libraries
i2d::CVector2d Class Reference

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

#include <CVector2d.h>

Inheritance diagram for i2d::CVector2d:
Collaboration diagram for i2d::CVector2d:

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

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

◆ BaseClass

Definition at line 31 of file CVector2d.h.

Constructor & Destructor Documentation

◆ CVector2d() [1/5]

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-(), operator-(), and operator/().

◆ CVector2d() [2/5]

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[]().

◆ CVector2d() [3/5]

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

◆ CVector2d() [4/5]

i2d::CVector2d::CVector2d ( const QPointF & point)
inline

Definition at line 140 of file CVector2d.h.

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

◆ CVector2d() [5/5]

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

Copy constructor.

Definition at line 159 of file CVector2d.h.

Member Function Documentation

◆ GetAngle()

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

Get angle of this vector.

Definition at line 226 of file CVector2d.h.

References GetX(), and GetY().

◆ GetCrossProductZ()

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().

◆ GetDotProduct()

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().

◆ GetHorizontalTranslated()

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().

◆ GetNormalized()

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

Return normalized vector with the same direction and specified length.

◆ GetOrthogonal()

CVector2d i2d::CVector2d::GetOrthogonal ( ) const

Get orthogonal vector.

◆ GetTranslated()

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

Get translated point.

Definition at line 196 of file CVector2d.h.

◆ GetVerticalTranslated()

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().

◆ GetX()

◆ GetY()

◆ GetZero()

const CVector2d & i2d::CVector2d::GetZero ( )
inlinestatic

◆ Init()

void i2d::CVector2d::Init ( double angle,
double length = 1.0 )

Init this vector using angle and vector length.

◆ operator QPointF()

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

Definition at line 298 of file CVector2d.h.

◆ operator*()

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

Definition at line 250 of file CVector2d.h.

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

◆ operator*=()

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

Definition at line 282 of file CVector2d.h.

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

◆ 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().

◆ operator+=()

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

Definition at line 266 of file CVector2d.h.

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

◆ operator-() [1/2]

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

Definition at line 232 of file CVector2d.h.

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

◆ operator-() [2/2]

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

Definition at line 244 of file CVector2d.h.

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

◆ operator-=()

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

Definition at line 274 of file CVector2d.h.

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

◆ operator/()

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

Definition at line 256 of file CVector2d.h.

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

◆ operator/=()

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

Definition at line 290 of file CVector2d.h.

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

◆ Serialize()

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

Serialize this vector to specified archive.

◆ SetX()

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(), and ialgo::CHoughSpace2d::GetSpaceDistance2().

◆ SetY()

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(), and ialgo::CHoughSpace2d::GetSpaceDistance2().

◆ ToIndex2d()

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

Get vector converted to 2D index.


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

© Witold Gantzke and Kirill Lepskiy