Gra zręcznościowa „Straszna Epidemia"  V1.2
Projekt Wizualizacja Danych Sensorycznych Kewin Gałuszka rok akademicki 2019/2020
Dokumentacja klasy QCPVector2D

Represents two doubles as a mathematical 2D vector. Więcej...

#include <qcustomplot.h>

Metody publiczne

 QCPVector2D ()
 
 QCPVector2D (double x, double y)
 
 QCPVector2D (const QPoint &point)
 
 QCPVector2D (const QPointF &point)
 
double x () const
 
double y () const
 
double & rx ()
 
double & ry ()
 
void setX (double x)
 
void setY (double y)
 
double length () const
 
double lengthSquared () const
 
QPoint toPoint () const
 
QPointF toPointF () const
 
bool isNull () const
 
void normalize ()
 
QCPVector2D normalized () const
 
QCPVector2D perpendicular () const
 
double dot (const QCPVector2D &vec) const
 
double distanceSquaredToLine (const QCPVector2D &start, const QCPVector2D &end) const
 
double distanceSquaredToLine (const QLineF &line) const
 
double distanceToStraightLine (const QCPVector2D &base, const QCPVector2D &direction) const
 
QCPVector2Doperator*= (double factor)
 
QCPVector2Doperator/= (double divisor)
 
QCPVector2Doperator+= (const QCPVector2D &vector)
 
QCPVector2Doperator-= (const QCPVector2D &vector)
 

Przyjaciele

const QCPVector2D operator* (double factor, const QCPVector2D &vec)
 
const QCPVector2D operator* (const QCPVector2D &vec, double factor)
 
const QCPVector2D operator/ (const QCPVector2D &vec, double divisor)
 
const QCPVector2D operator+ (const QCPVector2D &vec1, const QCPVector2D &vec2)
 
const QCPVector2D operator- (const QCPVector2D &vec1, const QCPVector2D &vec2)
 
const QCPVector2D operator- (const QCPVector2D &vec)
 

Funkcje powiązane

(Zauważ, że to nie są metody klas.)

QDebug operator<< (QDebug d, const QCPVector2D &vec)
 

Opis szczegółowy

Represents two doubles as a mathematical 2D vector.

This class acts as a replacement for QVector2D with the advantage of double precision instead of single, and some convenience methods tailored for the QCustomPlot library.

Definicja w linii 387 pliku qcustomplot.h.

Dokumentacja konstruktora i destruktora

◆ QCPVector2D() [1/4]

QCPVector2D::QCPVector2D ( )

Creates a QCPVector2D object and initializes the x and y coordinates to 0.

Definicja w linii 111 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ QCPVector2D() [2/4]

QCPVector2D::QCPVector2D ( double  x,
double  y 
)

Creates a QCPVector2D object and initializes the x and y coordinates with the specified values.

Definicja w linii 121 pliku qcustomplot.cpp.

◆ QCPVector2D() [3/4]

QCPVector2D::QCPVector2D ( const QPoint &  point)

Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified point.

Definicja w linii 131 pliku qcustomplot.cpp.

◆ QCPVector2D() [4/4]

QCPVector2D::QCPVector2D ( const QPointF &  point)

Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of the specified point.

Definicja w linii 141 pliku qcustomplot.cpp.

Dokumentacja funkcji składowych

◆ distanceSquaredToLine() [1/2]

double QCPVector2D::distanceSquaredToLine ( const QCPVector2D start,
const QCPVector2D end 
) const

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Returns the squared shortest distance of this vector (interpreted as a point) to the finite line segment given by start and end.

Zobacz również
distanceToStraightLine

Definicja w linii 178 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ distanceSquaredToLine() [2/2]

double QCPVector2D::distanceSquaredToLine ( const QLineF &  line) const

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Returns the squared shortest distance of this vector (interpreted as a point) to the finite line segment given by line.

Zobacz również
distanceToStraightLine

Definicja w linii 202 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ distanceToStraightLine()

double QCPVector2D::distanceToStraightLine ( const QCPVector2D base,
const QCPVector2D direction 
) const

Returns the shortest distance of this vector (interpreted as a point) to the infinite straight line given by a base point and a direction vector.

Zobacz również
distanceSquaredToLine

Definicja w linii 213 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ dot()

double QCPVector2D::dot ( const QCPVector2D vec) const
inline

Returns the dot/scalar product of this vector with the specified vector vec.

Definicja w linii 415 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ isNull()

bool QCPVector2D::isNull ( ) const
inline

Returns whether this vector is null. A vector is null if qIsNull returns true for both x and y coordinates, i.e. if both are binary equal to 0.

Definicja w linii 411 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ length()

