- Qt 6.8
- Qt 3D
- C++ Classes
- Qt3DCore (Deprecated)
- QGeometryView
- Qt 6.8.2 Reference Documentation

# QGeometryView Class

class Qt3DCore::QGeometryView

Encapsulates geometry details. More...

Header: | `#include <QGeometryView>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS 3DCore)` `target_link_libraries(mytarget PRIVATE Qt6::3DCore)`
qmake: | `QT += 3dcore`
Since: | Qt 6.0
In QML: | GeometryView
Inherits: | Qt3DCore::QNode
Inherited By: | Qt3DExtras::QConeGeometryView, Qt3DExtras::QCuboidGeometryView, Qt3DExtras::QCylinderGeometryView, Qt3DExtras::QPlaneGeometryView, Qt3DExtras::QSphereGeometryView, and Qt3DExtras::QTorusGeometryView
Status: | Deprecated

- List of all members, including inherited members

## Public Types

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

## Properties

firstInstance : int firstVertex : int geometry : Qt3DCore::QGeometry* indexBufferByteOffset : int indexOffset : int instanceCount : int | primitiveRestartEnabled : bool primitiveType : PrimitiveType restartIndexValue : int vertexCount : int verticesPerPatch : int

## Public Functions

| QGeometryView(Qt3DCore::QNode *parent = nullptr)
int | firstInstance() const
int | firstVertex() const
Qt3DCore::QGeometry * | geometry() const
int | indexBufferByteOffset() const
int | indexOffset() const
int | instanceCount() const
bool | primitiveRestartEnabled() const
Qt3DCore::QGeometryView::PrimitiveType | primitiveType() const
int | restartIndexValue() const
int | vertexCount() const
int | verticesPerPatch() const

## Public Slots

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

## Signals

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

## Detailed Description

A GeometryView holds all the information necessary to handle a Geometry. A Geometry holds the coordinates of the geometry data - GeometryView specifies how to interpret that data.

## Member Type Documentation

### enum QGeometryView::PrimitiveType

The type of the primitive.

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

## Property Documentation

### firstInstance : int

Holds the base instance.

Access functions:

int | firstInstance() const
void | setFirstInstance(int firstInstance)

Notifier signal:

void | firstInstanceChanged(int firstInstance)

### firstVertex : int

Holds the base vertex.

Access functions:

int | firstVertex() const
void | setFirstVertex(int firstVertex)

Notifier signal:

void | firstVertexChanged(int firstVertex)

### geometry : Qt3DCore::QGeometry*

Holds the geometry.

Access functions:

Qt3DCore::QGeometry * | geometry() const
void | setGeometry(Qt3DCore::QGeometry *geometry)

Notifier signal:

void | geometryChanged(Qt3DCore::QGeometry *geometry)

### indexBufferByteOffset : int

Holds the byte offset into the index buffer.

Access functions:

int | indexBufferByteOffset() const
void | setIndexBufferByteOffset(int offset)

Notifier signal:

void | indexBufferByteOffsetChanged(int offset)

### indexOffset : int

Holds the base vertex.

Access functions:

int | indexOffset() const
void | setIndexOffset(int indexOffset)

Notifier signal:

void | indexOffsetChanged(int indexOffset)

### instanceCount : int

Holds the instance count.

Access functions:

int | instanceCount() const
void | setInstanceCount(int instanceCount)

Notifier signal:

void | instanceCountChanged(int instanceCount)

### primitiveRestartEnabled : bool

Holds the primitive restart flag.

Access functions:

bool | primitiveRestartEnabled() const
void | setPrimitiveRestartEnabled(bool enabled)

Notifier signal:

void | primitiveRestartEnabledChanged(bool primitiveRestartEnabled)

### primitiveType : PrimitiveType

Holds the primitive type.

Access functions:

Qt3DCore::QGeometryView::PrimitiveType | primitiveType() const
void | setPrimitiveType(Qt3DCore::QGeometryView::PrimitiveType primitiveType)

Notifier signal:

void | primitiveTypeChanged(Qt3DCore::QGeometryView::PrimitiveType primitiveType)

### restartIndexValue : int

Holds the restart index.

Access functions:

int | restartIndexValue() const
void | setRestartIndexValue(int index)

Notifier signal:

void | restartIndexValueChanged(int restartIndexValue)

### vertexCount : int

Holds the primitive count.

Access functions:

int | vertexCount() const
void | setVertexCount(int vertexCount)

Notifier signal:

void | vertexCountChanged(int vertexCount)

### verticesPerPatch : int

Holds vertices per patch.

Access functions:

int | verticesPerPatch() const
void | setVerticesPerPatch(int verticesPerPatch)

Notifier signal:

void | verticesPerPatchChanged(int verticesPerPatch)

## Member Function Documentation

### `[explicit]` QGeometryView::QGeometryView(Qt3DCore::QNode *parent = nullptr)

Constructs a new QGeometryView with parent.