diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-19 17:16:52 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-04-29 16:22:24 +0000 |
commit | 948d0357850918596b56f38a6dc6e25cd186f5a0 (patch) | |
tree | 2a522442757660b6eadecd3a6decde1f34ab5740 /src | |
parent | ae5ac1128bc61176f797f6e248d18b9ced051ad9 (diff) |
Strip out cloning subsystem
Change-Id: I4def54a11de0f9c676ef6b2d7bd8e723ded25ab9
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
171 files changed, 99 insertions, 1239 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp index cc6b357d0..81573442d 100644 --- a/src/core/nodes/qcomponent.cpp +++ b/src/core/nodes/qcomponent.cpp @@ -110,7 +110,6 @@ QComponent::QComponent(QNode *parent) QComponent::~QComponent() { Q_D(QComponent); - Q_ASSERT_X(d->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DCore::QComponent subclass didn't call QNode::cleanup in its destructor"); for (QEntity *entity : qAsConst(d->m_entities)) { QEntityPrivate *entityPimpl = static_cast<QEntityPrivate *>(QEntityPrivate::get(entity)); @@ -140,16 +139,6 @@ void QComponent::setShareable(bool shareable) } /*! - Copies the \a ref. - */ -void QComponent::copy(const QNode *ref) -{ - QNode::copy(ref); - const QComponent *comp = static_cast<const QComponent *>(ref); - setShareable(comp->isShareable()); -} - -/*! Returns a QVector containing all the entities that reference this component. */ QVector<QEntity *> QComponent::entities() const diff --git a/src/core/nodes/qcomponent.h b/src/core/nodes/qcomponent.h index 070959148..a303b4d5b 100644 --- a/src/core/nodes/qcomponent.h +++ b/src/core/nodes/qcomponent.h @@ -70,7 +70,6 @@ Q_SIGNALS: protected: QComponent(QComponentPrivate &dd, QNode *parent = Q_NULLPTR); - void copy(const QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QComponent) diff --git a/src/core/nodes/qentity.cpp b/src/core/nodes/qentity.cpp index 2e84e9d69..6e8fbfcb8 100644 --- a/src/core/nodes/qentity.cpp +++ b/src/core/nodes/qentity.cpp @@ -97,11 +97,6 @@ QEntity::~QEntity() const auto components = std::move(d->m_components); for (QComponent *comp : components) removeComponent(comp); - - QMetaObject::invokeMethod(this, "_q_cleanup", Qt::DirectConnection); - // If all children are removed - // That includes the components that are parented by this entity - } /*! \internal */ @@ -111,22 +106,6 @@ QEntity::QEntity(QEntityPrivate &dd, QNode *parent) } /*! - Copies all the properties and components of the Qt3DCore::QEntity \a ref to the - current instance. -*/ -void QEntity::copy(const QNode *ref) -{ - QNode::copy(ref); - const QEntity *entity = static_cast<const QEntity*>(ref); - d_func()->m_visible = entity->d_func()->m_visible; - d_func()->m_parentEntityId = entity->d_func()->parentEntityId(); - - for (QComponent *c : qAsConst(entity->d_func()->m_components)) { - QNode *ccclone = QNode::clone(c); - addComponent(qobject_cast<QComponent *>(ccclone)); - } -} -/*! \typedef Qt3DCore::QComponentVector \relates Qt3DCore::QEntity diff --git a/src/core/nodes/qentity.h b/src/core/nodes/qentity.h index 0560ae256..aa064071c 100644 --- a/src/core/nodes/qentity.h +++ b/src/core/nodes/qentity.h @@ -70,11 +70,10 @@ public: protected: QEntity(QEntityPrivate &dd, QNode *parent = Q_NULLPTR); - void copy(const QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QEntity) - QT3D_CLONEABLE_CUSTOM_DTOR(QEntity) + QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/core/nodes/qnode.cpp b/src/core/nodes/qnode.cpp index 9f31630a6..879ad7a07 100644 --- a/src/core/nodes/qnode.cpp +++ b/src/core/nodes/qnode.cpp @@ -69,7 +69,6 @@ QNodePrivate::QNodePrivate() , m_scene(Q_NULLPTR) , m_id(QNodeId::createId()) , m_blockNotifications(false) - , m_wasCleanedUp(false) , m_hasBackendNode(false) , m_enabled(true) , m_propertyChangesSetup(false) @@ -82,135 +81,42 @@ void QNodePrivate::_q_addChild(QNode *childNode) { Q_ASSERT(childNode); - if (ms_useCloning) { - if (childNode == q_func()) - return; - - // If the scene is null it means that the current node is part of a subtree - // that has been pre-prepared. Therefore the node shouldn't be added by - // itself but only when the root of the said subtree is inserted into an - // existing node whose m_scene member is valid - if (m_scene == Q_NULLPTR) - return; - - QNodeVisitor visitor; - // Recursively set scene and change arbiter for the node subtree - visitor.traverse(childNode, this, &QNodePrivate::setSceneHelper); - - // We notify only if we have a QChangeArbiter - if (m_changeArbiter != Q_NULLPTR) { - QNodePropertyChangePtr e(new QNodePropertyChange(NodeCreated, QSceneChange::Node, m_id)); - e->setPropertyName("node"); - // We need to clone the parent of the childNode we send - QNode *parentClone = QNode::clone(q_func()); - QNode *childClone = Q_NULLPTR; - for (QObject *c : parentClone->children()) { - QNode *clone = qobject_cast<QNode *>(c); - if (clone != Q_NULLPTR && clone->id() == childNode->id()) { - childClone = clone; - break; - } - } - e->setValue(QVariant::fromValue(QNodePtr(childClone, &QNodePrivate::nodePtrDeleter))); - notifyObservers(e); - } + if (!m_scene) + return; - // Handle Entity - Components - visitor.traverse(childNode, this, &QNodePrivate::addEntityComponentToScene); - } else { - if (!m_scene) - return; - - QNodeCreatedChangeGenerator generator(childNode); - const auto creationChanges = generator.creationChanges(); - // TODO: Wrap all creation changes into a single aggregate change to avoid - // hamemring the change arbiter when all of these need to be delivered to - // all of the aspects. - for (const auto &change : creationChanges) - notifyObservers(change); - - // Update the scene - // TODO: Fold this into the QNodeCreatedChangeGenerator so we don't have to - // traverse the sub tree three times! - QNodeVisitor visitor; - visitor.traverse(childNode, this, &QNodePrivate::setSceneHelper); - visitor.traverse(childNode, this, &QNodePrivate::addEntityComponentToScene); - } + QNodeCreatedChangeGenerator generator(childNode); + const auto creationChanges = generator.creationChanges(); + // TODO: Wrap all creation changes into a single aggregate change to avoid + // hamemring the change arbiter when all of these need to be delivered to + // all of the aspects. + for (const auto &change : creationChanges) + notifyObservers(change); + + // Update the scene + // TODO: Fold this into the QNodeCreatedChangeGenerator so we don't have to + // traverse the sub tree three times! + QNodeVisitor visitor; + visitor.traverse(childNode, this, &QNodePrivate::setSceneHelper); + visitor.traverse(childNode, this, &QNodePrivate::addEntityComponentToScene); } // Called by setParent or cleanup (main thread) (could be other thread if created on the backend in a job) void QNodePrivate::_q_removeChild(QNode *childNode) { Q_ASSERT(childNode); - - if (ms_useCloning) { - if (childNode->parent() != q_func()) - qCWarning(Nodes) << Q_FUNC_INFO << "not a child of " << this; - - // Notify only if child isn't a clone - if (m_changeArbiter != Q_NULLPTR) { - QNodePropertyChangePtr e(new QNodePropertyChange(NodeAboutToBeDeleted, QSceneChange::Node, m_id)); - e->setPropertyName("node"); - // We need to clone the parent of the childNode we send - // QNode *parentClone = QNode::clone(childNode->parentNode()); - // QNode *childClone = Q_NULLPTR; - // Q_FOREACH (QObject *c, parentClone->children()) { - // QNode *clone = qobject_cast<QNode *>(c); - // if (clone != Q_NULLPTR && clone->id() == childNode->id()) { - // childClone = clone; - // break; - // } - // } - - // We cannot clone the parent as it seems that the childNode is already removed - // from the parent when the ChildRemoved event is triggered - // and that would therefore return us a childNode NULL (because not found in the parent's children list) - // and crash the backend - - QNode *childClone = QNode::clone(childNode); - e->setValue(QVariant::fromValue(QNodePtr(childClone, &QNodePrivate::nodePtrDeleter))); - notifyObservers(e); - } - - // Recursively unset the scene on all children - QNodeVisitor visitor; - visitor.traverse(childNode, this, &QNodePrivate::unsetSceneHelper); - } else { - auto childNodePrivate = get(childNode); - if (childNodePrivate->m_hasBackendNode) { - const QDestructionIdAndTypeCollector collector(childNode); - auto destroyedChange = QNodeDestroyedChangePtr::create(childNode, collector.subtreeIdsAndTypes()); - notifyObservers(destroyedChange); - } - - // Update the scene - // TODO: Fold this into the QNodeCreatedChangeGenerator so we don't have to - // traverse the sub tree twice - QNodeVisitor visitor; - visitor.traverse(childNode, this, &QNodePrivate::unsetSceneHelper); + if (childNode->parent() != q_func()) + qCWarning(Nodes) << Q_FUNC_INFO << "not a child of " << this; + + auto childNodePrivate = get(childNode); + if (childNodePrivate->m_hasBackendNode) { + const QDestructionIdAndTypeCollector collector(childNode); + auto destroyedChange = QNodeDestroyedChangePtr::create(childNode, collector.subtreeIdsAndTypes()); + notifyObservers(destroyedChange); } -} -/*! - * This methods can only be called once and takes care of notyfing the backend - * aspects that the current Qt3DCore::QNode instance is about to be destroyed. - * - * \note It must be called by the destructor of every class subclassing - * QNode that is clonable (using the QT3D_CLONEABLE macro). - * - * \internal - */ -void QNodePrivate::_q_cleanup() -{ - if (!m_wasCleanedUp) { - m_wasCleanedUp = true; - Q_Q(QNode); - qCDebug(Nodes) << Q_FUNC_INFO << q; - if (q->parentNode()) - QNodePrivate::get(q->parentNode())->_q_removeChild(q); - // Root element has no parent and therefore we cannot - // call parent->_q_removeChild(); - } + // Update the scene + QNodeVisitor visitor; + visitor.traverse(childNode, this, &QNodePrivate::unsetSceneHelper); } void QNodePrivate::registerNotifiedProperties() @@ -524,26 +430,8 @@ QNode::QNode(QNodePrivate &dd, QNode *parent) } } -/*! - Copies all the attributes from \a ref to the current Qt3DCore::QNode instance. - - \note When subclassing QNode, you should reimplement this method and - always call the copy method on the base class. This will ensure that when cloned, - the QNode is properly initialized. -*/ -void QNode::copy(const QNode *ref) -{ - if (ref) { - d_func()->m_id = ref->d_func()->m_id; - d_func()->m_enabled = ref->d_func()->m_enabled; - setObjectName(ref->objectName()); - } -} - QNode::~QNode() { - Q_ASSERT_X(QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DCore::QNode subclass didn't call QNode::cleanup in its destructor"); - // Create a QNodeDestroyedChange for this node that informs the backend that // this node and all of its children are going away Q_D(QNode); @@ -680,47 +568,6 @@ bool QNode::isEnabled() const return d->m_enabled; } -/*! - Returns a clone of \a node. All the children of \a node are cloned as well. - - \note This is the only way to create two nodes with the same id. -*/ -QNode *QNode::clone(QNode *node) -{ - if (node == Q_NULLPTR) - return Q_NULLPTR; - - static int clearLock = 0; - clearLock++; - - // We keep a reference of clones for the current subtree - // In order to preserve relationships when multiple entities - // reference the same component - QNode *clonedNode = QNodePrivate::m_clonesLookupTable.value(node->id()); - if (clonedNode == Q_NULLPTR) { - clonedNode = node->doClone(); - // doClone, returns new instance with content copied - // and relationships added - Q_ASSERT(node->id() == clonedNode->id()); - QNodePrivate::m_clonesLookupTable.insert(node->id(), clonedNode); - } - for (QObject *c : node->children()) { - QNode *childNode = qobject_cast<QNode *>(c); - if (childNode != Q_NULLPTR) { - QNode *cclone = QNode::clone(childNode); - // We use QObject::setParent instead of QNode::setParent to avoid the - // whole overhead generated by the latter as we are only dealing with clones - if (cclone != Q_NULLPTR) - static_cast<QObject *>(cclone)->setParent(clonedNode); - } - } - - if (--clearLock == 0) // Cloning done - QNodePrivate::m_clonesLookupTable.clear(); - - return clonedNode; -} - QNodeCreatedChangeBasePtr QNode::createNodeCreationChange() const { // TODO: Remove the qDebug() from this default implementation diff --git a/src/core/nodes/qnode.h b/src/core/nodes/qnode.h index cf9ec46a7..c4b42e680 100644 --- a/src/core/nodes/qnode.h +++ b/src/core/nodes/qnode.h @@ -61,27 +61,6 @@ class QAspectEngine; typedef QVector<QNode *> QNodeVector; typedef QSharedPointer<QNode> QNodePtr; -#define QT3DCORE_QUOTE(str) #str -#define QT3D_CLONEABLE(Class) \ - friend class Qt3DCore::QAbstractNodeFactory; \ - QNode *doClone() const Q_DECL_OVERRIDE { \ - Class *clone_ = Qt3DCore::QAbstractNodeFactory::createNode<Class>(QT3DCORE_QUOTE(Class)); \ - clone_->copy(this); \ - return clone_; \ - } \ - public: \ - virtual ~Class() { \ - QMetaObject::invokeMethod(this, "_q_cleanup", Qt::DirectConnection); \ - } - -#define QT3D_CLONEABLE_CUSTOM_DTOR(Class) \ - friend class Qt3DCore::QAbstractNodeFactory; \ - QNode *doClone() const Q_DECL_OVERRIDE { \ - Class *clone_ = Qt3DCore::QAbstractNodeFactory::createNode<Class>(QT3DCORE_QUOTE(Class)); \ - clone_->copy(this); \ - return clone_; \ - } \ - // Each QNode subclass should call QNode::cleanup in it dtor // QNode::cleanup checks that a flags wasn't set to true, // sets it to true and sends a clone to the backend @@ -114,16 +93,11 @@ Q_SIGNALS: void enabledChanged(bool enabled); protected: - // Clone should only be made in the main thread - static QNode *clone(QNode *node); - QNode(QNodePrivate &dd, QNode *parent = Q_NULLPTR); - virtual void copy(const QNode *ref); virtual void sceneChangeEvent(const QSceneChangePtr &change); private: Q_DECLARE_PRIVATE(QNode) - virtual QNode *doClone() const = 0; // TODO: Make this pure virtual once all classes have been adapted virtual QNodeCreatedChangeBasePtr createNodeCreationChange() const; @@ -133,7 +107,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_addChild(Qt3DCore::QNode *)) Q_PRIVATE_SLOT(d_func(), void _q_removeChild(Qt3DCore::QNode *)) - Q_PRIVATE_SLOT(d_func(), void _q_cleanup()) friend class QAspectEngine; friend class QAspectEnginePrivate; diff --git a/src/core/nodes/qnode_p.h b/src/core/nodes/qnode_p.h index 3b0ee3773..0851985bb 100644 --- a/src/core/nodes/qnode_p.h +++ b/src/core/nodes/qnode_p.h @@ -89,7 +89,6 @@ public: QScene *m_scene; mutable QNodeId m_id; bool m_blockNotifications; - bool m_wasCleanedUp; bool m_hasBackendNode; bool m_enabled; @@ -99,7 +98,6 @@ public: private: void _q_addChild(QNode *childNode); void _q_removeChild(QNode *childNode); - void _q_cleanup(); void registerNotifiedProperties(); void unregisterNotifiedProperties(); void propertyChanged(int propertyIndex); diff --git a/src/core/nodes/qnodecreatedchangegenerator_p.h b/src/core/nodes/qnodecreatedchangegenerator_p.h index 7011af526..8bec039c3 100644 --- a/src/core/nodes/qnodecreatedchangegenerator_p.h +++ b/src/core/nodes/qnodecreatedchangegenerator_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE namespace Qt3DCore { -class QNodeCreatedChangeGenerator +class Q_AUTOTEST_EXPORT QNodeCreatedChangeGenerator { public: QNodeCreatedChangeGenerator(QNode *rootNode); diff --git a/src/core/transforms/qtransform.cpp b/src/core/transforms/qtransform.cpp index 960cce33c..b00940a7a 100644 --- a/src/core/transforms/qtransform.cpp +++ b/src/core/transforms/qtransform.cpp @@ -186,20 +186,6 @@ QTransform::QTransform(QTransformPrivate &dd, QNode *parent) { } -void QTransform::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QTransform *transform = static_cast<const QTransform *>(ref); - // We need to copy the matrix with all the pending - // transformations applied - d_func()->m_matrix = transform->matrix(); - d_func()->m_rotation = transform->rotation(); - d_func()->m_scale = transform->scale3D(); - d_func()->m_translation = transform->translation(); - d_func()->m_eulerRotationAngles = transform->d_func()->m_eulerRotationAngles; - d_func()->m_matrixDirty = transform->d_func()->m_matrixDirty; -} - void QTransform::setMatrix(const QMatrix4x4 &m) { Q_D(QTransform); diff --git a/src/core/transforms/qtransform.h b/src/core/transforms/qtransform.h index e8dab0758..a07da2533 100644 --- a/src/core/transforms/qtransform.h +++ b/src/core/transforms/qtransform.h @@ -114,11 +114,9 @@ Q_SIGNALS: protected: QTransform(QTransformPrivate &dd, QNode *parent = Q_NULLPTR); - void copy(const QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QTransform) - QT3D_CLONEABLE(QTransform) QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qabstractphysicaldevice.cpp b/src/input/frontend/qabstractphysicaldevice.cpp index ab56ca57b..1d876133f 100644 --- a/src/input/frontend/qabstractphysicaldevice.cpp +++ b/src/input/frontend/qabstractphysicaldevice.cpp @@ -90,14 +90,6 @@ QAbstractPhysicalDevice::QAbstractPhysicalDevice(QAbstractPhysicalDevicePrivate } /*! - Deletes the QAbstractPhysicalDevice instance. - */ -QAbstractPhysicalDevice::~QAbstractPhysicalDevice() -{ - Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DInput::QAbstractPhysicalDevice subclass didn't call QNode::cleanup in its destructor"); -} - -/*! Return the number of axis this device has. */ int QAbstractPhysicalDevice::axisCount() const @@ -224,15 +216,6 @@ void QAbstractPhysicalDevicePrivate::postButtonEvent(int button, qreal value) notifyObservers(change); } -void QAbstractPhysicalDevice::copy(const QNode *ref) -{ - QNode::copy(ref); - const QAbstractPhysicalDevice *physicalDevice = static_cast<const QAbstractPhysicalDevice *>(ref); - d_func()->m_axisSettings = physicalDevice->d_func()->m_axisSettings; - d_func()->m_axesHash = physicalDevice->d_func()->m_axesHash; - d_func()->m_buttonsHash = physicalDevice->d_func()->m_buttonsHash; -} - Qt3DCore::QNodeCreatedChangeBasePtr QAbstractPhysicalDevice::createNodeCreationChange() const { auto creationChange = QPhysicalDeviceCreatedChangeBasePtr::create(this); diff --git a/src/input/frontend/qabstractphysicaldevice.h b/src/input/frontend/qabstractphysicaldevice.h index 1836c0e9d..94b23bd14 100644 --- a/src/input/frontend/qabstractphysicaldevice.h +++ b/src/input/frontend/qabstractphysicaldevice.h @@ -58,7 +58,6 @@ class QT3DINPUTSHARED_EXPORT QAbstractPhysicalDevice : public Qt3DCore::QNode Q_OBJECT public: explicit QAbstractPhysicalDevice(Qt3DCore::QNode *parent = Q_NULLPTR); - ~QAbstractPhysicalDevice(); virtual int axisCount() const; virtual int buttonCount() const; @@ -75,7 +74,6 @@ public: protected: QAbstractPhysicalDevice(QAbstractPhysicalDevicePrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); Q_DECLARE_PRIVATE(QAbstractPhysicalDevice) - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qaction.cpp b/src/input/frontend/qaction.cpp index 76422ee98..987ce6ca1 100644 --- a/src/input/frontend/qaction.cpp +++ b/src/input/frontend/qaction.cpp @@ -155,14 +155,6 @@ QVector<QAbstractActionInput *> QAction::inputs() const return d->m_inputs; } -void QAction::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QAction *action = static_cast<const QAction *>(ref); - Q_FOREACH (QAbstractActionInput *input, action->inputs()) - d_func()->m_inputs.append(qobject_cast<QAbstractActionInput *>(QNode::clone(input))); -} - void QAction::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QAction); diff --git a/src/input/frontend/qaction.h b/src/input/frontend/qaction.h index e7643d8d1..442d58e7c 100644 --- a/src/input/frontend/qaction.h +++ b/src/input/frontend/qaction.h @@ -67,12 +67,10 @@ Q_SIGNALS: void activeChanged(bool isActive); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QAction) - QT3D_CLONEABLE(QAction) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qactioninput.cpp b/src/input/frontend/qactioninput.cpp index 3e885c209..666ec493b 100644 --- a/src/input/frontend/qactioninput.cpp +++ b/src/input/frontend/qactioninput.cpp @@ -177,14 +177,6 @@ void QActionInput::setButtons(const QVariantList &buttons) } } -void QActionInput::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QActionInput *input = static_cast<const QActionInput *>(ref); - d_func()->m_sourceDevice = qobject_cast<QAbstractPhysicalDevice *>(QNode::clone(input->d_func()->m_sourceDevice)); - d_func()->m_buttons = input->d_func()->m_buttons; -} - Qt3DCore::QNodeCreatedChangeBasePtr QActionInput::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QActionInputData>::create(this); diff --git a/src/input/frontend/qactioninput.h b/src/input/frontend/qactioninput.h index 9f89b5f15..89c912ef4 100644 --- a/src/input/frontend/qactioninput.h +++ b/src/input/frontend/qactioninput.h @@ -71,12 +71,8 @@ Q_SIGNALS: void sourceDeviceChanged(QAbstractPhysicalDevice *sourceDevice); void buttonsChanged(const QVariantList &buttons); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QActionInput) - QT3D_CLONEABLE(QActionInput) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qaxis.cpp b/src/input/frontend/qaxis.cpp index b506dbc03..d5ffb9cb5 100644 --- a/src/input/frontend/qaxis.cpp +++ b/src/input/frontend/qaxis.cpp @@ -113,15 +113,6 @@ float QAxis::value() const return d->m_value; } -void QAxis::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QAxis *axis = static_cast<const QAxis *>(ref); - Q_FOREACH (QAxisInput *input, axis->inputs()) - d_func()->m_inputs.append(qobject_cast<QAxisInput *>(QNode::clone(input))); - -} - void QAxis::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QAxis); diff --git a/src/input/frontend/qaxis.h b/src/input/frontend/qaxis.h index e84c829b6..d7532d04e 100644 --- a/src/input/frontend/qaxis.h +++ b/src/input/frontend/qaxis.h @@ -66,12 +66,10 @@ Q_SIGNALS: void valueChanged(float value); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QAxis) - QT3D_CLONEABLE(QAxis) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qaxisinput.cpp b/src/input/frontend/qaxisinput.cpp index b1a9b6ec5..e5cb0c054 100644 --- a/src/input/frontend/qaxisinput.cpp +++ b/src/input/frontend/qaxisinput.cpp @@ -131,16 +131,6 @@ QVariantList QAxisInput::buttons() const return d->m_buttons; } -void QAxisInput::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QAxisInput *input = static_cast<const QAxisInput *>(ref); - d_func()->m_sourceDevice = qobject_cast<QAbstractPhysicalDevice *>(QNode::clone(input->d_func()->m_sourceDevice)); - d_func()->m_buttons = input->d_func()->m_buttons; - d_func()->m_scale = input->d_func()->m_scale; - d_func()->m_axis = input->d_func()->m_axis; -} - Qt3DCore::QNodeCreatedChangeBasePtr QAxisInput::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QAxisInputData>::create(this); diff --git a/src/input/frontend/qaxisinput.h b/src/input/frontend/qaxisinput.h index 056af403d..97e3f1eeb 100644 --- a/src/input/frontend/qaxisinput.h +++ b/src/input/frontend/qaxisinput.h @@ -79,12 +79,8 @@ Q_SIGNALS: void axisChanged(int axis); void buttonsChanged(const QVariantList &buttons); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QAxisInput) - QT3D_CLONEABLE(QAxisInput) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qaxissetting.cpp b/src/input/frontend/qaxissetting.cpp index 2a230e69b..7614f9e8d 100644 --- a/src/input/frontend/qaxissetting.cpp +++ b/src/input/frontend/qaxissetting.cpp @@ -115,15 +115,6 @@ void QAxisSetting::setSmoothEnabled(bool enabled) emit smoothChanged(enabled); } -void QAxisSetting::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QAxisSetting *setting = static_cast<const QAxisSetting *>(ref); - d_func()->m_deadZoneRadius = setting->d_func()->m_deadZoneRadius; - d_func()->m_axes = setting->d_func()->m_axes; - d_func()->m_smooth = setting->d_func()->m_smooth; -} - Qt3DCore::QNodeCreatedChangeBasePtr QAxisSetting::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QAxisSettingData>::create(this); diff --git a/src/input/frontend/qaxissetting.h b/src/input/frontend/qaxissetting.h index b2c591ada..033b6fa7b 100644 --- a/src/input/frontend/qaxissetting.h +++ b/src/input/frontend/qaxissetting.h @@ -75,12 +75,8 @@ Q_SIGNALS: void axesChanged(QVariantList axes); void smoothChanged(bool smooth); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QAxisSetting) - QT3D_CLONEABLE(QAxisSetting) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qgenericinputdevice_p.h b/src/input/frontend/qgenericinputdevice_p.h index fd2d516d0..011f3864f 100644 --- a/src/input/frontend/qgenericinputdevice_p.h +++ b/src/input/frontend/qgenericinputdevice_p.h @@ -74,9 +74,6 @@ public: Q_SIGNALS: void axesMapChanged(); void buttonsMapChanged(); - -protected: - QT3D_CLONEABLE(QGenericInputDevice) }; } // Qt3DInput diff --git a/src/input/frontend/qinputchord.cpp b/src/input/frontend/qinputchord.cpp index d012e0b7b..a423abdc0 100644 --- a/src/input/frontend/qinputchord.cpp +++ b/src/input/frontend/qinputchord.cpp @@ -187,15 +187,6 @@ QVector<QAbstractActionInput *> QInputChord::chords() const return d->m_chords; } - -void QInputChord::copy(const Qt3DCore::QNode *ref) -{ - QAbstractActionInput::copy(ref); - const QInputChord *input = static_cast<const QInputChord *>(ref); - d_func()->m_timeout = input->d_func()->m_timeout; - d_func()->m_chords = input->chords(); -} - Qt3DCore::QNodeCreatedChangeBasePtr QInputChord::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QInputChordData>::create(this); diff --git a/src/input/frontend/qinputchord.h b/src/input/frontend/qinputchord.h index ba86eb896..404fc8624 100644 --- a/src/input/frontend/qinputchord.h +++ b/src/input/frontend/qinputchord.h @@ -71,12 +71,8 @@ public Q_SLOTS: Q_SIGNALS: void timeoutChanged(int timeout); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QInputChord) - QT3D_CLONEABLE(QInputChord) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qinputsequence.cpp b/src/input/frontend/qinputsequence.cpp index 3f180c674..c3076466f 100644 --- a/src/input/frontend/qinputsequence.cpp +++ b/src/input/frontend/qinputsequence.cpp @@ -232,14 +232,6 @@ QVector<QAbstractActionInput *> QInputSequence::sequences() const return d->m_sequences; } -void QInputSequence::copy(const Qt3DCore::QNode *ref) -{ - const QInputSequence *input = static_cast<const QInputSequence *>(ref); - d_func()->m_timeout = input->d_func()->m_timeout; - d_func()->m_buttonInterval = input->d_func()->m_buttonInterval; - d_func()->m_sequences = input->sequences(); -} - Qt3DCore::QNodeCreatedChangeBasePtr QInputSequence::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QInputSequenceData>::create(this); diff --git a/src/input/frontend/qinputsequence.h b/src/input/frontend/qinputsequence.h index 07ca7490c..e6b067774 100644 --- a/src/input/frontend/qinputsequence.h +++ b/src/input/frontend/qinputsequence.h @@ -75,12 +75,8 @@ Q_SIGNALS: void timeoutChanged(int timeout); void buttonIntervalChanged(int buttonInterval); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QInputSequence) - QT3D_CLONEABLE(QInputSequence) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qinputsettings.h b/src/input/frontend/qinputsettings.h index 9a5979edb..c306ddd96 100644 --- a/src/input/frontend/qinputsettings.h +++ b/src/input/frontend/qinputsettings.h @@ -66,7 +66,6 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QInputSettings) - QT3D_CLONEABLE(QInputSettings) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qkeyboarddevice.h b/src/input/frontend/qkeyboarddevice.h index dbcf39e5b..70ed438fd 100644 --- a/src/input/frontend/qkeyboarddevice.h +++ b/src/input/frontend/qkeyboarddevice.h @@ -77,7 +77,6 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QKeyboardDevice) - QT3D_CLONEABLE(QKeyboardDevice) void setActiveInput(QKeyboardHandler *activeInput); }; diff --git a/src/input/frontend/qkeyboardhandler.cpp b/src/input/frontend/qkeyboardhandler.cpp index b861298dc..0e9b969d9 100644 --- a/src/input/frontend/qkeyboardhandler.cpp +++ b/src/input/frontend/qkeyboardhandler.cpp @@ -158,17 +158,6 @@ QKeyboardHandler::QKeyboardHandler(QNode *parent) { } -void QKeyboardHandler::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QKeyboardHandler *input = static_cast<const QKeyboardHandler *>(ref); - - // TO DO: We may want to store the keyboard device id and only send a clone when we are the parent - // of the keyboard device - if (input->d_func()->m_keyboardDevice != Q_NULLPTR && input->d_func()->m_keyboardDevice->parent() == ref) - setSourceDevice(qobject_cast<QKeyboardDevice *>(QNode::clone(input->d_func()->m_keyboardDevice))); -} - void QKeyboardHandler::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QKeyboardHandler); diff --git a/src/input/frontend/qkeyboardhandler.h b/src/input/frontend/qkeyboardhandler.h index ed253b309..2a5196775 100644 --- a/src/input/frontend/qkeyboardhandler.h +++ b/src/input/frontend/qkeyboardhandler.h @@ -115,12 +115,10 @@ Q_SIGNALS: void released(Qt3DInput::QKeyEvent *event); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QKeyboardHandler) - QT3D_CLONEABLE(QKeyboardHandler) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qlogicaldevice.cpp b/src/input/frontend/qlogicaldevice.cpp index 96be0438e..9737b4afa 100644 --- a/src/input/frontend/qlogicaldevice.cpp +++ b/src/input/frontend/qlogicaldevice.cpp @@ -246,16 +246,6 @@ QVector<QAxis *> QLogicalDevice::axes() const return d->m_axes; } -void QLogicalDevice::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QLogicalDevice *device = static_cast<const QLogicalDevice *>(ref); - Q_FOREACH (QAction *action, device->actions()) - d_func()->m_actions.push_back(qobject_cast<QAction *>(QNode::clone(action))); - Q_FOREACH (QAxis *axis, device->axes()) - d_func()->m_axes.push_back(qobject_cast<QAxis *>(QNode::clone(axis))); -} - Qt3DCore::QNodeCreatedChangeBasePtr QLogicalDevice::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QLogicalDeviceData>::create(this); diff --git a/src/input/frontend/qlogicaldevice.h b/src/input/frontend/qlogicaldevice.h index f0c7392a1..f42deaa73 100644 --- a/src/input/frontend/qlogicaldevice.h +++ b/src/input/frontend/qlogicaldevice.h @@ -65,12 +65,8 @@ public: void removeAxis(QAxis *axis); QVector<QAxis *> axes() const; -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QLogicalDevice) - QT3D_CLONEABLE(QLogicalDevice) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qmousedevice.cpp b/src/input/frontend/qmousedevice.cpp index 3def81185..49e925a49 100644 --- a/src/input/frontend/qmousedevice.cpp +++ b/src/input/frontend/qmousedevice.cpp @@ -127,13 +127,6 @@ void QMouseDevice::setSensitivity(float value) emit sensitivityChanged(value); } -void QMouseDevice::copy(const Qt3DCore::QNode *ref) -{ - QNode::copy(ref); - const QMouseDevice *object = static_cast<const QMouseDevice *>(ref); - d_func()->m_sensitivity = object->d_func()->m_sensitivity; -} - void QMouseDevice::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_UNUSED(change); diff --git a/src/input/frontend/qmousedevice.h b/src/input/frontend/qmousedevice.h index 32a9d87a9..5ba1be595 100644 --- a/src/input/frontend/qmousedevice.h +++ b/src/input/frontend/qmousedevice.h @@ -81,12 +81,10 @@ Q_SIGNALS: void sensitivityChanged(float value); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QMouseDevice) - QT3D_CLONEABLE(QMouseDevice) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/input/frontend/qmousehandler.cpp b/src/input/frontend/qmousehandler.cpp index 88d12feee..8ff0b0e17 100644 --- a/src/input/frontend/qmousehandler.cpp +++ b/src/input/frontend/qmousehandler.cpp @@ -161,20 +161,6 @@ void QMouseHandler::setContainsMouse(bool contains) } } -void QMouseHandler::copy(const QNode *ref) -{ - Q_D(QMouseHandler); - const QMouseHandler *refInput = static_cast<const QMouseHandler *>(ref); - d->m_containsMouse = refInput->containsMouse(); - - // TODO: We may want to store the device id and only send a clone when we are the parent - // of the device. - // Perhaps it's time to investigate sending a "kernel" or "seed" over to the backend rather - // than a complete clone. - if (refInput && refInput->sourceDevice() && refInput->sourceDevice()->parent() == ref) - d->m_mouseDevice = static_cast<QMouseDevice *>(QNode::clone(refInput->sourceDevice())); -} - void QMouseHandler::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QMouseHandler); diff --git a/src/input/frontend/qmousehandler.h b/src/input/frontend/qmousehandler.h index deca370b4..fbf62a127 100644 --- a/src/input/frontend/qmousehandler.h +++ b/src/input/frontend/qmousehandler.h @@ -84,13 +84,11 @@ Q_SIGNALS: void wheel(Qt3DInput::QWheelEvent *wheel); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; void setContainsMouse(bool contains); private: Q_DECLARE_PRIVATE(QMouseHandler) - QT3D_CLONEABLE(QMouseHandler) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/logic/qframeaction.h b/src/logic/qframeaction.h index 9000c916e..7c04d074a 100644 --- a/src/logic/qframeaction.h +++ b/src/logic/qframeaction.h @@ -69,8 +69,6 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QFrameAction) - QT3D_CLONEABLE(QFrameAction) - void onTriggered(float dt); friend class Logic::Executor; diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp index 176ec0c79..38a343d65 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser.cpp +++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp @@ -312,7 +312,6 @@ public: private: QByteArray m_data; - QT3D_CLONEABLE(AssimpRawTextureImage) class AssimpRawTextureImageFunctor : public QTextureImageDataGenerator { diff --git a/src/quick3d/quick3d/items/quick3dentityloader.cpp b/src/quick3d/quick3d/items/quick3dentityloader.cpp index 0e72cba6b..119b2e66d 100644 --- a/src/quick3d/quick3d/items/quick3dentityloader.cpp +++ b/src/quick3d/quick3d/items/quick3dentityloader.cpp @@ -132,15 +132,6 @@ void Quick3DEntityLoader::setSource(const QUrl &url) d->loadFromSource(); } -void Quick3DEntityLoader::copy(const QNode *ref) -{ - QNode::copy(ref); - const Quick3DEntityLoader *loader = static_cast<const Quick3DEntityLoader*>(ref); - d_func()->m_source = loader->d_func()->m_source; - d_func()->m_entity = static_cast<QEntity*>(QNode::clone(loader->d_func()->m_entity)); - d_func()->m_entity->setParent(this); -} - Quick3DEntityLoaderPrivate::Quick3DEntityLoaderPrivate() : QEntityPrivate(), m_incubator(Q_NULLPTR), diff --git a/src/quick3d/quick3d/items/quick3dentityloader_p.h b/src/quick3d/quick3d/items/quick3dentityloader_p.h index fe470653f..928f31ada 100644 --- a/src/quick3d/quick3d/items/quick3dentityloader_p.h +++ b/src/quick3d/quick3d/items/quick3dentityloader_p.h @@ -86,13 +86,9 @@ Q_SIGNALS: void entityChanged(); void sourceChanged(); -protected: - void copy(const QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(Quick3DEntityLoader) Q_PRIVATE_SLOT(d_func(), void _q_componentStatusChanged(QQmlComponent::Status)) - QT3D_CLONEABLE(Quick3DEntityLoader) }; } // namespace Quick diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp index aff179f17..e9b084a3d 100644 --- a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp +++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp @@ -498,21 +498,22 @@ void Quick3DNodeInstantiator::componentComplete() } } -void Quick3DNodeInstantiator::copy(const QNode *ref) -{ - QNode::copy(ref); - const Quick3DNodeInstantiator *instantiator = static_cast<const Quick3DNodeInstantiator*>(ref); - // We only need to clone the children as the instantiator itself has no - // corresponding backend node type. - for (int i = 0; i < instantiator->d_func()->m_objects.size(); ++i) { - QNode *n = qobject_cast<QNode *>(instantiator->d_func()->m_objects.at(i)); - if (!n) - continue; - QNode *clonedNode = QNode::clone(n); - clonedNode->setParent(this); - d_func()->m_objects.append(clonedNode); - } -} +// TODO: Avoid cloning here +//void Quick3DNodeInstantiator::copy(const QNode *ref) +//{ +// QNode::copy(ref); +// const Quick3DNodeInstantiator *instantiator = static_cast<const Quick3DNodeInstantiator*>(ref); +// // We only need to clone the children as the instantiator itself has no +// // corresponding backend node type. +// for (int i = 0; i < instantiator->d_func()->m_objects.size(); ++i) { +// QNode *n = qobject_cast<QNode *>(instantiator->d_func()->m_objects.at(i)); +// if (!n) +// continue; +// QNode *clonedNode = QNode::clone(n); +// clonedNode->setParent(this); +// d_func()->m_objects.append(clonedNode); +// } +//} } // namespace Quick } // namespace Qt3DCore diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h index d1fc88147..d861fc2fe 100644 --- a/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h +++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator_p.h @@ -112,11 +112,7 @@ Q_SIGNALS: void objectAdded(int index, QObject *object); void objectRemoved(int index, QObject *object); -protected: - void copy(const QNode *ref) Q_DECL_OVERRIDE; - private: - QT3D_CLONEABLE(Quick3DNodeInstantiator) Q_DISABLE_COPY(Quick3DNodeInstantiator) Q_DECLARE_PRIVATE(Quick3DNodeInstantiator) Q_PRIVATE_SLOT(d_func(), void _q_createdItem(int, QObject *)) diff --git a/src/quick3d/quick3drender/items/quick3dparameter_p.h b/src/quick3d/quick3drender/items/quick3dparameter_p.h index 051e7b253..60493973d 100644 --- a/src/quick3d/quick3drender/items/quick3dparameter_p.h +++ b/src/quick3d/quick3drender/items/quick3dparameter_p.h @@ -73,7 +73,6 @@ private: protected: Quick3DParameter(Quick3DParameterPrivate &dd, QNode *parent = 0); - QT3D_CLONEABLE(Quick3DParameter) }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h index ac55e0b5d..72c117c90 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdata_p.h +++ b/src/quick3d/quick3drender/items/quick3dshaderdata_p.h @@ -68,9 +68,6 @@ class QT3DQUICKRENDERSHARED_PRIVATE_EXPORT Quick3DShaderData : public QShaderDat Q_OBJECT public: explicit Quick3DShaderData(QNode *parent = 0); - -private: - QT3D_CLONEABLE(Quick3DShaderData) }; } // namespace Quick diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp index f9522f87d..21dd2525a 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp +++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray.cpp @@ -76,13 +76,14 @@ QVector<QShaderData *> Quick3DShaderDataArray::values() const return d->m_values; } -void Quick3DShaderDataArray::copy(const QNode *ref) -{ - QNode::copy(ref); - const Quick3DShaderDataArray *dataArray = static_cast<const Quick3DShaderDataArray *>(ref); - Q_FOREACH (QShaderData *v, dataArray->d_func()->m_values) - d_func()->m_values.append(static_cast<QShaderData *>(QNode::clone(v))); -} +// TODO: Avoid cloning here +//void Quick3DShaderDataArray::copy(const QNode *ref) +//{ +// QNode::copy(ref); +// const Quick3DShaderDataArray *dataArray = static_cast<const Quick3DShaderDataArray *>(ref); +// Q_FOREACH (QShaderData *v, dataArray->d_func()->m_values) +// d_func()->m_values.append(static_cast<QShaderData *>(QNode::clone(v))); +//} void Quick3DShaderDataArray::appendValue(QQmlListProperty<QShaderData> *list, QShaderData *bar) { diff --git a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h index 7f68e1456..effd18b32 100644 --- a/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h +++ b/src/quick3d/quick3drender/items/quick3dshaderdataarray_p.h @@ -79,16 +79,12 @@ public: QQmlListProperty<QShaderData> valuesList(); QVector<QShaderData *> values() const; -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: static void appendValue(QQmlListProperty<QShaderData> *list, QShaderData *bar); static QShaderData *valueAt(QQmlListProperty<QShaderData> *list, int index); static int valueCount(QQmlListProperty<QShaderData> *list); static void clearValues(QQmlListProperty<QShaderData> *list); Q_DECLARE_PRIVATE(Quick3DShaderDataArray) - QT3D_CLONEABLE(Quick3DShaderDataArray) }; } // namespace Quick diff --git a/src/render/framegraph/qcameraselector.cpp b/src/render/framegraph/qcameraselector.cpp index 81a5ea8ad..452bd71f2 100644 --- a/src/render/framegraph/qcameraselector.cpp +++ b/src/render/framegraph/qcameraselector.cpp @@ -61,20 +61,13 @@ QCameraSelector::QCameraSelector(QCameraSelectorPrivate &dd, QNode *parent) QCameraSelectorPrivate::QCameraSelectorPrivate() : QFrameGraphNodePrivate() , m_camera(Q_NULLPTR) -{} - -void QCameraSelector::copy(const QNode *ref) { - QFrameGraphNode::copy(ref); - const QCameraSelector *other = static_cast<const QCameraSelector*>(ref); - - if (other->d_func()->m_camera) - setCamera(qobject_cast<Qt3DCore::QEntity *>(QNode::clone(other->d_func()->m_camera))); } QCameraSelector::QCameraSelector(Qt3DCore::QNode *parent) : QFrameGraphNode(*new QCameraSelectorPrivate, parent) -{} +{ +} /*! \property Qt3DRender::QCameraSelector::camera diff --git a/src/render/framegraph/qcameraselector.h b/src/render/framegraph/qcameraselector.h index 9e9e9ba55..9ed2b17a1 100644 --- a/src/render/framegraph/qcameraselector.h +++ b/src/render/framegraph/qcameraselector.h @@ -67,10 +67,8 @@ Q_SIGNALS: protected: QCameraSelector(QCameraSelectorPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: - QT3D_CLONEABLE(QCameraSelector) Q_DECLARE_PRIVATE(QCameraSelector) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qclearbuffers.cpp b/src/render/framegraph/qclearbuffers.cpp index 3fbce4016..b241f7bc0 100644 --- a/src/render/framegraph/qclearbuffers.cpp +++ b/src/render/framegraph/qclearbuffers.cpp @@ -53,16 +53,6 @@ QClearBuffersPrivate::QClearBuffersPrivate() { } -void QClearBuffers::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QClearBuffers *b = static_cast<const QClearBuffers*>(ref); - d_func()->m_buffersType = b->d_func()->m_buffersType; - d_func()->m_clearColor = b->d_func()->m_clearColor; - d_func()->m_clearDepthValue = b->d_func()->m_clearDepthValue; - d_func()->m_clearStencilValue = b->d_func()->m_clearStencilValue; -} - QClearBuffers::QClearBuffers(QNode *parent) : QFrameGraphNode(*new QClearBuffersPrivate, parent) { diff --git a/src/render/framegraph/qclearbuffers.h b/src/render/framegraph/qclearbuffers.h index 2f75295cf..75c2c20c4 100644 --- a/src/render/framegraph/qclearbuffers.h +++ b/src/render/framegraph/qclearbuffers.h @@ -92,11 +92,9 @@ Q_SIGNALS: protected: explicit QClearBuffers(QClearBuffersPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QClearBuffers) - QT3D_CLONEABLE(QClearBuffers) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qdispatchcompute.cpp b/src/render/framegraph/qdispatchcompute.cpp index 1d9b72ac1..5f83ffb53 100644 --- a/src/render/framegraph/qdispatchcompute.cpp +++ b/src/render/framegraph/qdispatchcompute.cpp @@ -95,15 +95,6 @@ void QDispatchCompute::setWorkGroupZ(int workGroupZ) } -void QDispatchCompute::copy(const Qt3DCore::QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QDispatchCompute *dispatch = static_cast<const QDispatchCompute *>(ref); - d_func()->m_workGroupX = dispatch->workGroupX(); - d_func()->m_workGroupY = dispatch->workGroupY(); - d_func()->m_workGroupZ = dispatch->workGroupZ(); -} - Qt3DCore::QNodeCreatedChangeBasePtr QDispatchCompute::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QDispatchComputeData>::create(this); diff --git a/src/render/framegraph/qdispatchcompute.h b/src/render/framegraph/qdispatchcompute.h index 7884b80e6..24a4fced1 100644 --- a/src/render/framegraph/qdispatchcompute.h +++ b/src/render/framegraph/qdispatchcompute.h @@ -72,12 +72,7 @@ Q_SIGNALS: void workGroupYChanged(); void workGroupZChanged(); - // QNode interface -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: - QT3D_CLONEABLE(QDispatchCompute) Q_DECLARE_PRIVATE(QDispatchCompute) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qframegraphnode.cpp b/src/render/framegraph/qframegraphnode.cpp index 410bea676..6a707c57c 100644 --- a/src/render/framegraph/qframegraphnode.cpp +++ b/src/render/framegraph/qframegraphnode.cpp @@ -78,11 +78,6 @@ QFrameGraphNode::QFrameGraphNode(QNode *parent) { } -QFrameGraphNode::~QFrameGraphNode() -{ - Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DRender::QFrameGraphNode subclass didn't call QNode::cleanup in its destructor"); -} - /*! Returns a pointer to the parent. */ diff --git a/src/render/framegraph/qframegraphnode.h b/src/render/framegraph/qframegraphnode.h index 5d4441204..fe128e1b7 100644 --- a/src/render/framegraph/qframegraphnode.h +++ b/src/render/framegraph/qframegraphnode.h @@ -55,7 +55,6 @@ class QT3DRENDERSHARED_EXPORT QFrameGraphNode : public Qt3DCore::QNode Q_OBJECT public: explicit QFrameGraphNode(Qt3DCore::QNode *parent = Q_NULLPTR); - ~QFrameGraphNode(); QFrameGraphNode *parentFrameGraphNode() const; diff --git a/src/render/framegraph/qfrustumculling.h b/src/render/framegraph/qfrustumculling.h index 16874f941..5a1bf6e9d 100644 --- a/src/render/framegraph/qfrustumculling.h +++ b/src/render/framegraph/qfrustumculling.h @@ -51,9 +51,6 @@ class QT3DRENDERSHARED_EXPORT QFrustumCulling : public QFrameGraphNode Q_OBJECT public: explicit QFrustumCulling(Qt3DCore::QNode *parent = Q_NULLPTR); - -private: - QT3D_CLONEABLE(QFrustumCulling) }; } // Qt3DRender diff --git a/src/render/framegraph/qlayerfilter.cpp b/src/render/framegraph/qlayerfilter.cpp index 2322bd391..5a9f9d692 100644 --- a/src/render/framegraph/qlayerfilter.cpp +++ b/src/render/framegraph/qlayerfilter.cpp @@ -66,17 +66,6 @@ QLayerFilterPrivate::QLayerFilterPrivate() \brief For ... */ -/*! \fn void Qt3DRender::QLayerFilter::copy(const Qt3DCore::QNode *ref) - Copies the \a ref instance into this one. - */ -void QLayerFilter::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QLayerFilter *layer = static_cast<const QLayerFilter*>(ref); - d_func()->m_layers = layer->d_func()->m_layers; -} - - /*! \fn Qt3DRender::QLayerFilter::QLayerFilter(Qt3DCore::QNode *parent) Constructs a new QLayerFilter with the specified \a parent. */ diff --git a/src/render/framegraph/qlayerfilter.h b/src/render/framegraph/qlayerfilter.h index c1da1c9cb..ccbca2219 100644 --- a/src/render/framegraph/qlayerfilter.h +++ b/src/render/framegraph/qlayerfilter.h @@ -66,11 +66,9 @@ Q_SIGNALS: protected: QLayerFilter(QLayerFilterPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QLayerFilter) - QT3D_CLONEABLE(QLayerFilter) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qnodraw.h b/src/render/framegraph/qnodraw.h index c776f92b1..247d37da1 100644 --- a/src/render/framegraph/qnodraw.h +++ b/src/render/framegraph/qnodraw.h @@ -51,9 +51,6 @@ class QT3DRENDERSHARED_EXPORT QNoDraw : public QFrameGraphNode Q_OBJECT public: explicit QNoDraw(Qt3DCore::QNode *parent = Q_NULLPTR); - -private: - QT3D_CLONEABLE(QNoDraw) }; } // namespace Qt3DRender diff --git a/src/render/framegraph/qrenderpassfilter.cpp b/src/render/framegraph/qrenderpassfilter.cpp index b702a8e1f..472dd2402 100644 --- a/src/render/framegraph/qrenderpassfilter.cpp +++ b/src/render/framegraph/qrenderpassfilter.cpp @@ -103,16 +103,6 @@ void QRenderPassFilter::removeMatch(QFilterKey *filterKey) d->m_matchList.removeOne(filterKey); } -void QRenderPassFilter::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QRenderPassFilter *other = static_cast<const QRenderPassFilter*>(ref); - Q_FOREACH (QFilterKey *c, other->d_func()->m_matchList) - addMatch(qobject_cast<QFilterKey *>(QNode::clone(c))); - for (QParameter *p : other->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); -} - void QRenderPassFilter::addParameter(QParameter *parameter) { Q_ASSERT(parameter); diff --git a/src/render/framegraph/qrenderpassfilter.h b/src/render/framegraph/qrenderpassfilter.h index 6d0ff3904..4a707865a 100644 --- a/src/render/framegraph/qrenderpassfilter.h +++ b/src/render/framegraph/qrenderpassfilter.h @@ -70,11 +70,9 @@ public: protected: QRenderPassFilter(QRenderPassFilterPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderPassFilter) - QT3D_CLONEABLE(QRenderPassFilter) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qrenderstateset.cpp b/src/render/framegraph/qrenderstateset.cpp index 291b831a5..55c301f3c 100644 --- a/src/render/framegraph/qrenderstateset.cpp +++ b/src/render/framegraph/qrenderstateset.cpp @@ -80,20 +80,6 @@ QRenderStateSet::QRenderStateSet(QNode *parent) { } -QRenderStateSet::QRenderStateSet(QRenderStateSetPrivate &dd, QNode *parent) - : QFrameGraphNode(dd, parent) -{ -} - -void QRenderStateSet::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QRenderStateSet *other = static_cast<const QRenderStateSet*>(ref); - - for (QRenderState *renderState : other->d_func()->m_renderStates) - addRenderState(qobject_cast<QRenderState *>(QNode::clone(renderState))); -} - /*! * Adds a new QRenderState \a state to the QRenderStateSet instance. * diff --git a/src/render/framegraph/qrenderstateset.h b/src/render/framegraph/qrenderstateset.h index 50c631dee..6eeb9977e 100644 --- a/src/render/framegraph/qrenderstateset.h +++ b/src/render/framegraph/qrenderstateset.h @@ -62,11 +62,9 @@ public: protected: explicit QRenderStateSet(QRenderStateSetPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderStateSet) - QT3D_CLONEABLE(QRenderStateSet) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qrendersurfaceselector.cpp b/src/render/framegraph/qrendersurfaceselector.cpp index 37fa26e72..b4bfad22f 100644 --- a/src/render/framegraph/qrendersurfaceselector.cpp +++ b/src/render/framegraph/qrendersurfaceselector.cpp @@ -228,18 +228,6 @@ void QRenderSurfaceSelector::setExternalRenderTargetSize(const QSize &size) emit externalRenderTargetSizeChanged(size); } -/*! - * \internal - */ -void QRenderSurfaceSelector::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QRenderSurfaceSelector *object = static_cast<const QRenderSurfaceSelector *>(ref); - - d_func()->m_surface = object->d_func()->m_surface; - d_func()->m_externalRenderTargetSize = object->d_func()->m_externalRenderTargetSize; -} - Qt3DCore::QNodeCreatedChangeBasePtr QRenderSurfaceSelector::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QRenderSurfaceSelectorData>::create(this); diff --git a/src/render/framegraph/qrendersurfaceselector.h b/src/render/framegraph/qrendersurfaceselector.h index ee7ec98b1..4f75e82f5 100644 --- a/src/render/framegraph/qrendersurfaceselector.h +++ b/src/render/framegraph/qrendersurfaceselector.h @@ -76,10 +76,8 @@ Q_SIGNALS: protected: Q_DECLARE_PRIVATE(QRenderSurfaceSelector) QRenderSurfaceSelector(QRenderSurfaceSelectorPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: - QT3D_CLONEABLE(QRenderSurfaceSelector) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qrendertargetselector.cpp b/src/render/framegraph/qrendertargetselector.cpp index 0cbe701be..5d5ad6afc 100644 --- a/src/render/framegraph/qrendertargetselector.cpp +++ b/src/render/framegraph/qrendertargetselector.cpp @@ -55,17 +55,6 @@ QRenderTargetSelectorPrivate::QRenderTargetSelectorPrivate() { } -void QRenderTargetSelector::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - - const QRenderTargetSelector *other = static_cast<const QRenderTargetSelector*>(ref); - - setOutputs(other->outputs()); - if (other->d_func()->m_target) - setTarget(qobject_cast<QRenderTarget *>(QNode::clone(other->d_func()->m_target))); -} - QRenderTargetSelector::QRenderTargetSelector(QNode *parent) : QFrameGraphNode(*new QRenderTargetSelectorPrivate, parent) { diff --git a/src/render/framegraph/qrendertargetselector.h b/src/render/framegraph/qrendertargetselector.h index 7495ffe20..5b9ceac49 100644 --- a/src/render/framegraph/qrendertargetselector.h +++ b/src/render/framegraph/qrendertargetselector.h @@ -72,11 +72,9 @@ Q_SIGNALS: protected: QRenderTargetSelector(QRenderTargetSelectorPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderTargetSelector) - QT3D_CLONEABLE(QRenderTargetSelector) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qsortcriterion.cpp b/src/render/framegraph/qsortcriterion.cpp index 926f80621..f5252b1f7 100644 --- a/src/render/framegraph/qsortcriterion.cpp +++ b/src/render/framegraph/qsortcriterion.cpp @@ -51,13 +51,6 @@ QSortCriterionPrivate::QSortCriterionPrivate() { } -void QSortCriterion::copy(const QNode *ref) -{ - QNode::copy(ref); - const QSortCriterion *s = static_cast<const QSortCriterion*>(ref); - d_func()->m_sort = s->d_func()->m_sort; -} - QSortCriterion::QSortCriterion(QNode *parent) : QNode(*new QSortCriterionPrivate, parent) { diff --git a/src/render/framegraph/qsortcriterion.h b/src/render/framegraph/qsortcriterion.h index 79bfc7187..bf2821550 100644 --- a/src/render/framegraph/qsortcriterion.h +++ b/src/render/framegraph/qsortcriterion.h @@ -73,10 +73,8 @@ Q_SIGNALS: protected: QSortCriterion(QSortCriterionPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: - QT3D_CLONEABLE(QSortCriterion) Q_DECLARE_PRIVATE(QSortCriterion) }; diff --git a/src/render/framegraph/qsortpolicy.cpp b/src/render/framegraph/qsortpolicy.cpp index 9dbfbbc8c..e89e0f472 100644 --- a/src/render/framegraph/qsortpolicy.cpp +++ b/src/render/framegraph/qsortpolicy.cpp @@ -51,14 +51,6 @@ QSortPolicyPrivate::QSortPolicyPrivate() { } -void QSortPolicy::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QSortPolicy *other = static_cast<const QSortPolicy*>(ref); - Q_FOREACH (const QSortPolicy::SortType c, other->d_func()->m_sortTypes) - addSortType(c); -} - QSortPolicy::QSortPolicy(QNode *parent) : QFrameGraphNode(*new QSortPolicyPrivate, parent) { @@ -70,6 +62,15 @@ QSortPolicy::QSortPolicy(QSortPolicyPrivate &dd, QNode *parent) { } +QNodeCreatedChangeBasePtr QSortPolicy::createNodeCreationChange() const +{ + auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QSortPolicyData>::create(this); + QSortPolicyData &data = creationChange->data; + Q_D(const QSortPolicy); + data.sortTypes = d->m_sortTypes; + return creationChange; +} + void QSortPolicy::addSortType(Qt3DRender::QSortPolicy::SortType sortType) { Q_D(QSortPolicy); diff --git a/src/render/framegraph/qsortpolicy.h b/src/render/framegraph/qsortpolicy.h index 323168fa4..cbe7fe9c2 100644 --- a/src/render/framegraph/qsortpolicy.h +++ b/src/render/framegraph/qsortpolicy.h @@ -77,11 +77,10 @@ Q_SIGNALS: protected: explicit QSortPolicy(QSortPolicyPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QSortPolicy) - QT3D_CLONEABLE(QSortPolicy) + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; } // namespace Qt3DRender diff --git a/src/render/framegraph/qsortpolicy_p.h b/src/render/framegraph/qsortpolicy_p.h index e84f646da..e9e27408d 100644 --- a/src/render/framegraph/qsortpolicy_p.h +++ b/src/render/framegraph/qsortpolicy_p.h @@ -67,6 +67,12 @@ public: QVector<QSortPolicy::SortType> m_sortTypes; }; + +struct QSortPolicyData +{ + QVector<QSortPolicy::SortType> sortTypes; +}; + } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/render/framegraph/qtechniquefilter.cpp b/src/render/framegraph/qtechniquefilter.cpp index 3237113b5..7af782537 100644 --- a/src/render/framegraph/qtechniquefilter.cpp +++ b/src/render/framegraph/qtechniquefilter.cpp @@ -56,17 +56,6 @@ QTechniqueFilterPrivate::QTechniqueFilterPrivate() { } -void QTechniqueFilter::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QTechniqueFilter *other = static_cast<const QTechniqueFilter*>(ref); - - Q_FOREACH (QFilterKey *crit, other->d_func()->m_matchList) - addMatch(qobject_cast<QFilterKey *>(QNode::clone(crit))); - for (QParameter *p : other->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); -} - QTechniqueFilter::QTechniqueFilter(QNode *parent) : QFrameGraphNode(*new QTechniqueFilterPrivate, parent) { diff --git a/src/render/framegraph/qtechniquefilter.h b/src/render/framegraph/qtechniquefilter.h index b3545b6e5..bc441679e 100644 --- a/src/render/framegraph/qtechniquefilter.h +++ b/src/render/framegraph/qtechniquefilter.h @@ -67,11 +67,9 @@ public: protected: QTechniqueFilter(QTechniqueFilterPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QTechniqueFilter) - QT3D_CLONEABLE(QTechniqueFilter) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/qviewport.cpp b/src/render/framegraph/qviewport.cpp index 43562caa5..2be781279 100644 --- a/src/render/framegraph/qviewport.cpp +++ b/src/render/framegraph/qviewport.cpp @@ -52,13 +52,6 @@ QViewportPrivate::QViewportPrivate() { } -void QViewport::copy(const QNode *ref) -{ - QFrameGraphNode::copy(ref); - const QViewport *viewport = static_cast<const QViewport*>(ref); - d_func()->m_normalizedRect = viewport->d_func()->m_normalizedRect; -} - QViewport::QViewport(QNode *parent) : QFrameGraphNode(*new QViewportPrivate, parent) { diff --git a/src/render/framegraph/qviewport.h b/src/render/framegraph/qviewport.h index 8489b2462..04658737d 100644 --- a/src/render/framegraph/qviewport.h +++ b/src/render/framegraph/qviewport.h @@ -68,11 +68,9 @@ Q_SIGNALS: protected: QViewport(QViewportPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QViewport) - QT3D_CLONEABLE(QViewport) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/framegraph/sortpolicy.cpp b/src/render/framegraph/sortpolicy.cpp index aba272d9d..f04243d6a 100644 --- a/src/render/framegraph/sortpolicy.cpp +++ b/src/render/framegraph/sortpolicy.cpp @@ -39,6 +39,7 @@ #include "sortpolicy_p.h" #include <Qt3DCore/qnodepropertychange.h> +#include <Qt3DRender/private/qsortpolicy_p.h> QT_BEGIN_NAMESPACE @@ -81,6 +82,13 @@ QVector<QSortPolicy::SortType> SortPolicy::sortTypes() const return m_sortTypes; } +void SortPolicy::initializeFromPeer(const QNodeCreatedChangeBasePtr &change) +{ + const auto typedChange = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<QSortPolicyData>>(change); + const QSortPolicyData &data = typedChange->data; + m_sortTypes = data.sortTypes; +} + } // namepace Render } // namespace Qt3DRender diff --git a/src/render/framegraph/sortpolicy_p.h b/src/render/framegraph/sortpolicy_p.h index b05622555..749965b47 100644 --- a/src/render/framegraph/sortpolicy_p.h +++ b/src/render/framegraph/sortpolicy_p.h @@ -71,6 +71,8 @@ public: QVector<Qt3DRender::QSortPolicy::SortType> sortTypes() const; private: + void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL; + QVector<Qt3DRender::QSortPolicy::SortType> m_sortTypes; }; diff --git a/src/render/frontend/qboundingvolumedebug.cpp b/src/render/frontend/qboundingvolumedebug.cpp index cf178f51c..e8ed47ba7 100644 --- a/src/render/frontend/qboundingvolumedebug.cpp +++ b/src/render/frontend/qboundingvolumedebug.cpp @@ -110,13 +110,6 @@ bool QBoundingVolumeDebug::recursive() const return d->m_recursive; } -void QBoundingVolumeDebug::copy(const Qt3DCore::QNode *ref) -{ - QComponent::copy(ref); - const QBoundingVolumeDebug *debugVolume = static_cast<const QBoundingVolumeDebug *>(ref); - d_func()->m_recursive = debugVolume->d_func()->m_recursive; -} - void QBoundingVolumeDebug::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QBoundingVolumeDebug); diff --git a/src/render/frontend/qboundingvolumedebug_p.h b/src/render/frontend/qboundingvolumedebug_p.h index 05977e9f6..d6b2d8809 100644 --- a/src/render/frontend/qboundingvolumedebug_p.h +++ b/src/render/frontend/qboundingvolumedebug_p.h @@ -81,12 +81,12 @@ Q_SIGNALS: void recursiveChanged(bool recursive); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QBoundingVolumeDebug) - QT3D_CLONEABLE(QBoundingVolumeDebug) + + // TODO: Handle creation changes }; } // Qt3DRender diff --git a/src/render/frontend/qcamera.h b/src/render/frontend/qcamera.h index 3b82b5a71..812ef5729 100644 --- a/src/render/frontend/qcamera.h +++ b/src/render/frontend/qcamera.h @@ -165,7 +165,6 @@ Q_SIGNALS: protected: Q_DECLARE_PRIVATE(QCamera) - QT3D_CLONEABLE(QCamera) QCamera(QCameraPrivate &dd, QNode *parent = Q_NULLPTR); }; diff --git a/src/render/frontend/qcameralens.cpp b/src/render/frontend/qcameralens.cpp index e36fae063..c86610f3d 100644 --- a/src/render/frontend/qcameralens.cpp +++ b/src/render/frontend/qcameralens.cpp @@ -68,22 +68,6 @@ QCameraLens::QCameraLens(QNode *parent) d->updateProjectionMatrix(); } -void QCameraLens::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QCameraLens *lens = static_cast<const QCameraLens*>(ref); - d_func()->m_projectionType = lens->d_func()->m_projectionType; - d_func()->m_nearPlane = lens->d_func()->m_nearPlane; - d_func()->m_farPlane = lens->d_func()->m_farPlane; - d_func()->m_fieldOfView = lens->d_func()->m_fieldOfView; - d_func()->m_aspectRatio = lens->d_func()->m_aspectRatio; - d_func()->m_left = lens->d_func()->m_left; - d_func()->m_right = lens->d_func()->m_right; - d_func()->m_bottom = lens->d_func()->m_bottom; - d_func()->m_top = lens->d_func()->m_top; - d_func()->m_projectionMatrix = lens->d_func()->m_projectionMatrix; -} - /*! \class Qt3DRender::QCameraLens * \inmodule Qt3DCore * diff --git a/src/render/frontend/qcameralens.h b/src/render/frontend/qcameralens.h index 7fba4ac43..846c4557c 100644 --- a/src/render/frontend/qcameralens.h +++ b/src/render/frontend/qcameralens.h @@ -127,11 +127,9 @@ Q_SIGNALS: protected: QCameraLens(QCameraLensPrivate &dd, QNode *parent = Q_NULLPTR); - void copy(const QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QCameraLens) - QT3D_CLONEABLE(QCameraLens) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/frontend/qcomputecommand.cpp b/src/render/frontend/qcomputecommand.cpp index 3a4b67111..41883f76a 100644 --- a/src/render/frontend/qcomputecommand.cpp +++ b/src/render/frontend/qcomputecommand.cpp @@ -102,15 +102,6 @@ void QComputeCommand::setWorkGroupZ(int workGroupZ) } } -void QComputeCommand::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QComputeCommand *object = static_cast<const QComputeCommand *>(ref); - d_func()->m_workGroupX = object->workGroupX(); - d_func()->m_workGroupY = object->workGroupY(); - d_func()->m_workGroupZ = object->workGroupZ(); -} - } // Render QT_END_NAMESPACE diff --git a/src/render/frontend/qcomputecommand.h b/src/render/frontend/qcomputecommand.h index 04699ac7a..764e4de33 100644 --- a/src/render/frontend/qcomputecommand.h +++ b/src/render/frontend/qcomputecommand.h @@ -74,12 +74,10 @@ Q_SIGNALS: void workGroupYChanged(); void workGroupZChanged(); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QComputeCommand) - QT3D_CLONEABLE(QComputeCommand) + + // TODO: Handle creation changes }; } // Qt3DRender diff --git a/src/render/frontend/qlayer.cpp b/src/render/frontend/qlayer.cpp index 8ecf46b1e..b4c85a596 100644 --- a/src/render/frontend/qlayer.cpp +++ b/src/render/frontend/qlayer.cpp @@ -65,17 +65,6 @@ QLayerPrivate::QLayerPrivate() \brief For ... */ - -/*! \fn void Qt3DRender::QLayer::copy(const Qt3DCore::QNode *ref) - Copies the \a ref instance into this one. - */ -void QLayer::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QLayer *layer = static_cast<const QLayer*>(ref); - d_func()->m_names = layer->d_func()->m_names; -} - /*! \fn Qt3DRender::QLayer::QLayer(Qt3DCore::QNode *parent) Constructs a new QLayer with the specified \a parent. */ diff --git a/src/render/frontend/qlayer.h b/src/render/frontend/qlayer.h index 13037d711..ad245b60f 100644 --- a/src/render/frontend/qlayer.h +++ b/src/render/frontend/qlayer.h @@ -67,11 +67,9 @@ Q_SIGNALS: protected: QLayer(QLayerPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QLayer) - QT3D_CLONEABLE(QLayer) }; } // namespace Qt3DRender diff --git a/src/render/frontend/qpickingsettings.cpp b/src/render/frontend/qpickingsettings.cpp index 705cf150e..abb6115cb 100644 --- a/src/render/frontend/qpickingsettings.cpp +++ b/src/render/frontend/qpickingsettings.cpp @@ -93,14 +93,6 @@ void QPickingSettings::setPickResultMode(QPickingSettings::PickResultMode pickRe emit pickResultModeChanged(pickResultMode); } -void QPickingSettings::copy(const QNode *ref) -{ - QNode::copy(ref); - const QPickingSettings *object = static_cast<const QPickingSettings *>(ref); - d_func()->m_pickMethod = object->d_func()->m_pickMethod; - d_func()->m_pickResultMode = object->d_func()->m_pickResultMode; -} - } // namespace Qt3Drender QT_END_NAMESPACE diff --git a/src/render/frontend/qpickingsettings.h b/src/render/frontend/qpickingsettings.h index c87127e3c..985f851a3 100644 --- a/src/render/frontend/qpickingsettings.h +++ b/src/render/frontend/qpickingsettings.h @@ -84,10 +84,6 @@ Q_SIGNALS: protected: Q_DECLARE_PRIVATE(QPickingSettings) QPickingSettings(QPickingSettingsPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - -private: - QT3D_CLONEABLE(QPickingSettings) }; } // namespace Qt3Drender diff --git a/src/render/frontend/qrendersettings.cpp b/src/render/frontend/qrendersettings.cpp index 9d360e9fa..d3d3cba04 100644 --- a/src/render/frontend/qrendersettings.cpp +++ b/src/render/frontend/qrendersettings.cpp @@ -125,15 +125,6 @@ void QRenderSettings::setRenderPolicy(QRenderSettings::RenderPolicy renderPolicy emit renderPolicyChanged(renderPolicy); } -void QRenderSettings::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QRenderSettings *object = static_cast<const QRenderSettings *>(ref); - setActiveFrameGraph(qobject_cast<QFrameGraphNode *>(QNode::clone(object->activeFrameGraph()))); - - d_func()->m_renderPolicy = object->d_func()->m_renderPolicy; -} - Qt3DCore::QNodeCreatedChangeBasePtr QRenderSettings::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QRenderSettingsData>::create(this); diff --git a/src/render/frontend/qrendersettings.h b/src/render/frontend/qrendersettings.h index 862d91e6b..e9ac4d5dd 100644 --- a/src/render/frontend/qrendersettings.h +++ b/src/render/frontend/qrendersettings.h @@ -84,10 +84,8 @@ Q_SIGNALS: protected: Q_DECLARE_PRIVATE(QRenderSettings) QRenderSettings(QRenderSettingsPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: - QT3D_CLONEABLE(QRenderSettings) Q_PRIVATE_SLOT(d_func(), void _q_onPickingMethodChanged(QPickingSettings::PickMethod)) Q_PRIVATE_SLOT(d_func(), void _q_onPickResultModeChanged(QPickingSettings::PickResultMode)) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; diff --git a/src/render/frontend/qrendertarget.cpp b/src/render/frontend/qrendertarget.cpp index b947d8494..da2196108 100644 --- a/src/render/frontend/qrendertarget.cpp +++ b/src/render/frontend/qrendertarget.cpp @@ -55,14 +55,6 @@ QRenderTargetPrivate::QRenderTargetPrivate() { } -void QRenderTarget::copy(const QNode *ref) -{ - QNode::copy(ref); - const QRenderTarget *other = static_cast<const QRenderTarget*>(ref); - for (QRenderTargetOutput *output : other->d_func()->m_outputs) - addOutput(qobject_cast<QRenderTargetOutput *>(QNode::clone(output))); -} - QRenderTarget::QRenderTarget(QNode *parent) : QComponent(*new QRenderTargetPrivate, parent) { diff --git a/src/render/frontend/qrendertarget.h b/src/render/frontend/qrendertarget.h index ac011103b..3a21ec611 100644 --- a/src/render/frontend/qrendertarget.h +++ b/src/render/frontend/qrendertarget.h @@ -62,11 +62,9 @@ public: protected: QRenderTarget(QRenderTargetPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderTarget) - QT3D_CLONEABLE(QRenderTarget) }; } // namespace Qt3DRender diff --git a/src/render/frontend/qrendertargetoutput.cpp b/src/render/frontend/qrendertargetoutput.cpp index 8a4cb0494..8d1a2f11e 100644 --- a/src/render/frontend/qrendertargetoutput.cpp +++ b/src/render/frontend/qrendertargetoutput.cpp @@ -55,14 +55,6 @@ QRenderTargetOutputPrivate::QRenderTargetOutputPrivate() { } -void QRenderTargetOutput::copy(const QNode *ref) -{ - QNode::copy(ref); - const QRenderTargetOutput *rA = static_cast<const QRenderTargetOutput*>(ref); - d_func()->m_attachmentPoint = rA->d_func()->m_attachmentPoint; - setTexture(qobject_cast<QAbstractTexture *>(QNode::clone(rA->d_func()->m_texture))); -} - QRenderTargetOutput::QRenderTargetOutput(QNode *parent) : QNode(*new QRenderTargetOutputPrivate, parent) { diff --git a/src/render/frontend/qrendertargetoutput.h b/src/render/frontend/qrendertargetoutput.h index baaf8dc1a..a56644028 100644 --- a/src/render/frontend/qrendertargetoutput.h +++ b/src/render/frontend/qrendertargetoutput.h @@ -108,11 +108,9 @@ Q_SIGNALS: protected: explicit QRenderTargetOutput(QRenderTargetOutputPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderTargetOutput) - QT3D_CLONEABLE(QRenderTargetOutput) }; } // namespace Qt3DRender diff --git a/src/render/geometry/qattribute.cpp b/src/render/geometry/qattribute.cpp index 1d17b4bc9..e20ede4a6 100644 --- a/src/render/geometry/qattribute.cpp +++ b/src/render/geometry/qattribute.cpp @@ -148,25 +148,6 @@ QAttribute::QAttribute(QBuffer *buf, const QString &name, VertexBaseType type, u d->m_byteStride = stride; } - -/*! - * \internal - */ -void QAttribute::copy(const QNode *ref) -{ - QNode::copy(ref); - const QAttribute *attribute = static_cast<const QAttribute *>(ref); - d_func()->m_buffer = qobject_cast<QBuffer *>(QNode::clone(attribute->d_func()->m_buffer)); - d_func()->m_name = attribute->d_func()->m_name; - d_func()->m_count = attribute->d_func()->m_count; - d_func()->m_divisor = attribute->d_func()->m_divisor; - d_func()->m_byteOffset = attribute->d_func()->m_byteOffset; - d_func()->m_dataType = attribute->d_func()->m_dataType; - d_func()->m_dataSize = attribute->d_func()->m_dataSize; - d_func()->m_byteStride = attribute->d_func()->m_byteStride; - d_func()->m_attributeType = attribute->d_func()->m_attributeType; -} - /*! * \property QAttribute::buffer * diff --git a/src/render/geometry/qattribute.h b/src/render/geometry/qattribute.h index 0252d7de5..85a82317a 100644 --- a/src/render/geometry/qattribute.h +++ b/src/render/geometry/qattribute.h @@ -129,12 +129,8 @@ Q_SIGNALS: void divisorChanged(uint divisor); void attributeTypeChanged(AttributeType attributeType); -protected: - void copy(const QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QAttribute) - QT3D_CLONEABLE(QAttribute) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/geometry/qbuffer.cpp b/src/render/geometry/qbuffer.cpp index 1c7914fe2..de2589124 100644 --- a/src/render/geometry/qbuffer.cpp +++ b/src/render/geometry/qbuffer.cpp @@ -156,20 +156,6 @@ QBuffer::QBuffer(QBuffer::BufferType ty, QNode *parent) /*! * \internal */ -void QBuffer::copy(const QNode *ref) -{ - QNode::copy(ref); - const QBuffer *buffer = static_cast<const QBuffer *>(ref); - d_func()->m_data = buffer->d_func()->m_data; - d_func()->m_type = buffer->d_func()->m_type; - d_func()->m_usage = buffer->d_func()->m_usage; - d_func()->m_functor = buffer->d_func()->m_functor; - d_func()->m_syncData = buffer->d_func()->m_syncData; -} - -/*! - * \internal - */ void QBuffer::sceneChangeEvent(const QSceneChangePtr &change) { QNodePropertyChangePtr e = qSharedPointerCast<QNodePropertyChange>(change); diff --git a/src/render/geometry/qbuffer.h b/src/render/geometry/qbuffer.h index b9ee3e5c8..edd6055ed 100644 --- a/src/render/geometry/qbuffer.h +++ b/src/render/geometry/qbuffer.h @@ -103,7 +103,6 @@ public Q_SLOTS: void setSyncData(bool syncData); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; Q_SIGNALS: @@ -114,7 +113,6 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QBuffer) - QT3D_CLONEABLE(QBuffer) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/geometry/qgeometry.cpp b/src/render/geometry/qgeometry.cpp index 5399517e5..600cce2fd 100644 --- a/src/render/geometry/qgeometry.cpp +++ b/src/render/geometry/qgeometry.cpp @@ -163,20 +163,6 @@ QVector<QAttribute *> QGeometry::attributes() const return d->m_attributes; } -/*! - * \internal - */ -void QGeometry::copy(const QNode *ref) -{ - QNode::copy(ref); - const QGeometry *geometry = static_cast<const QGeometry *>(ref); - Q_FOREACH (QAttribute *attribute, geometry->d_func()->m_attributes) - d_func()->m_attributes.append(qobject_cast<QAttribute *>(QNode::clone(attribute))); - // Copy bounding volume position attribute - if (geometry->d_func()->m_boundingVolumePositionAttribute != Q_NULLPTR) - d_func()->m_boundingVolumePositionAttribute = qobject_cast<QAttribute *>(QNode::clone(geometry->d_func()->m_boundingVolumePositionAttribute)); -} - Qt3DCore::QNodeCreatedChangeBasePtr QGeometry::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QGeometryData>::create(this); diff --git a/src/render/geometry/qgeometry.h b/src/render/geometry/qgeometry.h index f35d362a4..a4057ce12 100644 --- a/src/render/geometry/qgeometry.h +++ b/src/render/geometry/qgeometry.h @@ -71,11 +71,9 @@ Q_SIGNALS: protected: QGeometry(QGeometryPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QGeometry) - QT3D_CLONEABLE(QGeometry) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/geometry/qgeometryrenderer.cpp b/src/render/geometry/qgeometryrenderer.cpp index aa6d96043..6aad35710 100644 --- a/src/render/geometry/qgeometryrenderer.cpp +++ b/src/render/geometry/qgeometryrenderer.cpp @@ -404,37 +404,19 @@ void QGeometryRenderer::setGeometryFactory(const QGeometryFactoryPtr &factory) /*! * \internal */ -void QGeometryRenderer::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QGeometryRenderer *other = static_cast<const QGeometryRenderer *>(ref); - d_func()->m_instanceCount = other->d_func()->m_instanceCount; - d_func()->m_vertexCount = other->d_func()->m_vertexCount; - d_func()->m_indexOffset = other->d_func()->m_indexOffset; - d_func()->m_firstInstance = other->d_func()->m_firstInstance; - d_func()->m_restartIndexValue = other->d_func()->m_restartIndexValue; - d_func()->m_primitiveRestart = other->d_func()->m_primitiveRestart; - d_func()->m_primitiveType = other->d_func()->m_primitiveType; - d_func()->m_verticesPerPatch = other->d_func()->m_verticesPerPatch; - d_func()->m_geometry = static_cast<QGeometry *>(QNode::clone(other->d_func()->m_geometry)); - d_func()->m_geometryFactory = other->d_func()->m_geometryFactory; -} - -/*! - * \internal - */ void QGeometryRenderer::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) { - Q_D(QGeometryRenderer); - QNodePropertyChangePtr change = qSharedPointerCast<QNodePropertyChange>(e); - if (change->type() == NodeUpdated && change->propertyName() == QByteArrayLiteral("geometry")) { - QNodePtr nodePtr = change->value().value<QNodePtr>(); - QGeometry *backendGeometry = static_cast<QGeometry *>(nodePtr.data()); - QGeometry *frontendGeometry = static_cast<QGeometry *>(QNode::clone(backendGeometry)); - if (frontendGeometry != Q_NULLPTR) - d->insertTree(frontendGeometry); - setGeometry(frontendGeometry); - } + // TODO: Avoid cloning here +// Q_D(QGeometryRenderer); +// QScenePropertyChangePtr change = qSharedPointerCast<QScenePropertyChange>(e); +// if (change->type() == NodeUpdated && change->propertyName() == QByteArrayLiteral("geometry")) { +// QNodePtr nodePtr = change->value().value<QNodePtr>(); +// QGeometry *backendGeometry = static_cast<QGeometry *>(nodePtr.data()); +// QGeometry *frontendGeometry = static_cast<QGeometry *>(QNode::clone(backendGeometry)); +// if (frontendGeometry != Q_NULLPTR) +// d->insertTree(frontendGeometry); +// setGeometry(frontendGeometry); +// } } Qt3DCore::QNodeCreatedChangeBasePtr QGeometryRenderer::createNodeCreationChange() const diff --git a/src/render/geometry/qgeometryrenderer.h b/src/render/geometry/qgeometryrenderer.h index 6aab5a1c2..55fdcf93c 100644 --- a/src/render/geometry/qgeometryrenderer.h +++ b/src/render/geometry/qgeometryrenderer.h @@ -125,12 +125,10 @@ Q_SIGNALS: protected: QGeometryRenderer(QGeometryRendererPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QGeometryRenderer) - QT3D_CLONEABLE(QGeometryRenderer) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/io/qsceneloader.cpp b/src/render/io/qsceneloader.cpp index 09ce56f47..19bec1fba 100644 --- a/src/render/io/qsceneloader.cpp +++ b/src/render/io/qsceneloader.cpp @@ -101,13 +101,6 @@ void QSceneLoader::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) } } -void QSceneLoader::copy(const QNode *ref) -{ - Qt3DCore::QComponent::copy(ref); - const QSceneLoader *s = static_cast<const QSceneLoader*>(ref); - d_func()->m_source = s->d_func()->m_source; -} - QUrl QSceneLoader::source() const { Q_D(const QSceneLoader); diff --git a/src/render/io/qsceneloader.h b/src/render/io/qsceneloader.h index 005b54f49..1cdc03da3 100644 --- a/src/render/io/qsceneloader.h +++ b/src/render/io/qsceneloader.h @@ -80,9 +80,7 @@ Q_SIGNALS: void statusChanged(Status status); protected: - QT3D_CLONEABLE(QSceneLoader) explicit QSceneLoader(QSceneLoaderPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QSceneLoader) diff --git a/src/render/lights/qabstractlight.cpp b/src/render/lights/qabstractlight.cpp index 1b4f3c199..767ce9031 100644 --- a/src/render/lights/qabstractlight.cpp +++ b/src/render/lights/qabstractlight.cpp @@ -61,14 +61,6 @@ QAbstractLightPrivate::QAbstractLightPrivate(QAbstractLight::Type type) m_shaderData->setProperty("type", type); } -void QAbstractLight::copy(const QNode *ref) -{ - const QAbstractLight *light = static_cast<const QAbstractLight*>(ref); - d_func()->m_type = light->d_func()->m_type; - d_func()->m_shaderData = qobject_cast<QShaderData *>(QNode::clone(light->d_func()->m_shaderData)); - QComponent::copy(ref); -} - Qt3DCore::QNodeCreatedChangeBasePtr QAbstractLight::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QAbstractLightData>::create(this); diff --git a/src/render/lights/qabstractlight.h b/src/render/lights/qabstractlight.h index 0a8593066..29c4eece1 100644 --- a/src/render/lights/qabstractlight.h +++ b/src/render/lights/qabstractlight.h @@ -77,7 +77,7 @@ public Q_SLOTS: protected : QAbstractLight(QAbstractLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + Q_SIGNALS: void colorChanged(const QColor &color); diff --git a/src/render/lights/qdirectionallight.cpp b/src/render/lights/qdirectionallight.cpp index d53d86aa7..98a98e801 100644 --- a/src/render/lights/qdirectionallight.cpp +++ b/src/render/lights/qdirectionallight.cpp @@ -70,11 +70,6 @@ QDirectionalLightPrivate::QDirectionalLightPrivate() m_shaderData->setProperty("direction", QVector3D(0.0f, -1.0f, 0.0f)); } -void QDirectionalLight::copy(const QNode *ref) -{ - QAbstractLight::copy(ref); -} - QDirectionalLight::QDirectionalLight(QNode *parent) : QAbstractLight(*new QDirectionalLightPrivate, parent) { diff --git a/src/render/lights/qdirectionallight.h b/src/render/lights/qdirectionallight.h index ec2e960db..79ad7c663 100644 --- a/src/render/lights/qdirectionallight.h +++ b/src/render/lights/qdirectionallight.h @@ -66,11 +66,9 @@ Q_SIGNALS: protected: QDirectionalLight(QDirectionalLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QDirectionalLight) - QT3D_CLONEABLE(QDirectionalLight) }; } // namespace Qt3DRender diff --git a/src/render/lights/qpointlight.h b/src/render/lights/qpointlight.h index 972a19b20..6f975f07b 100644 --- a/src/render/lights/qpointlight.h +++ b/src/render/lights/qpointlight.h @@ -75,7 +75,6 @@ Q_SIGNALS: protected: Q_DECLARE_PRIVATE(QPointLight) QPointLight(QPointLightPrivate &dd, Qt3DCore::QNode *parent); - QT3D_CLONEABLE(QPointLight) }; } // namespace Qt3DRender diff --git a/src/render/lights/qspotlight.cpp b/src/render/lights/qspotlight.cpp index 711fb790c..7a510b89d 100644 --- a/src/render/lights/qspotlight.cpp +++ b/src/render/lights/qspotlight.cpp @@ -91,16 +91,6 @@ QSpotLightPrivate::QSpotLightPrivate() \brief For OpenGL ... */ -/*! \fn void Qt3DRender::QSpotLight::copy(const Qt3DCore::QNode *ref) - Copies the \a ref instance into this one. - */ - -void QSpotLight::copy(const QNode *ref) -{ - QAbstractLight::copy(ref); -} - - /*! \fn Qt3DRender::QSpotLight::QSpotLight(Qt3DCore::QNode *parent) Constructs a new QSpotLight with the specified \a parent. diff --git a/src/render/lights/qspotlight.h b/src/render/lights/qspotlight.h index 3d7889156..d66aa2719 100644 --- a/src/render/lights/qspotlight.h +++ b/src/render/lights/qspotlight.h @@ -84,11 +84,9 @@ Q_SIGNALS: protected: QSpotLight(QSpotLightPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QSpotLight) - QT3D_CLONEABLE(QSpotLight) }; } // namespace Qt3DRender diff --git a/src/render/materialsystem/qeffect.cpp b/src/render/materialsystem/qeffect.cpp index 31a74c53b..fd6ed985f 100644 --- a/src/render/materialsystem/qeffect.cpp +++ b/src/render/materialsystem/qeffect.cpp @@ -62,17 +62,6 @@ QEffect::QEffect(QNode *parent) { } -void QEffect::copy(const QNode* ref) -{ - QNode::copy(ref); - const QEffect *effect = static_cast<const QEffect*>(ref); - Q_FOREACH (QParameter *p, effect->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); - - Q_FOREACH (QTechnique *t, effect->d_func()->m_techniques) - addTechnique(qobject_cast<QTechnique *>(QNode::clone(t))); -} - /*! \internal */ QEffect::QEffect(QEffectPrivate &dd, QNode *parent) : QNode(dd, parent) diff --git a/src/render/materialsystem/qeffect.h b/src/render/materialsystem/qeffect.h index 54e18454c..b5a12f575 100644 --- a/src/render/materialsystem/qeffect.h +++ b/src/render/materialsystem/qeffect.h @@ -67,11 +67,9 @@ public: protected: QEffect(QEffectPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QEffect) - QT3D_CLONEABLE(QEffect) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qfilterkey.cpp b/src/render/materialsystem/qfilterkey.cpp index 332000db2..135dc9c46 100644 --- a/src/render/materialsystem/qfilterkey.cpp +++ b/src/render/materialsystem/qfilterkey.cpp @@ -69,17 +69,6 @@ QFilterKeyPrivate::QFilterKeyPrivate() */ /*! - Copies the annotation in \a ref into this annotation. - */ -void QFilterKey::copy(const QNode *ref) -{ - QNode::copy(ref); - const QFilterKey *criterion = static_cast<const QFilterKey*>(ref); - d_func()->m_name = criterion->d_func()->m_name; - d_func()->m_value = criterion->d_func()->m_value; -} - -/*! The constructor creats a new annotation under \a parent. */ QFilterKey::QFilterKey(QNode *parent) diff --git a/src/render/materialsystem/qfilterkey.h b/src/render/materialsystem/qfilterkey.h index 5bcd81a11..e0a2ecb10 100644 --- a/src/render/materialsystem/qfilterkey.h +++ b/src/render/materialsystem/qfilterkey.h @@ -69,12 +69,8 @@ Q_SIGNALS: void nameChanged(const QString &name); void valueChanged(const QVariant &value); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QFilterKey) - QT3D_CLONEABLE(QFilterKey) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qmaterial.cpp b/src/render/materialsystem/qmaterial.cpp index 93518f602..3a1e75117 100644 --- a/src/render/materialsystem/qmaterial.cpp +++ b/src/render/materialsystem/qmaterial.cpp @@ -84,19 +84,6 @@ QMaterialPrivate::QMaterialPrivate() { } -void QMaterial::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QMaterial *material = static_cast<const QMaterial*>(ref); - Q_FOREACH (QParameter *p, material->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); - - // TO DO: We may want to copy the node id of the effect and only send a clone - // when we are the parent of the effect - if (material->d_func()->m_effect && material->d_func()->m_effect->parent() == ref) - setEffect(qobject_cast<QEffect *>(QNode::clone(material->d_func()->m_effect))); -} - QMaterial::QMaterial(QNode *parent) : QComponent(*new QMaterialPrivate, parent) { diff --git a/src/render/materialsystem/qmaterial.h b/src/render/materialsystem/qmaterial.h index b97f11b90..06df54a4d 100644 --- a/src/render/materialsystem/qmaterial.h +++ b/src/render/materialsystem/qmaterial.h @@ -76,11 +76,9 @@ Q_SIGNALS: protected: QMaterial(QMaterialPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QMaterial) - QT3D_CLONEABLE(QMaterial) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qparameter.cpp b/src/render/materialsystem/qparameter.cpp index c4bea633b..8d05290aa 100644 --- a/src/render/materialsystem/qparameter.cpp +++ b/src/render/materialsystem/qparameter.cpp @@ -64,15 +64,6 @@ void QParameterPrivate::setValue(const QVariant &v) m_value = v; } -void QParameter::copy(const QNode *ref) -{ - QNode::copy(ref); - const QParameter *param = static_cast<const QParameter*>(ref); - d_func()->m_name = param->d_func()->m_name; - d_func()->m_value = param->d_func()->m_value; - d_func()->m_backendValue = param->d_func()->m_backendValue; -} - /*! \internal */ QParameter::QParameter(QParameterPrivate &dd, QNode *parent) : QNode(dd, parent) diff --git a/src/render/materialsystem/qparameter.h b/src/render/materialsystem/qparameter.h index 1ec5bc556..590bfc166 100644 --- a/src/render/materialsystem/qparameter.h +++ b/src/render/materialsystem/qparameter.h @@ -75,11 +75,9 @@ Q_SIGNALS: protected: QParameter(QParameterPrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QParameter) - QT3D_CLONEABLE(QParameter) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qrenderpass.cpp b/src/render/materialsystem/qrenderpass.cpp index c0191512a..d3ad56623 100644 --- a/src/render/materialsystem/qrenderpass.cpp +++ b/src/render/materialsystem/qrenderpass.cpp @@ -60,20 +60,6 @@ QRenderPassPrivate::QRenderPassPrivate() { } -void QRenderPass::copy(const QNode *ref) -{ - QNode::copy(ref); - const QRenderPass *other = static_cast<const QRenderPass*>(ref); - d_func()->m_shader = qobject_cast<QShaderProgram *>(QNode::clone(other->d_func()->m_shader)); - - Q_FOREACH (QFilterKey *crit, other->d_func()->m_filterKeyList) - addFilterKey(qobject_cast<QFilterKey *>(QNode::clone(crit))); - Q_FOREACH (QRenderState *renderState, other->d_func()->m_renderStates) - addRenderState(qobject_cast<QRenderState *>(QNode::clone(renderState))); - Q_FOREACH (QParameter *p, other->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); -} - QRenderPass::QRenderPass(QNode *parent) : QNode(*new QRenderPassPrivate, parent) { diff --git a/src/render/materialsystem/qrenderpass.h b/src/render/materialsystem/qrenderpass.h index 971f01eee..def35fef7 100644 --- a/src/render/materialsystem/qrenderpass.h +++ b/src/render/materialsystem/qrenderpass.h @@ -89,11 +89,9 @@ Q_SIGNALS: protected: QRenderPass(QRenderPassPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QRenderPass) - QT3D_CLONEABLE(QRenderPass) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qshaderdata.cpp b/src/render/materialsystem/qshaderdata.cpp index e19c28b73..062b28549 100644 --- a/src/render/materialsystem/qshaderdata.cpp +++ b/src/render/materialsystem/qshaderdata.cpp @@ -88,32 +88,6 @@ QShaderData::QShaderData(QShaderDataPrivate &dd, QNode *parent) { } -void QShaderData::copy(const QNode *ref) -{ - QNode::copy(ref); - const QShaderData *shaderData = static_cast<const QShaderData *>(ref); - // We need to copy the properties - // At the moment we assume that the properties are copyable - // this may change in a later refactoring - - const QMetaObject *metaObject = shaderData->metaObject(); - const int propertyOffset = QShaderData::staticMetaObject.propertyOffset(); - const int propertyCount = metaObject->propertyCount(); - - // Copy properties of shaderData - for (int i = propertyOffset; i < propertyCount; ++i) { - const QMetaProperty property = metaObject->property(i); - if (property.isWritable()) { - setProperty(property.name(), propertyReader()->readProperty(shaderData->property(property.name()))); - } - } - - // Also copy the dynamic properties - foreach (const QByteArray &propertyName, shaderData->dynamicPropertyNames()) { - setProperty(propertyName, propertyReader()->readProperty(shaderData->property(propertyName))); - } -} - Qt3DCore::QNodeCreatedChangeBasePtr QShaderData::createNodeCreationChange() const { auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QShaderDataData>::create(this); diff --git a/src/render/materialsystem/qshaderdata.h b/src/render/materialsystem/qshaderdata.h index 325948fba..7c74c58d7 100644 --- a/src/render/materialsystem/qshaderdata.h +++ b/src/render/materialsystem/qshaderdata.h @@ -75,12 +75,9 @@ public: protected: QShaderData(QShaderDataPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QShaderData) - QT3D_CLONEABLE(QShaderData) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qshaderprogram.cpp b/src/render/materialsystem/qshaderprogram.cpp index 612e89bdd..4c7d99e15 100644 --- a/src/render/materialsystem/qshaderprogram.cpp +++ b/src/render/materialsystem/qshaderprogram.cpp @@ -55,19 +55,6 @@ QShaderProgramPrivate::QShaderProgramPrivate() { } -void QShaderProgram::copy(const QNode *ref) -{ - QNode::copy(ref); - const QShaderProgram *prog = static_cast<const QShaderProgram*>(ref); - - d_func()->m_vertexShaderCode = prog->d_func()->m_vertexShaderCode; - d_func()->m_tessControlShaderCode = prog->d_func()->m_tessControlShaderCode; - d_func()->m_tessEvalShaderCode = prog->d_func()->m_tessEvalShaderCode; - d_func()->m_geometryShaderCode = prog->d_func()->m_geometryShaderCode; - d_func()->m_fragmentShaderCode = prog->d_func()->m_fragmentShaderCode; - d_func()->m_computeShaderCode = prog->d_func()->m_computeShaderCode; -} - QShaderProgram::QShaderProgram(QNode *parent) : QNode(*new QShaderProgramPrivate, parent) { diff --git a/src/render/materialsystem/qshaderprogram.h b/src/render/materialsystem/qshaderprogram.h index 3e88c1f4c..82b0a686e 100644 --- a/src/render/materialsystem/qshaderprogram.h +++ b/src/render/materialsystem/qshaderprogram.h @@ -103,11 +103,9 @@ Q_SIGNALS: protected: QShaderProgram(QShaderProgramPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QShaderProgram) - QT3D_CLONEABLE(QShaderProgram) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/materialsystem/qtechnique.cpp b/src/render/materialsystem/qtechnique.cpp index 659350a2f..7353fbe2d 100644 --- a/src/render/materialsystem/qtechnique.cpp +++ b/src/render/materialsystem/qtechnique.cpp @@ -75,21 +75,6 @@ QTechnique::QTechnique(QTechniquePrivate &dd, QNode *parent) QObject::connect(&d->m_graphicsApiFilter, SIGNAL(graphicsApiFilterChanged()), this, SLOT(_q_graphicsApiFilterChanged())); } -void QTechnique::copy(const QNode *ref) -{ - QNode::copy(ref); - const QTechnique *tech = static_cast<const QTechnique*>(ref); - QGraphicsApiFilterPrivate::get(const_cast<QGraphicsApiFilter *>(&d_func()->m_graphicsApiFilter))->m_data = - QGraphicsApiFilterPrivate::get(const_cast<QGraphicsApiFilter *>(&tech->d_func()->m_graphicsApiFilter))->m_data; - - Q_FOREACH (QFilterKey *annotation, tech->d_func()->m_filterKeys) - addFilterKey(qobject_cast<QFilterKey *>(QNode::clone(annotation))); - Q_FOREACH (QRenderPass *pass, tech->d_func()->m_renderPasses) - addRenderPass(qobject_cast<QRenderPass *>(QNode::clone(pass))); - Q_FOREACH (QParameter *p, tech->d_func()->m_parameters) - addParameter(qobject_cast<QParameter *>(QNode::clone(p))); -} - void QTechniquePrivate::_q_graphicsApiFilterChanged() { if (m_changeArbiter != Q_NULLPTR) { diff --git a/src/render/materialsystem/qtechnique.h b/src/render/materialsystem/qtechnique.h index 737bbd005..d9f7a1fb1 100644 --- a/src/render/materialsystem/qtechnique.h +++ b/src/render/materialsystem/qtechnique.h @@ -79,11 +79,9 @@ public: protected: QTechnique(QTechniquePrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(QTechnique) - QT3D_CLONEABLE(QTechnique) Q_PRIVATE_SLOT(d_func(), void _q_graphicsApiFilterChanged()) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/picking/qobjectpicker.cpp b/src/render/picking/qobjectpicker.cpp index 111332fda..3f2af9694 100644 --- a/src/render/picking/qobjectpicker.cpp +++ b/src/render/picking/qobjectpicker.cpp @@ -186,14 +186,6 @@ bool QObjectPicker::isPressed() const return d->m_pressed; } -void QObjectPicker::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QObjectPicker *picker = static_cast<const QObjectPicker *>(ref); - d_func()->m_hoverEnabled = picker->d_func()->m_hoverEnabled; - d_func()->m_dragEnabled = picker->d_func()->m_dragEnabled; -} - void QObjectPicker::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QObjectPicker); diff --git a/src/render/picking/qobjectpicker.h b/src/render/picking/qobjectpicker.h index cddb731b8..607d332ba 100644 --- a/src/render/picking/qobjectpicker.h +++ b/src/render/picking/qobjectpicker.h @@ -85,12 +85,12 @@ Q_SIGNALS: void containsMouseChanged(bool containsMouse); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; private: - QT3D_CLONEABLE(QObjectPicker) Q_DECLARE_PRIVATE(QObjectPicker) + + // TODO: Handle creation changes }; } // Qt3D diff --git a/src/render/renderstates/qalphacoverage.h b/src/render/renderstates/qalphacoverage.h index 885bc8651..f488fe520 100644 --- a/src/render/renderstates/qalphacoverage.h +++ b/src/render/renderstates/qalphacoverage.h @@ -57,7 +57,6 @@ public: private: Q_DECLARE_PRIVATE(QAlphaCoverage) - QT3D_CLONEABLE(QAlphaCoverage) }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qalphatest.cpp b/src/render/renderstates/qalphatest.cpp index f0e29cec1..d6b4d03b7 100644 --- a/src/render/renderstates/qalphatest.cpp +++ b/src/render/renderstates/qalphatest.cpp @@ -51,14 +51,6 @@ QAlphaTest::QAlphaTest(QNode *parent) { } -void QAlphaTest::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QAlphaTest *refState = static_cast<const QAlphaTest*>(ref); - d_func()->m_alphaFunction = refState->d_func()->m_alphaFunction; - d_func()->m_referenceValue = refState->d_func()->m_referenceValue; -} - QAlphaTest::AlphaFunction QAlphaTest::alphaFunction() const { Q_D(const QAlphaTest); diff --git a/src/render/renderstates/qalphatest.h b/src/render/renderstates/qalphatest.h index df8e4a4e9..2807cef79 100644 --- a/src/render/renderstates/qalphatest.h +++ b/src/render/renderstates/qalphatest.h @@ -81,12 +81,8 @@ Q_SIGNALS: void alphaFunctionChanged(AlphaFunction alphaFunction); void referenceValueChanged(float referenceValue); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QAlphaTest) - QT3D_CLONEABLE(QAlphaTest) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qblendequation.cpp b/src/render/renderstates/qblendequation.cpp index d805062a9..5062b157d 100644 --- a/src/render/renderstates/qblendequation.cpp +++ b/src/render/renderstates/qblendequation.cpp @@ -46,13 +46,6 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -void QBlendEquation::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QBlendEquation *refState = reinterpret_cast<const QBlendEquation*>(ref); - d_func()->m_blendFunction = refState->d_func()->m_blendFunction; -} - QBlendEquation::QBlendEquation(QNode *parent) : QRenderState(*new QBlendEquationPrivate, parent) { diff --git a/src/render/renderstates/qblendequation.h b/src/render/renderstates/qblendequation.h index cde1b07c3..5165ce90a 100644 --- a/src/render/renderstates/qblendequation.h +++ b/src/render/renderstates/qblendequation.h @@ -75,12 +75,8 @@ public Q_SLOTS: Q_SIGNALS: void blendFunctionChanged(BlendFunction blendFunction); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QBlendEquation) - QT3D_CLONEABLE(QBlendEquation) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qblendequationarguments.cpp b/src/render/renderstates/qblendequationarguments.cpp index 03e0bf68f..7983b9c0a 100644 --- a/src/render/renderstates/qblendequationarguments.cpp +++ b/src/render/renderstates/qblendequationarguments.cpp @@ -83,21 +83,6 @@ QBlendEquationArguments::QBlendEquationArguments(QNode *parent) { } -/*! \fn void QBlendEquationArguments::copy(const Qt3DCore::QNode *ref) - \internal - Copies \a ref into this object. - */ -void QBlendEquationArguments::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QBlendEquationArguments *refState = static_cast<const QBlendEquationArguments*>(ref); - d_func()->m_sourceRgb = refState->d_func()->m_sourceRgb; - d_func()->m_sourceAlpha = refState->d_func()->m_sourceAlpha; - d_func()->m_destinationAlpha = refState->d_func()->m_destinationAlpha; - d_func()->m_destinationRgb = refState->d_func()->m_destinationRgb; - d_func()->m_bufferIndex = refState->d_func()->m_bufferIndex; -} - /*! \internal */ diff --git a/src/render/renderstates/qblendequationarguments.h b/src/render/renderstates/qblendequationarguments.h index d4994c1a6..47b14bde1 100644 --- a/src/render/renderstates/qblendequationarguments.h +++ b/src/render/renderstates/qblendequationarguments.h @@ -112,12 +112,10 @@ Q_SIGNALS: void bufferIndexChanged(int index); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; QBlendEquationArguments(QBlendEquationArgumentsPrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); private: Q_DECLARE_PRIVATE(QBlendEquationArguments) - QT3D_CLONEABLE(QBlendEquationArguments) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qclipplane.cpp b/src/render/renderstates/qclipplane.cpp index 14b3e4aba..2deab3bf1 100644 --- a/src/render/renderstates/qclipplane.cpp +++ b/src/render/renderstates/qclipplane.cpp @@ -131,15 +131,6 @@ void QClipPlane::setDistance(float distance) } } -void QClipPlane::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QClipPlane *refClip = static_cast<const QClipPlane *>(ref); - d_func()->m_planeIndex = refClip->planeIndex(); - d_func()->m_normal = refClip->normal(); - d_func()->m_distance = refClip->distance(); -} - Qt3DCore::QNodeCreatedChangeBasePtr QClipPlane::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QClipPlaneData>::create(this); diff --git a/src/render/renderstates/qclipplane.h b/src/render/renderstates/qclipplane.h index 0e5489871..c0a951427 100644 --- a/src/render/renderstates/qclipplane.h +++ b/src/render/renderstates/qclipplane.h @@ -67,9 +67,6 @@ public Q_SLOTS: void setNormal(QVector3D); void setDistance(float); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_FINAL; - Q_SIGNALS: void planeIndexChanged(int planeIndex); void normalChanged(QVector3D normal); @@ -77,7 +74,6 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QClipPlane) - QT3D_CLONEABLE(QClipPlane) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qcolormask.cpp b/src/render/renderstates/qcolormask.cpp index c9677154e..da231dc2d 100644 --- a/src/render/renderstates/qcolormask.cpp +++ b/src/render/renderstates/qcolormask.cpp @@ -143,16 +143,6 @@ void QColorMask::setAlphaMasked(bool alphaMasked) } } -void QColorMask::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QColorMask *refState = static_cast<const QColorMask *>(ref); - d_func()->m_redMasked = refState->d_func()->m_redMasked; - d_func()->m_greenMasked = refState->d_func()->m_greenMasked; - d_func()->m_blueMasked = refState->d_func()->m_blueMasked; - d_func()->m_alphaMasked = refState->d_func()->m_alphaMasked; -} - Qt3DCore::QNodeCreatedChangeBasePtr QColorMask::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QColorMaskData>::create(this); diff --git a/src/render/renderstates/qcolormask.h b/src/render/renderstates/qcolormask.h index 042a07b71..bd59cc85d 100644 --- a/src/render/renderstates/qcolormask.h +++ b/src/render/renderstates/qcolormask.h @@ -76,12 +76,8 @@ Q_SIGNALS: void blueMaskedChanged(bool blueMasked); void alphaMaskedChanged(bool alphaMasked); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_FINAL; - private: Q_DECLARE_PRIVATE(QColorMask) - QT3D_CLONEABLE(QColorMask) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qcullface.cpp b/src/render/renderstates/qcullface.cpp index cb7dc3f28..cebb55761 100644 --- a/src/render/renderstates/qcullface.cpp +++ b/src/render/renderstates/qcullface.cpp @@ -51,13 +51,6 @@ QCullFace::QCullFace(QNode *parent) { } -void QCullFace::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QCullFace *refState = static_cast<const QCullFace*>(ref); - d_func()->m_mode = refState->d_func()->m_mode; -} - QCullFace::CullingMode QCullFace::mode() const { Q_D(const QCullFace); diff --git a/src/render/renderstates/qcullface.h b/src/render/renderstates/qcullface.h index cc766d32d..acdb0336a 100644 --- a/src/render/renderstates/qcullface.h +++ b/src/render/renderstates/qcullface.h @@ -76,12 +76,8 @@ public Q_SLOTS: Q_SIGNALS: void modeChanged(CullingMode mode); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QCullFace) - QT3D_CLONEABLE(QCullFace) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qdepthtest.cpp b/src/render/renderstates/qdepthtest.cpp index c8348e161..00207c824 100644 --- a/src/render/renderstates/qdepthtest.cpp +++ b/src/render/renderstates/qdepthtest.cpp @@ -46,13 +46,6 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { -void QDepthTest::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QDepthTest *refState = static_cast<const QDepthTest*>(ref); - d_func()->m_depthFunction = refState->d_func()->m_depthFunction; -} - QDepthTest::QDepthTest(QNode *parent) : QRenderState(*new QDepthTestPrivate, parent) { diff --git a/src/render/renderstates/qdepthtest.h b/src/render/renderstates/qdepthtest.h index d6b57e95b..322170f9e 100644 --- a/src/render/renderstates/qdepthtest.h +++ b/src/render/renderstates/qdepthtest.h @@ -77,12 +77,8 @@ public Q_SLOTS: Q_SIGNALS: void depthFunctionChanged(DepthFunction depthFunction); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QDepthTest) - QT3D_CLONEABLE(QDepthTest) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qdithering.h b/src/render/renderstates/qdithering.h index aae5aa1e5..f151790a8 100644 --- a/src/render/renderstates/qdithering.h +++ b/src/render/renderstates/qdithering.h @@ -57,7 +57,6 @@ public: private: Q_DECLARE_PRIVATE(QDithering) - QT3D_CLONEABLE(QDithering) }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qfrontface.cpp b/src/render/renderstates/qfrontface.cpp index 300626a63..e5efcb882 100644 --- a/src/render/renderstates/qfrontface.cpp +++ b/src/render/renderstates/qfrontface.cpp @@ -51,13 +51,6 @@ QFrontFace::QFrontFace(QNode *parent) { } -void QFrontFace::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QFrontFace *refState = static_cast<const QFrontFace*>(ref); - d_func()->m_direction = refState->d_func()->m_direction; -} - QFrontFace::WindingDirection QFrontFace::direction() const { Q_D(const QFrontFace); diff --git a/src/render/renderstates/qfrontface.h b/src/render/renderstates/qfrontface.h index 02bbbb67d..c2441c270 100644 --- a/src/render/renderstates/qfrontface.h +++ b/src/render/renderstates/qfrontface.h @@ -72,12 +72,8 @@ public Q_SLOTS: Q_SIGNALS: void directionChanged(WindingDirection direction); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QFrontFace) - QT3D_CLONEABLE(QFrontFace) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qmultisampleantialiasing.h b/src/render/renderstates/qmultisampleantialiasing.h index 8393a38ab..fa672189b 100644 --- a/src/render/renderstates/qmultisampleantialiasing.h +++ b/src/render/renderstates/qmultisampleantialiasing.h @@ -57,7 +57,6 @@ public: private: Q_DECLARE_PRIVATE(QMultiSampleAntiAliasing) - QT3D_CLONEABLE(QMultiSampleAntiAliasing) }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qnodepthmask.h b/src/render/renderstates/qnodepthmask.h index d4fa653fa..6e7c4b8fa 100644 --- a/src/render/renderstates/qnodepthmask.h +++ b/src/render/renderstates/qnodepthmask.h @@ -57,7 +57,6 @@ public: private: Q_DECLARE_PRIVATE(QNoDepthMask) - QT3D_CLONEABLE(QNoDepthMask) }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qpointsize.cpp b/src/render/renderstates/qpointsize.cpp index c3fa6e3ee..908940e0f 100644 --- a/src/render/renderstates/qpointsize.cpp +++ b/src/render/renderstates/qpointsize.cpp @@ -87,17 +87,6 @@ void QPointSize::setValue(float size) emit valueChanged(size); } -void QPointSize::copy(const Qt3DCore::QNode *ref) -{ - const QPointSize *refState = static_cast<const QPointSize *>(ref); - - QRenderState::copy(ref); - - Q_D(QPointSize); - d->m_value = refState->d_func()->m_value; - d->m_sizeMode = refState->d_func()->m_sizeMode; -} - Qt3DCore::QNodeCreatedChangeBasePtr QPointSize::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QPointSizeData>::create(this); diff --git a/src/render/renderstates/qpointsize.h b/src/render/renderstates/qpointsize.h index 66628a694..3ba3c7f3a 100644 --- a/src/render/renderstates/qpointsize.h +++ b/src/render/renderstates/qpointsize.h @@ -73,12 +73,8 @@ Q_SIGNALS: void sizeModeChanged(SizeMode sizeMode); void valueChanged(float value); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_FINAL; - private: Q_DECLARE_PRIVATE(QPointSize) - QT3D_CLONEABLE(QPointSize) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qpolygonoffset.cpp b/src/render/renderstates/qpolygonoffset.cpp index 590c434db..edada68ae 100644 --- a/src/render/renderstates/qpolygonoffset.cpp +++ b/src/render/renderstates/qpolygonoffset.cpp @@ -80,14 +80,6 @@ void QPolygonOffset::setDepthSteps(float depthSteps) } } -void QPolygonOffset::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QPolygonOffset *refState = static_cast<const QPolygonOffset *>(ref); - d_func()->m_scaleFactor = refState->d_func()->m_scaleFactor; - d_func()->m_depthSteps = refState->d_func()->m_depthSteps; -} - Qt3DCore::QNodeCreatedChangeBasePtr QPolygonOffset::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QPolygonOffsetData>::create(this); diff --git a/src/render/renderstates/qpolygonoffset.h b/src/render/renderstates/qpolygonoffset.h index 599397e42..6192f70fd 100644 --- a/src/render/renderstates/qpolygonoffset.h +++ b/src/render/renderstates/qpolygonoffset.h @@ -68,12 +68,8 @@ Q_SIGNALS: void scaleFactorChanged(float scaleFactor); void depthStepsChanged(float depthSteps); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QPolygonOffset) - QT3D_CLONEABLE(QPolygonOffset) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qrenderstate.cpp b/src/render/renderstates/qrenderstate.cpp index 9167366ff..19a25fc72 100644 --- a/src/render/renderstates/qrenderstate.cpp +++ b/src/render/renderstates/qrenderstate.cpp @@ -61,11 +61,6 @@ const QRenderStatePrivate *QRenderStatePrivate::get(const QRenderState *state) return state->d_func(); } -QRenderState::~QRenderState() -{ - Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DRender::QRenderState subclass didn't call QNode::cleanup in its destructor"); -} - /*! \internal */ QRenderState::QRenderState(QRenderStatePrivate &dd, QNode *parent) : QNode(dd, parent) diff --git a/src/render/renderstates/qrenderstate.h b/src/render/renderstates/qrenderstate.h index c26bb6f27..126dfaf0f 100644 --- a/src/render/renderstates/qrenderstate.h +++ b/src/render/renderstates/qrenderstate.h @@ -54,9 +54,6 @@ class QT3DRENDERSHARED_EXPORT QRenderState : public Qt3DCore::QNode { Q_OBJECT -public: - ~QRenderState(); - protected: QRenderState(QRenderStatePrivate &dd, Qt3DCore::QNode *parent = Q_NULLPTR); diff --git a/src/render/renderstates/qscissortest.cpp b/src/render/renderstates/qscissortest.cpp index ea24838bc..e56ac83e6 100644 --- a/src/render/renderstates/qscissortest.cpp +++ b/src/render/renderstates/qscissortest.cpp @@ -51,16 +51,6 @@ QScissorTest::QScissorTest(QNode *parent) { } -void QScissorTest::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QScissorTest *refState = static_cast<const QScissorTest*>(ref); - d_func()->m_left = refState->d_func()->m_left; - d_func()->m_bottom = refState->d_func()->m_bottom; - d_func()->m_width = refState->d_func()->m_width; - d_func()->m_height = refState->d_func()->m_height; -} - int QScissorTest::left() const { Q_D(const QScissorTest); diff --git a/src/render/renderstates/qscissortest.h b/src/render/renderstates/qscissortest.h index 9e7b770cc..15b5630bf 100644 --- a/src/render/renderstates/qscissortest.h +++ b/src/render/renderstates/qscissortest.h @@ -77,12 +77,8 @@ Q_SIGNALS: void widthChanged(int width); void heightChanged(int height); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QScissorTest) - QT3D_CLONEABLE(QScissorTest) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qseamlesscubemap.h b/src/render/renderstates/qseamlesscubemap.h index f9fc11170..029c6d674 100644 --- a/src/render/renderstates/qseamlesscubemap.h +++ b/src/render/renderstates/qseamlesscubemap.h @@ -57,7 +57,6 @@ public: private: Q_DECLARE_PRIVATE(QSeamlessCubemap) - QT3D_CLONEABLE(QSeamlessCubemap) }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qstencilmask.cpp b/src/render/renderstates/qstencilmask.cpp index fe62b87d0..79416eba9 100644 --- a/src/render/renderstates/qstencilmask.cpp +++ b/src/render/renderstates/qstencilmask.cpp @@ -84,14 +84,6 @@ uint QStencilMask::backOutputMask() const return d->m_backOutputMask; } -void QStencilMask::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QStencilMask *otherRef = static_cast<const QStencilMask *>(ref); - d_func()->m_frontOutputMask = otherRef->frontOutputMask(); - d_func()->m_backOutputMask = otherRef->backOutputMask(); -} - Qt3DCore::QNodeCreatedChangeBasePtr QStencilMask::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QStencilMaskData>::create(this); diff --git a/src/render/renderstates/qstencilmask.h b/src/render/renderstates/qstencilmask.h index ed75d3222..9308ab3b9 100644 --- a/src/render/renderstates/qstencilmask.h +++ b/src/render/renderstates/qstencilmask.h @@ -67,12 +67,8 @@ Q_SIGNALS: void frontOutputMaskChanged(uint frontOutputMask); void backOutputMaskChanged(uint backOutputMask); -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_FINAL; - private: Q_DECLARE_PRIVATE(QStencilMask) - QT3D_CLONEABLE(QStencilMask) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qstenciloperation.cpp b/src/render/renderstates/qstenciloperation.cpp index b8ea5bf24..78281a8b3 100644 --- a/src/render/renderstates/qstenciloperation.cpp +++ b/src/render/renderstates/qstenciloperation.cpp @@ -63,18 +63,6 @@ QStencilOperationArguments *QStencilOperation::back() const return d->m_back; } -void QStencilOperation::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QStencilOperation *refState = static_cast<const QStencilOperation*>(ref); - d_func()->m_back->setDepthTestFailureOperation(refState->d_func()->m_back->depthTestFailureOperation()); - d_func()->m_back->setStencilTestFailureOperation(refState->d_func()->m_back->stencilTestFailureOperation()); - d_func()->m_back->setAllTestsPassOperation(refState->d_func()->m_back->allTestsPassOperation()); - d_func()->m_front->setDepthTestFailureOperation(refState->d_func()->m_front->depthTestFailureOperation()); - d_func()->m_front->setStencilTestFailureOperation(refState->d_func()->m_front->stencilTestFailureOperation()); - d_func()->m_front->setAllTestsPassOperation(refState->d_func()->m_front->allTestsPassOperation()); -} - Qt3DCore::QNodeCreatedChangeBasePtr QStencilOperation::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QStencilOperationData>::create(this); diff --git a/src/render/renderstates/qstenciloperation.h b/src/render/renderstates/qstenciloperation.h index 2d8a784ca..9d360a0e2 100644 --- a/src/render/renderstates/qstenciloperation.h +++ b/src/render/renderstates/qstenciloperation.h @@ -61,12 +61,8 @@ public: QStencilOperationArguments *front() const; QStencilOperationArguments *back() const; -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_FINAL; - private: Q_DECLARE_PRIVATE(QStencilOperation) - QT3D_CLONEABLE(QStencilOperation) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/renderstates/qstenciltest.cpp b/src/render/renderstates/qstenciltest.cpp index a6ccf860d..21cf66d8a 100644 --- a/src/render/renderstates/qstenciltest.cpp +++ b/src/render/renderstates/qstenciltest.cpp @@ -64,18 +64,6 @@ QStencilTestArguments *QStencilTest::back() const return d->m_back; } -void QStencilTest::copy(const QNode *ref) -{ - QRenderState::copy(ref); - const QStencilTest *refState = static_cast<const QStencilTest*>(ref); - d_func()->m_front->setComparisonMask(refState->d_func()->m_front->comparisonMask()); - d_func()->m_front->setReferenceValue(refState->d_func()->m_front->referenceValue()); - d_func()->m_front->setStencilFunction(refState->d_func()->m_front->stencilFunction()); - d_func()->m_back->setComparisonMask(refState->d_func()->m_back->comparisonMask()); - d_func()->m_back->setReferenceValue(refState->d_func()->m_back->referenceValue()); - d_func()->m_back->setStencilFunction(refState->d_func()->m_back->stencilFunction()); -} - Qt3DCore::QNodeCreatedChangeBasePtr QStencilTest::createNodeCreationChange() const { auto creationChange = QRenderStateCreatedChangePtr<QStencilTestData>::create(this); diff --git a/src/render/renderstates/qstenciltest.h b/src/render/renderstates/qstenciltest.h index 3ffca7d89..295e913ca 100644 --- a/src/render/renderstates/qstenciltest.h +++ b/src/render/renderstates/qstenciltest.h @@ -61,12 +61,8 @@ public: QStencilTestArguments *front() const; QStencilTestArguments *back() const; -protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - private: Q_DECLARE_PRIVATE(QStencilTest) - QT3D_CLONEABLE(QStencilTest) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/texture/qabstracttexture.cpp b/src/render/texture/qabstracttexture.cpp index 868e3fcf0..112579b20 100644 --- a/src/render/texture/qabstracttexture.cpp +++ b/src/render/texture/qabstracttexture.cpp @@ -68,27 +68,6 @@ QAbstractTexturePrivate::QAbstractTexturePrivate() { } -void QAbstractTexture::copy(const QNode *ref) -{ - QNode::copy(ref); - const QAbstractTexture *t = static_cast<const QAbstractTexture*>(ref); - d_func()->m_target = t->d_func()->m_target; - d_func()->m_width = t->d_func()->m_width; - d_func()->m_height = t->d_func()->m_height; - d_func()->m_depth = t->d_func()->m_depth; - d_func()->m_format = t->d_func()->m_format; - d_func()->m_wrapMode.setX(t->d_func()->m_wrapMode.x()); - d_func()->m_wrapMode.setY(t->d_func()->m_wrapMode.y()); - d_func()->m_wrapMode.setZ(t->d_func()->m_wrapMode.z()); - d_func()->m_minFilter = t->d_func()->m_minFilter; - d_func()->m_magFilter = t->d_func()->m_magFilter; - d_func()->m_autoMipMap = t->d_func()->m_autoMipMap; - d_func()->m_maximumAnisotropy = t->d_func()->m_maximumAnisotropy; - d_func()->m_comparisonFunction = t->d_func()->m_comparisonFunction; - d_func()->m_comparisonMode = t->d_func()->m_comparisonMode; - d_func()->m_layers = t->d_func()->m_layers; -} - /*! \class Qt3DRender::QAbstractTexture \inmodule Qt3DRender diff --git a/src/render/texture/qabstracttexture.h b/src/render/texture/qabstracttexture.h index f25b08afe..5a76a2267 100644 --- a/src/render/texture/qabstracttexture.h +++ b/src/render/texture/qabstracttexture.h @@ -326,12 +326,10 @@ protected: explicit QAbstractTexture(Target target, Qt3DCore::QNode *parent = nullptr); QAbstractTexture(QAbstractTexturePrivate &dd, Qt3DCore::QNode *parent = nullptr); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void setStatus(Status status); private: Q_DECLARE_PRIVATE(QAbstractTexture) - QT3D_CLONEABLE(QAbstractTexture) Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; diff --git a/src/render/texture/qabstracttextureimage.cpp b/src/render/texture/qabstracttextureimage.cpp index c6266e4cc..7debb2567 100644 --- a/src/render/texture/qabstracttextureimage.cpp +++ b/src/render/texture/qabstracttextureimage.cpp @@ -90,7 +90,6 @@ QAbstractTextureImage::QAbstractTextureImage(QNode *parent) */ QAbstractTextureImage::~QAbstractTextureImage() { - Q_ASSERT_X(Qt3DCore::QNodePrivate::get(this)->m_wasCleanedUp, Q_FUNC_INFO, "QNode::cleanup should have been called by now. A Qt3DRender::QAbstractTextureImage subclass didn't call QNode::cleanup in its destructor"); } @@ -201,18 +200,6 @@ void QAbstractTextureImage::notifyDataGeneratorChanged() } } -/*! - Copies \a ref into this object. - */ -void QAbstractTextureImage::copy(const QNode *ref) -{ - QNode::copy(ref); - const QAbstractTextureImage *imageRef = static_cast<const QAbstractTextureImage *>(ref); - d_func()->m_face = imageRef->face(); - d_func()->m_layer = imageRef->layer(); - d_func()->m_mipLevel = imageRef->mipLevel(); -} - /*! \internal */ QAbstractTextureImage::QAbstractTextureImage(QAbstractTextureImagePrivate &dd, QNode *parent) : QNode(dd, parent) diff --git a/src/render/texture/qabstracttextureimage.h b/src/render/texture/qabstracttextureimage.h index dd27c1513..90e9e7194 100644 --- a/src/render/texture/qabstracttextureimage.h +++ b/src/render/texture/qabstracttextureimage.h @@ -92,7 +92,6 @@ Q_SIGNALS: void faceChanged(QAbstractTexture::CubeMapFace face); protected: - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void notifyDataGeneratorChanged(); virtual QTextureImageDataGeneratorPtr dataGenerator() const = 0; QAbstractTextureImage(QAbstractTextureImagePrivate &dd, Qt3DCore::QNode *parent = nullptr); diff --git a/src/render/texture/qtextureimage.cpp b/src/render/texture/qtextureimage.cpp index a074a514e..578867374 100644 --- a/src/render/texture/qtextureimage.cpp +++ b/src/render/texture/qtextureimage.cpp @@ -144,16 +144,6 @@ void QTextureImage::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) setStatus(static_cast<QTextureImage::Status>(e->value().toInt())); } -/*! - Copies \a ref into this texture image. - */ -void QTextureImage::copy(const QNode *ref) -{ - QAbstractTextureImage::copy(ref); - const QTextureImage *img = static_cast<const QTextureImage *>(ref); - d_func()->m_source = img->source(); -} - } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/render/texture/qtextureimage.h b/src/render/texture/qtextureimage.h index db6e0276d..878c27406 100644 --- a/src/render/texture/qtextureimage.h +++ b/src/render/texture/qtextureimage.h @@ -78,13 +78,11 @@ Q_SIGNALS: protected: void sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) Q_DECL_OVERRIDE; - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; void setStatus(Status status); private: QTextureImageDataGeneratorPtr dataGenerator() const Q_DECL_OVERRIDE; Q_DECLARE_PRIVATE(QTextureImage) - QT3D_CLONEABLE(QTextureImage) }; } // namespace Qt3DRender |