summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-10-23 11:21:37 +0200
committerSean Harmer <sean.harmer@kdab.com>2015-10-24 16:36:35 +0000
commite9b0e73782b094c6b1d207e856f6bb4217cf4562 (patch)
tree46304c8d4b0bafd3da58fcb436db8f4b796b1d9b
parent6e400dec50cf0485f426f6fb5dc7c7eedd05ed92 (diff)
QCylinderGeometry: expose attributes as properties
Change-Id: I525b3ce19a5c98c8015c295363e6fe49e99e3409 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/geometry/qcylindergeometry.cpp24
-rw-r--r--src/render/geometry/qcylindergeometry.h10
2 files changed, 34 insertions, 0 deletions
diff --git a/src/render/geometry/qcylindergeometry.cpp b/src/render/geometry/qcylindergeometry.cpp
index 9aed11f1d..9527fb476 100644
--- a/src/render/geometry/qcylindergeometry.cpp
+++ b/src/render/geometry/qcylindergeometry.cpp
@@ -447,6 +447,30 @@ float QCylinderGeometry::length() const
return d->m_length;
}
+QAttribute *QCylinderGeometry::positionAttribute() const
+{
+ Q_D(const QCylinderGeometry);
+ return d->m_positionAttribute;
+}
+
+QAttribute *QCylinderGeometry::normalAttribute() const
+{
+ Q_D(const QCylinderGeometry);
+ return d->m_normalAttribute;
+}
+
+QAttribute *QCylinderGeometry::texCoordAttribute() const
+{
+ Q_D(const QCylinderGeometry);
+ return d->m_texCoordAttribute;
+}
+
+QAttribute *QCylinderGeometry::indexAttribute() const
+{
+ Q_D(const QCylinderGeometry);
+ return d->m_indexAttribute;
+}
+
} // namespace Qt3DRender
QT_END_NAMESPACE
diff --git a/src/render/geometry/qcylindergeometry.h b/src/render/geometry/qcylindergeometry.h
index 930eade88..b6b626816 100644
--- a/src/render/geometry/qcylindergeometry.h
+++ b/src/render/geometry/qcylindergeometry.h
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
class QCylinderGeometryPrivate;
+class QAttribute;
class QT3DRENDERSHARED_EXPORT QCylinderGeometry : public QGeometry
{
@@ -53,6 +54,10 @@ class QT3DRENDERSHARED_EXPORT QCylinderGeometry : public QGeometry
Q_PROPERTY(int slices READ slices WRITE setSlices NOTIFY slicesChanged)
Q_PROPERTY(float radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(float length READ length WRITE setLength NOTIFY lengthChanged)
+ Q_PROPERTY(Qt3DRender::QAttribute *positionAttribute READ positionAttribute CONSTANT)
+ Q_PROPERTY(Qt3DRender::QAttribute *normalAttribute READ normalAttribute CONSTANT)
+ Q_PROPERTY(Qt3DRender::QAttribute *texCoordAttribute READ texCoordAttribute CONSTANT)
+ Q_PROPERTY(Qt3DRender::QAttribute *indexAttribute READ indexAttribute CONSTANT)
public:
explicit QCylinderGeometry(QNode *parent = 0);
@@ -70,6 +75,11 @@ public:
float radius() const;
float length() const;
+ QAttribute *positionAttribute() const;
+ QAttribute *normalAttribute() const;
+ QAttribute *texCoordAttribute() const;
+ QAttribute *indexAttribute() const;
+
Q_SIGNALS:
void radiusChanged();
void ringsChanged();