summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/engine/q3dbars_p.h
blob: b72e2ed3b4fedc6a440f71d2a813772f65bdfabf (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef Q3DBARS_p_H
#define Q3DBARS_p_H

#include "qdatavis3dglobal.h"

class QOpenGLShaderProgram;
class QPoint;
class QPointF;

QTCOMMERCIALDATAVIS3D_BEGIN_NAMESPACE

class Q3DBars;

class Q3DBarsPrivate
{
public:
    Q3DBarsPrivate(Q3DBars *q);
    ~Q3DBarsPrivate();

    void loadBarMesh();
    void loadBackgroundMesh();
    void initShaders(QString vertexShader, QString fragmentShader);
    void calculateSceneScalingFactors();

    GLuint m_positionAttr;
    GLuint m_uvAttr;
    GLuint m_normalAttr;
    GLuint m_colorUniform;
    GLuint m_viewMatrixUniform;
    GLuint m_modelMatrixUniform;
    GLuint m_invTransModelMatrixUniform;
    GLuint m_mvpMatrixUniform;
    GLuint m_lightPositionUniform;
    GLuint m_lightStrengthUniform;

    GLuint m_vertexbuffer;
    GLuint m_uvbuffer;
    GLuint m_normalbuffer;
    GLuint m_elementbuffer;
    GLuint m_vertexbufferBackground;
    GLuint m_uvbufferBackground;
    GLuint m_normalbufferBackground;
    GLuint m_elementbufferBackground;

    Q3DBars *q_ptr;

    QOpenGLShaderProgram *m_program;
    QPoint m_sampleCount;
    QString m_objFile;
    int m_vertexCount;
    int m_indexCount;
    int m_indexCountBackground;
    bool m_mousePressed;
    QPoint m_mousePos;
    int m_zoomLevel;
    QPointF m_barThickness;
    QPointF m_barSpacing;
    bool m_meshDataLoaded;
    bool m_background;
    QVector<QVector<float>> m_dataSet;
    float m_rowWidth;
    float m_columnDepth;
    float m_maxDimension;
    float m_scaleX;
    float m_scaleZ;
    float m_scaleFactorX;
    float m_scaleFactorZ;
    float m_sceneScale;
};

QTCOMMERCIALDATAVIS3D_END_NAMESPACE

#endif