summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-10-14 11:09:10 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-10-14 11:09:10 +0300
commit275127c08d876b9dca53735d07140feae34bcee4 (patch)
tree29eefbe3d568ae774dd1d398aab4b6b39cf04c54
parent18a5a1510b90a16007569f436392b52553f150fa (diff)
parent2240de43294ec080d8aa665c7a0731ea81ea6c1f (diff)
Merge remote-tracking branch 'origin/develop'
Conflicts: README Change-Id: I2edf6dd13e4cece0afc047218af84a7f023481ea
-rw-r--r--.gitattributes5
-rw-r--r--.qmake.conf4
-rw-r--r--.tag1
-rw-r--r--README62
-rw-r--r--dist/changes-0.1.01
-rw-r--r--dist/changes-1.0.00
-rw-r--r--src/datavisualization/datavisualization.pro7
-rw-r--r--src/datavisualization/doc/qtdatavisualization.qdocconf10
-rw-r--r--src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp2
-rw-r--r--src/datavisualization/engine/bars3drenderer.cpp84
-rw-r--r--src/datavisualization/engine/drawer.cpp10
-rw-r--r--src/datavisualization/global/qdatavisualizationglobal.h6
12 files changed, 126 insertions, 66 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..7709f882
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+.tag export-subst
+.gitignore export-ignore
+.gitattributes export-ignore
+.commit-template export-ignore
+tests export-ignore
diff --git a/.qmake.conf b/.qmake.conf
index cee97767..213e6914 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,2 +1,2 @@
-MODULE_VERSION=5.1.0
-load(qt_build_config) \ No newline at end of file
+MODULE_VERSION=0.1.0
+load(qt_build_config)
diff --git a/.tag b/.tag
new file mode 100644
index 00000000..6828f88d
--- /dev/null
+++ b/.tag
@@ -0,0 +1 @@
+$Format:%H$
diff --git a/README b/README
index f818b631..f450b8b8 100644
--- a/README
+++ b/README
@@ -1 +1,61 @@
-Merging develop to master (this is a dummy change) \ No newline at end of file
+-------------------------------------------------
+Qt Data Visualization 0.1.0 (Techonology preview)
+-------------------------------------------------
+
+Qt Data Visualization module provides multiple graph types to visualize data in 3D space
+both with C++ and Qt Quick 2.
+
+System Requirements
+===================
+
+- Qt 5.1 or newer
+- OpenGL 2.1 or newer (recommended) or OpenGL ES2 (reduced feature set)
+
+Building
+========
+Configure project with qmake and build project with make:
+ (Linux) make
+ (Windows with MinGw) mingw32-make
+ (Visual Studio) nmake
+ (OSX) make
+
+If you want to install the module to your Qt directory use:
+ make install
+
+If you want to uninstall the module
+ make uninstall
+
+Building as a statically linked library
+=======================================
+
+The same as above applies you will just have to add static to the CONFIG:
+ qmake CONFIG+=static
+
+Documentation
+=============
+Pregenerated documentation can be found from doc folder for both Qt Assistant
+(qtdatavisualization.qch) and in HTML format (qtdatavisualization subfolder).
+
+The documentation can also be generated with:
+ make docs
+
+Please refer to the generated documentation for more information:
+ doc/qtdatavisualization/qtdatavisualization-index.html
+
+Known Issues
+============
+
+The technology preview version is still missing some features entirely, while some
+others may be only partially implemented. Here are some known issues:
+
+- Scatter graphs can only show zero centered axis ranges properly.
+- Value axis range of a bar graph with negative values need to be zero
+ centered to display properly.
+- Selection API is missing for surface graphs.
+- Shadows do not work for surface graphs.
+- Mac: Graphs drawn half the size on Retina displays.
+- Using multiple graphs in one application crashes on application shutdown
+ unless the last graph to have active context is deleted last.
+- Android doesn't support both widgets and OpenGL simulataneously, so only
+ the Qt Quick 2 API is usable in practice in Android.
+- Shadows are not supported with OpenGL ES2 (including Angle builds in Windows).
diff --git a/dist/changes-0.1.0 b/dist/changes-0.1.0
new file mode 100644
index 00000000..854f74e4
--- /dev/null
+++ b/dist/changes-0.1.0
@@ -0,0 +1 @@
+Initial version, no changes. \ No newline at end of file
diff --git a/dist/changes-1.0.0 b/dist/changes-1.0.0
deleted file mode 100644
index e69de29b..00000000
--- a/dist/changes-1.0.0
+++ /dev/null
diff --git a/src/datavisualization/datavisualization.pro b/src/datavisualization/datavisualization.pro
index 87857062..bfb07440 100644
--- a/src/datavisualization/datavisualization.pro
+++ b/src/datavisualization/datavisualization.pro
@@ -1,7 +1,10 @@
-TARGET = QtDataVisualization
-QT = core gui
+# Target can't start with 'Qt' as it gets major version number inserted into it in that case,
+# which we don't want.
+TARGET = DataVisualization
+QT = core gui
DEFINES += QT_DATAVISUALIZATION_LIBRARY
+MODULE_INCNAME = QtDataVisualization
QMAKE_DOCS = $$PWD/doc/qtdatavisualization.qdocconf
diff --git a/src/datavisualization/doc/qtdatavisualization.qdocconf b/src/datavisualization/doc/qtdatavisualization.qdocconf
index e3189604..82a5d8c4 100644
--- a/src/datavisualization/doc/qtdatavisualization.qdocconf
+++ b/src/datavisualization/doc/qtdatavisualization.qdocconf
@@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtDataVisualization
description = Qt Data Visualization Reference Documentation
-version = 1.0.0
+version = 0.1.0
exampledirs += ../../../examples \
snippets
@@ -18,14 +18,14 @@ depends += qtcore \
qhp.projects = qtdatavisualization
qhp.qtdatavisualization.file = qtdatavisualization.qhp
-qhp.qtdatavisualization.namespace = org.qt-project.qtdatavisualization.1.0.0
+qhp.qtdatavisualization.namespace = org.qt-project.qtdatavisualization.0.1.0
qhp.qtdatavisualization.virtualFolder = qtdatavisualization
qhp.qtdatavisualization.indexTitle = Qt Data Visualization
qhp.qtdatavisualization.indexRoot =
-qhp.qtdatavisualization.filterAttributes = qtdatavisualization 1.0.0 qtrefdoc
-qhp.qtdatavisualization.customFilters.Qt.name = QtDataVisualization 1.0.0
-qhp.qtdatavisualization.customFilters.Qt.filterAttributes = qtdatavisualization 1.0.0
+qhp.qtdatavisualization.filterAttributes = qtdatavisualization 0.1.0 qtrefdoc
+qhp.qtdatavisualization.customFilters.Qt.name = QtDataVisualization 0.1.0
+qhp.qtdatavisualization.customFilters.Qt.filterAttributes = qtdatavisualization 0.1.0
qhp.qtdatavisualization.subprojects = classes
qhp.qtdatavisualization.subprojects.classes.title = C++ Classes
qhp.qtdatavisualization.subprojects.classes.indexTitle = Qt Data Visualization C++ Classes
diff --git a/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp b/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp
index 2f3d6a98..d32bde0e 100644
--- a/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp
+++ b/src/datavisualization/doc/snippets/doc_src_qtdatavisualization.cpp
@@ -82,11 +82,13 @@ QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(customModel,
//! [6]
qmake
make
+make install
//! [6]
//! [7]
qmake CONFIG+=static
make
+make install
//! [7]
//! [8]
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp
index 74c1a99b..32a23da5 100644
--- a/src/datavisualization/engine/bars3drenderer.cpp
+++ b/src/datavisualization/engine/bars3drenderer.cpp
@@ -43,6 +43,7 @@ QT_DATAVISUALIZATION_BEGIN_NAMESPACE
const GLfloat labelMargin = 0.05f;
const GLfloat gridLineWidth = 0.005f;
static QVector3D selectionSkipColor = QVector3D(255, 255, 255); // Selection texture's background color
+const int smallerVPSize = 5;
Bars3DRenderer::Bars3DRenderer(Bars3DController *controller)
: Abstract3DRenderer(controller),
@@ -356,7 +357,6 @@ void Bars3DRenderer::drawSlicedScene(const LabelItem &xLabel,
m_cachedTheme.m_ambientStrength * 2.0f);
// Draw the object
#if defined (Q_OS_MAC)
- // Mac slice issue hack fix. TODO: Fix correctly
m_drawer->drawObject(m_barShader, m_barObj, 0, -1);
#else
m_drawer->drawObject(m_barShader, m_barObj);
@@ -481,7 +481,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QMatrix4x4 viewMatrix = m_cachedScene->activeCamera()->viewMatrix();
// Calculate drawing order
- // Draw order is reversed to optimize amount of drawing (ie. draw front objects first, depth test handles not needing to draw objects behind them)
+ // Draw order is reversed to optimize amount of drawing (ie. draw front objects first,
+ // depth test handles not needing to draw objects behind them)
if (viewMatrix.row(0).x() > 0) {
startRow = 0;
stopRow = m_cachedRowCount;
@@ -530,7 +531,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QMatrix4x4 depthProjectionMatrix;
#if !defined(QT_OPENGL_ES_2)
- if (m_cachedShadowQuality > QDataVis::ShadowQualityNone && !m_cachedIsSlicingActivated) {
+ if (m_cachedShadowQuality > QDataVis::ShadowQualityNone) {
// Render scene into a depth texture for using with shadow mapping
// Enable drawing to depth framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, m_depthFrameBuffer);
@@ -540,7 +541,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
m_depthShader->bind();
// Set viewport for depth map rendering. Must match texture size. Larger values give smoother shadows.
- glViewport(m_mainViewPort.x(), m_mainViewPort.y(),
+ // Depth viewport must always start from 0, 0, as it is rendered into a texture, not screen
+ glViewport(0, 0,
m_mainViewPort.width() * m_shadowQualityMultiplier,
m_mainViewPort.height() * m_shadowQualityMultiplier);
@@ -688,8 +690,6 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
MVPMatrix = projectionMatrix * viewMatrix * modelMatrix;
- // TODO: Save position to qdataitem, so that we don't need to calculate it each time?
-
//#if !defined(QT_OPENGL_ES_2)
// QVector3D barColor = QVector3D((GLdouble)row / 32767.0,
// (GLdouble)bar / 32767.0,
@@ -812,7 +812,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
#if 0
QVector3D baseColor = Utils::vectorFromColor(m_cachedTheme.m_baseColor);
- QVector3D heightColor = Utils::vectorFromColor(m_cachedTheme.m_heightColor) * item.height();
+ QVector3D heightColor = Utils::vectorFromColor(m_cachedTheme.m_heightColor)
+ * item.height();
QVector3D depthColor = Utils::vectorFromColor(m_cachedTheme.m_depthColor)
* (float(row) / GLfloat(m_cachedRowCount));
@@ -902,11 +903,11 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
itModelMatrix.transposed().inverted());
m_barShader->setUniformValue(m_barShader->MVP(), MVPMatrix);
m_barShader->setUniformValue(m_barShader->color(), barColor);
- m_barShader->setUniformValue(m_barShader->ambientS(), m_cachedTheme.m_ambientStrength);
+ m_barShader->setUniformValue(m_barShader->ambientS(),
+ m_cachedTheme.m_ambientStrength);
#if !defined(QT_OPENGL_ES_2)
- if (m_cachedShadowQuality > QDataVis::ShadowQualityNone
- && !m_cachedIsSlicingActivated) {
+ if (m_cachedShadowQuality > QDataVis::ShadowQualityNone) {
// Set shadow shader bindings
m_barShader->setUniformValue(m_barShader->shadowQ(), m_shadowQualityToShader);
m_barShader->setUniformValue(m_barShader->depth(), depthMVPMatrix);
@@ -921,12 +922,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
m_barShader->setUniformValue(m_barShader->lightS(), lightStrength);
// Draw the object
-#if defined (Q_OS_MAC)
- // Mac slice issue hack fix. TODO: Fix correctly
- m_drawer->drawObject(m_barShader, m_barObj, 0, -1);
-#else
m_drawer->drawObject(m_barShader, m_barObj);
-#endif
}
}
}
@@ -1286,8 +1282,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QVector3D(0.0f, m_yAdjustment, zComp),
QVector3D(rotLabelX, rotLabelY, rotLabelZ),
0, m_cachedSelectionMode,
- m_labelShader, m_labelObj, m_cachedScene->activeCamera(), true, true, Drawer::LabelMid,
- alignment);
+ m_labelShader, m_labelObj, m_cachedScene->activeCamera(),
+ true, true, Drawer::LabelMid, alignment);
}
}
for (int column = 0; column != m_cachedColumnCount; column += 1) {
@@ -1324,8 +1320,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QVector3D(0.0f, m_yAdjustment, zComp),
QVector3D(rotLabelX, rotLabelY, rotLabelZ),
0, m_cachedSelectionMode,
- m_labelShader, m_labelObj, m_cachedScene->activeCamera(), true, true, Drawer::LabelMid,
- alignment);
+ m_labelShader, m_labelObj, m_cachedScene->activeCamera(),
+ true, true, Drawer::LabelMid, alignment);
}
}
@@ -1373,8 +1369,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QVector3D(0.0f, m_yAdjustment, zComp),
QVector3D(rotLabelX, rotLabelY, rotLabelZ),
0, m_cachedSelectionMode,
- m_labelShader, m_labelObj, m_cachedScene->activeCamera(), true, true, Drawer::LabelMid,
- alignment);
+ m_labelShader, m_labelObj, m_cachedScene->activeCamera(),
+ true, true, Drawer::LabelMid, alignment);
// Side wall
if (m_xFlipped)
@@ -1394,8 +1390,8 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QVector3D(0.0f, m_yAdjustment, zComp),
QVector3D(rotLabelX, rotLabelY, rotLabelZ),
0, m_cachedSelectionMode,
- m_labelShader, m_labelObj, m_cachedScene->activeCamera(), true, true, Drawer::LabelMid,
- alignment);
+ m_labelShader, m_labelObj, m_cachedScene->activeCamera(),
+ true, true, Drawer::LabelMid, alignment);
}
labelNbr++;
labelPos += heightStep;
@@ -1498,9 +1494,10 @@ void Bars3DRenderer::handleResize()
// Set view port
if (m_cachedIsSlicingActivated) {
m_mainViewPort = QRect(0,
- m_cachedBoundingRect.height() - m_cachedBoundingRect.height() / 5,
- m_cachedBoundingRect.width() / 5,
- m_cachedBoundingRect.height() / 5);
+ m_cachedBoundingRect.height()
+ - (m_cachedBoundingRect.height() / smallerVPSize),
+ m_cachedBoundingRect.width() / smallerVPSize,
+ m_cachedBoundingRect.height() / smallerVPSize);
m_sliceViewPort = QRect(0, 0, m_cachedBoundingRect.width(), m_cachedBoundingRect.height());
} else {
m_mainViewPort = QRect(0, 0, m_cachedBoundingRect.width(), m_cachedBoundingRect.height());
@@ -1722,14 +1719,16 @@ Bars3DController::SelectionType Bars3DRenderer::isSelected(GLint row, GLint bar)
if (current == m_selection) {
isSelectedType = Bars3DController::SelectionItem;
}
- else if (current.y() == m_selection.y() && (m_cachedSelectionMode == QDataVis::SelectionModeItemAndColumn
- || m_cachedSelectionMode == QDataVis::SelectionModeItemRowAndColumn
- || m_cachedSelectionMode == QDataVis::SelectionModeSliceColumn)) {
+ else if (current.y() == m_selection.y()
+ && (m_cachedSelectionMode == QDataVis::SelectionModeItemAndColumn
+ || m_cachedSelectionMode == QDataVis::SelectionModeItemRowAndColumn
+ || m_cachedSelectionMode == QDataVis::SelectionModeSliceColumn)) {
isSelectedType = Bars3DController::SelectionColumn;
}
- else if (current.x() == m_selection.x() && (m_cachedSelectionMode == QDataVis::SelectionModeItemAndRow
- || m_cachedSelectionMode == QDataVis::SelectionModeItemRowAndColumn
- || m_cachedSelectionMode == QDataVis::SelectionModeSliceRow)) {
+ else if (current.x() == m_selection.x()
+ && (m_cachedSelectionMode == QDataVis::SelectionModeItemAndRow
+ || m_cachedSelectionMode == QDataVis::SelectionModeItemRowAndColumn
+ || m_cachedSelectionMode == QDataVis::SelectionModeSliceRow)) {
isSelectedType = Bars3DController::SelectionRow;
}
return isSelectedType;
@@ -1742,22 +1741,20 @@ void Bars3DRenderer::updateSlicingActive(bool isSlicing)
m_cachedIsSlicingActivated = isSlicing;
if (isSlicing) {
- m_mainViewPort = QRect(0, m_cachedBoundingRect.height() - m_cachedBoundingRect.height() / 5,
- m_cachedBoundingRect.width() / 5, m_cachedBoundingRect.height() / 5);
+ m_mainViewPort = QRect(0,
+ m_cachedBoundingRect.height()
+ - (m_cachedBoundingRect.height() / smallerVPSize),
+ m_cachedBoundingRect.width() / smallerVPSize,
+ m_cachedBoundingRect.height() / smallerVPSize);
m_sliceViewPort = QRect(0, 0, m_cachedBoundingRect.width(), m_cachedBoundingRect.height());
- if (m_depthTexture) {
- m_textureHelper->deleteTexture(&m_depthTexture);
- m_depthTexture = 0;
- }
} else {
- m_mainViewPort = QRect(0, 0, this->m_cachedBoundingRect.width(),
- this->m_cachedBoundingRect.height());
+ m_mainViewPort = QRect(0, 0, m_cachedBoundingRect.width(), m_cachedBoundingRect.height());
m_sliceViewPort = QRect(0, 0, 0, 0);
initSelectionBuffer(); // We need to re-init selection buffer in case there has been a resize
+ }
#if !defined(QT_OPENGL_ES_2)
- updateDepthBuffer(); // Re-init depth buffer as well
+ updateDepthBuffer(); // Re-init depth buffer as well
#endif
- }
}
QRect Bars3DRenderer::mainViewPort()
@@ -1807,9 +1804,6 @@ void Bars3DRenderer::initDepthShader()
void Bars3DRenderer::updateDepthBuffer()
{
- if (m_cachedIsSlicingActivated)
- return;
-
if (m_depthTexture) {
m_textureHelper->deleteTexture(&m_depthTexture);
m_depthTexture = 0;
diff --git a/src/datavisualization/engine/drawer.cpp b/src/datavisualization/engine/drawer.cpp
index 9d50186d..b3b0fe99 100644
--- a/src/datavisualization/engine/drawer.cpp
+++ b/src/datavisualization/engine/drawer.cpp
@@ -93,12 +93,6 @@ void Drawer::setStyle(QDataVis::LabelStyle style)
void Drawer::drawObject(ShaderHelper *shader, AbstractObjectHelper *object, GLuint textureId,
GLuint depthTextureId)
{
- // Store the GL state before changing
- GLint oldActiveTex[1];
- glGetIntegerv(GL_ACTIVE_TEXTURE, oldActiveTex);
- GLint oldTexId[1];
- glGetIntegerv(GL_TEXTURE_BINDING_2D, oldTexId);
-
if (textureId) {
// Activate texture
glActiveTexture(GL_TEXTURE0);
@@ -147,8 +141,8 @@ void Drawer::drawObject(ShaderHelper *shader, AbstractObjectHelper *object, GLui
glDisableVertexAttribArray(shader->posAtt());
// Restore the GL state
- glActiveTexture(*oldActiveTex);
- glBindTexture(GL_TEXTURE_2D, *oldTexId);
+ glActiveTexture(0);
+ glBindTexture(GL_TEXTURE_2D, 0);
}
void Drawer::drawSurfaceGrid(ShaderHelper *shader, SurfaceObject *object)
diff --git a/src/datavisualization/global/qdatavisualizationglobal.h b/src/datavisualization/global/qdatavisualizationglobal.h
index ac734960..eefa2888 100644
--- a/src/datavisualization/global/qdatavisualizationglobal.h
+++ b/src/datavisualization/global/qdatavisualizationglobal.h
@@ -21,13 +21,13 @@
#include <qglobal.h>
-#define QT_DATAVISUALIZATION_VERSION_STR "0.0.1"
+#define QT_DATAVISUALIZATION_VERSION_STR "0.1.0"
/*
QT_DATAVISUALIZATION_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_DATAVISUALIZATION_VERSION 0x000001
+#define QT_DATAVISUALIZATION_VERSION 0x000100
/*
- can be used like #if (QT_DATAVISUALIZATION_VERSION >= QT_DATAVISUALIZATION_VERSION_CHECK(1, 1, 0))
+ can be used like #if (QT_DATAVISUALIZATION_VERSION >= QT_DATAVISUALIZATION_VERSION_CHECK(1, 0, 0))
*/
#define QT_DATAVISUALIZATION_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))