diff options
Diffstat (limited to 'src/datavis3d/data')
-rw-r--r-- | src/datavis3d/data/data.pri | 14 | ||||
-rw-r--r-- | src/datavis3d/data/maprenderitem.cpp | 43 | ||||
-rw-r--r-- | src/datavis3d/data/maprenderitem_p.h | 68 | ||||
-rw-r--r-- | src/datavis3d/data/qabstractdataproxy.h | 5 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdatamapping.cpp | 165 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdatamapping.h | 67 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdatamapping_p.h | 56 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdataproxy.cpp | 347 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdataproxy.h | 58 | ||||
-rw-r--r-- | src/datavis3d/data/qitemmodelmapdataproxy_p.h | 81 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataitem.cpp | 121 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataitem.h | 57 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataitem_p.h | 52 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataproxy.cpp | 183 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataproxy.h | 84 | ||||
-rw-r--r-- | src/datavis3d/data/qmapdataproxy_p.h | 58 | ||||
-rw-r--r-- | src/datavis3d/data/scatterrenderitem_p.h | 1 |
17 files changed, 2 insertions, 1458 deletions
diff --git a/src/datavis3d/data/data.pri b/src/datavis3d/data/data.pri index 873b9a0e..312a8658 100644 --- a/src/datavis3d/data/data.pri +++ b/src/datavis3d/data/data.pri @@ -12,20 +12,11 @@ HEADERS += \ $$PWD/qitemmodelbardatamapping_p.h \ $$PWD/qitemmodelbardataproxy_p.h \ $$PWD/qitemmodelbardataproxy.h \ - $$PWD/maprenderitem_p.h \ - $$PWD/qmapdataitem.h \ - $$PWD/qmapdataitem_p.h \ - $$PWD/qmapdataproxy.h \ - $$PWD/qmapdataproxy_p.h \ $$PWD/scatterrenderitem_p.h \ $$PWD/qscatterdataitem.h \ $$PWD/qscatterdataitem_p.h \ $$PWD/qscatterdataproxy.h \ $$PWD/qscatterdataproxy_p.h \ - $$PWD/qitemmodelmapdatamapping.h \ - $$PWD/qitemmodelmapdatamapping_p.h \ - $$PWD/qitemmodelmapdataproxy.h \ - $$PWD/qitemmodelmapdataproxy_p.h \ $$PWD/qitemmodelscatterdatamapping.h \ $$PWD/qitemmodelscatterdatamapping_p.h \ $$PWD/qitemmodelscatterdataproxy.h \ @@ -45,14 +36,9 @@ SOURCES += \ $$PWD/qbardataitem.cpp \ $$PWD/qitemmodelbardatamapping.cpp \ $$PWD/qitemmodelbardataproxy.cpp \ - $$PWD/maprenderitem.cpp \ - $$PWD/qmapdataitem.cpp \ - $$PWD/qmapdataproxy.cpp \ $$PWD/scatterrenderitem.cpp \ $$PWD/qscatterdataitem.cpp \ $$PWD/qscatterdataproxy.cpp \ - $$PWD/qitemmodelmapdatamapping.cpp \ - $$PWD/qitemmodelmapdataproxy.cpp \ $$PWD/qitemmodelscatterdatamapping.cpp \ $$PWD/qitemmodelscatterdataproxy.cpp \ $$PWD/abstractitemmodelhandler.cpp \ diff --git a/src/datavis3d/data/maprenderitem.cpp b/src/datavis3d/data/maprenderitem.cpp deleted file mode 100644 index d737e6f6..00000000 --- a/src/datavis3d/data/maprenderitem.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 -** -****************************************************************************/ - -#include "maprenderitem_p.h" -#include "maps3drenderer_p.h" // TODO remove when maps refactored -#include "maps3dcontroller_p.h" // TODO should be renderer -#include "qmapdataproxy.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -MapRenderItem::MapRenderItem() - : BarRenderItem() -{ -} - -MapRenderItem::MapRenderItem(const MapRenderItem &other) - : BarRenderItem(other) -{ - m_renderer = other.m_renderer; - m_mapPosition = other.m_mapPosition; - m_itemLabel = other.m_itemLabel; -} - -MapRenderItem::~MapRenderItem() -{ -} - -QT_DATAVIS3D_END_NAMESPACE diff --git a/src/datavis3d/data/maprenderitem_p.h b/src/datavis3d/data/maprenderitem_p.h deleted file mode 100644 index f8f877af..00000000 --- a/src/datavis3d/data/maprenderitem_p.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QtDataVis3D 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 MAPRENDERITEM_P_H -#define MAPRENDERITEM_P_H - -#include "barrenderitem_p.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class Maps3DRenderer; -class Maps3DController; // TODO remove when maps refactored - -class MapRenderItem : public BarRenderItem -{ -public: - MapRenderItem(); - MapRenderItem(const MapRenderItem &other); - virtual ~MapRenderItem(); - - inline const QPointF &mapPosition() const { return m_mapPosition; } - inline void setMapPosition(const QPointF &pos) { m_mapPosition = pos; } - - inline const QString &itemLabel() const { return m_itemLabel; } - inline void setItemLabel(const QString &label) { m_itemLabel = label; } - - // TODO should be in abstract, but currently there is no abstract renderer - // TODO change when maps refactored - inline void setRenderer(Maps3DController *renderer) { m_renderer = renderer; } - -protected: - Maps3DController *m_renderer; - QPointF m_mapPosition; - QString m_itemLabel; // from QMapDataItem::label() - unformatted item label - - friend class QMapDataItem; -}; - -typedef QVector<MapRenderItem> MapRenderItemArray; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qabstractdataproxy.h b/src/datavis3d/data/qabstractdataproxy.h index 99b28e1f..ccf66b20 100644 --- a/src/datavis3d/data/qabstractdataproxy.h +++ b/src/datavis3d/data/qabstractdataproxy.h @@ -37,9 +37,8 @@ public: enum DataType { DataTypeNone = 0, DataTypeBar = 1, - DataTypeMap = 2, - DataTypeScatter = 4, - DataTypeSurface = 8 + DataTypeScatter = 2, + DataTypeSurface = 4 }; protected: diff --git a/src/datavis3d/data/qitemmodelmapdatamapping.cpp b/src/datavis3d/data/qitemmodelmapdatamapping.cpp deleted file mode 100644 index bdc23b7f..00000000 --- a/src/datavis3d/data/qitemmodelmapdatamapping.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 -** -****************************************************************************/ - -#include "qitemmodelmapdatamapping_p.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -/*! - * \class QItemModelMapDataMapping - * \inmodule QtDataVis3D - * \brief Data model mapping for Q3DMaps. - * \since 1.0.0 - * - * QItemModelMapDataMapping is used to define roles for mapping data in QAbstractItemModel to - * Q3DMaps. - * - * TO BE CHECKED (add more explanations and/or example) - * - * \sa QItemModelMapDataProxy - */ - -/*! - * Constructs QItemModelMapDataMapping with the given \a parent. - */ -QItemModelMapDataMapping::QItemModelMapDataMapping(QObject *parent) - : QObject(parent), - d_ptr(new QItemModelMapDataMappingPrivate(this)) -{ -} - -/*! - * Constructs QItemModelMapDataMapping with \a labelRole, \a xPosRole, \a zPosRole, - * \a valueRole and the given \a parent. - */ -QItemModelMapDataMapping::QItemModelMapDataMapping(const QString &labelRole, - const QString &xPosRole, - const QString &zPosRole, - const QString &valueRole, - QObject *parent) - : QObject(parent), - d_ptr(new QItemModelMapDataMappingPrivate(this)) -{ - d_ptr->m_labelRole = labelRole; - d_ptr->m_xPosRole = xPosRole; - d_ptr->m_zPosRole = zPosRole; - d_ptr->m_valueRole = valueRole; -} - -/*! - * Destroys QItemModelMapDataMapping. - */ -QItemModelMapDataMapping::~QItemModelMapDataMapping() -{ -} - -/*! - * \property QItemModelMapDataMapping::labelRole - * - * Defines the label role for the mapping. - */ -void QItemModelMapDataMapping::setLabelRole(const QString &role) -{ - d_ptr->m_labelRole = role; - emit mappingChanged(); -} - -QString QItemModelMapDataMapping::labelRole() const -{ - return d_ptr->m_labelRole; -} - -/*! - * \property QItemModelMapDataMapping::xPosRole - * - * Defines the x position role for the mapping. - */ -void QItemModelMapDataMapping::setXPosRole(const QString &role) -{ - d_ptr->m_xPosRole = role; - emit mappingChanged(); -} - -QString QItemModelMapDataMapping::xPosRole() const -{ - return d_ptr->m_xPosRole; -} - -/*! - * \property QItemModelMapDataMapping::zPosRole - * - * Defines the z position role for the mapping. - */ -void QItemModelMapDataMapping::setZPosRole(const QString &role) -{ - d_ptr->m_zPosRole = role; - emit mappingChanged(); -} - -QString QItemModelMapDataMapping::zPosRole() const -{ - return d_ptr->m_zPosRole; -} - -/*! - * \property QItemModelMapDataMapping::valueRole - * - * Defines the value role for the mapping. - */ -void QItemModelMapDataMapping::setValueRole(const QString &role) -{ - d_ptr->m_valueRole = role; - emit mappingChanged(); -} - -QString QItemModelMapDataMapping::valueRole() const -{ - return d_ptr->m_valueRole; -} - - -/*! - * Changes \a labelRole, \a xPosRole, \a zPosRole and \a valueRole to the mapping. - * - * Emits mappingChanged() signal after remapping. - */ -void QItemModelMapDataMapping::remap(const QString &labelRole, const QString &xPosRole, - const QString &zPosRole, const QString &valueRole) -{ - d_ptr->m_labelRole = labelRole; - d_ptr->m_xPosRole = xPosRole; - d_ptr->m_zPosRole = zPosRole; - d_ptr->m_valueRole = valueRole; - - emit mappingChanged(); -} - -// QItemModelMapDataMappingPrivate - -QItemModelMapDataMappingPrivate::QItemModelMapDataMappingPrivate(QItemModelMapDataMapping *q) - : QObject(0), - q_ptr(q) -{ -} - -QItemModelMapDataMappingPrivate::~QItemModelMapDataMappingPrivate() -{ -} - -QT_DATAVIS3D_END_NAMESPACE - diff --git a/src/datavis3d/data/qitemmodelmapdatamapping.h b/src/datavis3d/data/qitemmodelmapdatamapping.h deleted file mode 100644 index 6c6acdae..00000000 --- a/src/datavis3d/data/qitemmodelmapdatamapping.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QITEMMODELMAPDATAMAPPING_H -#define QITEMMODELMAPDATAMAPPING_H - -#include <QtDataVis3D/qdatavis3denums.h> -#include <QStringList> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QItemModelMapDataMappingPrivate; - -class QT_DATAVIS3D_EXPORT QItemModelMapDataMapping : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString labelRole READ labelRole WRITE setLabelRole NOTIFY mappingChanged) - Q_PROPERTY(QString xPosRole READ xPosRole WRITE setXPosRole NOTIFY mappingChanged) - Q_PROPERTY(QString zPosRole READ zPosRole WRITE setZPosRole NOTIFY mappingChanged) - Q_PROPERTY(QString valueRole READ valueRole WRITE setValueRole NOTIFY mappingChanged) - -public: - explicit QItemModelMapDataMapping(QObject *parent = 0); - QItemModelMapDataMapping(const QString &labelRole, const QString &xPosRole, - const QString &zPosRole, const QString &valueRole, - QObject *parent = 0); - virtual ~QItemModelMapDataMapping(); - - void setLabelRole(const QString &role); - QString labelRole() const; - void setXPosRole(const QString &role); - QString xPosRole() const; - void setZPosRole(const QString &role); - QString zPosRole() const; - void setValueRole(const QString &role); - QString valueRole() const; - - void remap(const QString &labelRole, const QString &xPosRole, - const QString &zPosRole, const QString &valueRole); - -signals: - void mappingChanged(); - -private: - Q_DISABLE_COPY(QItemModelMapDataMapping) - QScopedPointer<QItemModelMapDataMappingPrivate> d_ptr; -}; - - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qitemmodelmapdatamapping_p.h b/src/datavis3d/data/qitemmodelmapdatamapping_p.h deleted file mode 100644 index c289f565..00000000 --- a/src/datavis3d/data/qitemmodelmapdatamapping_p.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QtDataVis3D 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. - -#include "qitemmodelmapdatamapping.h" - -#ifndef QITEMMODELMAPDATAMAPPING_P_H -#define QITEMMODELMAPDATAMAPPING_P_H - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QItemModelMapDataMappingPrivate : public QObject -{ - Q_OBJECT -public: - QItemModelMapDataMappingPrivate(QItemModelMapDataMapping *q); - virtual ~QItemModelMapDataMappingPrivate(); - -private: - QString m_labelRole; - QString m_xPosRole; - QString m_zPosRole; - QString m_valueRole; - - QItemModelMapDataMapping *q_ptr; - - friend class QItemModelMapDataMapping; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qitemmodelmapdataproxy.cpp b/src/datavis3d/data/qitemmodelmapdataproxy.cpp deleted file mode 100644 index 6288d979..00000000 --- a/src/datavis3d/data/qitemmodelmapdataproxy.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 -** -****************************************************************************/ - -#include "qitemmodelmapdataproxy_p.h" -#include <QTimer> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -/*! - * \class QItemModelMapDataProxy - * \inmodule QtDataVis3D - * \brief Proxy class for Q3DMaps data model mapping. - * \since 1.0.0 - * - * QItemModelMapDataProxy allows you to use QAbstractItemModel derived models as a data source - * for Q3DMaps. It maps roles defined in QItemModelMapDataMapping to roles in the model. - */ - -/*! - * Constructs QItemModelMapDataProxy. - */ -QItemModelMapDataProxy::QItemModelMapDataProxy() : - QMapDataProxy(new QItemModelMapDataProxyPrivate(this)) -{ -} - -/*! - * Constructs QItemModelMapDataProxy with \a itemModel and \a mapping. Does not take ownership of - * the model or the mapping, but does connect to them to listen for changes. - */ -QItemModelMapDataProxy::QItemModelMapDataProxy(QAbstractItemModel *itemModel, - QItemModelMapDataMapping *mapping) : - QMapDataProxy(new QItemModelMapDataProxyPrivate(this)) -{ - dptr()->setItemModel(itemModel); - dptr()->setActiveMapping(mapping); -} - -/*! - * Destroys QItemModelMapDataProxy. - */ -QItemModelMapDataProxy::~QItemModelMapDataProxy() -{ -} - -/*! - * \property QItemModelMapDataProxy::itemModel - * - * Defines item model. Does not take ownership of the model, but does connect to it to listen for - * changes. - */ -void QItemModelMapDataProxy::setItemModel(const QAbstractItemModel *itemModel) -{ - dptr()->setItemModel(itemModel); -} - -const QAbstractItemModel *QItemModelMapDataProxy::itemModel() const -{ - return dptrc()->m_itemModel.data(); -} - -/*! - * \property QItemModelMapDataProxy::activeMapping - * - * Defines data mapping. Proxy takes ownership of the \a mapping. - * Modifying a mapping that is set to the proxy will trigger data set re-resolving. - */ -void QItemModelMapDataProxy::setActiveMapping(QItemModelMapDataMapping *mapping) -{ - dptr()->setActiveMapping(mapping); -} - -QItemModelMapDataMapping *QItemModelMapDataProxy::activeMapping() const -{ - return dptrc()->m_mapping; -} - -/*! - * \internal - */ -QItemModelMapDataProxyPrivate *QItemModelMapDataProxy::dptr() -{ - return static_cast<QItemModelMapDataProxyPrivate *>(d_ptr.data()); -} - -/*! - * \internal - */ -const QItemModelMapDataProxyPrivate *QItemModelMapDataProxy::dptrc() const -{ - return static_cast<const QItemModelMapDataProxyPrivate *>(d_ptr.data()); -} - -// QItemModelMapDataProxyPrivate - -QItemModelMapDataProxyPrivate::QItemModelMapDataProxyPrivate(QItemModelMapDataProxy *q) - : QMapDataProxyPrivate(q), - m_mapping(0), - resolvePending(0) -{ - m_resolveTimer.setSingleShot(true); - QObject::connect(&m_resolveTimer, &QTimer::timeout, - this, &QItemModelMapDataProxyPrivate::handlePendingResolve); -} - -QItemModelMapDataProxyPrivate::~QItemModelMapDataProxyPrivate() -{ -} - -void QItemModelMapDataProxyPrivate::setItemModel(const QAbstractItemModel *itemModel) -{ - if (!m_itemModel.isNull()) - QObject::disconnect(m_itemModel, 0, this, 0); - - m_itemModel = itemModel; - - if (!m_itemModel.isNull()) { - QObject::connect(m_itemModel.data(), &QAbstractItemModel::columnsInserted, - this, &QItemModelMapDataProxyPrivate::handleColumnsInserted); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::columnsMoved, - this, &QItemModelMapDataProxyPrivate::handleColumnsMoved); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::columnsRemoved, - this, &QItemModelMapDataProxyPrivate::handleColumnsRemoved); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::dataChanged, - this, &QItemModelMapDataProxyPrivate::handleDataChanged); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::layoutChanged, - this, &QItemModelMapDataProxyPrivate::handleLayoutChanged); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::modelReset, - this, &QItemModelMapDataProxyPrivate::handleModelReset); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::rowsInserted, - this, &QItemModelMapDataProxyPrivate::handleRowsInserted); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::rowsMoved, - this, &QItemModelMapDataProxyPrivate::handleRowsMoved); - QObject::connect(m_itemModel.data(), &QAbstractItemModel::rowsRemoved, - this, &QItemModelMapDataProxyPrivate::handleRowsRemoved); - } - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); -} - -void QItemModelMapDataProxyPrivate::setActiveMapping(QItemModelMapDataMapping *mapping) -{ - if (m_mapping) { - QObject::disconnect(m_mapping, &QItemModelMapDataMapping::mappingChanged, - this, &QItemModelMapDataProxyPrivate::handleMappingChanged); - } - - m_mapping = mapping; - - if (m_mapping) { - QObject::connect(m_mapping, &QItemModelMapDataMapping::mappingChanged, - this, &QItemModelMapDataProxyPrivate::handleMappingChanged); - } - - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); -} - -void QItemModelMapDataProxyPrivate::handleColumnsInserted(const QModelIndex &parent, - int start, int end) -{ - Q_UNUSED(parent) - Q_UNUSED(start) - Q_UNUSED(end) - - // Resolve new items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleColumnsMoved(const QModelIndex &sourceParent, - int sourceStart, - int sourceEnd, - const QModelIndex &destinationParent, - int destinationColumn) -{ - Q_UNUSED(sourceParent) - Q_UNUSED(sourceStart) - Q_UNUSED(sourceEnd) - Q_UNUSED(destinationParent) - Q_UNUSED(destinationColumn) - - // Resolve moved items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleColumnsRemoved(const QModelIndex &parent, - int start, int end) -{ - Q_UNUSED(parent) - Q_UNUSED(start) - Q_UNUSED(end) - - // Remove old items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleDataChanged(const QModelIndex &topLeft, - const QModelIndex &bottomRight, - const QVector<int> &roles) -{ - Q_UNUSED(topLeft) - Q_UNUSED(bottomRight) - Q_UNUSED(roles) - - // Resolve changed items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleLayoutChanged(const QList<QPersistentModelIndex> &parents, - QAbstractItemModel::LayoutChangeHint hint) -{ - Q_UNUSED(parents) - Q_UNUSED(hint) - - // Resolve moved items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleModelReset() -{ - // Data cleared, reset array - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleRowsInserted(const QModelIndex &parent, - int start, int end) -{ - Q_UNUSED(parent) - Q_UNUSED(start) - Q_UNUSED(end) - - // Resolve new items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleRowsMoved(const QModelIndex &sourceParent, - int sourceStart, - int sourceEnd, - const QModelIndex &destinationParent, - int destinationRow) -{ - Q_UNUSED(sourceParent) - Q_UNUSED(sourceStart) - Q_UNUSED(sourceEnd) - Q_UNUSED(destinationParent) - Q_UNUSED(destinationRow) - - // Resolve moved items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleRowsRemoved(const QModelIndex &parent, int start, int end) -{ - Q_UNUSED(parent) - Q_UNUSED(start) - Q_UNUSED(end) - - // Resolve removed items - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); // TODO Resolving entire model is inefficient -} - -void QItemModelMapDataProxyPrivate::handleMappingChanged() -{ - if (!m_resolveTimer.isActive()) - m_resolveTimer.start(0); -} - -void QItemModelMapDataProxyPrivate::handlePendingResolve() -{ - resolveModel(); -} - -// Resolve entire item model into QMapDataArray. -void QItemModelMapDataProxyPrivate::resolveModel() -{ - if (m_itemModel.isNull() || !m_mapping) { - qptr()->resetArray(0); - return; - } - - static const int noRoleIndex = -1; - - QHash<int, QByteArray> roleHash = m_itemModel->roleNames(); - const int labelRole = roleHash.key(m_mapping->labelRole().toLatin1(), noRoleIndex); - const int xPosRole = roleHash.key(m_mapping->xPosRole().toLatin1(), noRoleIndex); - const int zPosRole = roleHash.key(m_mapping->zPosRole().toLatin1(), noRoleIndex); - // Default valueRole to display role if no mapping - const int valueRole = roleHash.key(m_mapping->valueRole().toLatin1(), Qt::DisplayRole); - const int columnCount = m_itemModel->columnCount(); - const int rowCount = m_itemModel->rowCount(); - const int totalCount = rowCount * columnCount; - int runningCount = 0; - - // Parse data into newProxyArray - QMapDataArray *newProxyArray = new QMapDataArray(totalCount); - for (int i = 0; i < rowCount; i++) { - for (int j = 0; j < columnCount; j++) { - QModelIndex index = m_itemModel->index(i, j); - if (labelRole != noRoleIndex) - (*newProxyArray)[runningCount].setLabel(index.data(labelRole).toString()); - qreal xPos(qreal(0.0)); - qreal yPos(qreal(0.0)); - if (xPosRole != noRoleIndex) - xPos = index.data(xPosRole).toReal(); - if (zPosRole != noRoleIndex) - yPos = index.data(zPosRole).toReal(); // z position is mapped to y of QPoint - (*newProxyArray)[runningCount].setMapPosition(QPointF(xPos, yPos)); - (*newProxyArray)[runningCount].setValue(index.data(valueRole).toReal()); - runningCount++; - } - } - - qDebug() << __FUNCTION__ << "Total count:" << newProxyArray->size(); - - qptr()->resetArray(newProxyArray); -} - -QItemModelMapDataProxy *QItemModelMapDataProxyPrivate::qptr() -{ - return static_cast<QItemModelMapDataProxy *>(q_ptr); -} - -QT_DATAVIS3D_END_NAMESPACE diff --git a/src/datavis3d/data/qitemmodelmapdataproxy.h b/src/datavis3d/data/qitemmodelmapdataproxy.h deleted file mode 100644 index 6d817b46..00000000 --- a/src/datavis3d/data/qitemmodelmapdataproxy.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QITEMMODELMAPDATAPROXY_H -#define QITEMMODELMAPDATAPROXY_H - -#include <QtDataVis3D/qmapdataproxy.h> -#include <QtDataVis3D/qitemmodelmapdatamapping.h> -#include <QAbstractItemModel> -#include <QStringList> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QItemModelMapDataProxyPrivate; - -class QT_DATAVIS3D_EXPORT QItemModelMapDataProxy : public QMapDataProxy -{ - Q_OBJECT - Q_PROPERTY(const QAbstractItemModel* itemModel READ itemModel WRITE setItemModel) - Q_PROPERTY(QItemModelMapDataMapping* activeMapping READ activeMapping WRITE setActiveMapping) - -public: - explicit QItemModelMapDataProxy(); - explicit QItemModelMapDataProxy(QAbstractItemModel *itemModel, QItemModelMapDataMapping *mapping); - virtual ~QItemModelMapDataProxy(); - - void setItemModel(const QAbstractItemModel *itemModel); - const QAbstractItemModel *itemModel() const; - - void setActiveMapping(QItemModelMapDataMapping *mapping); - QItemModelMapDataMapping *activeMapping() const; - -protected: - QItemModelMapDataProxyPrivate *dptr(); - const QItemModelMapDataProxyPrivate *dptrc() const; - -private: - Q_DISABLE_COPY(QItemModelMapDataProxy) -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qitemmodelmapdataproxy_p.h b/src/datavis3d/data/qitemmodelmapdataproxy_p.h deleted file mode 100644 index ce73c54b..00000000 --- a/src/datavis3d/data/qitemmodelmapdataproxy_p.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QtDataVis3D 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 QITEMMODELMAPDATAPROXY_P_H -#define QITEMMODELMAPDATAPROXY_P_H - -#include "qitemmodelmapdataproxy.h" -#include "qmapdataproxy_p.h" -#include <QPointer> -#include <QTimer> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QItemModelMapDataProxyPrivate : public QMapDataProxyPrivate -{ - Q_OBJECT -public: - QItemModelMapDataProxyPrivate(QItemModelMapDataProxy *q); - virtual ~QItemModelMapDataProxyPrivate(); - - void setItemModel(const QAbstractItemModel *itemModel); - void setActiveMapping(QItemModelMapDataMapping *mapping); - -public slots: - void handleColumnsInserted(const QModelIndex &parent, int start, int end); - void handleColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, - const QModelIndex &destinationParent, int destinationColumn); - void handleColumnsRemoved(const QModelIndex &parent, int start, int end); - void handleDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, - const QVector<int> &roles = QVector<int> ()); - void handleLayoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex> (), - QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); - void handleModelReset(); - void handleRowsInserted(const QModelIndex &parent, int start, int end); - void handleRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, - const QModelIndex &destinationParent, int destinationRow); - void handleRowsRemoved(const QModelIndex &parent, int start, int end); - - void handleMappingChanged(); - void handlePendingResolve(); - -private: - void resolveModel(); - QItemModelMapDataProxy *qptr(); - - QPointer<const QAbstractItemModel> m_itemModel; // Not owned - QItemModelMapDataMapping *m_mapping; - bool resolvePending; - QTimer m_resolveTimer; - - friend class QItemModelMapDataProxy; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qmapdataitem.cpp b/src/datavis3d/data/qmapdataitem.cpp deleted file mode 100644 index 47e1a659..00000000 --- a/src/datavis3d/data/qmapdataitem.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 -** -****************************************************************************/ - -#include "qmapdataitem_p.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -/*! - * \class QMapDataItem - * \inmodule QtDataVis3D - * \brief The QMapDataItem class provides a container for resolved data to be added to maps graphs. - * \since 1.0.0 - * - * A QMapDataItem holds data for a single rendered bar in a maps graph. - * Maps data proxies parse data into QMapDataItem instances for visualizing. - * - * \sa QMapDataProxy, {Qt Data Visualization 3D C++ Classes} - */ - -/*! - * Constructs QMapDataItem. - */ -QMapDataItem::QMapDataItem() - : QBarDataItem() -{ -} - -/*! - * Constructs a copy of \a other. - */ -QMapDataItem::QMapDataItem(const QMapDataItem &other) - : QBarDataItem(other) -{ - operator=(other); -} - -/*! - * Destroys QMapDataItem. - */ -QMapDataItem::~QMapDataItem() -{ -} - -/*! - * Assigns a copy of \a other to this object. - */ -QMapDataItem &QMapDataItem::operator=(const QMapDataItem &other) -{ - QBarDataItem::operator =(other); - m_mapPosition = other.m_mapPosition; - m_label = other.m_label; - - return *this; -} - -/*! - * Sets \a position on the map to this data item. - */ -void QMapDataItem::setMapPosition(const QPointF &position) -{ - m_mapPosition = position; -} - -/*! - * \return position of this data item. - */ -QPointF QMapDataItem::mapPosition() const -{ - return m_mapPosition; -} - -/*! - * Sets \a label to this data item. - */ -void QMapDataItem::setLabel(const QString &label) -{ - m_label = label; -} - -/*! - * \return label of this data item. - */ -QString QMapDataItem::label() const -{ - return m_label; -} - -/*! - * \internal - */ -void QMapDataItem::createExtraData() -{ - if (!d_ptr) - d_ptr = new QMapDataItemPrivate; -} - -QMapDataItemPrivate::QMapDataItemPrivate() - : QBarDataItemPrivate() -{ -} - -QMapDataItemPrivate::~QMapDataItemPrivate() -{ -} - -QT_DATAVIS3D_END_NAMESPACE diff --git a/src/datavis3d/data/qmapdataitem.h b/src/datavis3d/data/qmapdataitem.h deleted file mode 100644 index 240b03dd..00000000 --- a/src/datavis3d/data/qmapdataitem.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QMAPDATAITEM_H -#define QMAPDATAITEM_H - -#include <QtDataVis3D/qdatavis3denums.h> -#include <QtDataVis3D/qbardataitem.h> -#include <QPointF> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QMapDataItemPrivate; - -class QT_DATAVIS3D_EXPORT QMapDataItem : public QBarDataItem -{ -public: - QMapDataItem(); - QMapDataItem(const QMapDataItem &other); - ~QMapDataItem(); - - QMapDataItem &operator=(const QMapDataItem &other); - - void setMapPosition(const QPointF &position); - QPointF mapPosition() const; - - void setLabel(const QString &label); - QString label() const; - -protected: - virtual void createExtraData(); - - QMapDataItemPrivate *d_ptr; - -private: - QPointF m_mapPosition; - QString m_label; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qmapdataitem_p.h b/src/datavis3d/data/qmapdataitem_p.h deleted file mode 100644 index 2926e3ef..00000000 --- a/src/datavis3d/data/qmapdataitem_p.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QtDataVis3D 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 QMAPDATAITEM_P_H -#define QMAPDATAITEM_P_H - -#include "datavis3dglobal_p.h" -#include "qmapdataitem.h" -#include "qbardataitem_p.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QMapDataItemPrivate : public QBarDataItemPrivate -{ -public: - QMapDataItemPrivate(); - virtual ~QMapDataItemPrivate(); - - // TODO stores other data for map items besides position - -protected: - friend class QMapDataItem; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qmapdataproxy.cpp b/src/datavis3d/data/qmapdataproxy.cpp deleted file mode 100644 index 1e0db088..00000000 --- a/src/datavis3d/data/qmapdataproxy.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 -** -****************************************************************************/ - -#include "qmapdataproxy.h" -#include "qmapdataproxy_p.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -/*! - * \class QMapDataProxy - * \inmodule QtDataVis3D - * \brief Proxy class for Q3DMaps. - * \since 1.0.0 - * - * QMapDataProxy handles adding, inserting, changing and removing data. - * - * QMapDataProxy takes ownership of all QMapDataArrays and QMapDataItems passed to it. - */ - -/*! - * Constructs QMapDataProxy with the given \a parent. - */ -QMapDataProxy::QMapDataProxy(QObject *parent) : - QAbstractDataProxy(new QMapDataProxyPrivate(this), parent) -{ -} - -/*! - * \internal - */ -QMapDataProxy::QMapDataProxy(QMapDataProxyPrivate *d, QObject *parent) : - QAbstractDataProxy(d, parent) -{ -} - -/*! - * Destroys QMapDataProxy. - */ -QMapDataProxy::~QMapDataProxy() -{ -} - -/*! - * Clears the existing array and takes ownership of the \a newArray. Do not use \a newArray pointer - * to further modify data after QMapDataProxy assumes ownership of it, as such modifications will - * not trigger proper signals. - * Passing null array clears all data. - */ -void QMapDataProxy::resetArray(QMapDataArray *newArray) -{ - if (dptr()->resetArray(newArray)) - emit arrayReset(); -} - -/*! - * \return item count in the array. - */ -int QMapDataProxy::itemCount() const -{ - return dptrc()->m_dataArray.size(); -} - -/*! - * \return pointer to the data array. - */ -const QMapDataArray *QMapDataProxy::array() const -{ - return &dptrc()->m_dataArray; -} - -/*! - * \return pointer to the item at \a index. It is guaranteed to be valid only until next call - * that modifies data. - */ -const QMapDataItem *QMapDataProxy::itemAt(int index) const -{ - return &dptrc()->m_dataArray.at(index); -} - -/*! - * \internal - */ -QMapDataProxyPrivate *QMapDataProxy::dptr() -{ - return static_cast<QMapDataProxyPrivate *>(d_ptr.data()); -} - -/*! - * \internal - */ -const QMapDataProxyPrivate *QMapDataProxy::dptrc() const -{ - return static_cast<const QMapDataProxyPrivate *>(d_ptr.data()); -} - -/*! - * \fn void QMapDataProxy::arrayReset() - * - * Emitted when data array is reset. - */ - -/*! - * \fn void QMapDataProxy::itemsAdded(int startIndex, int count) - * - * Emitted when items have been added. Provides \a startIndex and \a count of items added. - */ - -/*! - * \fn void QMapDataProxy::itemsChanged(int startIndex, int count) - * - * Emitted when items have changed. Provides \a startIndex and \a count of changed items. - */ - -/*! - * \fn void QMapDataProxy::itemsRemoved(int startIndex, int count) - * - * Emitted when items have been removed. Provides \a startIndex and \a count of items removed. - * Index may be over current array size if removed from end. - */ - -/*! - * \fn void QMapDataProxy::itemsInserted(int startIndex, int count) - * - * Emitted when items have been inserted. Provides \a startIndex and \a count of inserted items. - */ - -// QBarDataProxyPrivate - -QMapDataProxyPrivate::QMapDataProxyPrivate(QMapDataProxy *q) - : QAbstractDataProxyPrivate(q, QAbstractDataProxy::DataTypeMap) -{ -} - -QMapDataProxyPrivate::~QMapDataProxyPrivate() -{ - m_dataArray.clear(); -} - -bool QMapDataProxyPrivate::resetArray(QMapDataArray *newArray) -{ - if (!m_dataArray.size() && (!newArray || !newArray->size())) - return false; - - m_dataArray.clear(); - - if (newArray) { - m_dataArray = *newArray; - delete newArray; - } - - return true; -} - -QPair<GLfloat, GLfloat> QMapDataProxyPrivate::limitValues() -{ - QPair<GLfloat, GLfloat> limits = qMakePair(0.0f, 0.0f); - for (int i = 0; i < m_dataArray.size(); i++) { - const QMapDataItem &item = m_dataArray.at(i); - qreal itemValue = item.value(); - if (limits.second < itemValue) - limits.second = itemValue; - if (limits.first > itemValue) - limits.first = itemValue; - } - return limits; -} - -QT_DATAVIS3D_END_NAMESPACE diff --git a/src/datavis3d/data/qmapdataproxy.h b/src/datavis3d/data/qmapdataproxy.h deleted file mode 100644 index f6d281f9..00000000 --- a/src/datavis3d/data/qmapdataproxy.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QMAPDATAPROXY_H -#define QMAPDATAPROXY_H - -#include <QtDataVis3D/qabstractdataproxy.h> -#include <QtDataVis3D/qmapdataitem.h> - -QT_DATAVIS3D_BEGIN_NAMESPACE - -typedef QVector<QMapDataItem> QMapDataArray; - -class QMapDataProxyPrivate; - -class QT_DATAVIS3D_EXPORT QMapDataProxy : public QAbstractDataProxy -{ - Q_OBJECT - -public: - explicit QMapDataProxy(QObject *parent = 0); - virtual ~QMapDataProxy(); - - // TODO: Replace first part of class description in docs with this once all TODOs are done: - /* - * QMapDataProxy handles adding, inserting, changing and removing data. - * QMapDataProxy is optimized to use cases where the only defining characteristics of an individual - * map item are its value and position. Modifying other data such as color or mesh of individual bar - * requires allocating additional data object for the bar. - */ - - int itemCount() const; - const QMapDataArray *array() const; - const QMapDataItem *itemAt(int index) const; // Index needs to exist or this crashes - - void resetArray(QMapDataArray *newArray); - - // TODO void setItem(int index, QMapDataItem *item); - // TODO void setItems(int index, QMapDataArray *items); - - // TODO int addItem(QMapDataItem *item); // returns the index of added item - // TODO int addItems(QMapDataArray *items); // returns the index of added item - - // TODO void insertItem(int index, QMapDataItem *item); - // TODO void insertItems(int index, QMapDataArray *items); - - // TODO void removeItems(int index, int removeCount); - -signals: - void arrayReset(); - void itemsAdded(int startIndex, int count); - void itemsChanged(int startIndex, int count); - void itemsRemoved(int startIndex, int count); - void itemsInserted(int startIndex, int count); - -protected: - explicit QMapDataProxy(QMapDataProxyPrivate *d, QObject *parent = 0); - QMapDataProxyPrivate *dptr(); - const QMapDataProxyPrivate *dptrc() const; - -private: - Q_DISABLE_COPY(QMapDataProxy) - - friend class Maps3DController; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif diff --git a/src/datavis3d/data/qmapdataproxy_p.h b/src/datavis3d/data/qmapdataproxy_p.h deleted file mode 100644 index bf3d1d2c..00000000 --- a/src/datavis3d/data/qmapdataproxy_p.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** 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 QtDataVis3D 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 QtDataVis3D 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 QMAPDATAPROXY_P_H -#define QMAPDATAPROXY_P_H - -#include "qmapdataproxy.h" -#include "qabstractdataproxy_p.h" -#include "qmapdataitem.h" - -QT_DATAVIS3D_BEGIN_NAMESPACE - -class QMapDataProxyPrivate : public QAbstractDataProxyPrivate -{ - Q_OBJECT -public: - QMapDataProxyPrivate(QMapDataProxy *q); - virtual ~QMapDataProxyPrivate(); - - bool resetArray(QMapDataArray *newArray); - - QPair<GLfloat, GLfloat> limitValues(); - -private: - QMapDataArray m_dataArray; - -private: - friend class QMapDataProxy; -}; - -QT_DATAVIS3D_END_NAMESPACE - -#endif // QBARDATAPROXY_P_H diff --git a/src/datavis3d/data/scatterrenderitem_p.h b/src/datavis3d/data/scatterrenderitem_p.h index 6fade03e..cf63ae50 100644 --- a/src/datavis3d/data/scatterrenderitem_p.h +++ b/src/datavis3d/data/scatterrenderitem_p.h @@ -49,7 +49,6 @@ public: //inline qreal size() const { return m_size; } // TODO should be in abstract, but currently there is no abstract renderer - // TODO change when maps refactored inline void setRenderer(Scatter3DRenderer *renderer) { m_renderer = renderer; } protected: |