QGeometryRenderer Class

class Qt3DRender ::QGeometryRenderer

Encapsulates geometry rendering. 更多...

头: #include <QGeometryRenderer>
qmake: QT += 3drender
Since: Qt 5.7
实例化: GeometryRenderer
继承: Qt3DCore::QComponent
继承者:

Qt3DExtras::QConeMesh , Qt3DExtras::QCuboidMesh , Qt3DExtras::QCylinderMesh , Qt3DExtras::QExtrudedTextMesh , Qt3DExtras::QPlaneMesh , Qt3DExtras::QSphereMesh , Qt3DExtras::QTorusMesh ,和 Qt3DRender::QMesh

该类在 Qt 5.7 引入。

公共类型

enum PrimitiveType { Points, Lines, LineLoop, LineStrip, Triangles, …, Patches }

特性

公共函数

QGeometryRenderer (Qt3DCore::QNode * parent = nullptr)
int firstInstance () const
int firstVertex () const
Qt3DRender::QGeometry * geometry () const
Qt3DRender::QGeometryFactoryPtr geometryFactory () const
int indexBufferByteOffset () const
int indexOffset () const
int instanceCount () const
bool primitiveRestartEnabled () const
Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType () const
int restartIndexValue () const
void setGeometryFactory (const Qt3DRender::QGeometryFactoryPtr & factory )
int vertexCount () const
int verticesPerPatch () const

公共槽

void setFirstInstance (int firstInstance )
void setFirstVertex (int firstVertex )
void setGeometry (Qt3DRender::QGeometry * geometry )
void setIndexBufferByteOffset (int offset )
void setIndexOffset (int indexOffset )
void setInstanceCount (int instanceCount )
void setPrimitiveRestartEnabled (bool enabled )
void setPrimitiveType (Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType )
void setRestartIndexValue (int index )
void setVertexCount (int vertexCount )
void setVerticesPerPatch (int verticesPerPatch )

信号

void firstInstanceChanged (int firstInstance )
void firstVertexChanged (int firstVertex )
void geometryChanged (Qt3DRender::QGeometry * geometry )
void indexBufferByteOffsetChanged (int offset )
void indexOffsetChanged (int indexOffset )
void instanceCountChanged (int instanceCount )
void primitiveRestartEnabledChanged (bool primitiveRestartEnabled )
void primitiveTypeChanged (Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType )
void restartIndexValueChanged (int restartIndexValue )
void vertexCountChanged (int vertexCount )
void verticesPerPatchChanged (int verticesPerPatch )

详细描述

A Qt3DRender::QGeometryRenderer holds all the information necessary to draw a Qt3DRender::QGeometry QGeometry holds the coordinates of the geometry data - QGeometryRenderer specifies how to interpret that data.

成员类型文档编制

enum QGeometryRenderer:: PrimitiveType

The type of the primitive.

常量 描述
Qt3DRender::QGeometryRenderer::Points 0x0000 List of points
Qt3DRender::QGeometryRenderer::Lines 0x0001 List of lines
Qt3DRender::QGeometryRenderer::LineLoop 0x0002 Connected group of lines connected at ends forming a loop
Qt3DRender::QGeometryRenderer::LineStrip 0x0003 Connected group of lines
Qt3DRender::QGeometryRenderer::Triangles 0x0004 List of triangles
Qt3DRender::QGeometryRenderer::TriangleStrip 0x0005 List of connected triangles
Qt3DRender::QGeometryRenderer::TriangleFan 0x0006 List of connected triagles where all triangles share the first vertex
Qt3DRender::QGeometryRenderer::LinesAdjacency 0x000A Allows geometry shader to access adjacent lines in a line list
Qt3DRender::QGeometryRenderer::TrianglesAdjacency 0x000C Allows geometry shader to access adjacent triangles in a triangle list
Qt3DRender::QGeometryRenderer::LineStripAdjacency 0x000B Allows geometry shader to access adjacent lines in a line strip
Qt3DRender::QGeometryRenderer::TriangleStripAdjacency 0x000D Allows geometry shader to access adjacent triangles in a triangle strip
Qt3DRender::QGeometryRenderer::Patches 0x000E Only primitive type accepted by tesselation shader where a patch consists of arbitrary number of vertices

特性文档编制

firstInstance : int

Holds the base instance.

访问函数:

int firstInstance () const
void setFirstInstance (int firstInstance )

通知程序信号:

void firstInstanceChanged (int firstInstance )

firstVertex : int

Holds the base vertex.

访问函数:

int firstVertex () const
void setFirstVertex (int firstVertex )

通知程序信号:

void firstVertexChanged (int firstVertex )

geometry : Qt3DRender::QGeometry *

Holds the geometry.

访问函数:

Qt3DRender::QGeometry * geometry () const
void setGeometry (Qt3DRender::QGeometry * geometry )

通知程序信号:

void geometryChanged (Qt3DRender::QGeometry * geometry )

indexBufferByteOffset : int

Holds the byte offset into the index buffer.

访问函数:

int indexBufferByteOffset () const
void setIndexBufferByteOffset (int offset )

通知程序信号:

void indexBufferByteOffsetChanged (int offset )

indexOffset : int

Holds the base vertex.

访问函数:

int indexOffset () const
void setIndexOffset (int indexOffset )

通知程序信号:

void indexOffsetChanged (int indexOffset )

instanceCount : int

Holds the instance count.

访问函数:

int instanceCount () const
void setInstanceCount (int instanceCount )

通知程序信号:

void instanceCountChanged (int instanceCount )

primitiveRestartEnabled : bool

Holds the primitive restart flag.

访问函数:

bool primitiveRestartEnabled () const
void setPrimitiveRestartEnabled (bool enabled )

通知程序信号:

void primitiveRestartEnabledChanged (bool primitiveRestartEnabled )

primitiveType : PrimitiveType

Holds the primitive type.

访问函数:

Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType () const
void setPrimitiveType (Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType )

通知程序信号:

void primitiveTypeChanged (Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType )

restartIndexValue : int

Holds the restart index.

访问函数:

int restartIndexValue () const
void setRestartIndexValue (int index )

通知程序信号:

void restartIndexValueChanged (int restartIndexValue )

vertexCount : int

Holds the primitive count.

访问函数:

int vertexCount () const
void setVertexCount (int vertexCount )

通知程序信号:

void vertexCountChanged (int vertexCount )

verticesPerPatch : int

Holds vertices per patch.

访问函数:

int verticesPerPatch () const
void setVerticesPerPatch (int verticesPerPatch )

通知程序信号:

void verticesPerPatchChanged (int verticesPerPatch )

成员函数文档编制

QGeometryRenderer:: QGeometryRenderer ( Qt3DCore::QNode * parent = nullptr)

Constructs a new QGeometryRenderer with parent .

Qt3DRender::QGeometryFactoryPtr QGeometryRenderer:: geometryFactory () const

Returns the geometry functor.

另请参阅 setGeometryFactory ().

void QGeometryRenderer:: setGeometryFactory (const Qt3DRender::QGeometryFactoryPtr & factory )

Sets the geometry factory .

另请参阅 geometryFactory ().