VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
PolygonVertexAttributeArray.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef POLYGONVERTEXATTRIBUTEARRAY_H
18 #define POLYGONVERTEXATTRIBUTEARRAY_H
19 
20 #include <QObject>
21 #include <QVariant>
22 
36  Q_OBJECT
41  Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged)
45  Q_PROPERTY(QVariantList values READ getValuesAsVariantList WRITE setValuesFromVariantList
46  NOTIFY valuesChanged)
63 public:
68  explicit PolygonVertexAttributeArray(QObject* parent = nullptr);
69 
73  const QString& getName() const { return mName; }
78  void setName(const QString& value);
82  const QList<float>& getValues() const { return mValues; }
87  void setValues(const QList<float>& values);
88 
92  QVariantList getValuesAsVariantList() const;
97  void setValuesFromVariantList(const QVariantList& variants);
106  void setValuesFromBase64Binary(const QString& base64Str);
107 
108 signals:
112  void nameChanged();
116  void valuesChanged();
117 
118 private:
119  QString mName;
120  QList<float> mValues;
121 };
122 Q_DECLARE_METATYPE(PolygonVertexAttributeArray*)
123 
124 #endif // POLYGONVERTEXATTRIBUTEARRAY_H
Class storing the values in a vertex attribute array, instantiable from QML.
Definition: PolygonVertexAttributeArray.h:35
void setValuesFromBase64Binary(const QString &base64Str)
Sets valuesAsBase64Binary.
void setName(const QString &value)
Sets name.
QString getValuesAsBase64Binary() const
Returns valuesAsBase64Binary.
const QList< float > & getValues() const
Returns values as a QList of floats.
Definition: PolygonVertexAttributeArray.h:82
QString name
Name of the attribute represented by this array, mapping it to the corresponding attribute in the Sha...
Definition: PolygonVertexAttributeArray.h:41
QVariantList getValuesAsVariantList() const
Returns values as a QVariantList.
QString valuesAsBase64Binary
List of floats contained in this array, encoded as a base64 string.
Definition: PolygonVertexAttributeArray.h:62
PolygonVertexAttributeArray(QObject *parent=nullptr)
Construct a PolygonVertexAttributeArray.
void nameChanged()
Emitted when name changes.
const QString & getName() const
Returns name.
Definition: PolygonVertexAttributeArray.h:73
void setValues(const QList< float > &values)
Sets values from a QList of floats.
QObject * parent() const
void setValuesFromVariantList(const QVariantList &variants)
Sets values from a QVariantList.
QVariantList values
List of floats contained in this array, as a QVariantList.
Definition: PolygonVertexAttributeArray.h:46
void valuesChanged()
Emitted when values changes.