summaryrefslogtreecommitdiff
path: root/gui/vertexdatainterpreter.h
blob: 1ad46b7d85e74df8bc502112a90a03b921045a24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once

#include <QObject>

class QListWidget;

enum DataType {
    DT_INT8,
    DT_UINT8,
    DT_INT16,
    DT_UINT16,
    DT_INT32,
    DT_UINT32,
    DT_FLOAT,
    DT_DOUBLE,
};

class VertexDataInterpreter : public QObject
{
    Q_OBJECT
public:
    VertexDataInterpreter(QObject *parent=0);

    QByteArray data() const;

    int type() const;
    int stride() const;
    int components() const;
    int startingOffset() const;

    void setListWidget(QListWidget *listWidget);

public slots:
    void interpretData();

    void setData(const QByteArray &data);
    void setTypeFromString(const QString &str);
    void setStride(int stride);
    void setComponents(int num);
    void setType(int type);
    void setStartingOffset(int offset);

private:
    QListWidget *m_listWidget;
    QByteArray m_data;
    int m_type;
    int m_stride;
    int m_components;
    int m_startingOffset;
};