double QCPVector2D::length ( ) const
inline

Returns the length of this vector.

Zobacz również
lengthSquared

Definicja w linii 406 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ lengthSquared()

double QCPVector2D::lengthSquared ( ) const
inline

Returns the squared length of this vector. In some situations, e.g. when just trying to find the shortest vector of a group, this is faster than calculating length, because it avoids calculation of a square root.

Zobacz również
length

Definicja w linii 407 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ normalize()

void QCPVector2D::normalize ( )

Normalizes this vector. After this operation, the length of the vector is equal to 1.

Zobacz również
normalized, length, lengthSquared

Definicja w linii 152 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ normalized()

QCPVector2D QCPVector2D::normalized ( ) const

Returns a normalized version of this vector. The length of the returned vector is equal to 1.

Zobacz również
normalize, length, lengthSquared

Definicja w linii 164 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ operator*=()

QCPVector2D & QCPVector2D::operator*= ( double  factor)

Scales this vector by the given factor, i.e. the x and y components are multiplied by factor.

Definicja w linii 222 pliku qcustomplot.cpp.

◆ operator+=()

QCPVector2D & QCPVector2D::operator+= ( const QCPVector2D vector)

Adds the given vector to this vector component-wise.

Definicja w linii 243 pliku qcustomplot.cpp.

◆ operator-=()

QCPVector2D & QCPVector2D::operator-= ( const QCPVector2D vector)

subtracts the given vector from this vector component-wise.

Definicja w linii 253 pliku qcustomplot.cpp.

◆ operator/=()

QCPVector2D & QCPVector2D::operator/= ( double  divisor)

Scales this vector by the given divisor, i.e. the x and y components are divided by divisor.

Definicja w linii 233 pliku qcustomplot.cpp.

◆ perpendicular()

QCPVector2D QCPVector2D::perpendicular ( ) const
inline

Returns a vector perpendicular to this vector, with the same length.

Definicja w linii 414 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ rx()

double& QCPVector2D::rx ( )
inline

Definicja w linii 398 pliku qcustomplot.h.

◆ ry()

double& QCPVector2D::ry ( )
inline

Definicja w linii 399 pliku qcustomplot.h.

◆ setX()

void QCPVector2D::setX ( double  x)
inline

Sets the x coordinate of this vector to x.

Zobacz również
setY

Definicja w linii 402 pliku qcustomplot.h.

◆ setY()

void QCPVector2D::setY ( double  y)
inline

Sets the y coordinate of this vector to y.

Zobacz również
setX

Definicja w linii 403 pliku qcustomplot.h.

◆ toPoint()

QPoint QCPVector2D::toPoint ( ) const
inline

Returns a QPoint which has the x and y coordinates of this vector, truncating any floating point information.

Zobacz również
toPointF

Definicja w linii 408 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ toPointF()

QPointF QCPVector2D::toPointF ( ) const
inline

Returns a QPointF which has the x and y coordinates of this vector.

Zobacz również
toPoint

Definicja w linii 409 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ x()

double QCPVector2D::x ( ) const
inline

Definicja w linii 396 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ y()

double QCPVector2D::y ( ) const
inline

Definicja w linii 397 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

Dokumentacja przyjaciół i funkcji związanych

◆ operator* [1/2]

const QCPVector2D operator* ( const QCPVector2D vec,
double  factor 
)
friend

Definicja w linii 439 pliku qcustomplot.h.

◆ operator* [2/2]

const QCPVector2D operator* ( double  factor,
const QCPVector2D vec 
)
friend

Definicja w linii 438 pliku qcustomplot.h.

◆ operator+

const QCPVector2D operator+ ( const QCPVector2D vec1,
const QCPVector2D vec2 
)
friend

Definicja w linii 441 pliku qcustomplot.h.

◆ operator- [1/2]

const QCPVector2D operator- ( const QCPVector2D vec)
friend

Definicja w linii 443 pliku qcustomplot.h.

◆ operator- [2/2]

const QCPVector2D operator- ( const QCPVector2D vec1,
const QCPVector2D vec2 
)
friend

Definicja w linii 442 pliku qcustomplot.h.

◆ operator/

const QCPVector2D operator/ ( const QCPVector2D vec,
double  divisor 
)
friend

Definicja w linii 440 pliku qcustomplot.h.

◆ operator<<()

QDebug operator<< ( QDebug  d,
const QCPVector2D vec 
)
related

Prints vec in a human readable format to the qDebug output.

Definicja w linii 449 pliku qcustomplot.h.

Oto graf wywołań dla tej funkcji:

Dokumentacja dla tej klasy została wygenerowana z plików: