-
首页
-
PyQt 4.11.4
-
所有类
-
模块
QVector4D Class Reference
[
QtGui
module]
QVector4D 类表示 4D 空间中的向量或顶点。
更多...
方法
-
__init__
(
self
)
-
__init__
(
self
, float
xpos
, float
ypos
, float
zpos
, float
wpos
)
-
__init__
(
self
, QPoint
point
)
-
__init__
(
self
, QPointF
point
)
-
__init__
(
self
, QVector2D
vector
)
-
__init__
(
self
, QVector2D
vector
, float
zpos
, float
wpos
)
-
__init__
(
self
, QVector3D
vector
)
-
__init__
(
self
, QVector3D
vector
, float
wpos
)
-
__init__
(
self
, QVector4D)
-
bool
isNull
(
self
)
-
float
length
(
self
)
-
float
lengthSquared
(
self
)
-
normalize
(
self
)
-
QVector4D
normalized
(
self
)
-
setW
(
self
, float
aW
)
-
setX
(
self
, float
aX
)
-
setY
(
self
, float
aY
)
-
setZ
(
self
, float
aZ
)
-
QPoint
toPoint
(
self
)
-
QPointF
toPointF
(
self
)
-
QVector2D
toVector2D
(
self
)
-
QVector2D
toVector2DAffine
(
self
)
-
QVector3D
toVector3D
(
self
)
-
QVector3D
toVector3DAffine
(
self
)
-
float
w
(
self
)
-
float
x
(
self
)
-
float
y
(
self
)
-
float
z
(
self
)
Static Methods
Special Methods
-
QVector4D
__add__
(
self
, QVector4D
v2
)
-
QVector4D
__div__
(
self
, float
divisor
)
-
bool
__eq__
(
self
, QVector4D
v2
)
-
QVector4D
__iadd__
(
self
, QVector4D
vector
)
-
QVector4D
__idiv__
(
self
, float
divisor
)
-
QVector4D
__imul__
(
self
, float
factor
)
-
QVector4D
__imul__
(
self
, QVector4D
vector
)
-
QVector4D
__isub__
(
self
, QVector4D
vector
)
-
QVector4D
__mul__
(
self
, QMatrix4x4
matrix
)
-
QVector4D
__mul__
(
self
, QVector4D
vector
)
-
QVector4D
__mul__
(
self
, float
factor
)
-
QVector4D
__mul__
(
self
, QVector4D
v2
)
-
bool
__ne__
(
self
, QVector4D
v2
)
-
QVector4D
__neg__
(
self
)
-
str
__repr__
(
self
)
-
QVector4D
__sub__
(
self
, QVector4D
v2
)
详细描述
This class can be pickled.
The QVector4D class represents a vector or vertex in 4D
space.
The QVector4D class can also be used to represent vertices in 4D
space. We therefore do not need to provide a separate vertex
类。
注意:
By design values in the QVector4D instance are
stored as
float
. This means that on platforms where the
qreal
arguments to QVector4D functions are represented by
double
values, it is possible to lose precision.
方法文档编制
QVector4D.__init__ (
self
)
Constructs a null vector, i.e. with coordinates (0, 0, 0,
0).
QVector4D.__init__ (
self
, float
xpos
, float
ypos
, float
zpos
, float
wpos
)
构造向量采用坐标 (
xpos
,
ypos
,
zpos
,
wpos
).
QVector4D.__init__ (
self
,
QPoint
point
)
Constructs a vector with x and y coordinates from a 2D
point
, and z and w coordinates of 0.
QVector4D.__init__ (
self
,
QPointF
point
)
Constructs a vector with x and y coordinates from a 2D
point
, and z and w coordinates of 0.
QVector4D.__init__ (
self
,
QVector2D
vector
)
构造 4D 向量从指定 2D
vector
。
z and w coordinates are set to zero.
另请参阅
toVector2D
().
QVector4D.__init__ (
self
,
QVector2D
vector
, float
zpos
, float
wpos
)
构造 4D 向量从指定 2D
vector
。
z and w coordinates are set to
zpos
and
wpos
分别。
另请参阅
toVector2D
().
QVector4D.__init__ (
self
,
QVector3D
vector
)
构造 4D 向量从指定 3D
vector
。
w coordinate is set to zero.
另请参阅
toVector3D
().
QVector4D.__init__ (
self
,
QVector3D
vector
, float
wpos
)
构造 4D 向量从指定 3D
vector
。
w coordinate is set to
wpos
.
另请参阅
toVector3D
().
QVector4D.__init__ (
self
,
QVector4D
)
float QVector4D.dotProduct (
QVector4D
v1
,
QVector4D
v2
)
Returns the dot product of
v1
and
v2
.
bool QVector4D.isNull (
self
)
Returns true if the x, y, z, and w coordinates are set to 0.0,
otherwise returns false.
float QVector4D.length (
self
)
从原点返回向量长度。
另请参阅
lengthSquared
() 和
normalized
().
float QVector4D.lengthSquared (
self
)
Returns the squared length of the vector from the origin. This
is equivalent to the dot product of the vector with itself.
另请参阅
length
() 和
dotProduct
().
QVector4D.normalize (
self
)
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.
另请参阅
length
() 和
normalized
().
QVector4D
QVector4D.normalized (
self
)
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.
另请参阅
length
() 和
normalize
().
QVector4D.setW (
self
, float
aW
)
Sets the w coordinate of this point to the given
w
坐标。
另请参阅
w
(),
setX
(),
setY
(),和
setZ
().
QVector4D.setX (
self
, float
aX
)
Sets the x coordinate of this point to the given
x
坐标。
另请参阅
x
(),
setY
(),
setZ
(),和
setW
().
QVector4D.setY (
self
, float
aY
)
Sets the y coordinate of this point to the given
y
坐标。
另请参阅
y
(),
setX
(),
setZ
(),和
setW
().
QVector4D.setZ (
self
, float
aZ
)
Sets the z coordinate of this point to the given
z
坐标。
另请参阅
z
(),
setX
(),
setY
(),和
setW
().
QPoint
QVector4D.toPoint (
self
)
返回
QPoint
form of this 4D
vector. The z and w coordinates are dropped.
另请参阅
toPointF
()
and
toVector2D
().
QPointF
QVector4D.toPointF (
self
)
返回
QPointF
form of this 4D
vector. The z and w coordinates are dropped.
另请参阅
toPoint
()
and
toVector2D
().
QVector2D
QVector4D.toVector2D (
self
)
Returns the 2D vector form of this 4D vector, dropping the z and
w coordinates.
另请参阅
toVector2DAffine
(),
toVector3D
(),和
toPoint
().
QVector2D
QVector4D.toVector2DAffine (
self
)
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.
另请参阅
toVector2D
(),
toVector3DAffine
(),和
toPoint
().
QVector3D
QVector4D.toVector3D (
self
)
Returns the 3D vector form of this 4D vector, dropping the w
坐标。
另请参阅
toVector3DAffine
(),
toVector2D
(),和
toPoint
().
QVector3D
QVector4D.toVector3DAffine (
self
)
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.
另请参阅
toVector3D
(),
toVector2DAffine
(),和
toPoint
().
float QVector4D.w (
self
)
返回此点的 w 坐标。
另请参阅
setW
(),
x
(),
y
(),和
z
().
float QVector4D.x (
self
)
返回此点的 x 坐标。
另请参阅
setX
(),
y
(),
z
(),和
w
().
float QVector4D.y (
self
)
返回此点的 y 坐标。
另请参阅
setY
(),
x
(),
z
(),和
w
().
float QVector4D.z (
self
)
返回此点的 z 坐标。
另请参阅
setZ
(),
x
(),
y
(),和
w
().
QVector4D
QVector4D.__div__ (
self
, float
divisor
)
bool QVector4D.__eq__ (
self
,
QVector4D
v2
)
QVector4D
QVector4D.__iadd__ (
self
,
QVector4D
vector
)
QVector4D
QVector4D.__idiv__ (
self
, float
divisor
)
QVector4D
QVector4D.__imul__ (
self
, float
factor
)
QVector4D
QVector4D.__imul__ (
self
,
QVector4D
vector
)
QVector4D
QVector4D.__isub__ (
self
,
QVector4D
vector
)
QVector4D
QVector4D.__mul__ (
self
,
QVector4D
vector
)
QVector4D
QVector4D.__mul__ (
self
, float
factor
)
bool QVector4D.__ne__ (
self
,
QVector4D
v2
)
QVector4D
QVector4D.__neg__ (
self
)
str QVector4D.__repr__ (
self
)
-
首页
-
PyQt 4.11.4
-
文档编制