6#include <QtCore/QtGlobal>
7#if QT_VERSION >= 0x050000
8#include <QtCore/QtMath>
10#include <QtCore/qmath.h>
12#include <QtCore/QPointF>
73 void Init(
double angle,
double length = 1.0);
132 operator QPointF()
const;
198 return *
this + vector;
216 return GetX() * vector[1] -
GetY() * vector[0];
298inline CVector2d::operator QPointF()
const
300 return QPointF(qreal(GetX()), qreal(GetY()));
318 return int(key.
GetX()) ^ int(key.
GetY());
Definition of position or mathematical vector on 2D plane.
double GetY() const
Get Y position of this vector.
static const CVector2d & GetZero()
double GetX() const
Get X position of this vector.
CVector2d & operator-=(const imath::TVector< 2 > &vector)
CVector2d operator/(double scalar) const
void SetY(double y)
Set Y position of this vector.
CVector2d & operator+=(const imath::TVector< 2 > &vector)
CVector2d & operator*=(double scalar)
CVector2d operator-() const
CVector2d()
Default constructor.
double GetDotProduct(const CVector2d &vector) const
istd::CIndex2d ToIndex2d() const
Get vector converted to 2D index.
bool Serialize(iser::IArchive &archive)
Serialize this vector to specified archive.
CVector2d & operator/=(double scalar)
CVector2d GetHorizontalTranslated(double offsetX) const
Get horizontal translated point.
imath::TVector< 2 > BaseClass
double GetCrossProductZ(const imath::TVector< 2 > &vector) const
Return Z coordinate of two vectors cross product.
CVector2d operator+(const imath::TVector< 2 > &vector) const
CVector2d GetNormalized(double length=1.0) const
Return normalized vector with the same direction and specified length.
double GetAngle() const
Get angle of this vector.
void SetX(double x)
Set X position of this vector.
CVector2d GetVerticalTranslated(double offsetY) const
Get vertical translated point.
CVector2d GetTranslated(const imath::TVector< 2 > &vector)
Get translated point.
void Init(double angle, double length=1.0)
Init this vector using angle and vector length.
CVector2d GetOrthogonal() const
Get orthogonal vector.
CVector2d operator*(double scalar) const
Implementation of fixed-size mathematical vector with specified type of elements.
const double & operator[](int i) const
TVector< Size, double > & operator+=(const TVector< Size, double > &vector)
TVector< Size, double > & operator/=(double scalar)
TVector< Size, double > & operator-=(const TVector< Size, double > &vector)
TVector< Size, double > & operator*=(double scalar)
TVector< Size, double > GetTranslated(const TVector< Size, double > &vector)
Returns a new vector that is the translation of this vector.
static const TVector< Size, double > & GetZero()
Get vector with all coordinates set to 0.
bool GetNormalized(TVector< Size, double > &result, double length=1.0) const
Returns a normalized copy of this vector with specified length.
Represents an input/output persistence archive for object serialization.
Index implementation for addressing elements in 2D-space.
static const double I_BIG_EPSILON
uint qHash(const CLine2d &key, uint seed=0)