[−][src]Struct qt_gui::QVector4D
The QVector4D class represents a vector or vertex in 4D space.
C++ class: QVector4D
.
Methods
impl QVector4D
[src]
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QVector4D>>
) -> MutRef<QVector4D>
[src]
&mut self,
other: impl CastInto<Ref<QVector4D>>
) -> MutRef<QVector4D>
The QVector4D class represents a vector or vertex in 4D space.
Calls C++ function: QVector4D& QVector4D::operator=(const QVector4D& other)
.
pub unsafe fn dot_product(
v1: impl CastInto<Ref<QVector4D>>,
v2: impl CastInto<Ref<QVector4D>>
) -> c_float
[src]
v1: impl CastInto<Ref<QVector4D>>,
v2: impl CastInto<Ref<QVector4D>>
) -> c_float
Returns the dot product of v1 and v2.
Calls C++ function: static float QVector4D::dotProduct(const QVector4D& v1, const QVector4D& v2)
.
Returns the dot product of v1 and v2.
pub unsafe fn index_mut(&mut self, i: c_int) -> MutRef<c_float>
[src]
Returns the component of the vector at index position i as a modifiable reference.
Calls C++ function: float& QVector4D::operator[](int i)
.
Returns the component of the vector at index position i as a modifiable reference.
i must be a valid index position in the vector (i.e., 0 <= i < 4).
This function was introduced in Qt 5.2.
pub unsafe fn index(&self, i: c_int) -> c_float
[src]
Returns the component of the vector at index position i.
Calls C++ function: float QVector4D::operator[](int i) const
.
Returns the component of the vector at index position i.
i must be a valid index position in the vector (i.e., 0 <= i < 4).
This function was introduced in Qt 5.2.
pub unsafe fn is_null(&self) -> bool
[src]
Returns true
if the x, y, z, and w coordinates are set to 0.0, otherwise returns false
.
Calls C++ function: bool QVector4D::isNull() const
.
Returns true
if the x, y, z, and w coordinates are set to 0.0, otherwise returns false
.
pub unsafe fn length(&self) -> c_float
[src]
Returns the length of the vector from the origin.
Calls C++ function: float QVector4D::length() const
.
Returns the length of the vector from the origin.
See also lengthSquared() and normalized().
pub unsafe fn length_squared(&self) -> c_float
[src]
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
Calls C++ function: float QVector4D::lengthSquared() const
.
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
See also length() and dotProduct().
pub unsafe fn neg(&self) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator-(const QVector4D& vector)
.
pub unsafe fn new() -> CppBox<QVector4D>
[src]
Constructs a null vector, i.e. with coordinates (0, 0, 0, 0).
Calls C++ function: [constructor] void QVector4D::QVector4D()
.
Constructs a null vector, i.e. with coordinates (0, 0, 0, 0).
pub unsafe fn from_4_float(
xpos: c_float,
ypos: c_float,
zpos: c_float,
wpos: c_float
) -> CppBox<QVector4D>
[src]
xpos: c_float,
ypos: c_float,
zpos: c_float,
wpos: c_float
) -> CppBox<QVector4D>
Constructs a vector with coordinates (xpos, ypos, zpos, wpos).
Calls C++ function: [constructor] void QVector4D::QVector4D(float xpos, float ypos, float zpos, float wpos)
.
Constructs a vector with coordinates (xpos, ypos, zpos, wpos).
pub unsafe fn from_q_point(
point: impl CastInto<Ref<QPoint>>
) -> CppBox<QVector4D>
[src]
point: impl CastInto<Ref<QPoint>>
) -> CppBox<QVector4D>
Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QPoint& point)
.
Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
pub unsafe fn from_q_point_f(
point: impl CastInto<Ref<QPointF>>
) -> CppBox<QVector4D>
[src]
point: impl CastInto<Ref<QPointF>>
) -> CppBox<QVector4D>
Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QPointF& point)
.
Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
pub unsafe fn from_q_vector_2d(
vector: impl CastInto<Ref<QVector2D>>
) -> CppBox<QVector4D>
[src]
vector: impl CastInto<Ref<QVector2D>>
) -> CppBox<QVector4D>
Constructs a 4D vector from the specified 2D vector. The z and w coordinates are set to zero.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QVector2D& vector)
.
Constructs a 4D vector from the specified 2D vector. The z and w coordinates are set to zero.
See also toVector2D().
pub unsafe fn from_q_vector_2d2_float(
vector: impl CastInto<Ref<QVector2D>>,
zpos: c_float,
wpos: c_float
) -> CppBox<QVector4D>
[src]
vector: impl CastInto<Ref<QVector2D>>,
zpos: c_float,
wpos: c_float
) -> CppBox<QVector4D>
Constructs a 4D vector from the specified 2D vector. The z and w coordinates are set to zpos and wpos respectively.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QVector2D& vector, float zpos, float wpos)
.
Constructs a 4D vector from the specified 2D vector. The z and w coordinates are set to zpos and wpos respectively.
See also toVector2D().
pub unsafe fn from_q_vector_3d(
vector: impl CastInto<Ref<QVector3D>>
) -> CppBox<QVector4D>
[src]
vector: impl CastInto<Ref<QVector3D>>
) -> CppBox<QVector4D>
Constructs a 4D vector from the specified 3D vector. The w coordinate is set to zero.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QVector3D& vector)
.
Constructs a 4D vector from the specified 3D vector. The w coordinate is set to zero.
See also toVector3D().
pub unsafe fn from_q_vector_3d_float(
vector: impl CastInto<Ref<QVector3D>>,
wpos: c_float
) -> CppBox<QVector4D>
[src]
vector: impl CastInto<Ref<QVector3D>>,
wpos: c_float
) -> CppBox<QVector4D>
Constructs a 4D vector from the specified 3D vector. The w coordinate is set to wpos.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QVector3D& vector, float wpos)
.
Constructs a 4D vector from the specified 3D vector. The w coordinate is set to wpos.
See also toVector3D().
pub unsafe fn new_copy(
other: impl CastInto<Ref<QVector4D>>
) -> CppBox<QVector4D>
[src]
other: impl CastInto<Ref<QVector4D>>
) -> CppBox<QVector4D>
The QVector4D class represents a vector or vertex in 4D space.
Calls C++ function: [constructor] void QVector4D::QVector4D(const QVector4D& other)
.
pub unsafe fn normalize(&mut self)
[src]
Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.
Calls C++ function: void QVector4D::normalize()
.
Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.
See also length() and normalized().
pub unsafe fn normalized(&self) -> CppBox<QVector4D>
[src]
Returns the normalized unit vector form of this vector.
Calls C++ function: QVector4D QVector4D::normalized() const
.
Returns the normalized unit vector form of this vector.
If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.
pub unsafe fn set_w(&mut self, w: c_float)
[src]
Sets the w coordinate of this point to the given w coordinate.
Calls C++ function: void QVector4D::setW(float w)
.
pub unsafe fn set_x(&mut self, x: c_float)
[src]
Sets the x coordinate of this point to the given x coordinate.
Calls C++ function: void QVector4D::setX(float x)
.
pub unsafe fn set_y(&mut self, y: c_float)
[src]
Sets the y coordinate of this point to the given y coordinate.
Calls C++ function: void QVector4D::setY(float y)
.
pub unsafe fn set_z(&mut self, z: c_float)
[src]
Sets the z coordinate of this point to the given z coordinate.
Calls C++ function: void QVector4D::setZ(float z)
.
pub unsafe fn to_point(&self) -> CppBox<QPoint>
[src]
Returns the QPoint form of this 4D vector. The z and w coordinates are dropped.
Calls C++ function: QPoint QVector4D::toPoint() const
.
Returns the QPoint form of this 4D vector. The z and w coordinates are dropped.
See also toPointF() and toVector2D().
pub unsafe fn to_point_f(&self) -> CppBox<QPointF>
[src]
Returns the QPointF form of this 4D vector. The z and w coordinates are dropped.
Calls C++ function: QPointF QVector4D::toPointF() const
.
Returns the QPointF form of this 4D vector. The z and w coordinates are dropped.
See also toPoint() and toVector2D().
pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>
[src]
Returns the 4D vector as a QVariant.
Calls C++ function: QVariant QVector4D::operator QVariant() const
.
Returns the 4D vector as a QVariant.
pub unsafe fn to_vector_2d(&self) -> CppBox<QVector2D>
[src]
Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.
Calls C++ function: QVector2D QVector4D::toVector2D() const
.
Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.
See also toVector2DAffine(), toVector3D(), and toPoint().
pub unsafe fn to_vector_2d_affine(&self) -> CppBox<QVector2D>
[src]
Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.
Calls C++ function: QVector2D QVector4D::toVector2DAffine() const
.
Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.
See also toVector2D(), toVector3DAffine(), and toPoint().
pub unsafe fn to_vector_3d(&self) -> CppBox<QVector3D>
[src]
Returns the 3D vector form of this 4D vector, dropping the w coordinate.
Calls C++ function: QVector3D QVector4D::toVector3D() const
.
Returns the 3D vector form of this 4D vector, dropping the w coordinate.
See also toVector3DAffine(), toVector2D(), and toPoint().
pub unsafe fn to_vector_3d_affine(&self) -> CppBox<QVector3D>
[src]
Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate. Returns a null vector if w is zero.
Calls C++ function: QVector3D QVector4D::toVector3DAffine() const
.
Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate. Returns a null vector if w is zero.
See also toVector3D(), toVector2DAffine(), and toPoint().
pub unsafe fn w(&self) -> c_float
[src]
Returns the w coordinate of this point.
Calls C++ function: float QVector4D::w() const
.
pub unsafe fn x(&self) -> c_float
[src]
Returns the x coordinate of this point.
Calls C++ function: float QVector4D::x() const
.
pub unsafe fn y(&self) -> c_float
[src]
Returns the y coordinate of this point.
Calls C++ function: float QVector4D::y() const
.
pub unsafe fn z(&self) -> c_float
[src]
Returns the z coordinate of this point.
Calls C++ function: float QVector4D::z() const
.
Trait Implementations
impl<'_> Add<Ref<QVector4D>> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the +
operator.
fn add(self, v2: Ref<QVector4D>) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator+(const QVector4D& v1, const QVector4D& v2)
.
impl AddAssign<Ref<QVector4D>> for QVector4D
[src]
fn add_assign(&mut self, vector: Ref<QVector4D>)
[src]
Adds the given vector to this vector and returns a reference to this vector.
Calls C++ function: QVector4D& QVector4D::operator+=(const QVector4D& vector)
.
Adds the given vector to this vector and returns a reference to this vector.
See also operator-=().
impl CppDeletable for QVector4D
[src]
unsafe fn delete(&mut self)
[src]
The QVector4D class represents a vector or vertex in 4D space.
Calls C++ function: [destructor] void QVector4D::~QVector4D()
.
impl<'_> Div<Ref<QVector4D>> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the /
operator.
fn div(self, divisor: Ref<QVector4D>) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator/(const QVector4D& vector, const QVector4D& divisor)
.
impl<'_> Div<f32> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the /
operator.
fn div(self, divisor: c_float) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator/(const QVector4D& vector, float divisor)
.
impl DivAssign<Ref<QVector4D>> for QVector4D
[src]
fn div_assign(&mut self, vector: Ref<QVector4D>)
[src]
Divides the components of this vector by the corresponding components in vector.
Calls C++ function: QVector4D& QVector4D::operator/=(const QVector4D& vector)
.
Divides the components of this vector by the corresponding components in vector.
This function was introduced in Qt 5.5.
See also operator*=().
impl DivAssign<f32> for QVector4D
[src]
fn div_assign(&mut self, divisor: c_float)
[src]
Divides this vector's coordinates by the given divisor, and returns a reference to this vector.
Calls C++ function: QVector4D& QVector4D::operator/=(float divisor)
.
Divides this vector's coordinates by the given divisor, and returns a reference to this vector.
See also operator*=().
impl<'_> Mul<Ref<QMatrix4X4>> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the *
operator.
fn mul(self, matrix: Ref<QMatrix4X4>) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator*(const QVector4D& vector, const QMatrix4x4& matrix)
.
impl<'_> Mul<Ref<QVector4D>> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the *
operator.
fn mul(self, v2: Ref<QVector4D>) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator*(const QVector4D& v1, const QVector4D& v2)
.
impl<'_> Mul<f32> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the *
operator.
fn mul(self, factor: c_float) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator*(const QVector4D& vector, float factor)
.
impl MulAssign<Ref<QVector4D>> for QVector4D
[src]
fn mul_assign(&mut self, vector: Ref<QVector4D>)
[src]
Multiplies the components of this vector by the corresponding components in vector.
Calls C++ function: QVector4D& QVector4D::operator*=(const QVector4D& vector)
.
Multiplies the components of this vector by the corresponding components in vector.
impl MulAssign<f32> for QVector4D
[src]
fn mul_assign(&mut self, factor: c_float)
[src]
Multiplies this vector's coordinates by the given factor, and returns a reference to this vector.
Calls C++ function: QVector4D& QVector4D::operator*=(float factor)
.
Multiplies this vector's coordinates by the given factor, and returns a reference to this vector.
See also operator/=().
impl PartialEq<Ref<QVector4D>> for QVector4D
[src]
fn eq(&self, v2: &Ref<QVector4D>) -> bool
[src]
Returns true
if page layout lhs is equal to page layout rhs, i.e. if all the attributes are exactly equal.
Calls C++ function: bool operator==(const QVector4D& v1, const QVector4D& v2)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(const QPageLayout &lhs, const QPageLayout &rhs)
:
Returns true
if page layout lhs is equal to page layout rhs, i.e. if all the attributes are exactly equal.
Note that this is a strict equality, especially for page size where the QPageSize ID, name and size must exactly match, and the margins where the units must match.
See also QPageLayout::isEquivalentTo().
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> Sub<Ref<QVector4D>> for &'_ QVector4D
[src]
type Output = CppBox<QVector4D>
The resulting type after applying the -
operator.
fn sub(self, v2: Ref<QVector4D>) -> CppBox<QVector4D>
[src]
Calls C++ function: QVector4D operator-(const QVector4D& v1, const QVector4D& v2)
.
impl SubAssign<Ref<QVector4D>> for QVector4D
[src]
fn sub_assign(&mut self, vector: Ref<QVector4D>)
[src]
Subtracts the given vector from this vector and returns a reference to this vector.
Calls C++ function: QVector4D& QVector4D::operator-=(const QVector4D& vector)
.
Subtracts the given vector from this vector and returns a reference to this vector.
See also operator+=().
Auto Trait Implementations
impl RefUnwindSafe for QVector4D
impl Send for QVector4D
impl Sync for QVector4D
impl Unpin for QVector4D
impl UnwindSafe for QVector4D
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,