summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-1.1.01
-rw-r--r--examples/datavisualization/audiolevels/audiolevels.cpp50
-rw-r--r--src/datavisualization/engine/q3dbars.cpp12
-rw-r--r--src/datavisualization/engine/q3dscatter.cpp8
-rw-r--r--src/datavisualization/engine/q3dsurface.cpp10
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp3
6 files changed, 51 insertions, 33 deletions
diff --git a/dist/changes-1.1.0 b/dist/changes-1.1.0
index 8a470ccb..7d27438b 100644
--- a/dist/changes-1.1.0
+++ b/dist/changes-1.1.0
@@ -57,7 +57,6 @@ General:
- Surface3D: Fixed a crash when shadows were supported by OpenGL but flat shading was not.
- Surface3D: Selection texture no longer gets corrupted in case there are multiple surfaces
visible and the axis ranges are adjusted.
-- Surface3D: Fixed shadow culling, improving the shadow cast on the surface itself.
New examples
------------
diff --git a/examples/datavisualization/audiolevels/audiolevels.cpp b/examples/datavisualization/audiolevels/audiolevels.cpp
index 81059460..672e4984 100644
--- a/examples/datavisualization/audiolevels/audiolevels.cpp
+++ b/examples/datavisualization/audiolevels/audiolevels.cpp
@@ -25,6 +25,7 @@
#include <QtDataVisualization/q3dcamera.h>
#include <QtDataVisualization/qbar3dseries.h>
#include <QtDataVisualization/q3dtheme.h>
+#include <QtDataVisualization/qcustom3dlabel.h>
#include <QtMultimedia/QAudioDeviceInfo>
#include <QtMultimedia/QAudioInput>
@@ -59,31 +60,48 @@ AudioLevels::AudioLevels(Q3DBars *graph, QObject *parent)
//! [0]
QAudioDeviceInfo inputDevice = QAudioDeviceInfo::defaultInputDevice();
- QAudioFormat formatAudio;
- formatAudio.setSampleRate(inputDevice.supportedSampleRates().at(0));
- formatAudio.setChannelCount(inputDevice.supportedChannelCounts().at(0));
- formatAudio.setSampleSize(inputDevice.supportedSampleSizes().at(0));
- formatAudio.setCodec(inputDevice.supportedCodecs().at(0));
- formatAudio.setByteOrder(QAudioFormat::LittleEndian);
- formatAudio.setSampleType(QAudioFormat::UnSignedInt);
+ if (inputDevice.supportedSampleRates().size() > 0
+ && inputDevice.supportedChannelCounts().size() > 0
+ && inputDevice.supportedSampleSizes().size() > 0
+ && inputDevice.supportedCodecs().size() > 0) {
+ QAudioFormat formatAudio;
+ formatAudio.setSampleRate(inputDevice.supportedSampleRates().at(0));
+ formatAudio.setChannelCount(inputDevice.supportedChannelCounts().at(0));
+ formatAudio.setSampleSize(inputDevice.supportedSampleSizes().at(0));
+ formatAudio.setCodec(inputDevice.supportedCodecs().at(0));
+ formatAudio.setByteOrder(QAudioFormat::LittleEndian);
+ formatAudio.setSampleType(QAudioFormat::UnSignedInt);
- m_audioInput = new QAudioInput(inputDevice, formatAudio, this);
+ m_audioInput = new QAudioInput(inputDevice, formatAudio, this);
#ifdef Q_OS_MAC
- // Mac seems to wait for entire buffer to fill before calling writeData, so use smaller buffer
- m_audioInput->setBufferSize(256);
+ // Mac seems to wait for entire buffer to fill before calling writeData, so use smaller buffer
+ m_audioInput->setBufferSize(256);
#else
- m_audioInput->setBufferSize(1024);
+ m_audioInput->setBufferSize(1024);
#endif
- m_device = new AudioLevelsIODevice(m_graph->seriesList().at(0)->dataProxy(), this);
- m_device->open(QIODevice::WriteOnly);
+ m_device = new AudioLevelsIODevice(m_graph->seriesList().at(0)->dataProxy(), this);
+ m_device->open(QIODevice::WriteOnly);
- m_audioInput->start(m_device);
+ m_audioInput->start(m_device);
+ } else {
+ // No graph content can be shown, so add a custom warning label
+ QCustom3DLabel *titleLabel = new QCustom3DLabel("No valid audio input device found",
+ QFont(),
+ QVector3D(0.2f, 0.2f, 0.0f),
+ QVector3D(1.0f, 1.0f, 0.0f),
+ QQuaternion());
+ titleLabel->setPositionAbsolute(true);
+ titleLabel->setFacingCamera(true);
+ m_graph->addCustomItem(titleLabel);
+ }
//! [0]
}
AudioLevels::~AudioLevels()
{
- m_audioInput->stop();
- m_device->close();
+ if (m_audioInput)
+ m_audioInput->stop();
+ if (m_device)
+ m_device->close();
}
diff --git a/src/datavisualization/engine/q3dbars.cpp b/src/datavisualization/engine/q3dbars.cpp
index a903d831..bb7aca89 100644
--- a/src/datavisualization/engine/q3dbars.cpp
+++ b/src/datavisualization/engine/q3dbars.cpp
@@ -41,9 +41,6 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
* Row and column labels are taken from the first added series, unless explicitly defined to
* row and column axes.
*
- * Methods are provided for changing themes, bar selection modes and so on. See the
- * methods for more detailed descriptions.
- *
* \section1 How to construct a minimal Q3DBars graph
*
* First, construct an instance of Q3DBars. Since we are running the graph as top level window
@@ -78,10 +75,9 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*
* \image q3dbars-minimal.png
*
- * The scene can be rotated, zoomed into, and a bar can be selected to view it's value,
+ * The scene can be rotated, zoomed into, and a bar can be selected to view its value,
* but no other interaction is included in this minimal code example. You can learn more by
- * familiarizing yourself with the examples provided, like the \l{Bars Example} or
- * the \l{Custom Proxy Example}.
+ * familiarizing yourself with the examples provided, like the \l{Bars Example}.
*
* \sa Q3DScatter, Q3DSurface, {Qt Data Visualization C++ Classes}
*/
@@ -135,12 +131,12 @@ QBar3DSeries *Q3DBars::primarySeries() const
/*!
* Adds the \a series to the graph. A graph can contain multiple series, but only one set of axes,
* so the rows and columns of all series must match for the visualized data to be meaningful.
- * If the graph has multiple visible series, only the first one added will
+ * If the graph has multiple visible series, only the primary series will
* generate the row or column labels on the axes in cases where the labels are not explicitly set
* to the axes. If the newly added series has specified a selected bar, it will be highlighted and
* any existing selection will be cleared. Only one added series can have an active selection.
*
- * /sa seriesList()
+ * /sa seriesList(), primarySeries
*/
void Q3DBars::addSeries(QBar3DSeries *series)
{
diff --git a/src/datavisualization/engine/q3dscatter.cpp b/src/datavisualization/engine/q3dscatter.cpp
index 40bd5021..c6937207 100644
--- a/src/datavisualization/engine/q3dscatter.cpp
+++ b/src/datavisualization/engine/q3dscatter.cpp
@@ -39,9 +39,6 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*
* Q3DScatter supports more than one series visible at the same time.
*
- * Methods are provided for changing themes, item selection modes and so on. See the
- * methods for more detailed descriptions.
- *
* \section1 How to construct a minimal Q3DScatter graph
*
* First, construct Q3DScatter. Since we are running the graph as top level window
@@ -66,8 +63,9 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*
* \image q3dscatter-minimal.png
*
- * The scene can be rotated and zoomed into, but no other interaction is included in this minimal
- * code example. You can learn more by familiarizing yourself with the examples provided, like
+ * The scene can be rotated, zoomed into, and an item can be selected to view its position,
+ * but no other interaction is included in this minimal code example.
+ * You can learn more by familiarizing yourself with the examples provided, like
* the \l{Scatter Example}.
*
* \sa Q3DBars, Q3DSurface, {Qt Data Visualization C++ Classes}
diff --git a/src/datavisualization/engine/q3dsurface.cpp b/src/datavisualization/engine/q3dsurface.cpp
index 162b7a67..c5ce29d7 100644
--- a/src/datavisualization/engine/q3dsurface.cpp
+++ b/src/datavisualization/engine/q3dsurface.cpp
@@ -77,8 +77,10 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION
*
* \image q3dsurface-minimal.png
*
- * The scene can be rotated and zoomed into, but no other interaction is included in this minimal
- * code example.
+ * The scene can be rotated, zoomed into, and a surface point can be selected to view its position,
+ * but no other interaction is included in this minimal code example.
+ * You can learn more by familiarizing yourself with the examples provided,
+ * like the \l{Surface Example}.
*
*
* \sa Q3DBars, Q3DScatter, {Qt Data Visualization C++ Classes}
@@ -106,7 +108,9 @@ Q3DSurface::~Q3DSurface()
}
/*!
- * Adds the \a series to the graph.
+ * Adds the \a series to the graph. A graph can contain multiple series, but has only one set of
+ * axes. If the newly added series has specified a selected item, it will be highlighted and
+ * any existing selection will be cleared. Only one added series can have an active selection.
*/
void Q3DSurface::addSeries(QSurface3DSeries *series)
{
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index e4dfebfc..38c8d8fe 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -1126,6 +1126,9 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle)
}
}
+ glEnable(GL_CULL_FACE);
+ glCullFace(GL_FRONT);
+
Abstract3DRenderer::drawCustomItems(RenderingDepth, m_depthShader, viewMatrix,
projectionViewMatrix, depthProjectionViewMatrix,
m_depthTexture, m_shadowQualityToShader);