diff options
Diffstat (limited to 'src/render/geometry')
-rw-r--r-- | src/render/geometry/qabstractattribute.cpp | 131 | ||||
-rw-r--r-- | src/render/geometry/qabstractbuffer.cpp | 45 | ||||
-rw-r--r-- | src/render/geometry/qboundingvolumespecifier.cpp | 28 | ||||
-rw-r--r-- | src/render/geometry/qbuffer.cpp | 134 | ||||
-rw-r--r-- | src/render/geometry/qcuboidgeometry.cpp | 150 | ||||
-rw-r--r-- | src/render/geometry/qcuboidmesh.cpp | 88 | ||||
-rw-r--r-- | src/render/geometry/qcylindergeometry.cpp | 116 | ||||
-rw-r--r-- | src/render/geometry/qcylindermesh.cpp | 66 | ||||
-rw-r--r-- | src/render/geometry/qgeometry.cpp | 67 | ||||
-rw-r--r-- | src/render/geometry/qgeometryrenderer.cpp | 142 | ||||
-rw-r--r-- | src/render/geometry/qmesh.cpp | 57 | ||||
-rw-r--r-- | src/render/geometry/qplanegeometry.cpp | 116 | ||||
-rw-r--r-- | src/render/geometry/qplanemesh.cpp | 55 | ||||
-rw-r--r-- | src/render/geometry/qspheregeometry.cpp | 127 | ||||
-rw-r--r-- | src/render/geometry/qspheremesh.cpp | 66 | ||||
-rw-r--r-- | src/render/geometry/qtorusgeometry.cpp | 116 | ||||
-rw-r--r-- | src/render/geometry/qtorusmesh.cpp | 66 |
17 files changed, 1542 insertions, 28 deletions
diff --git a/src/render/geometry/qabstractattribute.cpp b/src/render/geometry/qabstractattribute.cpp index 9c37d69f9..579ca6aaa 100644 --- a/src/render/geometry/qabstractattribute.cpp +++ b/src/render/geometry/qabstractattribute.cpp @@ -47,10 +47,6 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -/*! - \class Qt3DRender::QAbstractAttributePrivate - \internal -*/ QAbstractAttributePrivate::QAbstractAttributePrivate() : QNodePrivate() , m_buffer(Q_NULLPTR) @@ -65,16 +61,89 @@ QAbstractAttributePrivate::QAbstractAttributePrivate() { } +/*! + * \qmltype AbstractAttribute + * \instantiates Qt3DRender::QAbstractAttribute + * \inqmlmodule Qt3D.Render + * \brief Uncreatable + */ + +/*! + * \class Qt3DRender::QAbstractAttribute + * \inmodule Qt3DRender + * + * \inherits Qt3DCore::QNode + * + * Abstract class. + */ + +/*! + * \typedef Qt3DRender::QAbstractBufferPtr + * \relates Qt3DRender::QAbstractAttribute + */ + +/*! + * \fn QVector<QVector4D> Qt3DRender::QAbstractAttribute::asVector4D() const + */ + +/*! + * \fn QVector<QVector3D> Qt3DRender::QAbstractAttribute::asVector3D() const + */ + +/*! + * \fn QVector<QVector2D> Qt3DRender::QAbstractAttribute::asVector2D() const + */ + +/*! + * \fn void Qt3DRender::QAbstractAttribute::dump(int count) + * \a count + */ + +/*! + * \enum QAbstractAttribute::AttributeType + * + * The type of the attribute. + * + * \value VertexAttribute + * \value IndexAttribute + */ + +/*! + * \enum QAbstractAttribute::DataType + * + * The type of the data. + * + * \value Byte + * \value UnsignedByte + * \value Short + * \value UnsignedShort + * \value Int + * \value UnsignedInt + * \value HalfFloat + * \value Float + * \value Double + */ + +/*! + * Constructs a new QAbstractAttribute with \a parent. + */ QAbstractAttribute::QAbstractAttribute(QNode *parent) : QNode(*new QAbstractAttributePrivate(), parent) { } +/*! + * Destroys the abstract attribute. + */ QAbstractAttribute::~QAbstractAttribute() { Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DRender::QAbstractAttribute subclass didn't call QNode::cleanup in its destructor"); } +/*! + * Constructs a new QAbstractAttribute from \a buf of \a type, \a dataSize, \a count, \a offset, + * and \a stride with \a parent. + */ QAbstractAttribute::QAbstractAttribute(QAbstractBuffer *buf, DataType type, uint dataSize, uint count, uint offset, uint stride, QNode *parent) : QNode(*new QAbstractAttributePrivate(), parent) { @@ -87,11 +156,17 @@ QAbstractAttribute::QAbstractAttribute(QAbstractBuffer *buf, DataType type, uint d->m_byteStride = stride; } +/*! + * \internal + */ QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QNode *parent) : QNode(dd, parent) { } +/*! + * \internal + */ QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QAbstractBuffer *buf, const QString &name, DataType dataType, uint dataSize, uint count, uint offset, uint stride, QNode *parent) : QNode(dd, parent) { @@ -105,6 +180,9 @@ QAbstractAttribute::QAbstractAttribute(QAbstractAttributePrivate &dd, QAbstractB d->m_byteStride = stride; } +/*! + * \internal + */ void QAbstractAttribute::copy(const QNode *ref) { QNode::copy(ref); @@ -120,54 +198,99 @@ void QAbstractAttribute::copy(const QNode *ref) d_func()->m_attributeType = attribute->d_func()->m_attributeType; } +/*! + * \property QAbstractAttribute::buffer + * + * Holds the buffer. + */ QAbstractBuffer *QAbstractAttribute::buffer() const { Q_D(const QAbstractAttribute); return d->m_buffer; } +/*! + * \property QAbstractAttribute::name + * + * Holds the name. + */ QString QAbstractAttribute::name() const { Q_D(const QAbstractAttribute); return d->m_name; } +/*! + * \property QAbstractAttribute::dataSize + * + * Holds the data size. + */ uint QAbstractAttribute::dataSize() const { Q_D(const QAbstractAttribute); return d->m_dataSize; } +/*! + * \property QAbstractAttribute::dataType + * + * Holds the data type. + */ QAbstractAttribute::DataType QAbstractAttribute::dataType() const { Q_D(const QAbstractAttribute); return d->m_dataType; } +/*! + * \property QAbstractAttribute::count + * + * Holds the count. + */ uint QAbstractAttribute::count() const { Q_D(const QAbstractAttribute); return d->m_count; } +/*! + * \property QAbstractAttribute::byteStride + * + * Holds the byte stride. + */ uint QAbstractAttribute::byteStride() const { Q_D(const QAbstractAttribute); return d->m_byteStride; } +/*! + * \property QAbstractAttribute::byteOffset + * + * Holds the byte offset. + */ uint QAbstractAttribute::byteOffset() const { Q_D(const QAbstractAttribute); return d->m_byteOffset; } +/*! + * \property QAbstractAttribute::divisor + * + * Holds the divisor. + */ uint QAbstractAttribute::divisor() const { Q_D(const QAbstractAttribute); return d->m_divisor; } +/*! + * \property QAbstractAttribute::attributeType + * + * Holds the attribute type. + */ QAbstractAttribute::AttributeType QAbstractAttribute::attributeType() const { Q_D(const QAbstractAttribute); diff --git a/src/render/geometry/qabstractbuffer.cpp b/src/render/geometry/qabstractbuffer.cpp index 7f7c11654..7cabeee56 100644 --- a/src/render/geometry/qabstractbuffer.cpp +++ b/src/render/geometry/qabstractbuffer.cpp @@ -44,32 +44,61 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -/*! - \class Qt3DCore::QAbstractBufferPrivate - \internal -*/ QAbstractBufferPrivate::QAbstractBufferPrivate() : QNodePrivate() { } +/*! + * \qmltype AbstractBuffer + * \instantiates Qt3DRender::QAbstractBuffer + * \inqmlmodule Qt3D.Render + * \brief Uncreatable + */ + +/*! + * \class Qt3DRender::QAbstractBuffer + * \inmodule Qt3DRender + * + * \inherits Qt3DCore::QNode + * + * Abstract class. + */ + +/*! + * \fn void Qt3DRender::QAbstractBuffer::dataChanged(const QByteArray &bytes) + * + * This signal is emitted with \a bytes when data changes. + */ + +/*! + * Constructs a new QAbstractBuffer with \a parent. + */ QAbstractBuffer::QAbstractBuffer(QNode *parent) : QNode(*new QAbstractBufferPrivate(), parent) { } +/*! + * Destroys the abstract buffer. + */ QAbstractBuffer::~QAbstractBuffer() { Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DRender::QAbstractBuffer subclass didn't call QNode::cleanup in its destructor"); } -/*! \internal */ +/*! + * \internal + */ QAbstractBuffer::QAbstractBuffer(QAbstractBufferPrivate &dd, QNode *parent) : QNode(dd, parent) { } +/*! + * \internal + */ void QAbstractBuffer::copy(const QNode *ref) { QNode::copy(ref); @@ -77,6 +106,9 @@ void QAbstractBuffer::copy(const QNode *ref) d_func()->m_data = buffer->d_func()->m_data; } +/*! + * Sets \a bytes as data. + */ void QAbstractBuffer::setData(const QByteArray &bytes) { Q_D(QAbstractBuffer); @@ -87,6 +119,9 @@ void QAbstractBuffer::setData(const QByteArray &bytes) } } +/*! + * \return the data. + */ QByteArray QAbstractBuffer::data() const { Q_D(const QAbstractBuffer); diff --git a/src/render/geometry/qboundingvolumespecifier.cpp b/src/render/geometry/qboundingvolumespecifier.cpp index 4d60e2981..cb62b379e 100644 --- a/src/render/geometry/qboundingvolumespecifier.cpp +++ b/src/render/geometry/qboundingvolumespecifier.cpp @@ -56,11 +56,39 @@ public: QAbstractAttribute *m_positionAttribute; }; +/*! + * \qmltype BoundingVolumeSpecifier + * \instantiates Qt3DRender::QBoundingVolumeSpecifier + * \inqmlmodule Qt3D.Render + * \brief Uncreatable + */ + +/*! + * \qmlproperty AbstractAttribute BoundingVolumeSpecifier::positionAttribute + * + * Holds the position attribute. + */ + +/*! + * \class Qt3DRender::QBoundingVolumeSpecifier + * \inmodule Qt3DRender + * + * \inherits QObject + */ + +/*! + * Constructs a new QBoundingVolumeSpecifier with \a parent. + */ QBoundingVolumeSpecifier::QBoundingVolumeSpecifier(QObject *parent) : QObject(*new QBoundingVolumeSpecifierPrivate(), parent) { } +/*! + * \property QBoundingVolumeSpecifier::positionAttribute + * + * Holds the position attribute. + */ QAbstractAttribute *QBoundingVolumeSpecifier::positionAttribute() const { Q_D(const QBoundingVolumeSpecifier); diff --git a/src/render/geometry/qbuffer.cpp b/src/render/geometry/qbuffer.cpp index a582c1f32..965af0994 100644 --- a/src/render/geometry/qbuffer.cpp +++ b/src/render/geometry/qbuffer.cpp @@ -48,10 +48,6 @@ using namespace Qt3DCore; namespace Qt3DRender { -/*! - \class Qt3DRender::QBufferPrivate - \internal -*/ QBufferPrivate::QBufferPrivate() : QAbstractBufferPrivate() , m_usage(QBuffer::StaticDraw) @@ -59,7 +55,90 @@ QBufferPrivate::QBufferPrivate() { } +/*! + * \qmltype Buffer + * \instantiates Qt3DRender::QBuffer + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty QBuffer::UsageType Buffer::usage + * + * Holds the buffer usage. + */ + +/*! + * \qmlproperty QBuffer::BufferType Buffer::type + * + * Holds the buffer type. + */ + +/*! + * \qmlproperty bool Buffer::sync + * + * Holds the sync flag. When sync is true, this will force data created + * by a Qt3DRender::QBufferFunctor to also be updated on the frontend + * Qt3DRender::QBuffer node. By default sync is false. + * + * \note: This has no effect if the buffer's data was set directly using the data + * property. + */ +/*! + * \class Qt3DRender::QBuffer + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QAbstractBuffer + */ + +/*! + * \enum QBuffer::BufferType + * + * The type of the buffer. + * + * \value VertexBuffer + * GL_ARRAY_BUFFER + * \value IndexBuffer + * GL_ELEMENT_ARRAY_BUFFER + * \value PixelPackBuffer + * GL_PIXEL_PACK_BUFFER + * \value PixelUnpackBuffer + * GL_PIXEL_UNPACK_BUFFER + */ + +/*! + * \enum QBuffer::UsageType + * + * The type of the usage. + * + * \value StreamDraw + * GL_STREAM_DRAW + * \value StreamRead + * GL_STREAM_READ + * \value StreamCopy + * GL_STREAM_COPY + * \value StaticDraw + * GL_STATIC_DRAW + * \value StaticRead + * GL_STATIC_READ + * \value StaticCopy + * GL_STATIC_COPY + * \value DynamicDraw + * GL_DYNAMIC_DRAW + * \value DynamicRead + * GL_DYNAMIC_READ + * \value DynamicCopy + * GL_DYNAMIC_COPY + */ + +/*! + * \typedef Qt3DRender::QBufferFunctorPtr + * \relates QBuffer + */ + +/*! + * Constructs a new QBuffer of buffer type \a ty with \a parent. + */ QBuffer::QBuffer(QBuffer::BufferType ty, QNode *parent) : QAbstractBuffer(*new QBufferPrivate(), parent) { @@ -67,12 +146,17 @@ QBuffer::QBuffer(QBuffer::BufferType ty, QNode *parent) d->m_type = ty; } +/*! + * Destroys this buffer. + */ QBuffer::~QBuffer() { QAbstractBuffer::cleanup(); } -/*! \internal */ +/*! + * \internal + */ QBuffer::QBuffer(QBufferPrivate &dd, QBuffer::BufferType ty, QNode *parent) : QAbstractBuffer(dd, parent) { @@ -80,6 +164,9 @@ QBuffer::QBuffer(QBufferPrivate &dd, QBuffer::BufferType ty, QNode *parent) d->m_type = ty; } +/*! + * \internal + */ void QBuffer::copy(const QNode *ref) { QAbstractBuffer::copy(ref); @@ -90,6 +177,9 @@ void QBuffer::copy(const QNode *ref) d_func()->m_sync = buffer->d_func()->m_sync; } +/*! + * \internal + */ void QBuffer::sceneChangeEvent(const QSceneChangePtr &change) { QScenePropertyChangePtr e = qSharedPointerCast<QScenePropertyChange>(change); @@ -100,6 +190,11 @@ void QBuffer::sceneChangeEvent(const QSceneChangePtr &change) } } +/*! + * \property QBuffer::usage + * + * Holds the buffer usage. + */ QBuffer::UsageType QBuffer::usage() const { Q_D(const QBuffer); @@ -115,12 +210,20 @@ void QBuffer::setUsage(QBuffer::UsageType usage) } } +/*! + * \property QBuffer::type + * + * Holds the buffer type. + */ QBuffer::BufferType QBuffer::type() const { Q_D(const QBuffer); return d->m_type; } +/*! + * Sets the buffer \a functor. + */ void QBuffer::setBufferFunctor(const QBufferFunctorPtr &functor) { Q_D(QBuffer); @@ -135,6 +238,9 @@ void QBuffer::setBufferFunctor(const QBufferFunctorPtr &functor) } } +/*! + * \return the buffer functor. + */ QBufferFunctorPtr QBuffer::bufferFunctor() const { Q_D(const QBuffer); @@ -142,12 +248,14 @@ QBufferFunctorPtr QBuffer::bufferFunctor() const } /*! - Sets the sync to \a sync. When sync is true, this will force data created - by a Qt3DRender::QBufferFunctor to also be updated on the frontend - Qt3DRender::QBuffer node. By default sync is false. - - \note: This has no effect if the buffer's data was set directly using the data - property. + * \property QBuffer::sync + * + * Holds the sync flag. When sync is true, this will force data created + * by a Qt3DRender::QBufferFunctor to also be updated on the frontend + * Qt3DRender::QBuffer node. By default sync is false. + * + * \note: This has no effect if the buffer's data was set directly using the data + * property. */ void QBuffer::setSync(bool sync) { @@ -158,10 +266,6 @@ void QBuffer::setSync(bool sync) } } -/*! - Returns whether data loaded by a Qt3DRender::QBufferFunctor should be - synched with the Qt3DRender::QBuffer node or not. - */ bool QBuffer::isSync() const { Q_D(const QBuffer); diff --git a/src/render/geometry/qcuboidgeometry.cpp b/src/render/geometry/qcuboidgeometry.cpp index 6d38186b5..64c6f5b24 100644 --- a/src/render/geometry/qcuboidgeometry.cpp +++ b/src/render/geometry/qcuboidgeometry.cpp @@ -492,6 +492,89 @@ void QCuboidGeometryPrivate::init() q->addAttribute(m_indexAttribute); } +/*! + * \qmltype CuboidGeometry + * \instantiates Qt3DRender::QCuboidGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty float CuboidGeometry::xExtent + * + * Holds the x extent. + */ + +/*! + * \qmlproperty float CuboidGeometry::yExtent + * + * Holds the y extent. + */ + +/*! + * \qmlproperty float CuboidGeometry::zExtent + * + * Holds the z extent. + */ + +/*! + * \qmlproperty size CuboidGeometry::yzMeshResolution + * + * Holds the y-z resolution. + */ + +/*! + * \qmlproperty size CuboidGeometry::xzMeshResolution + * + * Holds the x-z resolution. + */ + +/*! + * \qmlproperty size CuboidGeometry::xyMeshResolution + * + * Holds the x-y resolution. + */ + +/*! + * \qmlproperty Attribute CuboidGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute CuboidGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute CuboidGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute CuboidGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ + +/*! + * \qmlproperty Attribute CuboidGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + +/*! + * \class Qt3DRender::QCuboidGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometry + * + */ + +/*! + * Constructs a new QCuboidGeometry with \a parent. + */ QCuboidGeometry::QCuboidGeometry(QNode *parent) : QGeometry(*new QCuboidGeometryPrivate(), parent) { @@ -499,6 +582,9 @@ QCuboidGeometry::QCuboidGeometry(QNode *parent) d->init(); } +/*! + * \internal + */ QCuboidGeometry::QCuboidGeometry(QCuboidGeometryPrivate &dd, QNode *parent) : QGeometry(dd, parent) { @@ -506,11 +592,17 @@ QCuboidGeometry::QCuboidGeometry(QCuboidGeometryPrivate &dd, QNode *parent) d->init(); } +/*! + * Destroys this geometry. + */ QCuboidGeometry::~QCuboidGeometry() { QGeometry::cleanup(); } +/*! + * Updates indices based on mesh resolutions. + */ void QCuboidGeometry::updateIndices() { Q_D(QCuboidGeometry); @@ -524,6 +616,9 @@ void QCuboidGeometry::updateIndices() } +/*! + * Updates vertices based on mesh resolutions. + */ void QCuboidGeometry::updateVertices() { Q_D(QCuboidGeometry); @@ -604,66 +699,121 @@ void QCuboidGeometry::setXYMeshResolution(const QSize &resolution) } } +/*! + * \property QCuboidGeometry::xExtent + * + * Holds the x extent. + */ float QCuboidGeometry::xExtent() const { Q_D(const QCuboidGeometry); return d->m_xExtent; } +/*! + * \property QCuboidGeometry::yExtent + * + * Holds the y extent. + */ float QCuboidGeometry::yExtent() const { Q_D(const QCuboidGeometry); return d->m_yExtent; } +/*! + * \property QCuboidGeometry::zExtent + * + * Holds the z extent. + */ float QCuboidGeometry::zExtent() const { Q_D(const QCuboidGeometry); return d->m_zExtent; } +/*! + * \property QCuboidGeometry::yzMeshResolution + * + * Holds the y-z resolution. + */ QSize QCuboidGeometry::yzMeshResolution() const { Q_D(const QCuboidGeometry); return d->m_yzFaceResolution; } +/*! + * \property QCuboidGeometry::xzMeshResolution + * + * Holds the x-z resolution. + */ QSize QCuboidGeometry::xyMeshResolution() const { Q_D(const QCuboidGeometry); return d->m_xyFaceResolution; } +/*! + * \property QCuboidGeometry::xyMeshResolution + * + * Holds the x-y resolution. + */ QSize QCuboidGeometry::xzMeshResolution() const { Q_D(const QCuboidGeometry); return d->m_xzFaceResolution; } +/*! + * \property QCuboidGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ QAttribute *QCuboidGeometry::positionAttribute() const { Q_D(const QCuboidGeometry); return d->m_positionAttribute; } +/*! + * \property QCuboidGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ QAttribute *QCuboidGeometry::normalAttribute() const { Q_D(const QCuboidGeometry); return d->m_normalAttribute; } +/*! + * \property QCuboidGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ QAttribute *QCuboidGeometry::texCoordAttribute() const { Q_D(const QCuboidGeometry); return d->m_texCoordAttribute; } +/*! + * \property QCuboidGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ QAttribute *QCuboidGeometry::tangentAttribute() const { Q_D(const QCuboidGeometry); return d->m_tangentAttribute; } +/*! + * \property QCuboidGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ QAttribute *QCuboidGeometry::indexAttribute() const { Q_D(const QCuboidGeometry); diff --git a/src/render/geometry/qcuboidmesh.cpp b/src/render/geometry/qcuboidmesh.cpp index 692fbff12..bcde6efe9 100644 --- a/src/render/geometry/qcuboidmesh.cpp +++ b/src/render/geometry/qcuboidmesh.cpp @@ -44,6 +44,61 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + * \qmltype QCuboidMesh + * \instantiates Qt3DRender::QCuboidMesh + * \inqmlmodule Qt3D.Render + * \brief A cube mesh. + */ + +/*! + * \qmlproperty float CuboidMesh::xExtent + * + * Holds the x extent. + */ + +/*! + * \qmlproperty float CuboidMesh::yExtent + * + * Holds the y extent. + */ + +/*! + * \qmlproperty float CuboidMesh::zExtent + * + * Holds the z extent. + */ + +/*! + * \qmlproperty size CuboidMesh::yzMeshResolution + * + * Holds the y-z resolution. + */ + +/*! + * \qmlproperty size CuboidMesh::xzMeshResolution + * + * Holds the x-z resolution. + */ + +/*! + * \qmlproperty size CuboidMesh::xyMeshResolution + * + * Holds the x-y resolution. + */ + +/*! + * \class Qt3DRender::QCuboidMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A cube mesh. + */ + +/*! + * Constructs a new QCuboidMedh with \a parent. + */ QCuboidMesh::QCuboidMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -57,6 +112,9 @@ QCuboidMesh::QCuboidMesh(QNode *parent) QGeometryRenderer::setGeometry(geometry); } +/*! + * Destroys this cube mesh. + */ QCuboidMesh::~QCuboidMesh() { QNode::cleanup(); @@ -67,6 +125,11 @@ void QCuboidMesh::setXExtent(float xExtent) static_cast<QCuboidGeometry *>(geometry())->setXExtent(xExtent); } +/*! + * \property QCuboidMesh::xExtent + * + * Holds the x extent. + */ float QCuboidMesh::xExtent() const { return static_cast<QCuboidGeometry *>(geometry())->xExtent(); @@ -77,6 +140,11 @@ void QCuboidMesh::setYExtent(float yExtent) static_cast<QCuboidGeometry *>(geometry())->setYExtent(yExtent); } +/*! + * \property QCuboidMesh::yExtent + * + * Holds the y extent. + */ float QCuboidMesh::yExtent() const { return static_cast<QCuboidGeometry *>(geometry())->yExtent(); @@ -87,6 +155,11 @@ void QCuboidMesh::setZExtent(float zExtent) static_cast<QCuboidGeometry *>(geometry())->setZExtent(zExtent); } +/*! + * \property QCuboidMesh::zExtent + * + * Holds the z extent. + */ float QCuboidMesh::zExtent() const { return static_cast<QCuboidGeometry *>(geometry())->zExtent(); @@ -97,6 +170,11 @@ void QCuboidMesh::setYZMeshResolution(const QSize &resolution) static_cast<QCuboidGeometry *>(geometry())->setYZMeshResolution(resolution); } +/*! + * \property QCuboidMesh::yzMeshResolution + * + * Holds the y-z resolution. + */ QSize QCuboidMesh::yzMeshResolution() const { return static_cast<QCuboidGeometry *>(geometry())->yzMeshResolution(); @@ -107,6 +185,11 @@ void QCuboidMesh::setXZMeshResolution(const QSize &resolution) static_cast<QCuboidGeometry *>(geometry())->setXZMeshResolution(resolution); } +/*! + * \property QCuboidMesh::xzMeshResolution + * + * Holds the x-z resolution. + */ QSize QCuboidMesh::xzMeshResolution() const { return static_cast<QCuboidGeometry *>(geometry())->xzMeshResolution(); @@ -117,6 +200,11 @@ void QCuboidMesh::setXYMeshResolution(const QSize &resolution) static_cast<QCuboidGeometry *>(geometry())->setXYMeshResolution(resolution); } +/*! + * \property QCuboidMesh::xyMeshResolution + * + * Holds the x-y resolution. + */ QSize QCuboidMesh::xyMeshResolution() const { return static_cast<QCuboidGeometry *>(geometry())->xyMeshResolution(); diff --git a/src/render/geometry/qcylindergeometry.cpp b/src/render/geometry/qcylindergeometry.cpp index 83321dbe4..4e8986863 100644 --- a/src/render/geometry/qcylindergeometry.cpp +++ b/src/render/geometry/qcylindergeometry.cpp @@ -345,6 +345,70 @@ void QCylinderGeometryPrivate::init() q->addAttribute(m_indexAttribute); } +/*! + * \qmltype CylinderGeometry + * \instantiates Qt3DRender::QCylinderGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty int CylinderGeometry::rings + * + * Holds the number of rings in the cylinder. + */ + +/*! + * \qmlproperty int CylinderGeometry::slices + * + * Holds the number of slices in the cylinder. + */ + +/*! + * \qmlproperty float CylinderGeometry::radius + * + * Holds the radius of the cylinder. + */ + +/*! + * \qmlproperty float CylinderGeometry::length + * + * Holds the length of the cylinder. + */ + +/*! + * \qmlproperty Attribute CylinderGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute CylinderGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute CylinderGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute CylinderGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + +/*! + * \class Qt3DRender::QCylinderGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometry + */ + +/*! + * Constructs a new QCylinderMesh with \a parent. + */ QCylinderGeometry::QCylinderGeometry(QNode *parent) : QGeometry(*new QCylinderGeometryPrivate, parent) { @@ -352,6 +416,9 @@ QCylinderGeometry::QCylinderGeometry(QNode *parent) d->init(); } +/*! + * \internal + */ QCylinderGeometry::QCylinderGeometry(QCylinderGeometryPrivate &dd, QNode *parent) :QGeometry(dd, parent) { @@ -359,11 +426,17 @@ QCylinderGeometry::QCylinderGeometry(QCylinderGeometryPrivate &dd, QNode *parent d->init(); } +/*! + * Destroys the geometry. + */ QCylinderGeometry::~QCylinderGeometry() { QGeometry::cleanup(); } +/*! + * Updates the vertices based on rings and slices. + */ void QCylinderGeometry::updateVertices() { Q_D(QCylinderGeometry); @@ -375,6 +448,9 @@ void QCylinderGeometry::updateVertices() d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new CylinderVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_length))); } +/*! + * Updates the indices based on rings and slices. + */ void QCylinderGeometry::updateIndices() { Q_D(QCylinderGeometry); @@ -426,48 +502,88 @@ void QCylinderGeometry::setLength(float length) } } +/*! + * \property QCylinderGeometry::rings + * + * Holds the number of rings in the cylinder. + */ int QCylinderGeometry::rings() const { Q_D(const QCylinderGeometry); return d->m_rings; } +/*! + * \property QCylinderGeometry::slices + * + * Holds the number of slices in the cylinder. + */ int QCylinderGeometry::slices() const { Q_D(const QCylinderGeometry); return d->m_slices; } +/*! + * \property QCylinderGeometry::radius + * + * Holds the radius of the cylinder. + */ float QCylinderGeometry::radius() const { Q_D(const QCylinderGeometry); return d->m_radius; } +/*! + * \property QCylinderGeometry::length + * + * Holds the length of the cylinder. + */ float QCylinderGeometry::length() const { Q_D(const QCylinderGeometry); return d->m_length; } +/*! + * \property QCylinderGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ QAttribute *QCylinderGeometry::positionAttribute() const { Q_D(const QCylinderGeometry); return d->m_positionAttribute; } +/*! + * \property QCylinderGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ QAttribute *QCylinderGeometry::normalAttribute() const { Q_D(const QCylinderGeometry); return d->m_normalAttribute; } +/*! + * \property QCylinderGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ QAttribute *QCylinderGeometry::texCoordAttribute() const { Q_D(const QCylinderGeometry); return d->m_texCoordAttribute; } +/*! + * \property QCylinderGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ QAttribute *QCylinderGeometry::indexAttribute() const { Q_D(const QCylinderGeometry); diff --git a/src/render/geometry/qcylindermesh.cpp b/src/render/geometry/qcylindermesh.cpp index 97d728871..0bd528c9a 100644 --- a/src/render/geometry/qcylindermesh.cpp +++ b/src/render/geometry/qcylindermesh.cpp @@ -54,6 +54,49 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + * \qmltype CylinderMesh + * \instantiates Qt3DRender::QCylinderMesh + * \inqmlmodule Qt3D.Render + * \brief A cylindrical mesh. + */ + +/*! + * \qmlproperty int CylinderMesh::rings + * + * Holds the number of rings in the mesh. + */ + +/*! + * \qmlproperty int CylinderMesh::slices + * + * Holds the number of slices in the mesh. + */ + +/*! + * \qmlproperty float CylinderMesh::radius + * + * Holds the radius of the cylinder. + */ + +/*! + * \qmlproperty float CylinderMesh::length + * + * Holds the length of the cylinder. + */ + +/*! + * \class Qt3DRender::QCylinderMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A cylindrical mesh. + */ + +/*! + * Constructs a new QCylinderMesh with \a parent. + */ QCylinderMesh::QCylinderMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -66,6 +109,9 @@ QCylinderMesh::QCylinderMesh(QNode *parent) QGeometryRenderer::setGeometry(geometry); } +/*! + * Destroys this cylinder mesh. + */ QCylinderMesh::~QCylinderMesh() { QNode::cleanup(); @@ -91,21 +137,41 @@ void QCylinderMesh::setLength(float length) static_cast<QCylinderGeometry *>(geometry())->setLength(length); } +/*! + * \property QCylinderMesh::rings + * + * Holds the number of rings in the mesh. + */ int QCylinderMesh::rings() const { return static_cast<QCylinderGeometry *>(geometry())->rings(); } +/*! + * \property QCylinderMesh::slices + * + * Holds the number of slices in the mesh. + */ int QCylinderMesh::slices() const { return static_cast<QCylinderGeometry *>(geometry())->slices(); } +/*! + * \property QCylinderMesh::radius + * + * Holds the radius of the cylinder. + */ float QCylinderMesh::radius() const { return static_cast<QCylinderGeometry *>(geometry())->radius(); } +/*! + * \property QCylinderMesh::length + * + * Holds the length of the cylinder. + */ float QCylinderMesh::length() const { return static_cast<QCylinderGeometry *>(geometry())->length(); diff --git a/src/render/geometry/qgeometry.cpp b/src/render/geometry/qgeometry.cpp index b9e585f06..afce50db6 100644 --- a/src/render/geometry/qgeometry.cpp +++ b/src/render/geometry/qgeometry.cpp @@ -50,6 +50,9 @@ using namespace Qt3DCore; namespace Qt3DRender { +/*! + * \internal + */ void QGeometryPrivate::_q_boundingVolumeSpecifierChanged(QAbstractAttribute *) { if (m_changeArbiter != Q_NULLPTR) { @@ -63,6 +66,42 @@ void QGeometryPrivate::_q_boundingVolumeSpecifierChanged(QAbstractAttribute *) } } +/*! + * \qmltype Geometry + * \instantiates Qt3DRender::QGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty int Geometry::verticesPerPatch + * + * Holds vertices per patch. + */ + +/*! + * \qmlproperty BoundingVolumeSpecifier Geometry::boundingVolumeSpecifier + * + * Holds bounding volume specifier. + */ + +/*! + * \class Qt3DRender::QGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DCore::QNode + * + */ + +/*! + * \typedef Qt3DRender::QAttributeList + * \relates Qt3DRender::QGeometry + * + * A vector of {QAbstractAttribute}s. + */ + +/*! + * Constructs a new QGeometry with \a parent. + */ QGeometry::QGeometry(QNode *parent) : QNode(*new QGeometryPrivate(), parent) { @@ -71,6 +110,9 @@ QGeometry::QGeometry(QNode *parent) this, SLOT(_q_boundingVolumeSpecifierChanged(QAbstractAttribute *))); } +/*! + * \internal + */ QGeometry::QGeometry(QGeometryPrivate &dd, QNode *parent) : QNode(dd, parent) { @@ -79,11 +121,17 @@ QGeometry::QGeometry(QGeometryPrivate &dd, QNode *parent) this, SLOT(_q_boundingVolumeSpecifierChanged(QAbstractAttribute *))); } +/*! + * Destroys this geometry. + */ QGeometry::~QGeometry() { QNode::cleanup(); } +/*! + * Adds an \a attribute to this geometry. + */ void QGeometry::addAttribute(QAbstractAttribute *attribute) { Q_D(QGeometry); @@ -106,6 +154,9 @@ void QGeometry::addAttribute(QAbstractAttribute *attribute) } } +/*! + * Removes the given \a attribute from this geometry. + */ void QGeometry::removeAttribute(QAbstractAttribute *attribute) { Q_D(QGeometry); @@ -127,24 +178,40 @@ void QGeometry::setVerticesPerPatch(int verticesPerPatch) } } +/*! + * \property QGeometry::verticesPerPatch + * + * Holds vertices per patch. + */ int QGeometry::verticesPerPatch() const { Q_D(const QGeometry); return d->m_verticesPerPatch; } +/*! + * \property QGeometry::boundingVolumeSpecifier + * + * Holds bounding volume specifier. + */ QBoundingVolumeSpecifier *QGeometry::boundingVolumeSpecifier() { Q_D(QGeometry); return &d->m_boundingVolumeSpecifier; } +/*! + * \return the list of attributes in this geometry. + */ QAttributeList QGeometry::attributes() const { Q_D(const QGeometry); return d->m_attributes; } +/*! + * \internal + */ void QGeometry::copy(const QNode *ref) { QNode::copy(ref); diff --git a/src/render/geometry/qgeometryrenderer.cpp b/src/render/geometry/qgeometryrenderer.cpp index ac8b8119a..413bc37eb 100644 --- a/src/render/geometry/qgeometryrenderer.cpp +++ b/src/render/geometry/qgeometryrenderer.cpp @@ -62,69 +62,202 @@ QGeometryRendererPrivate::QGeometryRendererPrivate() { } +/*! + * \qmltype GeometryRenderer + * \instantiates Qt3DRender::QGeometryRenderer + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty int GeometryRenderer::instanceCount + * + * Holds the instance count. + */ + +/*! + * \qmlproperty int GeometryRenderer::primitiveCount + * + * Holds the primitive count. + */ + +/*! + * \qmlproperty int GeometryRenderer::baseVertex + * + * Holds the base vertex. + */ + +/*! + * \qmlproperty int GeometryRenderer::baseInstance + * + * Holds the base instance. + */ + +/*! + * \qmlproperty int GeometryRenderer::restartIndex + * + * Holds the restart index. + */ + +/*! + * \qmlproperty bool GeometryRenderer::primitiveRestart + * + * Holds the primitive restart flag. + */ + +/*! + * \qmlproperty Geometry GeometryRenderer::geometry + * + * Holds the geometry. + */ + +/*! + * \qmlproperty QGeometryRenderer::PrimitiveType GeometryRenderer::primitiveType + * + * Holds the primitive type. + */ + +/*! + * \class Qt3DRender::QGeometryRenderer + * \inmodule Qt3DRender + * + * \inherits Qt3DCore::QComponent + * + */ + +/*! + * \enum QGeometryRenderer::PrimitiveType + * + * The type of the primitive. + * + * \value Points + * \value Lines + * \value LineLoop + * \value LineStrip + * \value Triangles + * \value TriangleStrip + * \value TriangleFan + * \value LinesAdjacency + * \value TrianglesAdjacency + * \value LineStripAdjacency + * \value TriangleStripAdjacency + * \value Patches + */ + +/*! + * Constructs a new QGeometryRenderer with \a parent. + */ QGeometryRenderer::QGeometryRenderer(QNode *parent) : QComponent(*new QGeometryRendererPrivate(), parent) { } +/*! + * Destroys this geometry renderer. + */ QGeometryRenderer::~QGeometryRenderer() { QComponent::cleanup(); } +/*! + * \internal + */ QGeometryRenderer::QGeometryRenderer(QGeometryRendererPrivate &dd, QNode *parent) : QComponent(dd, parent) { } +/*! + * \property QGeometryRenderer::instanceCount + * + * Holds the instance count. + */ int QGeometryRenderer::instanceCount() const { Q_D(const QGeometryRenderer); return d->m_instanceCount; } +/*! + * \property QGeometryRenderer::primitiveCount + * + * Holds the primitive count. + */ int QGeometryRenderer::primitiveCount() const { Q_D(const QGeometryRenderer); return d->m_primitiveCount; } +/*! + * \property QGeometryRenderer::baseVertex + * + * Holds the base vertex. + */ int QGeometryRenderer::baseVertex() const { Q_D(const QGeometryRenderer); return d->m_baseVertex; } +/*! + * \property QGeometryRenderer::baseInstance + * + * Holds the base instance. + */ int QGeometryRenderer::baseInstance() const { Q_D(const QGeometryRenderer); return d->m_baseInstance; } +/*! + * \property QGeometryRenderer::restartIndex + * + * Holds the restart index. + */ int QGeometryRenderer::restartIndex() const { Q_D(const QGeometryRenderer); return d->m_restartIndex; } +/*! + * \property QGeometryRenderer::primitiveRestart + * + * Holds the primitive restart flag. + */ bool QGeometryRenderer::primitiveRestart() const { Q_D(const QGeometryRenderer); return d->m_primitiveRestart; } +/*! + * \property QGeometryRenderer::geometry + * + * Holds the geometry. + */ QGeometry *QGeometryRenderer::geometry() const { Q_D(const QGeometryRenderer); return d->m_geometry; } +/*! + * \property QGeometryRenderer::primitiveType + * + * Holds the primitive type. + */ QGeometryRenderer::PrimitiveType QGeometryRenderer::primitiveType() const { Q_D(const QGeometryRenderer); return d->m_primitiveType; } +/*! + * \return the geometry functor. + */ QGeometryFunctorPtr QGeometryRenderer::geometryFunctor() const { Q_D(const QGeometryRenderer); @@ -230,6 +363,9 @@ void QGeometryRenderer::setPrimitiveType(QGeometryRenderer::PrimitiveType primit emit primitiveTypeChanged(primitiveType); } +/*! + * Sets the geometry \a functor. + */ void QGeometryRenderer::setGeometryFunctor(const QGeometryFunctorPtr &functor) { Q_D(QGeometryRenderer); @@ -244,6 +380,9 @@ void QGeometryRenderer::setGeometryFunctor(const QGeometryFunctorPtr &functor) } } +/*! + * \internal + */ void QGeometryRenderer::copy(const QNode *ref) { QComponent::copy(ref); @@ -259,6 +398,9 @@ void QGeometryRenderer::copy(const QNode *ref) d_func()->m_functor = other->d_func()->m_functor; } +/*! + * \internal + */ void QGeometryRenderer::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) { Q_D(QGeometryRenderer); diff --git a/src/render/geometry/qmesh.cpp b/src/render/geometry/qmesh.cpp index 4cc6af8dc..edeac6f55 100644 --- a/src/render/geometry/qmesh.cpp +++ b/src/render/geometry/qmesh.cpp @@ -66,20 +66,50 @@ private: }; -/*! - \class Qt3DRender::QMeshPrivate - \internal -*/ QMeshPrivate::QMeshPrivate() : QGeometryRendererPrivate() { } +/*! + * \qmltype Mesh + * \instantiates Qt3DRender::QMesh + * \inqmlmodule Qt3D.Render + * \brief A custom mesh. + */ + +/*! + * \qmlproperty url Mesh::source + * + * Holds the source url to the file containing the custom mesh. + */ + +/*! + * \qmlproperty string Mesh::subMesh + * + * Holds the subMesh for the mesh. + */ + +/*! + * \class Qt3DRender::QMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A custom mesh. + */ + +/*! + * Constructs a new QMesh with \a parent. + */ QMesh::QMesh(QNode *parent) : QGeometryRenderer(*new QMeshPrivate, parent) { } +/*! + * Destroys this mesh. + */ QMesh::~QMesh() { QNode::cleanup(); @@ -102,6 +132,11 @@ void QMesh::setSource(const QUrl& source) emit sourceChanged(source); } +/*! + * \property QMesh::source + * + * Holds the \a source url to the file containing the custom mesh. + */ QUrl QMesh::source() const { Q_D(const QMesh); @@ -119,12 +154,20 @@ void QMesh::setSubMesh(const QString &subMesh) emit subMeshChanged(subMesh); } +/*! + * \property QMesh::subMesh + * + * Holds the subMesh for the mesh. + */ QString QMesh::subMesh() const { Q_D(const QMesh); return d->m_subMesh; } +/*! + * \internal + */ MeshFunctor::MeshFunctor(const QUrl &sourcePath, const QString& subMesh) : QGeometryFunctor() , m_sourcePath(sourcePath) @@ -132,6 +175,9 @@ MeshFunctor::MeshFunctor(const QUrl &sourcePath, const QString& subMesh) { } +/*! + * \internal + */ QGeometry *MeshFunctor::operator()() { if (m_sourcePath.isEmpty()) { @@ -156,6 +202,9 @@ QGeometry *MeshFunctor::operator()() return Q_NULLPTR; } +/*! + * \internal + */ bool MeshFunctor::operator ==(const QGeometryFunctor &other) const { const MeshFunctor *otherFunctor = functor_cast<MeshFunctor>(&other); diff --git a/src/render/geometry/qplanegeometry.cpp b/src/render/geometry/qplanegeometry.cpp index 5d7dcfebc..8abf07a81 100644 --- a/src/render/geometry/qplanegeometry.cpp +++ b/src/render/geometry/qplanegeometry.cpp @@ -204,6 +204,70 @@ public: QSize m_resolution; }; +/*! + * \qmltype PlaneGeometry + * \instantiates Qt3DRender::QPlaneGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty float PlaneGeometry::width + * + * Holds the plane width. + */ + +/*! + * \qmlproperty float PlaneGeometry::height + * + * Holds the plane height. + */ + +/*! + * \qmlproperty size PlaneGeometry::resolution + * + * Holds the plane resolution. + */ + +/*! + * \qmlproperty Attribute PlaneGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute PlaneGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute PlaneGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute PlaneGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ + +/*! + * \qmlproperty Attribute PlaneGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + +/*! + * \class Qt3DRender::QPlaneGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometry + */ + +/*! + * Constructs a new QPlaneGeometry with \a parent. + */ QPlaneGeometry::QPlaneGeometry(QPlaneGeometry::QNode *parent) : QGeometry(*new QPlaneGeometryPrivate(), parent) { @@ -211,6 +275,9 @@ QPlaneGeometry::QPlaneGeometry(QPlaneGeometry::QNode *parent) d->init(); } +/*! + * \internal + */ QPlaneGeometry::QPlaneGeometry(QPlaneGeometryPrivate &dd, QNode *parent) : QGeometry(dd, parent) { @@ -218,11 +285,17 @@ QPlaneGeometry::QPlaneGeometry(QPlaneGeometryPrivate &dd, QNode *parent) d->init(); } +/*! + * Destroys this geometry. + */ QPlaneGeometry::~QPlaneGeometry() { QGeometry::cleanup(); } +/*! + * Updates vertices based on resolution. + */ void QPlaneGeometry::updateVertices() { Q_D(QPlaneGeometry); @@ -235,6 +308,9 @@ void QPlaneGeometry::updateVertices() d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new PlaneVertexBufferFunctor(d->m_width, d->m_height, d->m_meshResolution))); } +/*! + * Updates indices based on resolution. + */ void QPlaneGeometry::updateIndices() { Q_D(QPlaneGeometry); @@ -276,48 +352,88 @@ void QPlaneGeometry::setHeight(float height) emit heightChanged(height); } +/*! + * \property QPlaneGeometry::resolution + * + * Holds the plane resolution. + */ QSize QPlaneGeometry::resolution() const { Q_D(const QPlaneGeometry); return d->m_meshResolution; } +/*! + * \property QPlaneGeometry::width + * + * Holds the plane width. + */ float QPlaneGeometry::width() const { Q_D(const QPlaneGeometry); return d->m_width; } +/*! + * \property QPlaneGeometry::height + * + * Holds the plane height. + */ float QPlaneGeometry::height() const { Q_D(const QPlaneGeometry); return d->m_height; } +/*! + * \property QPlaneGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ QAttribute *QPlaneGeometry::positionAttribute() const { Q_D(const QPlaneGeometry); return d->m_positionAttribute; } +/*! + * \property QPlaneGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ QAttribute *QPlaneGeometry::normalAttribute() const { Q_D(const QPlaneGeometry); return d->m_normalAttribute; } +/*! + * \property QPlaneGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ QAttribute *QPlaneGeometry::texCoordAttribute() const { Q_D(const QPlaneGeometry); return d->m_texCoordAttribute; } +/*! + * \property QPlaneGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ QAttribute *QPlaneGeometry::tangentAttribute() const { Q_D(const QPlaneGeometry); return d->m_tangentAttribute; } +/*! + * \property QPlaneGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ QAttribute *QPlaneGeometry::indexAttribute() const { Q_D(const QPlaneGeometry); diff --git a/src/render/geometry/qplanemesh.cpp b/src/render/geometry/qplanemesh.cpp index 07d128f75..5efa33116 100644 --- a/src/render/geometry/qplanemesh.cpp +++ b/src/render/geometry/qplanemesh.cpp @@ -44,6 +44,43 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + * \qmltype PlaneMesh + * \instantiates Qt3DRender::QPlaneMesh + * \inqmlmodule Qt3D.Render + * \brief A square planar mesh. + */ + +/*! + * \qmlproperty float PlaneMesh::width + * + * Holds the plane width. + */ + +/*! + * \qmlproperty float PlaneMesh::height + * + * Holds the plane height. + */ + +/*! + * \qmlproperty size PlaneMesh::meshResolution + * + * Holds the plane resolution. + */ + +/*! + * \class Qt3DRender::QPlaneMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A square planar mesh. + */ + +/*! + * Constructs a new QPlaneMesh with \a parent. + */ QPlaneMesh::QPlaneMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -54,6 +91,9 @@ QPlaneMesh::QPlaneMesh(QNode *parent) QGeometryRenderer::setGeometry(geometry); } +/*! + * Destroys this plane mesh. + */ QPlaneMesh::~QPlaneMesh() { QNode::cleanup(); @@ -64,6 +104,11 @@ void QPlaneMesh::setWidth(float width) static_cast<QPlaneGeometry *>(geometry())->setWidth(width); } +/*! + * \property QPlaneMesh::width + * + * Holds the plane width. + */ float QPlaneMesh::width() const { return static_cast<QPlaneGeometry *>(geometry())->width(); @@ -74,6 +119,11 @@ void QPlaneMesh::setHeight(float height) static_cast<QPlaneGeometry *>(geometry())->setHeight(height); } +/*! + * \property QPlaneMesh::height + * + * Holds the plane height. + */ float QPlaneMesh::height() const { return static_cast<QPlaneGeometry *>(geometry())->height(); @@ -84,6 +134,11 @@ void QPlaneMesh::setMeshResolution(const QSize &resolution) static_cast<QPlaneGeometry *>(geometry())->setResolution(resolution); } +/*! + * \property QPlaneMesh::meshResolution + * + * Holds the plane resolution. + */ QSize QPlaneMesh::meshResolution() const { return static_cast<QPlaneGeometry *>(geometry())->resolution(); diff --git a/src/render/geometry/qspheregeometry.cpp b/src/render/geometry/qspheregeometry.cpp index 9a97c422e..72c5b64df 100644 --- a/src/render/geometry/qspheregeometry.cpp +++ b/src/render/geometry/qspheregeometry.cpp @@ -311,6 +311,76 @@ void QSphereGeometryPrivate::init() q->addAttribute(m_indexAttribute); } +/*! + * \qmltype SphereGeometry + * \instantiates Qt3DRender::QSphereGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty int SphereGeometry::rings + * + * Holds the number of rings in the sphere. + */ + +/*! + * \qmlproperty int SphereGeometry::slices + * + * Holds the number of slices in the sphere. + */ + +/*! + * \qmlproperty float SphereGeometry::radius + * + * Holds the radius of the sphere. + */ + +/*! + * \qmlproperty bool SphereGeometry::generateTangents + * + * Holds the value of the automatic tangent generation flag. + */ + +/*! + * \qmlproperty Attribute SphereGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute SphereGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute SphereGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute SphereGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ + +/*! + * \qmlproperty Attribute SphereGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + +/*! + * \class Qt3DRender::QSphereGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometry + */ + +/*! + * Constructs a new QSphereGeometry with \a parent. + */ QSphereGeometry::QSphereGeometry(QNode *parent) : QGeometry(*new QSphereGeometryPrivate(), parent) { @@ -318,6 +388,9 @@ QSphereGeometry::QSphereGeometry(QNode *parent) d->init(); } +/*! + * \internal + */ QSphereGeometry::QSphereGeometry(QSphereGeometryPrivate &dd, QNode *parent) : QGeometry(dd, parent) { @@ -325,11 +398,17 @@ QSphereGeometry::QSphereGeometry(QSphereGeometryPrivate &dd, QNode *parent) d->init(); } +/*! + * Destroys this geometry. + */ QSphereGeometry::~QSphereGeometry() { QGeometry::cleanup(); } +/*! + * Updates vertices based on rings and slices. + */ void QSphereGeometry::updateVertices() { Q_D(QSphereGeometry); @@ -341,6 +420,9 @@ void QSphereGeometry::updateVertices() d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new SphereVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius))); } +/*! + * Updates indices based on rings and slices. + */ void QSphereGeometry::updateIndices() { Q_D(QSphereGeometry); @@ -395,54 +477,99 @@ void QSphereGeometry::setGenerateTangents(bool gen) } } +/*! + * \property QSphereGeometry::generateTangents + * + * Holds the value of the automatic tangent generation flag. + */ bool QSphereGeometry::generateTangents() const { Q_D(const QSphereGeometry); return d->m_generateTangents; } +/*! + * \property QSphereGeometry::rings + * + * Holds the number of rings in the sphere. + */ int QSphereGeometry::rings() const { Q_D(const QSphereGeometry); return d->m_rings; } +/*! + * \property QSphereGeometry::slices + * + * Holds the number of slices in the sphere. + */ int QSphereGeometry::slices() const { Q_D(const QSphereGeometry); return d->m_slices; } +/*! + * \property QSphereGeometry::radius + * + * Holds the radius of the sphere. + */ float QSphereGeometry::radius() const { Q_D(const QSphereGeometry); return d->m_radius; } +/*! + * \property QSphereGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ QAttribute *QSphereGeometry::positionAttribute() const { Q_D(const QSphereGeometry); return d->m_positionAttribute; } +/*! + * \property QSphereGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ QAttribute *QSphereGeometry::normalAttribute() const { Q_D(const QSphereGeometry); return d->m_normalAttribute; } +/*! + * \property QSphereGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ QAttribute *QSphereGeometry::texCoordAttribute() const { Q_D(const QSphereGeometry); return d->m_texCoordAttribute; } +/*! + * \property QSphereGeometry::tangentAttribute + * + * Holds the geometry tangent attribute. + */ QAttribute *QSphereGeometry::tangentAttribute() const { Q_D(const QSphereGeometry); return d->m_tangentAttribute; } +/*! + * \property QSphereGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ QAttribute *QSphereGeometry::indexAttribute() const { Q_D(const QSphereGeometry); diff --git a/src/render/geometry/qspheremesh.cpp b/src/render/geometry/qspheremesh.cpp index d6ca6cafa..a31370eb4 100644 --- a/src/render/geometry/qspheremesh.cpp +++ b/src/render/geometry/qspheremesh.cpp @@ -45,6 +45,49 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + * \qmltype SphereMesh + * \instantiates Qt3DRender::QSphereMesh + * \inqmlmodule Qt3D.Render + * \brief A spherical mesh. + */ + +/*! + * \qmlproperty int SphereMesh::rings + * + * Holds the number of rings in the mesh. + */ + +/*! + * \qmlproperty int SphereMesh::slices + * + * Holds the number of slices in the mesh. + */ + +/*! + * \qmlproperty float SphereMesh::radius + * + * Holds the radius of the sphere. + */ + +/*! + * \qmlproperty bool SphereMesh::generateTangents + * + * Holds the value of the automatic tangent generation flag. + */ + +/*! + * \class Qt3DRender::QSphereMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A spherical mesh. + */ + +/*! + * Constructs a new QSphereMesh with \a parent. + */ QSphereMesh::QSphereMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -56,6 +99,9 @@ QSphereMesh::QSphereMesh(QNode *parent) QGeometryRenderer::setGeometry(geometry); } +/*! + * Destroys this sphere mesh. + */ QSphereMesh::~QSphereMesh() { QNode::cleanup(); @@ -81,21 +127,41 @@ void QSphereMesh::setGenerateTangents(bool gen) static_cast<QSphereGeometry *>(geometry())->setGenerateTangents(gen); } +/*! + * \property QSphereMesh::generateTangents + * + * Holds the value of the automatic tangent generation flag. + */ bool QSphereMesh::generateTangents() const { return static_cast<QSphereGeometry *>(geometry())->generateTangents(); } +/*! + * \property QSphereMesh::rings + * + * Holds the number of rings in the mesh. + */ int QSphereMesh::rings() const { return static_cast<QSphereGeometry *>(geometry())->rings(); } +/*! + * \property QSphereMesh::slices + * + * Holds the number of slices in the mesh. + */ int QSphereMesh::slices() const { return static_cast<QSphereGeometry *>(geometry())->slices(); } +/*! + * \property QSphereMesh::radius + * + * Holds the radius of the sphere. + */ float QSphereMesh::radius() const { return static_cast<QSphereGeometry *>(geometry())->radius(); diff --git a/src/render/geometry/qtorusgeometry.cpp b/src/render/geometry/qtorusgeometry.cpp index f66cd2dc8..af77e7e95 100644 --- a/src/render/geometry/qtorusgeometry.cpp +++ b/src/render/geometry/qtorusgeometry.cpp @@ -260,6 +260,70 @@ void QTorusGeometryPrivate::init() q->addAttribute(m_indexAttribute); } +/*! + * \qmltype TorusGeometry + * \instantiates Qt3DRender::QTorusGeometry + * \inqmlmodule Qt3D.Render + */ + +/*! + * \qmlproperty int TorusGeometry::rings + * + * Holds the number of rings in the torus. + */ + +/*! + * \qmlproperty int TorusGeometry::slices + * + * Holds the number of slices in the torus. + */ + +/*! + * \qmlproperty float TorusGeometry::radius + * + * Holds the outer radius of the torus. + */ + +/*! + * \qmlproperty float TorusGeometry::minorRadius + * + * Holds the inner radius of the torus. + */ + +/*! + * \qmlproperty Attribute TorusGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ + +/*! + * \qmlproperty Attribute TorusGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ + +/*! + * \qmlproperty Attribute TorusGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ + +/*! + * \qmlproperty Attribute TorusGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ + +/*! + * \class Qt3DRender::QTorusGeometry + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometry + */ + +/*! + * Constructs a new QTorusGeometry with \a parent. + */ QTorusGeometry::QTorusGeometry(QNode *parent) : QGeometry(*new QTorusGeometryPrivate(), parent) { @@ -267,6 +331,9 @@ QTorusGeometry::QTorusGeometry(QNode *parent) d->init(); } +/*! + * \internal + */ QTorusGeometry::QTorusGeometry(QTorusGeometryPrivate &dd, QNode *parent) : QGeometry(dd, parent) { @@ -274,11 +341,17 @@ QTorusGeometry::QTorusGeometry(QTorusGeometryPrivate &dd, QNode *parent) d->init(); } +/*! + * Destroys this geometry. + */ QTorusGeometry::~QTorusGeometry() { QGeometry::cleanup(); } +/*! + * Updates vertices based on rings and slices. + */ void QTorusGeometry::updateVertices() { Q_D(QTorusGeometry); @@ -289,6 +362,9 @@ void QTorusGeometry::updateVertices() d->m_vertexBuffer->setBufferFunctor(QBufferFunctorPtr(new TorusVertexDataFunctor(d->m_rings, d->m_slices, d->m_radius, d->m_minorRadius))); } +/*! + * Updates indices based on rings and slices. + */ void QTorusGeometry::updateIndices() { Q_D(QTorusGeometry); @@ -340,48 +416,88 @@ void QTorusGeometry::setMinorRadius(float minorRadius) } } +/*! + * \property QTorusGeometry::rings + * + * Holds the number of rings in the torus. + */ int QTorusGeometry::rings() const { Q_D(const QTorusGeometry); return d->m_rings; } +/*! + * \property QTorusGeometry::slices + * + * Holds the number of slices in the torus. + */ int QTorusGeometry::slices() const { Q_D(const QTorusGeometry); return d->m_slices; } +/*! + * \property QTorusGeometry::radius + * + * Holds the outer radius of the torus. + */ float QTorusGeometry::radius() const { Q_D(const QTorusGeometry); return d->m_radius; } +/*! + * \property QTorusGeometry::minorRadius + * + * Holds the inner radius of the torus. + */ float QTorusGeometry::minorRadius() const { Q_D(const QTorusGeometry); return d->m_minorRadius; } +/*! + * \property QTorusGeometry::positionAttribute + * + * Holds the geometry position attribute. + */ QAttribute *QTorusGeometry::positionAttribute() const { Q_D(const QTorusGeometry); return d->m_positionAttribute; } +/*! + * \property QTorusGeometry::normalAttribute + * + * Holds the geometry normal attribute. + */ QAttribute *QTorusGeometry::normalAttribute() const { Q_D(const QTorusGeometry); return d->m_normalAttribute; } +/*! + * \property QTorusGeometry::texCoordAttribute + * + * Holds the geometry texture coordinate attribute. + */ QAttribute *QTorusGeometry::texCoordAttribute() const { Q_D(const QTorusGeometry); return d->m_texCoordAttribute; } +/*! + * \property QTorusGeometry::indexAttribute + * + * Holds the geometry index attribute. + */ QAttribute *QTorusGeometry::indexAttribute() const { Q_D(const QTorusGeometry); diff --git a/src/render/geometry/qtorusmesh.cpp b/src/render/geometry/qtorusmesh.cpp index 1a06494b5..4d9161f7e 100644 --- a/src/render/geometry/qtorusmesh.cpp +++ b/src/render/geometry/qtorusmesh.cpp @@ -49,6 +49,49 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +/*! + * \qmltype TorusMesh + * \instantiates Qt3DRender::QTorusMesh + * \inqmlmodule Qt3D.Render + * \brief A custom mesh. + */ + +/*! + * \qmlproperty int TorusMesh::rings + * + * Holds the number of rings in the mesh. + */ + +/*! + * \qmlproperty int TorusMesh::slices + * + * Holds the number of slices in the mesh. + */ + +/*! + * \qmlproperty float TorusMesh::radius + * + * Holds the outer radius of the torus. + */ + +/*! + * \qmlproperty float TorusMesh::minorRadius + * + * Holds the inner radius of the torus. + */ + +/*! + * \class Qt3DRender::QTorusMesh + * \inmodule Qt3DRender + * + * \inherits Qt3DRender::QGeometryRenderer + * + * \brief A custom mesh. + */ + +/*! + * Constructs a new QTorusMesh with \a parent. + */ QTorusMesh::QTorusMesh(QNode *parent) : QGeometryRenderer(parent) { @@ -61,6 +104,9 @@ QTorusMesh::QTorusMesh(QNode *parent) QGeometryRenderer::setGeometry(geometry); } +/*! + * Destroys this torus mesh. + */ QTorusMesh::~QTorusMesh() { QGeometryRenderer::cleanup(); @@ -86,21 +132,41 @@ void QTorusMesh::setMinorRadius(float minorRadius) static_cast<QTorusGeometry *>(geometry())->setMinorRadius(minorRadius); } +/*! + * \property QTorusMesh::rings + * + * Holds the number of rings in the mesh. + */ int QTorusMesh::rings() const { return static_cast<QTorusGeometry *>(geometry())->rings(); } +/*! + * \property QTorusMesh::slices + * + * Holds the number of slices in the mesh. + */ int QTorusMesh::slices() const { return static_cast<QTorusGeometry *>(geometry())->slices(); } +/*! + * \property QTorusMesh::radius + * + * Holds the outer radius of the torus. + */ float QTorusMesh::radius() const { return static_cast<QTorusGeometry *>(geometry())->radius(); } +/*! + * \property QTorusMesh::minorRadius + * + * Holds the inner radius of the torus. + */ float QTorusMesh::minorRadius() const { return static_cast<QTorusGeometry *>(geometry())->minorRadius(); |