From d557920485f0cc1094908f72ce3fffcd55acd941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Thu, 13 Jun 2013 06:37:57 +0300 Subject: Q3DBars: Removed obsolete constructor parameters + fixed a bug in resizing (resize after initialized -flag is set, or it won't work) + indentations Change-Id: Ib4ea83455f6cc1b89432b5254b0cfd7f30a6f03a Reviewed-by: Miikka Heikkinen --- src/datavis3d/engine/bars3dshared.cpp | 28 ++++++++++++++-------------- src/datavis3d/engine/q3dbars.cpp | 10 ++-------- src/datavis3d/engine/q3dbars.h | 2 +- 3 files changed, 17 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/datavis3d/engine/bars3dshared.cpp b/src/datavis3d/engine/bars3dshared.cpp index 9f4c3f11..8df8a368 100644 --- a/src/datavis3d/engine/bars3dshared.cpp +++ b/src/datavis3d/engine/bars3dshared.cpp @@ -219,9 +219,6 @@ void Bars3dRenderer::initializeOpenGL() m_textureHelper = new TextureHelper(); m_drawer->initializeOpenGL(); - // Resize in case we've missed resize events - resizeNotify(); - // Initialize shaders #if !defined(QT_OPENGL_ES_2) if (m_shadowQuality > ShadowNone) { @@ -311,6 +308,9 @@ void Bars3dRenderer::initializeOpenGL() // Set initialized -flag m_isInitialized = true; + // Resize in case we've missed resize events + resizeNotify(); + // Load background mesh loadBackgroundMesh(); } @@ -935,7 +935,7 @@ void Bars3dRenderer::drawScene() GLfloat lightStrength = m_theme->m_lightStrength; if (m_selectionMode > ModeNone) { Bars3dRenderer::SelectionType selectionType = isSelected(row, bar, - selection); + selection); switch (selectionType) { case Bars3dRenderer::SelectionBar: { barColor = Utils::vectorFromColor(m_theme->m_highlightBarColor); @@ -1779,7 +1779,7 @@ void Bars3dRenderer::setMeshFileName(const QString &objFileName) } void Bars3dRenderer::setupSampleSpace(int samplesRow, int samplesColumn, const QString &labelRow, - const QString &labelColumn, const QString &labelHeight) + const QString &labelColumn, const QString &labelHeight) { // Disable zoom mode if we're in it (causes crash if not, as zoom selection is deleted) closeZoomMode(); @@ -1849,7 +1849,7 @@ void Bars3dRenderer::setTheme(ColorTheme theme) } void Bars3dRenderer::setBarColor(QColor baseColor, QColor heightColor, QColor depthColor, - bool uniform) + bool uniform) { m_theme->m_baseColor = baseColor; m_theme->m_heightColor = heightColor; @@ -2033,7 +2033,7 @@ void Bars3dRenderer::setTickCount(GLint tickCount, GLfloat step, GLfloat minimum } void Bars3dRenderer::addDataRow(const QVector &dataRow, const QString &labelRow, - const QVector &labelsColumn) + const QVector &labelsColumn) { // Convert to QDataRow and add to QDataSet QDataRow *row = new QDataRow(labelRow); @@ -2048,7 +2048,7 @@ void Bars3dRenderer::addDataRow(const QVector &dataRow, const QString &la } void Bars3dRenderer::addDataRow(const QVector &dataRow, const QString &labelRow, - const QVector &labelsColumn) + const QVector &labelsColumn) { // Convert to QDataRow and add to QDataSet QDataRow *row = new QDataRow(labelRow); @@ -2076,8 +2076,8 @@ void Bars3dRenderer::addDataRow(QDataRow *dataRow) } void Bars3dRenderer::addDataSet(const QVector< QVector > &data, - const QVector &labelsRow, - const QVector &labelsColumn) + const QVector &labelsRow, + const QVector &labelsColumn) { // Copy axis labels QString xAxis; @@ -2110,8 +2110,8 @@ void Bars3dRenderer::addDataSet(const QVector< QVector > &data, } void Bars3dRenderer::addDataSet(const QVector< QVector > &data, - const QVector &labelsRow, - const QVector &labelsColumn) + const QVector &labelsRow, + const QVector &labelsColumn) { // Copy axis labels QString xAxis; @@ -2308,7 +2308,7 @@ void Bars3dRenderer::initDepthBuffer() #endif void Bars3dRenderer::initBackgroundShaders(const QString &vertexShader, - const QString &fragmentShader) + const QString &fragmentShader) { if (m_backgroundShader) delete m_backgroundShader; @@ -2353,7 +2353,7 @@ void Bars3dRenderer::calculateHeightAdjustment(const QPair &li } Bars3dRenderer::SelectionType Bars3dRenderer::isSelected(GLint row, GLint bar, - const QVector3D &selection) + const QVector3D &selection) { //static QVector3D prevSel = selection; // TODO: For debugging SelectionType isSelectedType = SelectionNone; diff --git a/src/datavis3d/engine/q3dbars.cpp b/src/datavis3d/engine/q3dbars.cpp index fe50d5fe..2d10859d 100644 --- a/src/datavis3d/engine/q3dbars.cpp +++ b/src/datavis3d/engine/q3dbars.cpp @@ -225,16 +225,10 @@ QTENTERPRISE_DATAVIS3D_BEGIN_NAMESPACE */ /*! - * \a fbohandle Handle to QML2 scene graph's framebuffer object. Developers should not need to - * ever use this directly. Not used when using C++ API. - * - * \a windowsize QML2 window size Developers should not need to ever use this directly. Not - * used when using C++ API. - * * Constructs a new 3D bar window. Parameters are not used unless instantiating from Qt Quick 2. */ -Q3DBars::Q3DBars(GLuint fbohandle, const QSize &windowsize) - : d_ptr(new Q3DBarsPrivate(this, geometry(), fbohandle)) +Q3DBars::Q3DBars() + : d_ptr(new Q3DBarsPrivate(this, geometry(), 0)) { } diff --git a/src/datavis3d/engine/q3dbars.h b/src/datavis3d/engine/q3dbars.h index 03635e4d..c63bfb6e 100644 --- a/src/datavis3d/engine/q3dbars.h +++ b/src/datavis3d/engine/q3dbars.h @@ -66,7 +66,7 @@ class QTENTERPRISE_DATAVIS3D_EXPORT Q3DBars : public Q3DWindow Q_PROPERTY(bool background READ backgroundEnabled WRITE setBackgroundEnabled) public: - explicit Q3DBars(GLuint fbohandle = 0, const QSize &windowsize = QSize()); + explicit Q3DBars(); ~Q3DBars(); // Add a row of data. Each new row is added to the front of the sample space, moving previous -- cgit v1.2.3