• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QVector4D

    下一话题

    QInputContextFactory

    QVector3D

    注意

    该类在 Qt4.6 引入

    概要

    函数

    静态函数

    详细描述

    PySide.QtGui.QVector3D class represents a vector or vertex in 3D space.

    Vectors are one of the main building blocks of 3D representation and drawing. They consist of three coordinates, traditionally called x, y, and z.

    PySide.QtGui.QVector3D class can also be used to represent vertices in 3D space. We therefore do not need to provide a separate vertex class.

    注意

    By design values in the PySide.QtGui.QVector3D instance are stored as float . This means that on platforms where the qreal arguments to PySide.QtGui.QVector3D functions are represented by double values, it is possible to lose precision.

    class PySide.QtGui. QVector3D
    class PySide.QtGui. QVector3D ( point )
    class PySide.QtGui. QVector3D ( point )
    class PySide.QtGui. QVector3D ( vector )
    class PySide.QtGui. QVector3D ( vector , zpos )
    class PySide.QtGui. QVector3D ( QVector3D )
    class PySide.QtGui. QVector3D ( vector )
    class PySide.QtGui. QVector3D ( xpos , ypos , zpos )
    参数:

    构造 null 向量,即:采用坐标 (0, 0, 0)。

    Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.

    Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.

    构造 3D 向量从指定 2D vector 。z 坐标被设为 0。

    构造 3D 向量从指定 2D vector 。z 坐标被设为 zpos .

    构造 3D 向量从指定 4D vector . The w coordinate is dropped.

    构造向量采用坐标 ( xpos , ypos , zpos ).

    PySide.QtGui.QVector3D. __reduce__ ( )
    返回类型: PyObject
    PySide.QtGui.QVector3D. __repr__ ( )
    返回类型: PyObject
    static PySide.QtGui.QVector3D. crossProduct ( v1 , v2 )
    参数:
    返回类型:

    PySide.QtGui.QVector3D

    Returns the cross-product of vectors v1 and v2 , which corresponds to the normal vector of a plane defined by v1 and v2 .

    PySide.QtGui.QVector3D. distanceToLine ( point , direction )
    参数:
    返回类型:

    PySide.QtCore.qreal

    Returns the distance that this vertex is from a line defined by point and the unit vector direction .

    direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex is returned.

    PySide.QtGui.QVector3D. distanceToPlane ( plane1 , plane2 , plane3 )
    参数:
    返回类型:

    PySide.QtCore.qreal

    这是重载函数。

    Returns the distance from this vertex a plane defined by the vertices plane1 , plane2 and plane3 .

    The return value will be negative if the vertex is below the plane, or zero if it is on the plane.

    The two vectors that define the plane are plane2 - plane1 and plane3 - plane1 .

    PySide.QtGui.QVector3D. distanceToPlane ( plane , normal )
    参数:
    返回类型:

    PySide.QtCore.qreal

    Returns the distance from this vertex to a plane defined by the vertex plane normal unit vector. The normal parameter is assumed to have been normalized to a unit vector.

    The return value will be negative if the vertex is below the plane, or zero if it is on the plane.

    static PySide.QtGui.QVector3D. dotProduct ( v1 , v2 )
    参数:
    返回类型:

    PySide.QtCore.qreal

    Returns the dot product of v1 and v2 .

    PySide.QtGui.QVector3D. isNull ( )
    返回类型: PySide.QtCore.bool

    Returns true if the x, y, and z coordinates are set to 0.0, otherwise returns false.

    PySide.QtGui.QVector3D. length ( )
    返回类型: PySide.QtCore.qreal

    从原点返回向量长度。

    PySide.QtGui.QVector3D. lengthSquared ( )
    返回类型: PySide.QtCore.qreal

    Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.

    static PySide.QtGui.QVector3D. normal ( v1 , v2 , v3 )
    参数:
    返回类型:

    PySide.QtGui.QVector3D

    这是重载函数。

    Returns the normal vector of a plane defined by vectors v2 - v1 and v3 - v1 , normalized to be a unit vector.

    使用 PySide.QtGui.QVector3D.crossProduct() to compute the cross-product of v2 - v1 and v3 - v1 if you do not need the result to be normalized to a unit vector.

    static PySide.QtGui.QVector3D. normal ( v1 , v2 )
    参数:
    返回类型:

    PySide.QtGui.QVector3D

    Returns the normal vector of a plane defined by vectors v1 and v2 , normalized to be a unit vector.

    使用 PySide.QtGui.QVector3D.crossProduct() to compute the cross-product of v1 and v2 if you do not need the result to be normalized to a unit vector.

    PySide.QtGui.QVector3D. 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.

    PySide.QtGui.QVector3D. normalized ( )
    返回类型: PySide.QtGui.QVector3D

    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.

    PySide.QtGui.QVector3D. __ne__ ( v2 )
    参数: v2 PySide.QtGui.QVector3D
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QVector3D. __mul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __mul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __mul__ ( matrix )
    参数: matrix PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __mul__ ( v2 )
    参数: v2 PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __mul__ ( matrix )
    参数: matrix PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __imul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QVector3D

    Multiplies this vector's coordinates by the given factor , and returns a reference to this vector.

    另请参阅

    PySide.QtGui.QVector3D.operator/=()

    PySide.QtGui.QVector3D. __imul__ ( vector )
    参数: vector PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D

    这是重载函数。

    Multiplies the components of this vector by the corresponding components in vector .

    Note: this is not the same as the PySide.QtGui.QVector3D.crossProduct() of this vector and vector .

    PySide.QtGui.QVector3D. __add__ ( v2 )
    参数: v2 PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __iadd__ ( vector )
    参数: vector PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D

    添加给定 vector to this vector and returns a reference to this vector.

    另请参阅

    PySide.QtGui.QVector3D.operator-=()

    PySide.QtGui.QVector3D. __sub__ ( )
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __sub__ ( v2 )
    参数: v2 PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __isub__ ( vector )
    参数: vector PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D

    Subtracts the given vector from this vector and returns a reference to this vector.

    另请参阅

    PySide.QtGui.QVector3D.operator+=()

    PySide.QtGui.QVector3D. __div__ ( divisor )
    参数: divisor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QVector3D
    PySide.QtGui.QVector3D. __idiv__ ( divisor )
    参数: divisor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QVector3D

    Divides this vector's coordinates by the given divisor , and returns a reference to this vector.

    另请参阅

    PySide.QtGui.QVector3D.operator*=()

    PySide.QtGui.QVector3D. __eq__ ( v2 )
    参数: v2 PySide.QtGui.QVector3D
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QVector3D. setX ( x )
    参数: x PySide.QtCore.qreal

    Sets the x coordinate of this point to the given x 坐标。

    PySide.QtGui.QVector3D. setY ( y )
    参数: y PySide.QtCore.qreal

    Sets the y coordinate of this point to the given y 坐标。

    PySide.QtGui.QVector3D. setZ ( z )
    参数: z PySide.QtCore.qreal

    Sets the z coordinate of this point to the given z 坐标。

    PySide.QtGui.QVector3D. toPoint ( )
    返回类型: PySide.QtCore.QPoint

    返回 PySide.QtCore.QPoint form of this 3D vector. The z coordinate is dropped.

    PySide.QtGui.QVector3D. toPointF ( )
    返回类型: PySide.QtCore.QPointF

    返回 PySide.QtCore.QPointF form of this 3D vector. The z coordinate is dropped.

    PySide.QtGui.QVector3D. toTuple ( )
    返回类型: PyObject
    PySide.QtGui.QVector3D. toVector2D ( )
    返回类型: PySide.QtGui.QVector2D

    Returns the 2D vector form of this 3D vector, dropping the z coordinate.

    PySide.QtGui.QVector3D. toVector4D ( )
    返回类型: PySide.QtGui.QVector4D

    Returns the 4D form of this 3D vector, with the w coordinate set to zero.

    PySide.QtGui.QVector3D. x ( )
    返回类型: PySide.QtCore.qreal

    返回此点的 x 坐标。

    PySide.QtGui.QVector3D. y ( )
    返回类型: PySide.QtCore.qreal

    返回此点的 y 坐标。

    PySide.QtGui.QVector3D. z ( )
    返回类型: PySide.QtCore.qreal

    返回此点的 z 坐标。