diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-08 15:56:06 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-09 12:23:57 +0200 |
commit | 39d0041f15601cee499c959702b004cbd721bed9 (patch) | |
tree | 95140b88dee61bd78d171cb958ceca0cca978ad1 /src/animation | |
parent | 93bd28e6d4ac8fdb6b07b30684e6b17ee515e44e (diff) |
Use QList instead of QVector in implementation and docs
Fix some const correctness.
Use list-initialization.
Task-number: QTBUG-84469
Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/animation')
45 files changed, 203 insertions, 210 deletions
diff --git a/src/animation/backend/abstractevaluateclipanimatorjob.cpp b/src/animation/backend/abstractevaluateclipanimatorjob.cpp index 5267d4526..43c1de260 100644 --- a/src/animation/backend/abstractevaluateclipanimatorjob.cpp +++ b/src/animation/backend/abstractevaluateclipanimatorjob.cpp @@ -54,7 +54,7 @@ public: void postFrame(Qt3DCore::QAspectManager *manager) override; AnimationRecord m_record; - QVector<AnimationCallbackAndValue> m_callbacks; + QList<AnimationCallbackAndValue> m_callbacks; }; AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob() @@ -62,7 +62,7 @@ AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob() { } -void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QVector<AnimationCallbackAndValue> &callbacks) +void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QList<AnimationCallbackAndValue> &callbacks) { auto mainThreadCB = callbacks; mainThreadCB.erase(std::remove_if(mainThreadCB.begin(), mainThreadCB.end(), [](const AnimationCallbackAndValue &callback) { diff --git a/src/animation/backend/abstractevaluateclipanimatorjob_p.h b/src/animation/backend/abstractevaluateclipanimatorjob_p.h index 2a8914faa..5bf88978a 100644 --- a/src/animation/backend/abstractevaluateclipanimatorjob_p.h +++ b/src/animation/backend/abstractevaluateclipanimatorjob_p.h @@ -63,7 +63,7 @@ class AbstractEvaluateClipAnimatorJob : public Qt3DCore::QAspectJob protected: AbstractEvaluateClipAnimatorJob(); - void setPostFrameData(const AnimationRecord &record, const QVector<AnimationCallbackAndValue> &callbacks); + void setPostFrameData(const AnimationRecord &record, const QList<AnimationCallbackAndValue> &callbacks); private: Q_DECLARE_PRIVATE(AbstractEvaluateClipAnimatorJob) diff --git a/src/animation/backend/additiveclipblend.cpp b/src/animation/backend/additiveclipblend.cpp index b89a1bbb2..338f64d36 100644 --- a/src/animation/backend/additiveclipblend.cpp +++ b/src/animation/backend/additiveclipblend.cpp @@ -68,7 +68,7 @@ void AdditiveClipBlend::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool f m_additiveClipId = Qt3DCore::qIdForNode(node->additiveClip()); } -ClipResults AdditiveClipBlend::doBlend(const QVector<ClipResults> &blendData) const +ClipResults AdditiveClipBlend::doBlend(const QList<ClipResults> &blendData) const { Q_ASSERT(blendData.size() == 2); Q_ASSERT(blendData[0].size() == blendData[1].size()); diff --git a/src/animation/backend/additiveclipblend_p.h b/src/animation/backend/additiveclipblend_p.h index 48e882303..3a89707c7 100644 --- a/src/animation/backend/additiveclipblend_p.h +++ b/src/animation/backend/additiveclipblend_p.h @@ -73,12 +73,12 @@ public: void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) final; - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - inline QVector<Qt3DCore::QNodeId> currentDependencyIds() const override + inline QList<Qt3DCore::QNodeId> currentDependencyIds() const override { return { m_baseClipId, m_additiveClipId }; } @@ -91,7 +91,7 @@ public: } protected: - ClipResults doBlend(const QVector<ClipResults> &blendData) const final; + ClipResults doBlend(const QList<ClipResults> &blendData) const final; private: Qt3DCore::QNodeId m_baseClipId; diff --git a/src/animation/backend/animationclip_p.h b/src/animation/backend/animationclip_p.h index ce97ef2c7..38bc117fe 100644 --- a/src/animation/backend/animationclip_p.h +++ b/src/animation/backend/animationclip_p.h @@ -78,7 +78,7 @@ public: void addDependingBlendedClipAnimator(const Qt3DCore::QNodeId &id); QString name() const { return m_name; } - const QVector<Channel> &channels() const { return m_channels; } + const QList<Channel> &channels() const { return m_channels; } // Called from jobs void loadAnimation(); @@ -117,7 +117,7 @@ private: ClipDataType m_dataType; QString m_name; - QVector<Channel> m_channels; + QList<Channel> m_channels; float m_duration; int m_channelComponentCount; @@ -134,7 +134,7 @@ inline QDebug operator<<(QDebug dbg, const AnimationClip &animationClip) << "Duration: " << animationClip.duration() << Qt::endl << "Channels:" << Qt::endl; - const QVector<Channel> channels = animationClip.channels(); + const QList<Channel> channels = animationClip.channels(); for (const auto &channel : channels) { dbg << channel; } diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp index a5656e230..2c0c5cb6d 100644 --- a/src/animation/backend/animationutils.cpp +++ b/src/animation/backend/animationutils.cpp @@ -60,12 +60,12 @@ const auto slerpThreshold = 0.01f; namespace Qt3DAnimation { namespace Animation { -inline QVector<float> valueToVector(const QVector3D &value) +inline QList<float> valueToVector(const QVector3D &value) { return { value.x(), value.y(), value.z() }; } -inline QVector<float> valueToVector(const QQuaternion &value) +inline QList<float> valueToVector(const QQuaternion &value) { return { value.scalar(), value.x(), value.y(), value.z() }; } @@ -157,17 +157,10 @@ ComponentIndices channelComponentsToIndices(const Channel &channel, int expectedComponentCount, int offset) { -#if defined Q_COMPILER_UNIFORM_INIT - static const QVector<char> standardSuffixes = { 'X', 'Y', 'Z', 'W' }; - static const QVector<char> quaternionSuffixes = { 'W', 'X', 'Y', 'Z' }; - static const QVector<char> colorSuffixesRGB = { 'R', 'G', 'B' }; - static const QVector<char> colorSuffixesRGBA = { 'R', 'G', 'B', 'A' }; -#else - static const QVector<char> standardSuffixes = (QVector<char>() << 'X' << 'Y' << 'Z' << 'W'); - static const QVector<char> quaternionSuffixes = (QVector<char>() << 'W' << 'X' << 'Y' << 'Z'); - static const QVector<char> colorSuffixesRGB = (QVector<char>() << 'R' << 'G' << 'B'); - static const QVector<char> colorSuffixesRGBA = (QVector<char>() << 'R' << 'G' << 'B' << 'A'); -#endif + static const QList<char> standardSuffixes = { 'X', 'Y', 'Z', 'W' }; + static const QList<char> quaternionSuffixes = { 'W', 'X', 'Y', 'Z' }; + static const QList<char> colorSuffixesRGB = { 'R', 'G', 'B' }; + static const QList<char> colorSuffixesRGBA = { 'R', 'G', 'B', 'A' }; switch (dataType) { case QVariant::Quaternion: @@ -189,7 +182,7 @@ ComponentIndices channelComponentsToIndices(const Channel &channel, ComponentIndices channelComponentsToIndicesHelper(const Channel &channel, int expectedComponentCount, int offset, - const QVector<char> &suffixes) + const QList<char> &suffixes) { const int actualComponentCount = channel.channelComponents.size(); if (actualComponentCount != expectedComponentCount) { @@ -200,7 +193,7 @@ ComponentIndices channelComponentsToIndicesHelper(const Channel &channel, ComponentIndices indices(expectedComponentCount); // Generate the set of channel suffixes - QVector<char> channelSuffixes; + QList<char> channelSuffixes; channelSuffixes.reserve(expectedComponentCount); for (int i = 0; i < expectedComponentCount; ++i) { const QString &componentName = channel.channelComponents[i].name; @@ -234,14 +227,14 @@ ComponentIndices channelComponentsToIndicesHelper(const Channel &channel, ClipResults evaluateClipAtLocalTime(AnimationClip *clip, float localTime) { - QVector<float> channelResults; + QList<float> channelResults; Q_ASSERT(clip); // Ensure we have enough storage to hold the evaluations channelResults.resize(clip->channelCount()); // Iterate over channels and evaluate the fcurves - const QVector<Channel> &channels = clip->channels(); + const QList<Channel> &channels = clip->channels(); int i = 0; for (const Channel &channel : channels) { if (channel.name.contains(QStringLiteral("Rotation")) && @@ -337,7 +330,7 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip, float phase) template<typename Container> Container mapChannelResultsToContainer(const MappingData &mappingData, - const QVector<float> &channelResults) + const QList<float> &channelResults) { Container r; r.reserve(channelResults.size()); @@ -349,9 +342,9 @@ Container mapChannelResultsToContainer(const MappingData &mappingData, return r; } -QVariant buildPropertyValue(const MappingData &mappingData, const QVector<float> &channelResults) +QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &channelResults) { - const int vectorOfFloatType = qMetaTypeId<QVector<float>>(); + const int vectorOfFloatType = qMetaTypeId<QList<float>>(); if (mappingData.type == vectorOfFloatType) return QVariant::fromValue(channelResults); @@ -416,8 +409,8 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QVector<float> } AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, - const QVector<MappingData> &mappingDataVec, - const QVector<float> &channelResults, + const QList<MappingData> &mappingDataVec, + const QList<float> &channelResults, bool finalFrame, float normalizedLocalTime) { @@ -475,10 +468,10 @@ AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, return record; } -QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec, - const QVector<float> &channelResults) +QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec, + const QList<float> &channelResults) { - QVector<AnimationCallbackAndValue> callbacks; + QList<AnimationCallbackAndValue> callbacks; for (const MappingData &mappingData : mappingDataVec) { if (!mappingData.callback) continue; @@ -498,10 +491,10 @@ QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> & // buildRequiredChannelsAndTypes() and assignChannelComponentIndices(). We are // currently repeating the iteration over mappings and extracting/generating // channel names, types and joint indices. -QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping*> &channelMappings, - const QVector<ChannelNameAndType> &channelNamesAndTypes, - const QVector<ComponentIndices> &channelComponentIndices, - const QVector<QBitArray> &sourceClipMask) +QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMappings, + const QList<ChannelNameAndType> &channelNamesAndTypes, + const QList<ComponentIndices> &channelComponentIndices, + const QList<QBitArray> &sourceClipMask) { // Accumulate the required number of mappings int maxMappingDatas = 0; @@ -519,7 +512,7 @@ QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping*> &chann } } } - QVector<MappingData> mappingDataVec; + QList<MappingData> mappingDataVec; mappingDataVec.reserve(maxMappingDatas); // Iterate over the mappings @@ -564,7 +557,7 @@ QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping*> &chann } case ChannelMapping::SkeletonMappingType: { - const QVector<ChannelNameAndType> jointProperties + const QList<ChannelNameAndType> jointProperties = { { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), Translation }, { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), Rotation }, { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), Scale } }; @@ -628,15 +621,15 @@ QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping*> &chann return mappingDataVec; } -QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, +QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, const ChannelMapper *mapper) { ChannelMappingManager *mappingManager = handler->channelMappingManager(); - const QVector<Qt3DCore::QNodeId> mappingIds = mapper->mappingIds(); + const QList<Qt3DCore::QNodeId> mappingIds = mapper->mappingIds(); // Reserve enough storage assuming each mapping is for a different channel. // May be overkill but avoids potential for multiple allocations - QVector<ChannelNameAndType> namesAndTypes; + QList<ChannelNameAndType> namesAndTypes; namesAndTypes.reserve(mappingIds.size()); // Iterate through the mappings and add ones not already used by an earlier mapping. @@ -667,7 +660,7 @@ QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, case ChannelMapping::SkeletonMappingType: { // Add an entry for each scale/rotation/translation property of each joint index // of the target skeleton. - const QVector<ChannelNameAndType> jointProperties + const QList<ChannelNameAndType> jointProperties = { { QLatin1String("Location"), static_cast<int>(QVariant::Vector3D), Translation }, { QLatin1String("Rotation"), static_cast<int>(QVariant::Quaternion), Rotation }, { QLatin1String("Scale"), static_cast<int>(QVariant::Vector3D), Scale } }; @@ -696,9 +689,9 @@ QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, return namesAndTypes; } -QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &namesAndTypes) +QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes) { - QVector<ComponentIndices> channelComponentIndices; + QList<ComponentIndices> channelComponentIndices; channelComponentIndices.reserve(namesAndTypes.size()); int baseIndex = 0; @@ -718,7 +711,7 @@ QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNam return channelComponentIndices; } -QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, +QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, Qt3DCore::QNodeId blendTreeRootId) { Q_ASSERT(handler); @@ -728,7 +721,7 @@ QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, ClipBlendNodeManager *nodeManager = handler->clipBlendNodeManager(); // Visit the tree in a pre-order manner and collect the dependencies - QVector<Qt3DCore::QNodeId> clipIds; + QList<Qt3DCore::QNodeId> clipIds; ClipBlendNodeVisitor visitor(nodeManager, ClipBlendNodeVisitor::PreOrder, ClipBlendNodeVisitor::VisitOnlyDependencies); @@ -756,8 +749,8 @@ QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, return clipIds; } -ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels, - const QVector<ComponentIndices> &targetIndices, +ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels, + const QList<ComponentIndices> &targetIndices, const AnimationClip *clip) { Q_ASSERT(targetChannels.size() == targetIndices.size()); @@ -871,10 +864,10 @@ ClipResults evaluateBlendTree(Handler *handler, return blendTreeRootNode->clipResults(animatorId); } -QVector<float> defaultValueForChannel(Handler *handler, +QList<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription) { - QVector<float> result; + QList<float> result; // Does the channel repesent a joint in a skeleton or is it a general channel? ChannelMappingManager *mappingManager = handler->channelMappingManager(); @@ -921,7 +914,7 @@ QVector<float> defaultValueForChannel(Handler *handler, // Everything else gets all zeros const int componentCount = mapping->componentCount(); - result = QVector<float>(componentCount, 0.0f); + result = QList<float>(componentCount, 0.0f); break; } @@ -930,7 +923,7 @@ QVector<float> defaultValueForChannel(Handler *handler, return result; } -void applyComponentDefaultValues(const QVector<ComponentValue> &componentDefaults, +void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults, ClipResults &formattedClipResults) { for (const auto &componentDefault : componentDefaults) diff --git a/src/animation/backend/animationutils_p.h b/src/animation/backend/animationutils_p.h index 0e74728c2..5f7bdf6be 100644 --- a/src/animation/backend/animationutils_p.h +++ b/src/animation/backend/animationutils_p.h @@ -71,7 +71,7 @@ class AnimationClip; class ChannelMapper; class ChannelMapping; -typedef QVector<int> ComponentIndices; +using ComponentIndices = QList<int>; enum JointTransformComponent { NoTransformComponent = 0, @@ -124,7 +124,7 @@ struct ClipEvaluationData bool isFinalFrame; }; -typedef QVector<float> ClipResults; +using ClipResults = QList<float>; struct ChannelNameAndType { @@ -225,10 +225,10 @@ struct ClipFormat // formattedComponentIndices in flat vectors. This will require a // way to look up the offset and number of elements for each channel. ComponentIndices sourceClipIndices; - QVector<QBitArray> sourceClipMask; - QVector<ComponentIndices> formattedComponentIndices; - QVector<ChannelNameAndType> namesAndTypes; - QVector<ComponentValue> defaultComponentValues; + QList<QBitArray> sourceClipMask; + QList<ComponentIndices> formattedComponentIndices; + QList<ChannelNameAndType> namesAndTypes; + QList<ComponentValue> defaultComponentValues; }; #ifndef QT_NO_DEBUG_STREAM @@ -277,16 +277,16 @@ struct AnimationRecord { }; Qt3DCore::QNodeId animatorId; - QVector<TargetChange> targetChanges; - QVector<QPair<Qt3DCore::QNodeId, QVector<Qt3DCore::Sqt>>> skeletonChanges; + QList<TargetChange> targetChanges; + QList<QPair<Qt3DCore::QNodeId, QList<Qt3DCore::Sqt>>> skeletonChanges; float normalizedTime = -1.f; bool finalFrame = false; }; Q_AUTOTEST_EXPORT AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId, - const QVector<MappingData> &mappingDataVec, - const QVector<float> &channelResults, + const QList<MappingData> &mappingDataVec, + const QList<float> &channelResults, bool finalFrame, float normalizedLocalTime); @@ -347,7 +347,7 @@ Q_AUTOTEST_EXPORT ComponentIndices channelComponentsToIndicesHelper(const Channel &channelGroup, int expectedComponentCount, int offset, - const QVector<char> &suffixes); + const QList<char> &suffixes); Q_AUTOTEST_EXPORT ClipResults evaluateClipAtLocalTime(AnimationClip *clip, @@ -358,21 +358,21 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip, float phase); Q_AUTOTEST_EXPORT -QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec, - const QVector<float> &channelResults); +QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec, + const QList<float> &channelResults); Q_AUTOTEST_EXPORT -QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping *> &channelMappings, - const QVector<ChannelNameAndType> &channelNamesAndTypes, - const QVector<ComponentIndices> &channelComponentIndices, - const QVector<QBitArray> &sourceClipMask); +QList<MappingData> buildPropertyMappings(const QList<ChannelMapping *> &channelMappings, + const QList<ChannelNameAndType> &channelNamesAndTypes, + const QList<ComponentIndices> &channelComponentIndices, + const QList<QBitArray> &sourceClipMask); Q_AUTOTEST_EXPORT -QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, - const ChannelMapper *mapper); +QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler, + const ChannelMapper *mapper); Q_AUTOTEST_EXPORT -QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &namesAndTypes); +QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes); Q_AUTOTEST_EXPORT double localTimeFromElapsedTime(double t_current_local, double t_elapsed_global, @@ -385,12 +385,12 @@ double phaseFromElapsedTime(double t_current_local, double t_elapsed_global, int loopCount, int ¤tLoop); Q_AUTOTEST_EXPORT -QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, +QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler, Qt3DCore::QNodeId blendTreeRootId); Q_AUTOTEST_EXPORT -ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels, - const QVector<ComponentIndices> &targetIndices, +ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels, + const QList<ComponentIndices> &targetIndices, const AnimationClip *clip); Q_AUTOTEST_EXPORT @@ -403,10 +403,10 @@ ClipResults evaluateBlendTree(Handler *handler, Qt3DCore::QNodeId blendNodeId); Q_AUTOTEST_EXPORT -QVector<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription); +QList<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription); Q_AUTOTEST_EXPORT -void applyComponentDefaultValues(const QVector<ComponentValue> &componentDefaults, +void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults, ClipResults &formattedClipResults); } // Animation diff --git a/src/animation/backend/blendedclipanimator_p.h b/src/animation/backend/blendedclipanimator_p.h index 2396cdd74..795aa5b6a 100644 --- a/src/animation/backend/blendedclipanimator_p.h +++ b/src/animation/backend/blendedclipanimator_p.h @@ -89,8 +89,8 @@ public: int currentLoop() const { return m_currentLoop; } void setCurrentLoop(int currentLoop) { m_currentLoop = currentLoop; } - void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; } - QVector<MappingData> mappingData() const { return m_mappingData; } + void setMappingData(const QList<MappingData> &mappingData) { m_mappingData = mappingData; } + QList<MappingData> mappingData() const { return m_mappingData; } void animationClipMarkedDirty() { setDirty(Handler::BlendedClipAnimatorDirty); } @@ -123,7 +123,7 @@ private: float m_normalizedLocalTime; float m_lastNormalizedLocalTime; - QVector<MappingData> m_mappingData; + QList<MappingData> m_mappingData; }; } // namespace Animation diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp index b4cc04323..aeaaa8c11 100644 --- a/src/animation/backend/buildblendtreesjob.cpp +++ b/src/animation/backend/buildblendtreesjob.cpp @@ -55,7 +55,7 @@ BuildBlendTreesJob::BuildBlendTreesJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::BuildBlendTree, 0) } -void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles) +void BuildBlendTreesJob::setBlendedClipAnimators(const QList<HBlendedClipAnimator> &blendedClipAnimatorHandles) { m_blendedClipAnimatorHandles = blendedClipAnimatorHandles; BlendedClipAnimatorManager *blendedClipAnimatorManager = m_handler->blendedClipAnimatorManager(); @@ -89,23 +89,23 @@ void BuildBlendTreesJob::run() const ChannelMapper *mapper = m_handler->channelMapperManager()->lookupResource(blendClipAnimator->mapperId()); if (!mapper) continue; - const QVector<ChannelNameAndType> channelNamesAndTypes + const QList<ChannelNameAndType> channelNamesAndTypes = buildRequiredChannelsAndTypes(m_handler, mapper); - const QVector<ComponentIndices> channelComponentIndices + const QList<ComponentIndices> channelComponentIndices = assignChannelComponentIndices(channelNamesAndTypes); // Find the leaf value nodes of the blend tree and for each of them // create a set of format indices that can later be used to map the // raw ClipResults resulting from evaluating an animation clip to the // layout used by the blend tree for this animator - QVector<QBitArray> blendTreeChannelMask; - const QVector<Qt3DCore::QNodeId> valueNodeIds + QList<QBitArray> blendTreeChannelMask; + const QList<Qt3DCore::QNodeId> valueNodeIds = gatherValueNodesToEvaluate(m_handler, blendClipAnimator->blendTreeRootId()); // Store the clip value nodes to avoid further lookups below. // TODO: Refactor this next block into a function in animationutils.cpp that takes - // a QVector<QClipBlendValue*> as input. - QVector<ClipBlendValue *> valueNodes; + // a QList<QClipBlendValue*> as input. + QList<ClipBlendValue *> valueNodes; valueNodes.reserve(valueNodeIds.size()); for (const auto valueNodeId : valueNodeIds) { ClipBlendValue *valueNode @@ -166,8 +166,8 @@ void BuildBlendTreesJob::run() // If we get to here then we need to obtain a default value // for this channel and store it for later application to any // missing components of this channel. - const QVector<float> defaultValue = defaultValueForChannel(m_handler, - f.namesAndTypes[i]); + const QList<float> defaultValue = defaultValueForChannel(m_handler, + f.namesAndTypes[i]); // Find the indices where we later need to inject these default // values and store them in the format. @@ -181,8 +181,8 @@ void BuildBlendTreesJob::run() // Finally, build the mapping data vector for this blended clip animator. This // gets used during the final stage of evaluation when sending the property changes // out to the targets of the animation. We do the costly work once up front. - const QVector<Qt3DCore::QNodeId> channelMappingIds = mapper->mappingIds(); - QVector<ChannelMapping *> channelMappings; + const QList<Qt3DCore::QNodeId> channelMappingIds = mapper->mappingIds(); + QList<ChannelMapping *> channelMappings; channelMappings.reserve(channelMappingIds.size()); for (const auto mappingId : channelMappingIds) { ChannelMapping *mapping = m_handler->channelMappingManager()->lookupResource(mappingId); @@ -190,7 +190,7 @@ void BuildBlendTreesJob::run() channelMappings.push_back(mapping); } - const QVector<MappingData> mappingDataVec + const QList<MappingData> mappingDataVec = buildPropertyMappings(channelMappings, channelNamesAndTypes, channelComponentIndices, diff --git a/src/animation/backend/buildblendtreesjob_p.h b/src/animation/backend/buildblendtreesjob_p.h index a14552cb9..c822e40f2 100644 --- a/src/animation/backend/buildblendtreesjob_p.h +++ b/src/animation/backend/buildblendtreesjob_p.h @@ -66,13 +66,13 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles); + void setBlendedClipAnimators(const QList<HBlendedClipAnimator> &blendedClipAnimatorHandles); protected: void run() override; private: - QVector<HBlendedClipAnimator> m_blendedClipAnimatorHandles; + QList<HBlendedClipAnimator> m_blendedClipAnimatorHandles; Handler *m_handler; }; diff --git a/src/animation/backend/channelmapper_p.h b/src/animation/backend/channelmapper_p.h index 45a3e789e..a2e9065a6 100644 --- a/src/animation/backend/channelmapper_p.h +++ b/src/animation/backend/channelmapper_p.h @@ -53,7 +53,7 @@ #include <Qt3DCore/qnodeid.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> QT_BEGIN_NAMESPACE @@ -71,10 +71,10 @@ public: void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; - void setMappingIds(const QVector<Qt3DCore::QNodeId> &mappingIds) { m_mappingIds = mappingIds; } - QVector<Qt3DCore::QNodeId> mappingIds() const { return m_mappingIds; } + void setMappingIds(const QList<Qt3DCore::QNodeId> &mappingIds) { m_mappingIds = mappingIds; } + QList<Qt3DCore::QNodeId> mappingIds() const { return m_mappingIds; } - QVector<ChannelMapping*> mappings() const + QList<ChannelMapping*> mappings() const { if (m_isDirty) updateMappings(); @@ -84,10 +84,10 @@ public: private: void updateMappings() const; - QVector<Qt3DCore::QNodeId> m_mappingIds; + QList<Qt3DCore::QNodeId> m_mappingIds; // Cached data - mutable QVector<ChannelMapping*> m_mappings; + mutable QList<ChannelMapping*> m_mappings; mutable bool m_isDirty; }; diff --git a/src/animation/backend/clipanimator_p.h b/src/animation/backend/clipanimator_p.h index 65fc6bdc8..25e4af3d0 100644 --- a/src/animation/backend/clipanimator_p.h +++ b/src/animation/backend/clipanimator_p.h @@ -85,8 +85,8 @@ public: // Called by jobs bool canRun() const { return !m_clipId.isNull() && !m_mapperId.isNull(); } - void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; } - QVector<MappingData> mappingData() const { return m_mappingData; } + void setMappingData(const QList<MappingData> &mappingData) { m_mappingData = mappingData; } + QList<MappingData> mappingData() const { return m_mappingData; } void setStartTime(qint64 globalTime) { m_lastGlobalTimeNS = globalTime; } @@ -122,7 +122,7 @@ private: // Working state qint64 m_lastGlobalTimeNS; double m_lastLocalTime; - QVector<MappingData> m_mappingData; + QList<MappingData> m_mappingData; int m_currentLoop; ClipFormat m_clipFormat; diff --git a/src/animation/backend/clipblendnode.cpp b/src/animation/backend/clipblendnode.cpp index 50e251398..37887664b 100644 --- a/src/animation/backend/clipblendnode.cpp +++ b/src/animation/backend/clipblendnode.cpp @@ -86,7 +86,7 @@ ClipResults ClipBlendNode::clipResults(Qt3DCore::QNodeId animatorId) const } /* - \fn QVector<Qt3DCore::QNodeId> ClipBlendNode::currentDependencyIds() const + \fn QList<Qt3DCore::QNodeId> ClipBlendNode::currentDependencyIds() const \internal Each subclass of ClipBlendNode must implement this function such that it @@ -108,7 +108,7 @@ ClipResults ClipBlendNode::clipResults(Qt3DCore::QNodeId animatorId) const */ /* - \fn QVector<Qt3DCore::QNodeId> ClipBlendNode::allDependencyIds() const + \fn QList<Qt3DCore::QNodeId> ClipBlendNode::allDependencyIds() const \internal Similar to currentDependencyIds() but returns the ids of all potential @@ -130,9 +130,9 @@ ClipResults ClipBlendNode::clipResults(Qt3DCore::QNodeId animatorId) const void ClipBlendNode::blend(Qt3DCore::QNodeId animatorId) { // Obtain the clip results from each of the dependencies - const QVector<Qt3DCore::QNodeId> dependencyNodeIds = currentDependencyIds(); + const QList<Qt3DCore::QNodeId> dependencyNodeIds = currentDependencyIds(); const int dependencyCount = dependencyNodeIds.size(); - QVector<ClipResults> blendData; + QList<ClipResults> blendData; blendData.reserve(dependencyCount); for (const auto dependencyId : dependencyNodeIds) { ClipBlendNode *dependencyNode = clipBlendNodeManager()->lookupNode(dependencyId); diff --git a/src/animation/backend/clipblendnode_p.h b/src/animation/backend/clipblendnode_p.h index e650270cd..0e2c2880d 100644 --- a/src/animation/backend/clipblendnode_p.h +++ b/src/animation/backend/clipblendnode_p.h @@ -82,21 +82,21 @@ public: void setClipResults(Qt3DCore::QNodeId animatorId, const ClipResults &clipResults); ClipResults clipResults(Qt3DCore::QNodeId animatorId) const; - virtual QVector<Qt3DCore::QNodeId> allDependencyIds() const = 0; - virtual QVector<Qt3DCore::QNodeId> currentDependencyIds() const = 0; + virtual QList<Qt3DCore::QNodeId> allDependencyIds() const = 0; + virtual QList<Qt3DCore::QNodeId> currentDependencyIds() const = 0; virtual double duration() const = 0; protected: explicit ClipBlendNode(BlendType blendType); - virtual ClipResults doBlend(const QVector<ClipResults> &blendData) const = 0; + virtual ClipResults doBlend(const QList<ClipResults> &blendData) const = 0; private: ClipBlendNodeManager *m_manager; BlendType m_blendType; // Store the results of evaluations indexed by animator id - QVector<Qt3DCore::QNodeId> m_animatorIds; - QVector<ClipResults> m_clipResults; + QList<Qt3DCore::QNodeId> m_animatorIds; + QList<ClipResults> m_clipResults; }; template<typename Backend, typename Frontend> diff --git a/src/animation/backend/clipblendvalue.cpp b/src/animation/backend/clipblendvalue.cpp index dc63d4367..768acddfe 100644 --- a/src/animation/backend/clipblendvalue.cpp +++ b/src/animation/backend/clipblendvalue.cpp @@ -62,7 +62,7 @@ void ClipBlendValue::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firs m_clipId = Qt3DCore::qIdForNode(node->clip()); } -ClipResults ClipBlendValue::doBlend(const QVector<ClipResults> &blendData) const +ClipResults ClipBlendValue::doBlend(const QList<ClipResults> &blendData) const { // Should never be called for the value node Q_UNUSED(blendData); diff --git a/src/animation/backend/clipblendvalue_p.h b/src/animation/backend/clipblendvalue_p.h index 8a0f93d3d..04d845543 100644 --- a/src/animation/backend/clipblendvalue_p.h +++ b/src/animation/backend/clipblendvalue_p.h @@ -66,12 +66,12 @@ public: void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - inline QVector<Qt3DCore::QNodeId> currentDependencyIds() const override + inline QList<Qt3DCore::QNodeId> currentDependencyIds() const override { return {}; } @@ -83,13 +83,13 @@ public: const ClipFormat &clipFormat(Qt3DCore::QNodeId animatorId) const; protected: - ClipResults doBlend(const QVector<ClipResults> &blendData) const override; + ClipResults doBlend(const QList<ClipResults> &blendData) const override; private: Qt3DCore::QNodeId m_clipId; - QVector<Qt3DCore::QNodeId> m_animatorIds; - QVector<ClipFormat> m_clipFormats; + QList<Qt3DCore::QNodeId> m_animatorIds; + QList<ClipFormat> m_clipFormats; }; } // namespace Animation diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp index 69df26992..dad5be6ab 100644 --- a/src/animation/backend/evaluateblendclipanimatorjob.cpp +++ b/src/animation/backend/evaluateblendclipanimatorjob.cpp @@ -77,7 +77,7 @@ void EvaluateBlendClipAnimatorJob::run() } Qt3DCore::QNodeId blendTreeRootId = blendedClipAnimator->blendTreeRootId(); - const QVector<Qt3DCore::QNodeId> valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId); + const QList<Qt3DCore::QNodeId> valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId); // Calculate the resulting duration of the blend tree based upon its current state ClipBlendNodeManager *blendNodeManager = m_handler->clipBlendNodeManager(); @@ -129,7 +129,7 @@ void EvaluateBlendClipAnimatorJob::run() // Prepare the change record const bool finalFrame = isFinalFrame(localTime, duration, animatorData.currentLoop, animatorData.loopCount, animatorData.playbackRate); - const QVector<MappingData> mappingData = blendedClipAnimator->mappingData(); + const QList<MappingData> mappingData = blendedClipAnimator->mappingData(); auto record = prepareAnimationRecord(blendedClipAnimator->peerId(), mappingData, blendedResults, diff --git a/src/animation/backend/fcurve_p.h b/src/animation/backend/fcurve_p.h index 4c5cfb351..1a1b6dca6 100644 --- a/src/animation/backend/fcurve_p.h +++ b/src/animation/backend/fcurve_p.h @@ -54,7 +54,7 @@ #include <Qt3DAnimation/qchannel.h> #include <Qt3DAnimation/qchannelcomponent.h> #include <Qt3DAnimation/qkeyframe.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> #ifndef QT_NO_DEBUG_STREAM #include <QtCore/qdebug.h> @@ -91,8 +91,8 @@ public: void setFromQChannelComponent(const QChannelComponent &qcc); private: - QVector<float> m_localTimes; - QVector<Keyframe> m_keyframes; + QList<float> m_localTimes; + QList<Keyframe> m_keyframes; FunctionRangeFinder m_rangeFinder; }; @@ -149,7 +149,7 @@ struct Channel { QString name; int jointIndex = -1; - QVector<ChannelComponent> channelComponents; + QList<ChannelComponent> channelComponents; void read(const QJsonObject &json); void setFromQChannel(const QChannel &qch); diff --git a/src/animation/backend/findrunningclipanimatorsjob.cpp b/src/animation/backend/findrunningclipanimatorsjob.cpp index 1005914c7..4b75d9180 100644 --- a/src/animation/backend/findrunningclipanimatorsjob.cpp +++ b/src/animation/backend/findrunningclipanimatorsjob.cpp @@ -53,7 +53,7 @@ FindRunningClipAnimatorsJob::FindRunningClipAnimatorsJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::FindRunningClipAnimator, 0) } -void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<HClipAnimator> &clipAnimatorHandles) +void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QList<HClipAnimator> &clipAnimatorHandles) { m_clipAnimatorHandles = clipAnimatorHandles; } @@ -85,11 +85,11 @@ void FindRunningClipAnimatorsJob::run() // blended clip animator for consistency and ease of maintenance. const ChannelMapper *mapper = m_handler->channelMapperManager()->lookupResource(clipAnimator->mapperId()); Q_ASSERT(mapper); - const QVector<ChannelMapping *> channelMappings = mapper->mappings(); + const QList<ChannelMapping *> channelMappings = mapper->mappings(); - const QVector<ChannelNameAndType> channelNamesAndTypes + const QList<ChannelNameAndType> channelNamesAndTypes = buildRequiredChannelsAndTypes(m_handler, mapper); - const QVector<ComponentIndices> channelComponentIndices + const QList<ComponentIndices> channelComponentIndices = assignChannelComponentIndices(channelNamesAndTypes); const AnimationClip *clip = m_handler->animationClipLoaderManager()->lookupResource(clipAnimator->clipId()); @@ -99,7 +99,7 @@ void FindRunningClipAnimatorsJob::run() clip); clipAnimator->setClipFormat(format); - const QVector<MappingData> mappingData = buildPropertyMappings(channelMappings, + const QList<MappingData> mappingData = buildPropertyMappings(channelMappings, channelNamesAndTypes, format.formattedComponentIndices, format.sourceClipMask); diff --git a/src/animation/backend/findrunningclipanimatorsjob_p.h b/src/animation/backend/findrunningclipanimatorsjob_p.h index f0e30e80c..f1d5d1701 100644 --- a/src/animation/backend/findrunningclipanimatorsjob_p.h +++ b/src/animation/backend/findrunningclipanimatorsjob_p.h @@ -50,7 +50,7 @@ #include <Qt3DCore/qaspectjob.h> #include <Qt3DAnimation/private/handle_types_p.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> #if defined(QT_BUILD_INTERNAL) class tst_FindRunningClipAnimatorsJob; @@ -71,13 +71,13 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void setDirtyClipAnimators(const QVector<HClipAnimator> &animationClipHandles); + void setDirtyClipAnimators(const QList<HClipAnimator> &animationClipHandles); protected: void run() override; private: - QVector<HClipAnimator> m_clipAnimatorHandles; + QList<HClipAnimator> m_clipAnimatorHandles; Handler *m_handler; #if defined(QT_BUILD_INTERNAL) diff --git a/src/animation/backend/functionrangefinder.cpp b/src/animation/backend/functionrangefinder.cpp index 8c0e30f4a..af695b7c1 100644 --- a/src/animation/backend/functionrangefinder.cpp +++ b/src/animation/backend/functionrangefinder.cpp @@ -69,7 +69,7 @@ namespace Animation { If the previous results are uncorrelated, a simple bisection is used. */ -FunctionRangeFinder::FunctionRangeFinder(const QVector<float> &x) +FunctionRangeFinder::FunctionRangeFinder(const QList<float> &x) : m_x(x) , m_previousLowerBound(0) , m_correlated(0) diff --git a/src/animation/backend/functionrangefinder_p.h b/src/animation/backend/functionrangefinder_p.h index bea9a2e2f..5df05bea4 100644 --- a/src/animation/backend/functionrangefinder_p.h +++ b/src/animation/backend/functionrangefinder_p.h @@ -48,7 +48,7 @@ // We mean it. // -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> #include <cmath> #include <cstdlib> @@ -61,7 +61,7 @@ namespace Animation { class Q_AUTOTEST_EXPORT FunctionRangeFinder { public: - FunctionRangeFinder(const QVector<float> &x); + FunctionRangeFinder(const QList<float> &x); inline int findLowerBound(float x) const { return m_correlated ? hunt(x) : locate(x); } @@ -81,7 +81,7 @@ private: int locate(float x) const; int hunt(float x) const; - const QVector<float> &m_x; + const QList<float> &m_x; mutable int m_previousLowerBound; mutable bool m_correlated; int m_rangeSize; diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp index 82401dd5e..06ff6be67 100644 --- a/src/animation/backend/gltfimporter.cpp +++ b/src/animation/backend/gltfimporter.cpp @@ -488,7 +488,7 @@ GLTFImporter::AnimationNameAndChannels GLTFImporter::createAnimationData(int ani nameAndChannels.name = animation.name; // Create node index to joint index lookup tables for each skin - QVector<QHash<int, int>> nodeIndexToJointIndexMaps; + QList<QHash<int, int>> nodeIndexToJointIndexMaps; nodeIndexToJointIndexMaps.reserve(m_skins.size()); for (const auto &skin : m_skins) nodeIndexToJointIndexMaps.push_back(createNodeIndexToJointIndexMap(skin)); @@ -546,7 +546,7 @@ GLTFImporter::AnimationNameAndChannels GLTFImporter::createAnimationData(int ani // Get the key frame times first as these are common to all components of the // key frame values. const int keyFrameCount = inputAccessor.count; - QVector<float> keyframeTimes(keyFrameCount); + QList<float> keyframeTimes(keyFrameCount); for (int i = 0; i < keyFrameCount; ++i) { const auto rawTimestamp = accessorData(sampler.inputAccessorIndex, i); keyframeTimes[i] = *reinterpret_cast<const float*>(rawTimestamp.data); @@ -827,7 +827,7 @@ void GLTFImporter::setupNodeParentLinks() const int nodeCount = m_nodes.size(); for (int i = 0; i < nodeCount; ++i) { const Node &node = m_nodes[i]; - const QVector<int> &childNodeIndices = node.childNodeIndices; + const QList<int> &childNodeIndices = node.childNodeIndices; for (const auto childNodeIndex : childNodeIndices) { Q_ASSERT(childNodeIndex < m_nodes.size()); Node &childNode = m_nodes[childNodeIndex]; diff --git a/src/animation/backend/gltfimporter_p.h b/src/animation/backend/gltfimporter_p.h index ef0486181..c4da7b40f 100644 --- a/src/animation/backend/gltfimporter_p.h +++ b/src/animation/backend/gltfimporter_p.h @@ -58,7 +58,7 @@ #include <QJsonObject> #include <QJsonArray> #include <QJsonValue> -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE @@ -117,7 +117,7 @@ public: QString name; int inverseBindAccessorIndex; - QVector<int> jointNodeIndices; + QList<int> jointNodeIndices; }; class Channel @@ -158,8 +158,8 @@ public: explicit Animation(const QJsonObject &json); QString name; - QVector<Channel> channels; - QVector<Sampler> samplers; + QList<Channel> channels; + QList<Sampler> samplers; }; class Node @@ -169,7 +169,7 @@ public: explicit Node(const QJsonObject &json); Qt3DCore::Sqt localTransform; - QVector<int> childNodeIndices; + QList<int> childNodeIndices; QString name; int parentNodeIndex; int cameraIndex; @@ -180,12 +180,12 @@ public: GLTFImporter(); bool load(QIODevice *ioDev); - const QVector<Animation> animations() const { return m_animations; } + const QList<Animation> animations() const { return m_animations; } struct AnimationNameAndChannels { QString name; - QVector<Qt3DAnimation::Animation::Channel> channels; + QList<Qt3DAnimation::Animation::Channel> channels; }; AnimationNameAndChannels createAnimationData(int animationIndex, const QString &animationName = QString()) const; @@ -221,12 +221,12 @@ private: QJsonDocument m_json; QString m_basePath; - QVector<BufferData> m_bufferDatas; - QVector<BufferView> m_bufferViews; - QVector<AccessorData> m_accessors; - QVector<Skin> m_skins; - QVector<Animation> m_animations; - QVector<Node> m_nodes; + QList<BufferData> m_bufferDatas; + QList<BufferView> m_bufferViews; + QList<AccessorData> m_accessors; + QList<Skin> m_skins; + QList<Animation> m_animations; + QList<Node> m_nodes; }; } // namespace Animation diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index 939e58263..1b81f6aa1 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -143,7 +143,7 @@ void Handler::setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, // The vectors may get outdated when the application removes/deletes an // animator component in the meantime. Recognize this. This should be // relatively infrequent so in most cases the vectors will not change at all. -void Handler::cleanupHandleList(QVector<HAnimationClip> *clips) +void Handler::cleanupHandleList(QList<HAnimationClip> *clips) { for (auto it = clips->begin(); it != clips->end(); ) { if (!m_animationClipLoaderManager->data(*it)) @@ -153,7 +153,7 @@ void Handler::cleanupHandleList(QVector<HAnimationClip> *clips) } } -void Handler::cleanupHandleList(QVector<HClipAnimator> *animators) +void Handler::cleanupHandleList(QList<HClipAnimator> *animators) { for (auto it = animators->begin(); it != animators->end(); ) { if (!m_clipAnimatorManager->data(*it)) @@ -163,7 +163,7 @@ void Handler::cleanupHandleList(QVector<HClipAnimator> *animators) } } -void Handler::cleanupHandleList(QVector<HBlendedClipAnimator> *animators) +void Handler::cleanupHandleList(QList<HBlendedClipAnimator> *animators) { for (auto it = animators->begin(); it != animators->end(); ) { if (!m_blendedClipAnimatorManager->data(*it)) @@ -215,7 +215,7 @@ std::vector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time) // Rebuild blending trees if a blend tree is dirty const bool hasBuildBlendTreesJob = !m_dirtyBlendedAnimators.isEmpty(); if (hasBuildBlendTreesJob) { - const QVector<HBlendedClipAnimator> dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators); + const QList<HBlendedClipAnimator> dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators); m_buildBlendTreesJob->setBlendedClipAnimators(dirtyBlendedAnimators); jobs.push_back(m_buildBlendTreesJob); } diff --git a/src/animation/backend/handler_p.h b/src/animation/backend/handler_p.h index cad1c568d..4f9f24091 100644 --- a/src/animation/backend/handler_p.h +++ b/src/animation/backend/handler_p.h @@ -105,10 +105,10 @@ public: void setDirty(DirtyFlag flag, Qt3DCore::QNodeId nodeId); void setClipAnimatorRunning(const HClipAnimator &handle, bool running); - QVector<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; } + QList<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; } void setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, bool running); - QVector<HBlendedClipAnimator> runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; } + QList<HBlendedClipAnimator> runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; } AnimationClipLoaderManager *animationClipLoaderManager() const Q_DECL_NOTHROW { return m_animationClipLoaderManager.data(); } ClockManager *clockManager() const Q_DECL_NOTHROW { return m_clockManager.data(); } @@ -121,9 +121,9 @@ public: std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time); - void cleanupHandleList(QVector<HAnimationClip> *clips); - void cleanupHandleList(QVector<HClipAnimator> *animators); - void cleanupHandleList(QVector<HBlendedClipAnimator> *animators); + void cleanupHandleList(QList<HAnimationClip> *clips); + void cleanupHandleList(QList<HClipAnimator> *animators); + void cleanupHandleList(QList<HBlendedClipAnimator> *animators); private: QMutex m_mutex; @@ -136,17 +136,17 @@ private: QScopedPointer<ClipBlendNodeManager> m_clipBlendNodeManager; QScopedPointer<SkeletonManager> m_skeletonManager; - QVector<HAnimationClip> m_dirtyAnimationClips; - QVector<HClipAnimator> m_dirtyClipAnimators; - QVector<HBlendedClipAnimator> m_dirtyBlendedAnimators; + QList<HAnimationClip> m_dirtyAnimationClips; + QList<HClipAnimator> m_dirtyClipAnimators; + QList<HBlendedClipAnimator> m_dirtyBlendedAnimators; - QVector<HClipAnimator> m_runningClipAnimators; - QVector<HBlendedClipAnimator> m_runningBlendedClipAnimators; + QList<HClipAnimator> m_runningClipAnimators; + QList<HBlendedClipAnimator> m_runningBlendedClipAnimators; QSharedPointer<LoadAnimationClipJob> m_loadAnimationClipJob; QSharedPointer<FindRunningClipAnimatorsJob> m_findRunningClipAnimatorsJob; - QVector<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs; - QVector<EvaluateBlendClipAnimatorJobPtr> m_evaluateBlendClipAnimatorJobs; + QList<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs; + QList<EvaluateBlendClipAnimatorJobPtr> m_evaluateBlendClipAnimatorJobs; BuildBlendTreesJobPtr m_buildBlendTreesJob; qint64 m_simulationTime; diff --git a/src/animation/backend/lerpclipblend.cpp b/src/animation/backend/lerpclipblend.cpp index b2ba2ff7e..ebf3c30e9 100644 --- a/src/animation/backend/lerpclipblend.cpp +++ b/src/animation/backend/lerpclipblend.cpp @@ -68,7 +68,7 @@ void LerpClipBlend::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool first m_endClipId = Qt3DCore::qIdForNode(node->endClip()); } -ClipResults LerpClipBlend::doBlend(const QVector<ClipResults> &blendData) const +ClipResults LerpClipBlend::doBlend(const QList<ClipResults> &blendData) const { Q_ASSERT(blendData.size() == 2); Q_ASSERT(blendData[0].size() == blendData[1].size()); diff --git a/src/animation/backend/lerpclipblend_p.h b/src/animation/backend/lerpclipblend_p.h index 61434af2c..027cbf331 100644 --- a/src/animation/backend/lerpclipblend_p.h +++ b/src/animation/backend/lerpclipblend_p.h @@ -73,12 +73,12 @@ public: void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) final; - inline QVector<Qt3DCore::QNodeId> allDependencyIds() const override + inline QList<Qt3DCore::QNodeId> allDependencyIds() const override { return currentDependencyIds(); } - inline QVector<Qt3DCore::QNodeId> currentDependencyIds() const override + inline QList<Qt3DCore::QNodeId> currentDependencyIds() const override { return { m_startClipId, m_endClipId }; } @@ -86,7 +86,7 @@ public: double duration() const override; protected: - ClipResults doBlend(const QVector<ClipResults> &blendData) const final; + ClipResults doBlend(const QList<ClipResults> &blendData) const final; private: Qt3DCore::QNodeId m_startClipId; diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp index 93d4c2d9d..fd8f620a8 100644 --- a/src/animation/backend/loadanimationclipjob.cpp +++ b/src/animation/backend/loadanimationclipjob.cpp @@ -58,7 +58,7 @@ public: void postFrame(Qt3DCore::QAspectManager *manager) override; - QVector<AnimationClip *> m_updatedNodes; + QList<AnimationClip *> m_updatedNodes; }; LoadAnimationClipJob::LoadAnimationClipJob() @@ -69,7 +69,7 @@ LoadAnimationClipJob::LoadAnimationClipJob() SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0) } -void LoadAnimationClipJob::addDirtyAnimationClips(const QVector<HAnimationClip> &animationClipHandles) +void LoadAnimationClipJob::addDirtyAnimationClips(const QList<HAnimationClip> &animationClipHandles) { for (const auto &handle : animationClipHandles) { if (!m_animationClipHandles.contains(handle)) diff --git a/src/animation/backend/loadanimationclipjob_p.h b/src/animation/backend/loadanimationclipjob_p.h index 07d78d416..bbe67f20e 100644 --- a/src/animation/backend/loadanimationclipjob_p.h +++ b/src/animation/backend/loadanimationclipjob_p.h @@ -50,7 +50,7 @@ #include <Qt3DCore/qaspectjob.h> #include <Qt3DAnimation/private/handle_types_p.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> QT_BEGIN_NAMESPACE @@ -69,7 +69,7 @@ public: void setHandler(Handler *handler) { m_handler = handler; } Handler *handler() const { return m_handler; } - void addDirtyAnimationClips(const QVector<HAnimationClip> &animationClipHandles); + void addDirtyAnimationClips(const QList<HAnimationClip> &animationClipHandles); void clearDirtyAnimationClips(); protected: @@ -78,7 +78,7 @@ protected: private: Q_DECLARE_PRIVATE(LoadAnimationClipJob) - QVector<HAnimationClip> m_animationClipHandles; + QList<HAnimationClip> m_animationClipHandles; Handler *m_handler; }; diff --git a/src/animation/backend/skeleton_p.h b/src/animation/backend/skeleton_p.h index d44f8fc1c..a184921dd 100644 --- a/src/animation/backend/skeleton_p.h +++ b/src/animation/backend/skeleton_p.h @@ -64,7 +64,7 @@ public: void cleanup(); void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; - QVector<Qt3DCore::Sqt> joints() const { return m_jointLocalPoses; } + QList<Qt3DCore::Sqt> joints() const { return m_jointLocalPoses; } int jointCount() const { return m_jointLocalPoses.size(); } QString jointName(int jointIndex) const { return m_jointNames.at(jointIndex); } @@ -104,15 +104,15 @@ public: m_jointNames.resize(jointCount); m_jointLocalPoses.resize(jointCount); } - void setJointNames(const QVector<QString> &names) { m_jointNames = names; } - QVector<QString> jointNames() const { return m_jointNames; } - void setJointLocalPoses(const QVector<Qt3DCore::Sqt> &localPoses) { m_jointLocalPoses = localPoses; } - QVector<Qt3DCore::Sqt> jointLocalPoses() const { return m_jointLocalPoses; } + void setJointNames(const QList<QString> &names) { m_jointNames = names; } + QList<QString> jointNames() const { return m_jointNames; } + void setJointLocalPoses(const QList<Qt3DCore::Sqt> &localPoses) { m_jointLocalPoses = localPoses; } + QList<Qt3DCore::Sqt> jointLocalPoses() const { return m_jointLocalPoses; } #endif private: - QVector<QString> m_jointNames; - QVector<Qt3DCore::Sqt> m_jointLocalPoses; + QList<QString> m_jointNames; + QList<Qt3DCore::Sqt> m_jointLocalPoses; }; } // namespace Animation diff --git a/src/animation/frontend/qabstractclipblendnode_p.h b/src/animation/frontend/qabstractclipblendnode_p.h index 3066682a5..fef0e113c 100644 --- a/src/animation/frontend/qabstractclipblendnode_p.h +++ b/src/animation/frontend/qabstractclipblendnode_p.h @@ -63,7 +63,7 @@ public: QAbstractClipBlendNodePrivate(); Q_DECLARE_PUBLIC(QAbstractClipBlendNode) - QVector<QAbstractAnimationClip *> m_clips; + QList<QAbstractAnimationClip *> m_clips; }; } // namespace Qt3DAnimation diff --git a/src/animation/frontend/qanimationaspect.cpp b/src/animation/frontend/qanimationaspect.cpp index ce059f996..351569190 100644 --- a/src/animation/frontend/qanimationaspect.cpp +++ b/src/animation/frontend/qanimationaspect.cpp @@ -95,7 +95,7 @@ QAnimationAspect::QAnimationAspect(QAnimationAspectPrivate &dd, QObject *parent) Q_D(QAnimationAspect); qRegisterMetaType<Qt3DAnimation::QAnimationClipLoader*>(); qRegisterMetaType<Qt3DAnimation::QChannelMapper*>(); - qRegisterMetaType<QVector<Qt3DCore::Sqt>>(); + qRegisterMetaType<QList<Qt3DCore::Sqt>>(); qRegisterMetaType<Qt3DAnimation::QAbstractAnimationClip*>(); registerBackendType<QAbstractAnimationClip>( diff --git a/src/animation/frontend/qanimationclipdata.cpp b/src/animation/frontend/qanimationclipdata.cpp index 1e02332de..8131d194f 100644 --- a/src/animation/frontend/qanimationclipdata.cpp +++ b/src/animation/frontend/qanimationclipdata.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QAnimationClipDataPrivate { public: - QVector<QChannel> m_channels; + QList<QChannel> m_channels; QString m_name; }; diff --git a/src/animation/frontend/qanimationcontroller_p.h b/src/animation/frontend/qanimationcontroller_p.h index c06484911..22d7f9a67 100644 --- a/src/animation/frontend/qanimationcontroller_p.h +++ b/src/animation/frontend/qanimationcontroller_p.h @@ -62,7 +62,7 @@ public: QString m_name; int m_activeAnimationGroup; - QVector<QAnimationGroup *> m_animationGroups; + QList<QAnimationGroup *> m_animationGroups; float m_position; float m_scaledPosition; float m_positionScale; diff --git a/src/animation/frontend/qanimationgroup_p.h b/src/animation/frontend/qanimationgroup_p.h index 1e13952aa..d0a2e16f4 100644 --- a/src/animation/frontend/qanimationgroup_p.h +++ b/src/animation/frontend/qanimationgroup_p.h @@ -61,7 +61,7 @@ public: QAnimationGroupPrivate(); QString m_name; - QVector<Qt3DAnimation::QAbstractAnimation *> m_animations; + QList<Qt3DAnimation::QAbstractAnimation *> m_animations; float m_position; float m_duration; diff --git a/src/animation/frontend/qchannel.cpp b/src/animation/frontend/qchannel.cpp index 9e47357e2..3970ea8ab 100644 --- a/src/animation/frontend/qchannel.cpp +++ b/src/animation/frontend/qchannel.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QChannelPrivate { public: - QVector<QChannelComponent> m_channelComponents; + QList<QChannelComponent> m_channelComponents; QString m_name; int m_jointIndex = -1; }; diff --git a/src/animation/frontend/qchannelcomponent.cpp b/src/animation/frontend/qchannelcomponent.cpp index 60c0fec88..e26752aa6 100644 --- a/src/animation/frontend/qchannelcomponent.cpp +++ b/src/animation/frontend/qchannelcomponent.cpp @@ -48,7 +48,7 @@ namespace Qt3DAnimation { class QChannelComponentPrivate { public: - QVector<QKeyFrame> m_keyFrames; + QList<QKeyFrame> m_keyFrames; QString m_name; }; diff --git a/src/animation/frontend/qchannelmapper_p.h b/src/animation/frontend/qchannelmapper_p.h index 45f8b0422..a246d4e4b 100644 --- a/src/animation/frontend/qchannelmapper_p.h +++ b/src/animation/frontend/qchannelmapper_p.h @@ -63,12 +63,12 @@ public: Q_DECLARE_PUBLIC(QChannelMapper) - QVector<QAbstractChannelMapping *> m_mappings; + QList<QAbstractChannelMapping *> m_mappings; }; struct QChannelMapperData { - QVector<Qt3DCore::QNodeId> mappingIds; + QList<Qt3DCore::QNodeId> mappingIds; }; } // namespace Qt3DAnimation diff --git a/src/animation/frontend/qchannelmapping.cpp b/src/animation/frontend/qchannelmapping.cpp index bbccb0f16..9c6687031 100644 --- a/src/animation/frontend/qchannelmapping.cpp +++ b/src/animation/frontend/qchannelmapping.cpp @@ -53,7 +53,7 @@ int componentCountForValue(const T &) } template<> -int componentCountForValue<QVector<float>>(const QVector<float> &v) +int componentCountForValue<QList<float>>(const QList<float> &v) { return v.size(); } @@ -67,10 +67,10 @@ int componentCountForValue<QVariantList>(const QVariantList &v) int componentCountForType(int type, const QVariant &value) { - const int vectorOfFloatTypeId = qMetaTypeId<QVector<float>>(); + const int vectorOfFloatTypeId = qMetaTypeId<QList<float>>(); if (type == vectorOfFloatTypeId) - return componentCountForValue<QVector<float>>(value.value<QVector<float>>()); + return componentCountForValue<QList<float>>(value.value<QList<float>>()); switch (type) { case QMetaType::Float: diff --git a/src/animation/frontend/qchannelmapping_p.h b/src/animation/frontend/qchannelmapping_p.h index 0ab66a7f7..eba548552 100644 --- a/src/animation/frontend/qchannelmapping_p.h +++ b/src/animation/frontend/qchannelmapping_p.h @@ -50,7 +50,7 @@ #include <Qt3DAnimation/private/qabstractchannelmapping_p.h> #include <Qt3DAnimation/qanimationcallback.h> -#include <QVector> +#include <QList> QT_BEGIN_NAMESPACE @@ -88,6 +88,6 @@ struct QChannelMappingData QT_END_NAMESPACE // Used to define the meta type id -Q_DECLARE_METATYPE(QVector<float>) // LCOV_EXCL_LINE +Q_DECLARE_METATYPE(QList<float>) // LCOV_EXCL_LINE #endif // QT3DANIMATION_QCHANNELMAPPING_P_H diff --git a/src/animation/frontend/qkeyframeanimation_p.h b/src/animation/frontend/qkeyframeanimation_p.h index b9b1f8585..3f7428d9d 100644 --- a/src/animation/frontend/qkeyframeanimation_p.h +++ b/src/animation/frontend/qkeyframeanimation_p.h @@ -63,8 +63,8 @@ public: void calculateFrame(float position); - QVector<float> m_framePositions; - QVector<Qt3DCore::QTransform *> m_keyframes; + QList<float> m_framePositions; + QList<Qt3DCore::QTransform *> m_keyframes; Qt3DCore::QTransform *m_target; QEasingCurve m_easing; QString m_animationName; diff --git a/src/animation/frontend/qmorphinganimation_p.h b/src/animation/frontend/qmorphinganimation_p.h index c306f3309..5c501ef8d 100644 --- a/src/animation/frontend/qmorphinganimation_p.h +++ b/src/animation/frontend/qmorphinganimation_p.h @@ -69,11 +69,11 @@ public: float m_minposition; float m_maxposition; - QVector<float> m_targetPositions; - QVector<QVector<float>*> m_weights; - QVector<float> m_morphKey; + QList<float> m_targetPositions; + QList<QList<float>*> m_weights; + QList<float> m_morphKey; QStringList m_attributeNames; - QVector<Qt3DAnimation::QMorphTarget *> m_morphTargets; + QList<Qt3DAnimation::QMorphTarget *> m_morphTargets; QMorphTarget *m_flattened; QMorphingAnimation::Method m_method; QEasingCurve m_easing; diff --git a/src/animation/frontend/qmorphtarget_p.h b/src/animation/frontend/qmorphtarget_p.h index 3214043f4..95ba0ed92 100644 --- a/src/animation/frontend/qmorphtarget_p.h +++ b/src/animation/frontend/qmorphtarget_p.h @@ -64,7 +64,7 @@ public: void updateAttributeNames(); QStringList m_attributeNames; - QVector<Qt3DCore::QAttribute *> m_targetAttributes; + QList<Qt3DCore::QAttribute *> m_targetAttributes; Q_DECLARE_PUBLIC(QMorphTarget) }; diff --git a/src/animation/frontend/qvertexblendanimation_p.h b/src/animation/frontend/qvertexblendanimation_p.h index 8f2609fc8..c4846856a 100644 --- a/src/animation/frontend/qvertexblendanimation_p.h +++ b/src/animation/frontend/qvertexblendanimation_p.h @@ -66,8 +66,8 @@ public: void getAttributesInPosition(float position, int *target0, int *target1, float *interpolator); void updateAnimation(float position); - QVector<float> m_targetPositions; - QVector<Qt3DAnimation::QMorphTarget *> m_morphTargets; + QList<float> m_targetPositions; + QList<Qt3DAnimation::QMorphTarget *> m_morphTargets; float m_interpolator; Qt3DRender::QGeometryRenderer *m_target; QString m_targetName; |