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
24QT_BEGIN_NAMESPACE
25
26// Constants used in several files
27// Distance from camera to origin
28static const GLfloat cameraDistance = 6.0f;
29// Size of font to be used in label texture rendering. Doesn't affect the actual font size.
30static const int textureFontSize = 50;
31static const GLfloat defaultRatio = 1.0f / 1.6f; // default aspect ratio 16:10
32#if !(defined QT_OPENGL_ES)
33static const float gridLineOffset = 0.0001f; // Offset for lifting grid lines off background
34#else
35static 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)
39static const QVector3D defaultLightPos = QVector3D(0.0f, 0.5f, 0.0f);
40static const QVector3D zeroVector = QVector3D(0.0f, 0.0f, 0.0f);
41static const QVector3D oneVector = QVector3D(1.0f, 1.0f, 1.0f);
42static const QVector3D upVector = QVector3D(0.0f, 1.0f, 0.0f);
43static const QVector3D cameraDistanceVector = QVector3D(0.0f, 0.0f, cameraDistance);
44static const QQuaternion identityQuaternion;
45
46// Skip color == selection texture's background color
47static const QVector4D selectionSkipColor = QVector4D(255.0f, 255.0f, 255.0f, 255.0f);
48static const QVector4D invalidColorVector = QVector4D(-1.0f, -1.0f, -1.0f, -1.0f);
49static const GLfloat itemAlpha = 0.0f;
50static const GLfloat customItemAlpha = 252.0f;
51static const GLfloat labelValueAlpha = 253.0f;
52static const GLfloat labelRowAlpha = 254.0f;
53static const GLfloat labelColumnAlpha = 255.0f;
54static const GLfloat gradientTextureHeight = 1024.0f;
55static const GLfloat gradientTextureWidth = 2.0f;
56static const GLfloat uniformTextureHeight = 64.0f;
57static const GLfloat uniformTextureWidth = 2.0f;
58static const GLfloat labelMargin = 0.05f;
59static const GLfloat gridLineWidth = 0.005f;
60
61QT_END_NAMESPACE
62
63#endif
64

source code of qtdatavis3d/src/datavisualization/global/datavisualizationglobal_p.h