From d548ffd13343516ebca70b23d50921a4cb3c8edf Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 6 Jun 2014 14:12:54 +0300 Subject: Doc updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idb05bcede58e56b6eafa8441ef4adaf2e5e74cae Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/q3dbars.cpp | 12 ++++-------- src/datavisualization/engine/q3dscatter.cpp | 8 +++----- src/datavisualization/engine/q3dsurface.cpp | 10 +++++++--- 3 files changed, 14 insertions(+), 16 deletions(-) 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) { -- cgit v1.2.3 From 5aa705f448900cfe9e6a31dca1c0cd5d3e95df7e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 9 Jun 2014 09:27:32 +0300 Subject: Fix audiolevels crash when no audio devices found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia5786ea399e2602cd5c36486c8a0d945bad4fb45 Reviewed-by: Tomi Korpipää --- .../datavisualization/audiolevels/audiolevels.cpp | 50 +++++++++++++++------- 1 file changed, 34 insertions(+), 16 deletions(-) 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 #include #include +#include #include #include @@ -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(); } -- cgit v1.2.3 From e9dc0f74f5cc06eb5edc3c16a63c9e6e89422584 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 9 Jun 2014 09:58:15 +0300 Subject: Revert surface shadow cull disable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix caused weird self-shadowing issues in some cases, needs to be done differently. Change-Id: Ie66b03b6d8c7f480a5822774de76b033586b6a3a Reviewed-by: Tomi Korpipää --- dist/changes-1.1.0 | 1 - src/datavisualization/engine/surface3drenderer.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) 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/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); -- cgit v1.2.3