diff options
Diffstat (limited to 'src/datavisualization/global')
5 files changed, 425 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..4d6f1b33 --- /dev/null +++ b/src/datavisualization/global/datavisualizationglobal_p.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** 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> + +//#define ROTATE_ZOOM_SELECTION + +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; +// 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..c62f8c94 --- /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(ColorTheme) + Q_ENUMS(SelectionMode) + Q_ENUMS(ShadowQuality) + Q_ENUMS(LabelTransparency) + +public: + enum InputState { + InputNone = 0, + InputOnScene, + InputOnOverview, + InputOnSlice, + InputRotating, + InputOnPinch + }; + + enum MeshStyle { + Bars = 0, + Pyramids, + Cones, + Cylinders, + BevelBars, + Spheres, + Dots + }; + + enum CameraPreset { + NoPreset = -1, + PresetFrontLow = 0, + PresetFront, + PresetFrontHigh, + PresetLeftLow, + PresetLeft, + PresetLeftHigh, + PresetRightLow, + PresetRight, + PresetRightHigh, + PresetBehindLow, + PresetBehind, + PresetBehindHigh, + PresetIsometricLeft, + PresetIsometricLeftHigh, + PresetIsometricRight, + PresetIsometricRightHigh, + PresetDirectlyAbove, + PresetDirectlyAboveCW45, + PresetDirectlyAboveCCW45, + PresetFrontBelow, // These work only for graphs including negative values. + PresetLeftBelow, // They act as Preset...Low for positive-only values. + PresetRightBelow, + PresetBehindBelow, + PresetDirectlyBelow + }; + + enum ColorTheme { + ThemeDefault = -1, + ThemeSystem = 0, + ThemeBlueCerulean, + ThemeBlueIcy, + ThemeBlueNcs, + ThemeBrownSand, + ThemeDark, + ThemeHighContrast, + ThemeLight + }; + + enum SelectionMode { + ModeNone = 0, + ModeItem, + ModeItemAndRow, // From here onwards used for Q3DBars only + ModeItemAndColumn, + ModeItemRowAndColumn, + ModeSliceRow, + ModeSliceColumn + }; + + enum ShadowQuality { + ShadowNone = 0, + ShadowLow, + ShadowMedium, + ShadowHigh, + ShadowSoftLow, + ShadowSoftMedium, + ShadowSoftHigh + }; + + enum LabelTransparency { + TransparencyNone = 0, // Full solid, using colors from theme + TransparencyFromTheme, // Use colors and transparencies from theme + TransparencyNoBackground // Draw just text on transparent background + }; +}; +} + +#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..a81b38f1 --- /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 InputNone + Default "no input received" state. + \value InputOnScene + Mouse or touch input received on the 3D scene. + \value InputOnOverview + Mouse or touch input received on the overview area. + \value InputOnSlice + Mouse or touch input received on the slice view area. + \value InputRotating + Rotation of the 3D geometry ongoing. + \value InputOnPinch + Pinch/punch multitouch input received. +*/ + +/*! + \enum QtDataVisualization::QDataVis::MeshStyle + + Predefined mesh types. All styles are not usable with all visualization types. + + \value Bars + Basic cubic bar. + \value Pyramids + Four-sided pyramid. + \value Cones + Basic cone. + \value Cylinders + Basic cylinder. + \value BevelBars + Slightly beveled (rounded) cubic bar. + \value Spheres + Sphere. Not usable in Q3DBars. + \value Dots + Triangular pyramid. Usable only with Q3DScatter. +*/ + +/*! + \enum QtDataVisualization::QDataVis::CameraPreset + + Predefined positions for camera. + + \value NoPreset + Used only in QML to indicate a preset has not been set. + \value PresetFrontLow + \value PresetFront + \value PresetFrontHigh + \value PresetLeftLow + \value PresetLeft + \value PresetLeftHigh + \value PresetRightLow + \value PresetRight + \value PresetRightHigh + \value PresetBehindLow + \value PresetBehind + \value PresetBehindHigh + \value PresetIsometricLeft + \value PresetIsometricLeftHigh + \value PresetIsometricRight + \value PresetIsometricRightHigh + \value PresetDirectlyAbove + \value PresetDirectlyAboveCW45 + \value PresetDirectlyAboveCCW45 + \value PresetFrontBelow + In Q3DBars from PresetFrontBelow onward these only work for graphs including negative + values. They act as Preset...Low for positive-only values. + \value PresetLeftBelow + \value PresetRightBelow + \value PresetBehindBelow + \value PresetDirectlyBelow + Acts as PresetFrontLow for positive -only bars. +*/ + +/*! + \enum QtDataVisualization::QDataVis::ColorTheme + + Predefined color themes. + + \value ThemeDefault + Used only in QML to indicate a theme has not been set. + \value ThemeSystem + \value ThemeBlueCerulean + \value ThemeBlueIcy + \value ThemeBlueNcs + \value ThemeBrownSand + \value ThemeDark + \value ThemeHighContrast + \value ThemeLight +*/ + +/*! + \enum QtDataVisualization::QDataVis::SelectionMode + + Item selection modes. + + \value ModeNone + Selection mode disabled. + \value ModeItem + Selection selects a single item. + \value ModeItemAndRow + Selection selects a single item and highlights the row it is on. In Q3DBars only. + \value ModeItemAndColumn + Selection selects a single item and highlights the column it is on. In Q3DBars only. + \value ModeItemRowAndColumn + Selection selects a single item and highlights the row and the column it is on. In + Q3DBars only. + \value ModeSliceRow + 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 ModeSliceColumn + 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 ShadowNone + Shadows are disabled. + \value ShadowLow + Shadows are rendered in low quality. + \value ShadowMedium + Shadows are rendered in medium quality. + \value ShadowHigh + Shadows are rendered in high quality. + \value ShadowSoftLow + Shadows are rendered in low quality with softened edges. + \value ShadowSoftMedium + Shadows are rendered in medium quality with softened edges. + \value ShadowSoftHigh + Shadows are rendered in high quality with softened edges. +*/ + +/*! + \enum QtDataVisualization::QDataVis::LabelTransparency + + Label transparencies. + + \value TransparencyNone + Full solid, using colors from theme. + \value TransparencyFromTheme + Use colors and transparencies from theme. + \value TransparencyNoBackground + Draw just text on transparent background. +*/ |