|
ACF $AcfVersion:0$
|
Definition of position or mathematical vector on 2D plane. More...
#include <CVector2d.h>
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. | |
| 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 | |
Public Member Functions inherited from imath::TVector< 2 > | |
| TVector () | |
| Creates an uninitialized vector. | |
| TVector (const TVector< Size, double > &vector) | |
| Creates a copy of another vector. | |
| TVector (std::initializer_list< double > values) | |
| Creates a vector from an initializer list. | |
| const double & | GetElement (int i) const |
| Gets the element at the specified index (read-only). | |
| double & | GetElementRef (int i) |
| Gets a reference to the element at the specified index (read-write). | |
| void | SetElement (int i, const double &value) |
| Sets the element at the specified index. | |
| void | SetAllElements (const double &value) |
| Sets all elements to the same value. | |
| void | Reset () |
| Sets all coordinates to zero. | |
| void | Clear () |
| Sets 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) |
| Translates (adds) another vector to this vector. | |
| TVector< Size, double > | GetTranslated (const TVector< Size, double > &vector) |
| Returns a new vector that is the translation of this vector. | |
| void | GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result) |
| Computes the translated vector and stores it in the result parameter. | |
| void | ScaledCumulate (const TVector< Size, double > &vector, double scale) |
| Adds a scaled vector to this vector. | |
| bool | IsNull (double tolerance=I_BIG_EPSILON) const |
| Checks if this vector is null (all elements approximately zero). | |
| double | GetDotProduct (const TVector< Size, double > &vector) const |
| Calculates the dot product with another vector. | |
| double | GetLength2 () const |
| Calculates the squared Euclidean length of the vector. | |
| double | GetLength () const |
| Calculates the Euclidean length (magnitude) of the vector. | |
| double | GetDistance2 (const TVector< Size, double > &vector) const |
| Calculates the squared distance to another vector. | |
| double | GetDistance (const TVector< Size, double > &vector) const |
| Calculates the Euclidean distance to another vector. | |
| double | GetElementsSum () const |
| Calculates the sum of all vector elements. | |
| bool | Normalize (double length=1.0) |
| Normalizes the vector to a specified length. | |
| bool | GetNormalized (TVector< Size, double > &result, double length=1.0) const |
| Returns a normalized copy of this vector with 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 > &vector)=default |
| 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-= (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 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 |
Definition of position or mathematical vector on 2D plane.
Definition at line 28 of file CVector2d.h.
| typedef imath::TVector<2> i2d::CVector2d::BaseClass |
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(), GetVerticalTranslated(), operator*(), operator+(), operator-(), operator-(), operator/(), i2d::qHash(), and iqt2d::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel, CircleBasedGui >::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(), GetVerticalTranslated(), operator*(), operator+(), operator-(), operator-(), operator/(), i2d::qHash(), and iqt2d::TCircleBasedParamsGuiComp< CircleBasedShape, CircleBasedModel, CircleBasedGui >::UpdateGui().
|
inlinestatic |
Definition at line 306 of file CVector2d.h.
References imath::TVector< 2 >::GetZero().
Referenced by iqt2d::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(), GetY(), and I_BIG_EPSILON.
|
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().
|
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.