![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Definition of position or mathematical vector on 2D plane. More...
#include <CVector2d.h>
Public Types | |
typedef imath::TVector< 2 > | BaseClass |
![]() | |
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 |
CVector2d & | operator+= (const imath::TVector< 2 > &vector) |
CVector2d & | operator-= (const imath::TVector< 2 > &vector) |
CVector2d & | operator*= (double scalar) |
CVector2d & | operator/= (double scalar) |
operator QPointF () const | |
![]() | |
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 >::Elements & | GetElements () const |
Get read-only access to internal element container. | |
TVector< Size, double >::Elements & | GetElementsRef () |
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 CVector2d & | GetZero () |
![]() | |
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 | |
![]() | |
Elements | m_elements |
Definition of position or mathematical vector on 2D plane.
Definition at line 28 of file CVector2d.h.
Definition at line 31 of file CVector2d.h.
|
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/().
|
inline |
Construct initializing elements to specified values.
Definition at line 152 of file CVector2d.h.
References imath::TVector< 2 >::operator[]().
|
inline |
Definition at line 165 of file CVector2d.h.
References istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and imath::TVector< 2 >::operator[]().
|
inline |
Definition at line 140 of file CVector2d.h.
References imath::TVector< 2 >::operator[]().
|
inline |
Copy constructor.
Definition at line 159 of file CVector2d.h.
|
inline |
Get angle of this vector.
Definition at line 226 of file CVector2d.h.
|
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().
|
inline |
Definition at line 220 of file CVector2d.h.
References GetX(), and GetY().
Referenced by i2d::CLine2d::GetAlphaAndCastDistance(), and i2d::CLine2d::GetCastAlpha().
|
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.
|
inline |
Get translated point.
Definition at line 196 of file CVector2d.h.
|
inline |
Get vertical translated point.
Definition at line 208 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
inline |
Get X position of this vector.
Definition at line 172 of file CVector2d.h.
References imath::TVector< 2 >::operator[]().
Referenced by i3d::CVector3d::CVector3d(), GetAngle(), GetCrossProductZ(), i2d::CLine2d::GetCutXPos(), i2d::CLine2d::GetCutYPos(), GetDotProduct(), GetHorizontalTranslated(), iview::CScreenTransform::GetScreenPosition(), ialgo::CHoughSpace2d::GetSpaceDistance2(), GetVerticalTranslated(), icmpstr::TShapeBase< GraphicsItemClass >::itemChange(), operator*(), operator+(), operator-(), operator-(), operator/(), i2d::qHash(), and i2dgui::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel >::UpdateGui().
|
inline |
Get Y position of this vector.
Definition at line 184 of file CVector2d.h.
References imath::TVector< 2 >::operator[]().
Referenced by i3d::CVector3d::CVector3d(), GetAngle(), GetCrossProductZ(), i2d::CLine2d::GetCutXPos(), i2d::CLine2d::GetCutYPos(), GetDotProduct(), GetHorizontalTranslated(), iview::CScreenTransform::GetScreenPosition(), ialgo::CHoughSpace2d::GetSpaceDistance2(), GetVerticalTranslated(), icmpstr::TShapeBase< GraphicsItemClass >::itemChange(), operator*(), operator+(), operator-(), operator-(), operator/(), i2d::qHash(), and i2dgui::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel >::UpdateGui().
|
inlinestatic |
Definition at line 306 of file CVector2d.h.
References imath::TVector< 2 >::GetZero().
Referenced by i2dgui::TPolygonBasedParamsGuiComp< PolygonBasedShape, PolygonBasedModel >::OnInsertNode().
void i2d::CVector2d::Init | ( | double | angle, |
double | length = 1.0 ) |
Init this vector using angle and vector length.
|
inline |
Definition at line 298 of file CVector2d.h.
|
inline |
Definition at line 250 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
inline |
Definition at line 282 of file CVector2d.h.
References imath::TVector< 2 >::operator*=().
|
inline |
Definition at line 238 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
inline |
Definition at line 266 of file CVector2d.h.
References imath::TVector< 2 >::operator+=().
|
inline |
Definition at line 232 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
inline |
Definition at line 244 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
inline |
Definition at line 274 of file CVector2d.h.
References imath::TVector< 2 >::operator-=().
|
inline |
Definition at line 256 of file CVector2d.h.
References CVector2d(), GetX(), and GetY().
|
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.
|
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().
|
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().
istd::CIndex2d i2d::CVector2d::ToIndex2d | ( | ) | const |
Get vector converted to 2D index.
© Witold Gantzke and Kirill Lepskiy