diff options
Diffstat (limited to 'src/datavisualization/global')
5 files changed, 427 insertions, 0 deletions
diff --git a/src/datavisualization/global/datavisualizationglobal_p.h b/src/datavisualization/global/datavisualizationglobal_p.h new file mode 100644 index 00000000..4da1023c --- /dev/null +++ b/src/datavisualization/global/datavisualizationglobal_p.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QtDataVisualization API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef DATAVISUALIZATIONGLOBAL_P_H +#define DATAVISUALIZATIONGLOBAL_P_H + +#include "qdatavisualizationglobal.h" +#include "qdatavisualizationenums.h" +#include <QOpenGLFunctions> +#include <QVector3D> +#include <QDebug> + +QT_DATAVISUALIZATION_BEGIN_NAMESPACE + +// Constants used in several files +// Compensation for z position; move all objects to positive z, as shader can't handle negative values correctly +const GLfloat zComp = 10.0f; +// Distance from camera to origin +const GLfloat cameraDistance = 6.0f; +// Size of font to be used in label texture rendering. Doesn't affect the actual font size. +const int textureFontSize = 50; +// Default light position. To have shadows working correctly, light should be as far as camera, or a bit further +// y position is added to the minimum height (or can be thought to be that much above or below the camera) +const QVector3D defaultLightPos = QVector3D(0.0f, 0.5f, zComp); +const GLfloat defaultRatio = 1.0f / 1.6f; // default aspect ratio 16:10 + +QT_DATAVISUALIZATION_END_NAMESPACE + +#endif // DATAVISUALIZATIONGLOBAL_P_H diff --git a/src/datavisualization/global/global.pri b/src/datavisualization/global/global.pri new file mode 100644 index 00000000..0fd7c576 --- /dev/null +++ b/src/datavisualization/global/global.pri @@ -0,0 +1,4 @@ +HEADERS += \ + $$PWD/qdatavisualizationglobal.h \ + $$PWD/qdatavisualizationenums.h \ + $$PWD/datavisualizationglobal_p.h diff --git a/src/datavisualization/global/qdatavisualizationenums.h b/src/datavisualization/global/qdatavisualizationenums.h new file mode 100644 index 00000000..3d765ff2 --- /dev/null +++ b/src/datavisualization/global/qdatavisualizationenums.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#ifndef QDATAVISUALIZATIONENUMS_H +#define QDATAVISUALIZATIONENUMS_H + +#include <QtDataVisualization/qdatavisualizationglobal.h> +#include <QObject> + +// namespace must be declared without using macros for qdoc +namespace QtDataVisualization { + +class QT_DATAVISUALIZATION_EXPORT QDataVis : public QObject +{ + Q_OBJECT + Q_ENUMS(MeshStyle) + Q_ENUMS(CameraPreset) + Q_ENUMS(Theme) + Q_ENUMS(SelectionMode) + Q_ENUMS(ShadowQuality) + Q_ENUMS(LabelStyle) + +public: + enum InputState { + InputStateNone = 0, + InputStateOnScene, + InputStateOnOverview, + InputStateOnSlice, + InputStateRotating, + InputStateOnPinch + }; + + enum MeshStyle { + MeshStyleBars = 0, + MeshStylePyramids, + MeshStyleCones, + MeshStyleCylinders, + MeshStyleBevelBars, + MeshStyleSpheres, + MeshStyleDots + }; + + enum CameraPreset { + CameraPresetNone = -1, + CameraPresetFrontLow = 0, + CameraPresetFront, + CameraPresetFrontHigh, + CameraPresetLeftLow, + CameraPresetLeft, + CameraPresetLeftHigh, + CameraPresetRightLow, + CameraPresetRight, + CameraPresetRightHigh, + CameraPresetBehindLow, + CameraPresetBehind, + CameraPresetBehindHigh, + CameraPresetIsometricLeft, + CameraPresetIsometricLeftHigh, + CameraPresetIsometricRight, + CameraPresetIsometricRightHigh, + CameraPresetDirectlyAbove, + CameraPresetDirectlyAboveCW45, + CameraPresetDirectlyAboveCCW45, + CameraPresetFrontBelow, + CameraPresetLeftBelow, + CameraPresetRightBelow, + CameraPresetBehindBelow, + CameraPresetDirectlyBelow + }; + + enum Theme { + ThemeDefault = -1, + ThemeQt, + ThemePrimaryColors, + ThemeDigia, + ThemeStoneMoss, + ThemeArmyBlue, + ThemeRetro, + ThemeEbony, + ThemeIsabelle + }; + + enum SelectionMode { + SelectionModeNone = 0, + SelectionModeItem, + SelectionModeItemAndRow, + SelectionModeItemAndColumn, + SelectionModeItemRowAndColumn, + SelectionModeSliceRow, + SelectionModeSliceColumn + }; + + enum ShadowQuality { + ShadowQualityNone = 0, + ShadowQualityLow, + ShadowQualityMedium, + ShadowQualityHigh, + ShadowQualitySoftLow, + ShadowQualitySoftMedium, + ShadowQualitySoftHigh + }; + + enum LabelStyle { + LabelStyleOpaque = 0, + LabelStyleFromTheme, + LabelStyleTransparent + }; +}; +} + +#endif diff --git a/src/datavisualization/global/qdatavisualizationglobal.h b/src/datavisualization/global/qdatavisualizationglobal.h new file mode 100644 index 00000000..ac734960 --- /dev/null +++ b/src/datavisualization/global/qdatavisualizationglobal.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#ifndef QDATAVISUALIZATIONGLOBAL_H +#define QDATAVISUALIZATIONGLOBAL_H + +#include <qglobal.h> + +#define QT_DATAVISUALIZATION_VERSION_STR "0.0.1" +/* + QT_DATAVISUALIZATION_VERSION is (major << 16) + (minor << 8) + patch. +*/ +#define QT_DATAVISUALIZATION_VERSION 0x000001 +/* + can be used like #if (QT_DATAVISUALIZATION_VERSION >= QT_DATAVISUALIZATION_VERSION_CHECK(1, 1, 0)) +*/ +#define QT_DATAVISUALIZATION_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +#if defined(QT_DATAVISUALIZATION_LIBRARY) +# define QT_DATAVISUALIZATION_EXPORT Q_DECL_EXPORT +#else +# define QT_DATAVISUALIZATION_EXPORT Q_DECL_IMPORT +#endif + +#if defined(BUILD_PRIVATE_UNIT_TESTS) && defined(QT_DATAVISUALIZATION_LIBRARY) +# define QT_DATAVISUALIZATION_AUTOTEST_EXPORT Q_DECL_EXPORT +#elif defined(BUILD_PRIVATE_UNIT_TESTS) && !defined(QT_DATAVISUALIZATION_LIBRARY) +# define QT_DATAVISUALIZATION_AUTOTEST_EXPORT Q_DECL_IMPORT +#else +# define QT_DATAVISUALIZATION_AUTOTEST_EXPORT +#endif + +#ifdef QT_DATAVISUALIZATION_STATICLIB +# undef QT_DATAVISUALIZATION_EXPORT +# undef QT_DATAVISUALIZATION_AUTOTEST_EXPORT +# define QT_DATAVISUALIZATION_EXPORT +# define QT_DATAVISUALIZATION_AUTOTEST_EXPORT +#endif + +#define QT_DATAVISUALIZATION_NAMESPACE QtDataVisualization + +#ifdef QT_DATAVISUALIZATION_NAMESPACE +# define QT_DATAVISUALIZATION_BEGIN_NAMESPACE namespace QT_DATAVISUALIZATION_NAMESPACE { +# define QT_DATAVISUALIZATION_END_NAMESPACE } +# define QT_DATAVISUALIZATION_USE_NAMESPACE using namespace QT_DATAVISUALIZATION_NAMESPACE; +#else +# define QT_DATAVISUALIZATION_BEGIN_NAMESPACE +# define QT_DATAVISUALIZATION_END_NAMESPACE +# define QT_DATAVISUALIZATION_USE_NAMESPACE +#endif + +#endif // QVIS3DGLOBAL_H diff --git a/src/datavisualization/global/qtdatavisualizationenums.qdoc b/src/datavisualization/global/qtdatavisualizationenums.qdoc new file mode 100644 index 00000000..fde6a258 --- /dev/null +++ b/src/datavisualization/global/qtdatavisualizationenums.qdoc @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +/*! + \namespace QtDataVisualization + \inmodule QtDataVisualization + \target QtDataVisualization Enums +*/ + +/*! + \enum QtDataVisualization::QDataVis::InputState + + Predefined input states for mouse and touch based input handlers. All states are not valid with all input handlers. + + \value InputStateNone + Default "no input received" state. + \value InputStateOnScene + Mouse or touch input received on the 3D scene. + \value InputStateOnOverview + Mouse or touch input received on the overview area. + \value InputStateOnSlice + Mouse or touch input received on the slice view area. + \value InputStateRotating + Rotation of the 3D geometry ongoing. + \value InputStateOnPinch + Pinch/punch multitouch input received. +*/ + +/*! + \enum QtDataVisualization::QDataVis::MeshStyle + + Predefined mesh types. All styles are not usable with all visualization types. + + \value MeshStyleBars + Basic cubic bar. + \value MeshStylePyramids + Four-sided pyramid. + \value MeshStyleCones + Basic cone. + \value MeshStyleCylinders + Basic cylinder. + \value MeshStyleBevelBars + Slightly beveled (rounded) cubic bar. + \value MeshStyleSpheres + Sphere. Not usable in Q3DBars. + \value MeshStyleDots + Triangular pyramid. Usable only with Q3DScatter. +*/ + +/*! + \enum QtDataVisualization::QDataVis::CameraPreset + + Predefined positions for camera. + + \value CameraPresetNone + Used to indicate a preset has not been set, or the scene has been rotated freely. + \value CameraPresetFrontLow + \value CameraPresetFront + \value CameraPresetFrontHigh + \value CameraPresetLeftLow + \value CameraPresetLeft + \value CameraPresetLeftHigh + \value CameraPresetRightLow + \value CameraPresetRight + \value CameraPresetRightHigh + \value CameraPresetBehindLow + \value CameraPresetBehind + \value CameraPresetBehindHigh + \value CameraPresetIsometricLeft + \value CameraPresetIsometricLeftHigh + \value CameraPresetIsometricRight + \value CameraPresetIsometricRightHigh + \value CameraPresetDirectlyAbove + \value CameraPresetDirectlyAboveCW45 + \value CameraPresetDirectlyAboveCCW45 + \value CameraPresetFrontBelow + In Q3DBars from CameraPresetFrontBelow onward these only work for graphs including negative + values. They act as Preset...Low for positive-only values. + \value CameraPresetLeftBelow + \value CameraPresetRightBelow + \value CameraPresetBehindBelow + \value CameraPresetDirectlyBelow + Acts as CameraPresetFrontLow for positive -only bars. +*/ + +/*! + \enum QtDataVisualization::QDataVis::Theme + + Predefined themes. + + \value ThemeDefault + Used only in QML to indicate a theme has not been set. + \value ThemeQt + \value ThemePrimaryColors + \value ThemeDigia + \value ThemeStoneMoss + \value ThemeArmyBlue + \value ThemeRetro + \value ThemeEbony + \value ThemeIsabelle +*/ + +/*! + \enum QtDataVisualization::QDataVis::SelectionMode + + Item selection modes. + + \value SelectionModeNone + Selection mode disabled. + \value SelectionModeItem + Selection selects a single item. + \value SelectionModeItemAndRow + Selection selects a single item and highlights the row it is on. In Q3DBars only. + \value SelectionModeItemAndColumn + Selection selects a single item and highlights the column it is on. In Q3DBars only. + \value SelectionModeItemRowAndColumn + Selection selects a single item and highlights the row and the column it is on. In + Q3DBars only. + \value SelectionModeSliceRow + Selection selects a single item and displays the row it is on in a separate view. The + original view is shrunk into upper left corner. Original view is restored by clicking + on it. In Q3DBars only. + \value SelectionModeSliceColumn + Selection selects a single item and displays the column it is on in a separate view. The + original view is shrunk into upper left corner. Original view is restored by clicking + on it. In Q3DBars only. +*/ + +/*! + \enum QtDataVisualization::QDataVis::ShadowQuality + + Quality of shadows. + + \value ShadowQualityNone + Shadows are disabled. + \value ShadowQualityLow + Shadows are rendered in low quality. + \value ShadowQualityMedium + Shadows are rendered in medium quality. + \value ShadowQualityHigh + Shadows are rendered in high quality. + \value ShadowQualitySoftLow + Shadows are rendered in low quality with softened edges. + \value ShadowQualitySoftMedium + Shadows are rendered in medium quality with softened edges. + \value ShadowQualitySoftHigh + Shadows are rendered in high quality with softened edges. +*/ + +/*! + \enum QtDataVisualization::QDataVis::LabelStyle + + Label styles. + + \value LabelStyleOpaque + Fully opaque background, using colors and borders from theme. + \value LabelStyleFromTheme + Use transparencies, colors and borders from theme. + \value LabelStyleTransparent + Fully transparent background, using text color from theme. +*/ |