1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the QtDataVisualization API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | |
14 | #ifndef DATAVISUALIZATIONGLOBAL_P_H |
15 | #define DATAVISUALIZATIONGLOBAL_P_H |
16 | |
17 | #include "qdatavisualizationglobal.h" |
18 | #include <QtGui/QOpenGLFunctions> |
19 | #include <QtOpenGL/QOpenGLFramebufferObject> |
20 | #include <QtGui/QVector3D> |
21 | #include <QtGui/QQuaternion> |
22 | #include <QtCore/QDebug> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | // Constants used in several files |
27 | // Distance from camera to origin |
28 | static const GLfloat cameraDistance = 6.0f; |
29 | // Size of font to be used in label texture rendering. Doesn't affect the actual font size. |
30 | static const int textureFontSize = 50; |
31 | static const GLfloat defaultRatio = 1.0f / 1.6f; // default aspect ratio 16:10 |
32 | #if !(defined QT_OPENGL_ES) |
33 | static const float gridLineOffset = 0.0001f; // Offset for lifting grid lines off background |
34 | #else |
35 | static const float gridLineOffset = 0.0035f; // Offset for lifting grid lines off background |
36 | #endif |
37 | // Default light position. To have shadows working correctly, light should be as far as camera, or a bit further |
38 | // y position is added to the minimum height (or can be thought to be that much above or below the camera) |
39 | static const QVector3D defaultLightPos = QVector3D(0.0f, 0.5f, 0.0f); |
40 | static const QVector3D zeroVector = QVector3D(0.0f, 0.0f, 0.0f); |
41 | static const QVector3D oneVector = QVector3D(1.0f, 1.0f, 1.0f); |
42 | static const QVector3D upVector = QVector3D(0.0f, 1.0f, 0.0f); |
43 | static const QVector3D cameraDistanceVector = QVector3D(0.0f, 0.0f, cameraDistance); |
44 | static const QQuaternion identityQuaternion; |
45 | |
46 | // Skip color == selection texture's background color |
47 | static const QVector4D selectionSkipColor = QVector4D(255.0f, 255.0f, 255.0f, 255.0f); |
48 | static const QVector4D invalidColorVector = QVector4D(-1.0f, -1.0f, -1.0f, -1.0f); |
49 | static const GLfloat itemAlpha = 0.0f; |
50 | static const GLfloat customItemAlpha = 252.0f; |
51 | static const GLfloat labelValueAlpha = 253.0f; |
52 | static const GLfloat labelRowAlpha = 254.0f; |
53 | static const GLfloat labelColumnAlpha = 255.0f; |
54 | static const GLfloat gradientTextureHeight = 1024.0f; |
55 | static const GLfloat gradientTextureWidth = 2.0f; |
56 | static const GLfloat uniformTextureHeight = 64.0f; |
57 | static const GLfloat uniformTextureWidth = 2.0f; |
58 | static const GLfloat labelMargin = 0.05f; |
59 | static const GLfloat gridLineWidth = 0.005f; |
60 | |
61 | QT_END_NAMESPACE |
62 | |
63 | #endif |
64 | |