summaryrefslogtreecommitdiffstats
path: root/src/render/geometry/qplanegeometry.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2015-08-30 20:22:24 +0200
committerPaul Lemire <paul.lemire@kdab.com>2015-10-15 06:32:20 +0000
commit744744431cda925e5df2ed794db2156369e6dc98 (patch)
tree37aba47a7d6d052fc88b37d1d7d8be94f411a97a /src/render/geometry/qplanegeometry.h
parent2ae331ec73718558f2544c87d80b5560a8ec5c8e (diff)
QPlaneGeometry refactored into a public class
Change-Id: I16e2a3a70f7f70c6ad42034a4d57bf2b6031400c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/geometry/qplanegeometry.h')
-rw-r--r--src/render/geometry/qplanegeometry.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/render/geometry/qplanegeometry.h b/src/render/geometry/qplanegeometry.h
new file mode 100644
index 000000000..17f963a9a
--- /dev/null
+++ b/src/render/geometry/qplanegeometry.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DRENDER_QPLANEGEOMETRY_H
+#define QT3DRENDER_QPLANEGEOMETRY_H
+
+#include <Qt3DRenderer/qgeometry.h>
+#include <QSize>
+
+QT_BEGIN_NAMESPACE
+
+namespace Qt3DRender {
+
+class QPlaneGeometryPrivate;
+
+class QT3DRENDERERSHARED_EXPORT QPlaneGeometry : public QGeometry
+{
+ Q_OBJECT
+ Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
+ Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
+ Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged)
+public:
+ explicit QPlaneGeometry(QNode *parent = Q_NULLPTR);
+ ~QPlaneGeometry();
+
+ void updateVertices();
+ void updateIndices();
+
+ void setResolution(const QSize &resolution);
+ void setWidth(float width);
+ void setHeight(float height);
+
+ QSize resolution() const;
+ int width() const;
+ int height() const;
+
+Q_SIGNALS:
+ void resolutionChanged();
+ void widthChanged();
+ void heightChanged();
+
+protected:
+ QPlaneGeometry(QPlaneGeometryPrivate &dd, QNode *parent = Q_NULLPTR);
+
+private:
+ Q_DECLARE_PRIVATE(QPlaneGeometry)
+ QT3D_CLONEABLE(QPlaneGeometry)
+};
+
+} // Qt3DRender
+
+QT_END_NAMESPACE
+
+#endif // QT3DRENDER_QPLANEGEOMETRY_H