summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-11-20 16:47:37 +0000
committerMike Krus <mike.krus@kdab.com>2021-01-05 13:57:54 +0000
commit173be1a93699c54d9680d809ca5a56ce0ccccd9a (patch)
treebf773d21f61edbc522e8b4128d40f2cb5458a0c2 /src/animation
parent45dfb8a03f4ee2abb963ce3726eaef0dd1c2c521 (diff)
Restore use of QVector in private API
Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/backend/abstractevaluateclipanimatorjob.cpp4
-rw-r--r--src/animation/backend/abstractevaluateclipanimatorjob_p.h2
-rw-r--r--src/animation/backend/animationclip_p.h9
-rw-r--r--src/animation/backend/animationutils.cpp58
-rw-r--r--src/animation/backend/animationutils_p.h46
-rw-r--r--src/animation/backend/blendedclipanimator_p.h6
-rw-r--r--src/animation/backend/buildblendtreesjob.cpp27
-rw-r--r--src/animation/backend/buildblendtreesjob_p.h4
-rw-r--r--src/animation/backend/channelmapper_p.h10
-rw-r--r--src/animation/backend/clipanimator_p.h6
-rw-r--r--src/animation/backend/evaluateblendclipanimatorjob.cpp4
-rw-r--r--src/animation/backend/fcurve_p.h2
-rw-r--r--src/animation/backend/findrunningclipanimatorsjob.cpp10
-rw-r--r--src/animation/backend/findrunningclipanimatorsjob_p.h4
-rw-r--r--src/animation/backend/gltfimporter.cpp2
-rw-r--r--src/animation/backend/gltfimporter_p.h2
-rw-r--r--src/animation/backend/handler.cpp8
-rw-r--r--src/animation/backend/handler_p.h24
-rw-r--r--src/animation/backend/loadanimationclipjob.cpp2
-rw-r--r--src/animation/backend/loadanimationclipjob_p.h4
-rw-r--r--src/animation/backend/skeleton_p.h14
-rw-r--r--src/animation/frontend/qanimationclipdata.cpp2
-rw-r--r--src/animation/frontend/qchannel.cpp2
-rw-r--r--src/animation/frontend/qchannelcomponent.cpp2
-rw-r--r--src/animation/frontend/qmorphinganimation.cpp20
-rw-r--r--src/animation/frontend/qmorphinganimation.h16
-rw-r--r--src/animation/frontend/qmorphinganimation_p.h8
27 files changed, 148 insertions, 150 deletions
diff --git a/src/animation/backend/abstractevaluateclipanimatorjob.cpp b/src/animation/backend/abstractevaluateclipanimatorjob.cpp
index 43c1de260..5267d4526 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;
- QList<AnimationCallbackAndValue> m_callbacks;
+ QVector<AnimationCallbackAndValue> m_callbacks;
};
AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob()
@@ -62,7 +62,7 @@ AbstractEvaluateClipAnimatorJob::AbstractEvaluateClipAnimatorJob()
{
}
-void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QList<AnimationCallbackAndValue> &callbacks)
+void AbstractEvaluateClipAnimatorJob::setPostFrameData(const AnimationRecord &record, const QVector<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 5bf88978a..2a8914faa 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 QList<AnimationCallbackAndValue> &callbacks);
+ void setPostFrameData(const AnimationRecord &record, const QVector<AnimationCallbackAndValue> &callbacks);
private:
Q_DECLARE_PRIVATE(AbstractEvaluateClipAnimatorJob)
diff --git a/src/animation/backend/animationclip_p.h b/src/animation/backend/animationclip_p.h
index 38bc117fe..23c564171 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 QList<Channel> &channels() const { return m_channels; }
+ const QVector<Channel> &channels() const { return m_channels; }
// Called from jobs
void loadAnimation();
@@ -117,7 +117,7 @@ private:
ClipDataType m_dataType;
QString m_name;
- QList<Channel> m_channels;
+ QVector<Channel> m_channels;
float m_duration;
int m_channelComponentCount;
@@ -134,10 +134,9 @@ inline QDebug operator<<(QDebug dbg, const AnimationClip &animationClip)
<< "Duration: " << animationClip.duration() << Qt::endl
<< "Channels:" << Qt::endl;
- const QList<Channel> channels = animationClip.channels();
- for (const auto &channel : channels) {
+ const auto &channels = animationClip.channels();
+ for (const auto &channel : channels)
dbg << channel;
- }
return dbg;
}
diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp
index e2cb04c15..0c1bd96dc 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 QList<float> valueToVector(const QVector3D &value)
+inline QVector<float> valueToVector(const QVector3D &value)
{
return { value.x(), value.y(), value.z() };
}
-inline QList<float> valueToVector(const QQuaternion &value)
+inline QVector<float> valueToVector(const QQuaternion &value)
{
return { value.scalar(), value.x(), value.y(), value.z() };
}
@@ -227,14 +227,14 @@ ComponentIndices channelComponentsToIndicesHelper(const Channel &channel,
ClipResults evaluateClipAtLocalTime(AnimationClip *clip, float localTime)
{
- QList<float> channelResults;
+ QVector<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 QList<Channel> &channels = clip->channels();
+ const auto &channels = clip->channels();
int i = 0;
for (const Channel &channel : channels) {
if (channel.name.contains(QStringLiteral("Rotation")) &&
@@ -330,7 +330,7 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip, float phase)
template<typename Container>
Container mapChannelResultsToContainer(const MappingData &mappingData,
- const QList<float> &channelResults)
+ const QVector<float> &channelResults)
{
Container r;
r.reserve(channelResults.size());
@@ -342,7 +342,7 @@ Container mapChannelResultsToContainer(const MappingData &mappingData,
return r;
}
-QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &channelResults)
+QVariant buildPropertyValue(const MappingData &mappingData, const QVector<float> &channelResults)
{
const int vectorOfFloatType = qMetaTypeId<QList<float>>();
@@ -410,8 +410,8 @@ QVariant buildPropertyValue(const MappingData &mappingData, const QList<float> &
}
AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
- const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults,
+ const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults,
bool finalFrame,
float normalizedLocalTime)
{
@@ -469,10 +469,10 @@ AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
return record;
}
-QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults)
+QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults)
{
- QList<AnimationCallbackAndValue> callbacks;
+ QVector<AnimationCallbackAndValue> callbacks;
for (const MappingData &mappingData : mappingDataVec) {
if (!mappingData.callback)
continue;
@@ -492,10 +492,10 @@ QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mapp
// buildRequiredChannelsAndTypes() and assignChannelComponentIndices(). We are
// currently repeating the iteration over mappings and extracting/generating
// channel names, types and joint indices.
-QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMappings,
- const QList<ChannelNameAndType> &channelNamesAndTypes,
- const QList<ComponentIndices> &channelComponentIndices,
- const QList<QBitArray> &sourceClipMask)
+QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping *> &channelMappings,
+ const QVector<ChannelNameAndType> &channelNamesAndTypes,
+ const QVector<ComponentIndices> &channelComponentIndices,
+ const QVector<QBitArray> &sourceClipMask)
{
// Accumulate the required number of mappings
int maxMappingDatas = 0;
@@ -513,7 +513,7 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
}
}
}
- QList<MappingData> mappingDataVec;
+ QVector<MappingData> mappingDataVec;
mappingDataVec.reserve(maxMappingDatas);
// Iterate over the mappings
@@ -622,15 +622,15 @@ QList<MappingData> buildPropertyMappings(const QList<ChannelMapping*> &channelMa
return mappingDataVec;
}
-QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
+QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
const ChannelMapper *mapper)
{
ChannelMappingManager *mappingManager = handler->channelMappingManager();
- const QList<Qt3DCore::QNodeId> mappingIds = mapper->mappingIds();
+ const auto mappingIds = mapper->mappingIds();
// Reserve enough storage assuming each mapping is for a different channel.
// May be overkill but avoids potential for multiple allocations
- QList<ChannelNameAndType> namesAndTypes;
+ QVector<ChannelNameAndType> namesAndTypes;
namesAndTypes.reserve(mappingIds.size());
// Iterate through the mappings and add ones not already used by an earlier mapping.
@@ -690,9 +690,9 @@ QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
return namesAndTypes;
}
-QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes)
+QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &namesAndTypes)
{
- QList<ComponentIndices> channelComponentIndices;
+ QVector<ComponentIndices> channelComponentIndices;
channelComponentIndices.reserve(namesAndTypes.size());
int baseIndex = 0;
@@ -712,7 +712,7 @@ QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAnd
return channelComponentIndices;
}
-QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
+QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
Qt3DCore::QNodeId blendTreeRootId)
{
Q_ASSERT(handler);
@@ -722,7 +722,7 @@ QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
ClipBlendNodeManager *nodeManager = handler->clipBlendNodeManager();
// Visit the tree in a pre-order manner and collect the dependencies
- QList<Qt3DCore::QNodeId> clipIds;
+ QVector<Qt3DCore::QNodeId> clipIds;
ClipBlendNodeVisitor visitor(nodeManager,
ClipBlendNodeVisitor::PreOrder,
ClipBlendNodeVisitor::VisitOnlyDependencies);
@@ -750,8 +750,8 @@ QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
return clipIds;
}
-ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels,
- const QList<ComponentIndices> &targetIndices,
+ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels,
+ const QVector<ComponentIndices> &targetIndices,
const AnimationClip *clip)
{
Q_ASSERT(targetChannels.size() == targetIndices.size());
@@ -865,10 +865,10 @@ ClipResults evaluateBlendTree(Handler *handler,
return blendTreeRootNode->clipResults(animatorId);
}
-QList<float> defaultValueForChannel(Handler *handler,
+QVector<float> defaultValueForChannel(Handler *handler,
const ChannelNameAndType &channelDescription)
{
- QList<float> result;
+ QVector<float> result;
// Does the channel repesent a joint in a skeleton or is it a general channel?
ChannelMappingManager *mappingManager = handler->channelMappingManager();
@@ -915,7 +915,7 @@ QList<float> defaultValueForChannel(Handler *handler,
// Everything else gets all zeros
const int componentCount = mapping->componentCount();
- result = QList<float>(componentCount, 0.0f);
+ result = QVector<float>(componentCount, 0.0f);
break;
}
@@ -924,7 +924,7 @@ QList<float> defaultValueForChannel(Handler *handler,
return result;
}
-void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults,
+void applyComponentDefaultValues(const QVector<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 63aaa1a37..bae9055bf 100644
--- a/src/animation/backend/animationutils_p.h
+++ b/src/animation/backend/animationutils_p.h
@@ -72,7 +72,7 @@ class AnimationClip;
class ChannelMapper;
class ChannelMapping;
-using ComponentIndices = QList<int>;
+using ComponentIndices = QVector<int>;
enum JointTransformComponent {
NoTransformComponent = 0,
@@ -125,7 +125,7 @@ struct ClipEvaluationData
bool isFinalFrame;
};
-using ClipResults = QList<float>;
+using ClipResults = QVector<float>;
struct ChannelNameAndType
{
@@ -226,10 +226,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;
- QList<QBitArray> sourceClipMask;
- QList<ComponentIndices> formattedComponentIndices;
- QList<ChannelNameAndType> namesAndTypes;
- QList<ComponentValue> defaultComponentValues;
+ QVector<QBitArray> sourceClipMask;
+ QVector<ComponentIndices> formattedComponentIndices;
+ QVector<ChannelNameAndType> namesAndTypes;
+ QVector<ComponentValue> defaultComponentValues;
};
#ifndef QT_NO_DEBUG_STREAM
@@ -279,15 +279,15 @@ struct AnimationRecord {
Qt3DCore::QNodeId animatorId;
QList<TargetChange> targetChanges;
- QList<QPair<Qt3DCore::QNodeId, QList<Qt3DCore::Sqt>>> skeletonChanges;
+ QList<QPair<Qt3DCore::QNodeId, QVector<Qt3DCore::Sqt>>> skeletonChanges;
float normalizedTime = -1.f;
bool finalFrame = false;
};
Q_AUTOTEST_EXPORT
AnimationRecord prepareAnimationRecord(Qt3DCore::QNodeId animatorId,
- const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults,
+ const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults,
bool finalFrame,
float normalizedLocalTime);
@@ -359,21 +359,21 @@ ClipResults evaluateClipAtPhase(AnimationClip *clip,
float phase);
Q_AUTOTEST_EXPORT
-QList<AnimationCallbackAndValue> prepareCallbacks(const QList<MappingData> &mappingDataVec,
- const QList<float> &channelResults);
+QVector<AnimationCallbackAndValue> prepareCallbacks(const QVector<MappingData> &mappingDataVec,
+ const QVector<float> &channelResults);
Q_AUTOTEST_EXPORT
-QList<MappingData> buildPropertyMappings(const QList<ChannelMapping *> &channelMappings,
- const QList<ChannelNameAndType> &channelNamesAndTypes,
- const QList<ComponentIndices> &channelComponentIndices,
- const QList<QBitArray> &sourceClipMask);
+QVector<MappingData> buildPropertyMappings(const QVector<ChannelMapping *> &channelMappings,
+ const QVector<ChannelNameAndType> &channelNamesAndTypes,
+ const QVector<ComponentIndices> &channelComponentIndices,
+ const QVector<QBitArray> &sourceClipMask);
Q_AUTOTEST_EXPORT
-QList<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
- const ChannelMapper *mapper);
+QVector<ChannelNameAndType> buildRequiredChannelsAndTypes(Handler *handler,
+ const ChannelMapper *mapper);
Q_AUTOTEST_EXPORT
-QList<ComponentIndices> assignChannelComponentIndices(const QList<ChannelNameAndType> &namesAndTypes);
+QVector<ComponentIndices> assignChannelComponentIndices(const QVector<ChannelNameAndType> &namesAndTypes);
Q_AUTOTEST_EXPORT
double localTimeFromElapsedTime(double t_current_local, double t_elapsed_global,
@@ -386,12 +386,12 @@ double phaseFromElapsedTime(double t_current_local, double t_elapsed_global,
int loopCount, int &currentLoop);
Q_AUTOTEST_EXPORT
-QList<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
+QVector<Qt3DCore::QNodeId> gatherValueNodesToEvaluate(Handler *handler,
Qt3DCore::QNodeId blendTreeRootId);
Q_AUTOTEST_EXPORT
-ClipFormat generateClipFormatIndices(const QList<ChannelNameAndType> &targetChannels,
- const QList<ComponentIndices> &targetIndices,
+ClipFormat generateClipFormatIndices(const QVector<ChannelNameAndType> &targetChannels,
+ const QVector<ComponentIndices> &targetIndices,
const AnimationClip *clip);
Q_AUTOTEST_EXPORT
@@ -404,10 +404,10 @@ ClipResults evaluateBlendTree(Handler *handler,
Qt3DCore::QNodeId blendNodeId);
Q_AUTOTEST_EXPORT
-QList<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription);
+QVector<float> defaultValueForChannel(Handler *handler, const ChannelNameAndType &channelDescription);
Q_AUTOTEST_EXPORT
-void applyComponentDefaultValues(const QList<ComponentValue> &componentDefaults,
+void applyComponentDefaultValues(const QVector<ComponentValue> &componentDefaults,
ClipResults &formattedClipResults);
} // Animation
diff --git a/src/animation/backend/blendedclipanimator_p.h b/src/animation/backend/blendedclipanimator_p.h
index 795aa5b6a..2396cdd74 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 QList<MappingData> &mappingData) { m_mappingData = mappingData; }
- QList<MappingData> mappingData() const { return m_mappingData; }
+ void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; }
+ QVector<MappingData> mappingData() const { return m_mappingData; }
void animationClipMarkedDirty() { setDirty(Handler::BlendedClipAnimatorDirty); }
@@ -123,7 +123,7 @@ private:
float m_normalizedLocalTime;
float m_lastNormalizedLocalTime;
- QList<MappingData> m_mappingData;
+ QVector<MappingData> m_mappingData;
};
} // namespace Animation
diff --git a/src/animation/backend/buildblendtreesjob.cpp b/src/animation/backend/buildblendtreesjob.cpp
index a9a6ce36c..0b4fc278a 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 QList<HBlendedClipAnimator> &blendedClipAnimatorHandles)
+void BuildBlendTreesJob::setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles)
{
m_blendedClipAnimatorHandles = blendedClipAnimatorHandles;
BlendedClipAnimatorManager *blendedClipAnimatorManager = m_handler->blendedClipAnimatorManager();
@@ -89,17 +89,17 @@ void BuildBlendTreesJob::run()
const ChannelMapper *mapper = m_handler->channelMapperManager()->lookupResource(blendClipAnimator->mapperId());
if (!mapper)
continue;
- const QList<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= buildRequiredChannelsAndTypes(m_handler, mapper);
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<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
- QList<QBitArray> blendTreeChannelMask;
- const QList<Qt3DCore::QNodeId> valueNodeIds
+ QVector<QBitArray> blendTreeChannelMask;
+ const QVector<Qt3DCore::QNodeId> valueNodeIds
= gatherValueNodesToEvaluate(m_handler, blendClipAnimator->blendTreeRootId());
// Store the clip value nodes to avoid further lookups below.
@@ -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 QList<float> defaultValue = defaultValueForChannel(m_handler,
- f.namesAndTypes[i]);
+ const QVector<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 QList<Qt3DCore::QNodeId> channelMappingIds = mapper->mappingIds();
- QList<ChannelMapping *> channelMappings;
+ const Qt3DCore::QNodeIdVector channelMappingIds = mapper->mappingIds();
+ QVector<ChannelMapping *> channelMappings;
channelMappings.reserve(channelMappingIds.size());
for (const auto &mappingId : channelMappingIds) {
ChannelMapping *mapping = m_handler->channelMappingManager()->lookupResource(mappingId);
@@ -190,11 +190,10 @@ void BuildBlendTreesJob::run()
channelMappings.push_back(mapping);
}
- const QList<MappingData> mappingDataVec
- = buildPropertyMappings(channelMappings,
- channelNamesAndTypes,
- channelComponentIndices,
- blendTreeChannelMask);
+ const QVector<MappingData> mappingDataVec = buildPropertyMappings(channelMappings,
+ channelNamesAndTypes,
+ channelComponentIndices,
+ blendTreeChannelMask);
blendClipAnimator->setMappingData(mappingDataVec);
}
}
diff --git a/src/animation/backend/buildblendtreesjob_p.h b/src/animation/backend/buildblendtreesjob_p.h
index c822e40f2..a14552cb9 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 QList<HBlendedClipAnimator> &blendedClipAnimatorHandles);
+ void setBlendedClipAnimators(const QVector<HBlendedClipAnimator> &blendedClipAnimatorHandles);
protected:
void run() override;
private:
- QList<HBlendedClipAnimator> m_blendedClipAnimatorHandles;
+ QVector<HBlendedClipAnimator> m_blendedClipAnimatorHandles;
Handler *m_handler;
};
diff --git a/src/animation/backend/channelmapper_p.h b/src/animation/backend/channelmapper_p.h
index a2e9065a6..12b712719 100644
--- a/src/animation/backend/channelmapper_p.h
+++ b/src/animation/backend/channelmapper_p.h
@@ -71,10 +71,10 @@ public:
void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
- void setMappingIds(const QList<Qt3DCore::QNodeId> &mappingIds) { m_mappingIds = mappingIds; }
- QList<Qt3DCore::QNodeId> mappingIds() const { return m_mappingIds; }
+ void setMappingIds(const Qt3DCore::QNodeIdVector &mappingIds) { m_mappingIds = mappingIds; }
+ Qt3DCore::QNodeIdVector mappingIds() const { return m_mappingIds; }
- QList<ChannelMapping*> mappings() const
+ QVector<ChannelMapping*> mappings() const
{
if (m_isDirty)
updateMappings();
@@ -84,10 +84,10 @@ public:
private:
void updateMappings() const;
- QList<Qt3DCore::QNodeId> m_mappingIds;
+ Qt3DCore::QNodeIdVector m_mappingIds;
// Cached data
- mutable QList<ChannelMapping*> m_mappings;
+ mutable QVector<ChannelMapping*> m_mappings;
mutable bool m_isDirty;
};
diff --git a/src/animation/backend/clipanimator_p.h b/src/animation/backend/clipanimator_p.h
index 25e4af3d0..65fc6bdc8 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 QList<MappingData> &mappingData) { m_mappingData = mappingData; }
- QList<MappingData> mappingData() const { return m_mappingData; }
+ void setMappingData(const QVector<MappingData> &mappingData) { m_mappingData = mappingData; }
+ QVector<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;
- QList<MappingData> m_mappingData;
+ QVector<MappingData> m_mappingData;
int m_currentLoop;
ClipFormat m_clipFormat;
diff --git a/src/animation/backend/evaluateblendclipanimatorjob.cpp b/src/animation/backend/evaluateblendclipanimatorjob.cpp
index cfb2be1e0..294932eca 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 QList<Qt3DCore::QNodeId> valueNodeIdsToEvaluate = gatherValueNodesToEvaluate(m_handler, blendTreeRootId);
+ const QVector<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 QList<MappingData> mappingData = blendedClipAnimator->mappingData();
+ const QVector<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 1a1b6dca6..71eebb763 100644
--- a/src/animation/backend/fcurve_p.h
+++ b/src/animation/backend/fcurve_p.h
@@ -149,7 +149,7 @@ struct Channel
{
QString name;
int jointIndex = -1;
- QList<ChannelComponent> channelComponents;
+ QVector<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 4b75d9180..1005914c7 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 QList<HClipAnimator> &clipAnimatorHandles)
+void FindRunningClipAnimatorsJob::setDirtyClipAnimators(const QVector<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 QList<ChannelMapping *> channelMappings = mapper->mappings();
+ const QVector<ChannelMapping *> channelMappings = mapper->mappings();
- const QList<ChannelNameAndType> channelNamesAndTypes
+ const QVector<ChannelNameAndType> channelNamesAndTypes
= buildRequiredChannelsAndTypes(m_handler, mapper);
- const QList<ComponentIndices> channelComponentIndices
+ const QVector<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 QList<MappingData> mappingData = buildPropertyMappings(channelMappings,
+ const QVector<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 f1d5d1701..ae2437ac8 100644
--- a/src/animation/backend/findrunningclipanimatorsjob_p.h
+++ b/src/animation/backend/findrunningclipanimatorsjob_p.h
@@ -71,13 +71,13 @@ public:
void setHandler(Handler *handler) { m_handler = handler; }
Handler *handler() const { return m_handler; }
- void setDirtyClipAnimators(const QList<HClipAnimator> &animationClipHandles);
+ void setDirtyClipAnimators(const QVector<HClipAnimator> &animationClipHandles);
protected:
void run() override;
private:
- QList<HClipAnimator> m_clipAnimatorHandles;
+ QVector<HClipAnimator> m_clipAnimatorHandles;
Handler *m_handler;
#if defined(QT_BUILD_INTERNAL)
diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp
index 910fd86fa..c4904ee9d 100644
--- a/src/animation/backend/gltfimporter.cpp
+++ b/src/animation/backend/gltfimporter.cpp
@@ -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;
- QList<float> keyframeTimes(keyFrameCount);
+ QVector<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);
diff --git a/src/animation/backend/gltfimporter_p.h b/src/animation/backend/gltfimporter_p.h
index c4da7b40f..e9c2a3248 100644
--- a/src/animation/backend/gltfimporter_p.h
+++ b/src/animation/backend/gltfimporter_p.h
@@ -185,7 +185,7 @@ public:
struct AnimationNameAndChannels
{
QString name;
- QList<Qt3DAnimation::Animation::Channel> channels;
+ QVector<Qt3DAnimation::Animation::Channel> channels;
};
AnimationNameAndChannels createAnimationData(int animationIndex, const QString &animationName = QString()) const;
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp
index ca0a971cc..d74138d91 100644
--- a/src/animation/backend/handler.cpp
+++ b/src/animation/backend/handler.cpp
@@ -146,7 +146,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(QList<HAnimationClip> *clips)
+void Handler::cleanupHandleList(QVector<HAnimationClip> *clips)
{
for (auto it = clips->begin(); it != clips->end(); ) {
if (!m_animationClipLoaderManager->data(*it))
@@ -156,7 +156,7 @@ void Handler::cleanupHandleList(QList<HAnimationClip> *clips)
}
}
-void Handler::cleanupHandleList(QList<HClipAnimator> *animators)
+void Handler::cleanupHandleList(QVector<HClipAnimator> *animators)
{
for (auto it = animators->begin(); it != animators->end(); ) {
if (!m_clipAnimatorManager->data(*it))
@@ -166,7 +166,7 @@ void Handler::cleanupHandleList(QList<HClipAnimator> *animators)
}
}
-void Handler::cleanupHandleList(QList<HBlendedClipAnimator> *animators)
+void Handler::cleanupHandleList(QVector<HBlendedClipAnimator> *animators)
{
for (auto it = animators->begin(); it != animators->end(); ) {
if (!m_blendedClipAnimatorManager->data(*it))
@@ -218,7 +218,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 QList<HBlendedClipAnimator> dirtyBlendedAnimators = std::move(m_dirtyBlendedAnimators);
+ const QVector<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 f565704b8..493f7f340 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);
- QList<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; }
+ QVector<HClipAnimator> runningClipAnimators() const { return m_runningClipAnimators; }
void setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle, bool running);
- QList<HBlendedClipAnimator> runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; }
+ QVector<HBlendedClipAnimator> runningBlenndedClipAnimators() const { return m_runningBlendedClipAnimators; }
AnimationClipLoaderManager *animationClipLoaderManager() const noexcept { return m_animationClipLoaderManager.data(); }
ClockManager *clockManager() const noexcept { return m_clockManager.data(); }
@@ -121,9 +121,9 @@ public:
std::vector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time);
- void cleanupHandleList(QList<HAnimationClip> *clips);
- void cleanupHandleList(QList<HClipAnimator> *animators);
- void cleanupHandleList(QList<HBlendedClipAnimator> *animators);
+ void cleanupHandleList(QVector<HAnimationClip> *clips);
+ void cleanupHandleList(QVector<HClipAnimator> *animators);
+ void cleanupHandleList(QVector<HBlendedClipAnimator> *animators);
private:
QMutex m_mutex;
@@ -136,17 +136,17 @@ private:
QScopedPointer<ClipBlendNodeManager> m_clipBlendNodeManager;
QScopedPointer<SkeletonManager> m_skeletonManager;
- QList<HAnimationClip> m_dirtyAnimationClips;
- QList<HClipAnimator> m_dirtyClipAnimators;
- QList<HBlendedClipAnimator> m_dirtyBlendedAnimators;
+ QVector<HAnimationClip> m_dirtyAnimationClips;
+ QVector<HClipAnimator> m_dirtyClipAnimators;
+ QVector<HBlendedClipAnimator> m_dirtyBlendedAnimators;
- QList<HClipAnimator> m_runningClipAnimators;
- QList<HBlendedClipAnimator> m_runningBlendedClipAnimators;
+ QVector<HClipAnimator> m_runningClipAnimators;
+ QVector<HBlendedClipAnimator> m_runningBlendedClipAnimators;
QSharedPointer<LoadAnimationClipJob> m_loadAnimationClipJob;
QSharedPointer<FindRunningClipAnimatorsJob> m_findRunningClipAnimatorsJob;
- QList<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs;
- QList<EvaluateBlendClipAnimatorJobPtr> m_evaluateBlendClipAnimatorJobs;
+ QVector<QSharedPointer<EvaluateClipAnimatorJob>> m_evaluateClipAnimatorJobs;
+ QVector<EvaluateBlendClipAnimatorJobPtr> m_evaluateBlendClipAnimatorJobs;
BuildBlendTreesJobPtr m_buildBlendTreesJob;
qint64 m_simulationTime;
diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp
index fd8f620a8..331b99b36 100644
--- a/src/animation/backend/loadanimationclipjob.cpp
+++ b/src/animation/backend/loadanimationclipjob.cpp
@@ -69,7 +69,7 @@ LoadAnimationClipJob::LoadAnimationClipJob()
SET_JOB_RUN_STAT_TYPE(this, JobTypes::LoadAnimationClip, 0)
}
-void LoadAnimationClipJob::addDirtyAnimationClips(const QList<HAnimationClip> &animationClipHandles)
+void LoadAnimationClipJob::addDirtyAnimationClips(const QVector<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 bbe67f20e..2c148f08d 100644
--- a/src/animation/backend/loadanimationclipjob_p.h
+++ b/src/animation/backend/loadanimationclipjob_p.h
@@ -69,7 +69,7 @@ public:
void setHandler(Handler *handler) { m_handler = handler; }
Handler *handler() const { return m_handler; }
- void addDirtyAnimationClips(const QList<HAnimationClip> &animationClipHandles);
+ void addDirtyAnimationClips(const QVector<HAnimationClip> &animationClipHandles);
void clearDirtyAnimationClips();
protected:
@@ -78,7 +78,7 @@ protected:
private:
Q_DECLARE_PRIVATE(LoadAnimationClipJob)
- QList<HAnimationClip> m_animationClipHandles;
+ QVector<HAnimationClip> m_animationClipHandles;
Handler *m_handler;
};
diff --git a/src/animation/backend/skeleton_p.h b/src/animation/backend/skeleton_p.h
index a184921dd..d44f8fc1c 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;
- QList<Qt3DCore::Sqt> joints() const { return m_jointLocalPoses; }
+ QVector<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 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; }
+ 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; }
#endif
private:
- QList<QString> m_jointNames;
- QList<Qt3DCore::Sqt> m_jointLocalPoses;
+ QVector<QString> m_jointNames;
+ QVector<Qt3DCore::Sqt> m_jointLocalPoses;
};
} // namespace Animation
diff --git a/src/animation/frontend/qanimationclipdata.cpp b/src/animation/frontend/qanimationclipdata.cpp
index 41ebe68ef..f68748515 100644
--- a/src/animation/frontend/qanimationclipdata.cpp
+++ b/src/animation/frontend/qanimationclipdata.cpp
@@ -48,7 +48,7 @@ namespace Qt3DAnimation {
class QAnimationClipDataPrivate
{
public:
- QList<QChannel> m_channels;
+ QVector<QChannel> m_channels;
QString m_name;
};
diff --git a/src/animation/frontend/qchannel.cpp b/src/animation/frontend/qchannel.cpp
index 8012f1b5c..0e944dd6e 100644
--- a/src/animation/frontend/qchannel.cpp
+++ b/src/animation/frontend/qchannel.cpp
@@ -48,7 +48,7 @@ namespace Qt3DAnimation {
class QChannelPrivate
{
public:
- QList<QChannelComponent> m_channelComponents;
+ QVector<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 755ed6294..e5a19f93d 100644
--- a/src/animation/frontend/qchannelcomponent.cpp
+++ b/src/animation/frontend/qchannelcomponent.cpp
@@ -48,7 +48,7 @@ namespace Qt3DAnimation {
class QChannelComponentPrivate
{
public:
- QList<QKeyFrame> m_keyFrames;
+ QVector<QKeyFrame> m_keyFrames;
QString m_name;
};
diff --git a/src/animation/frontend/qmorphinganimation.cpp b/src/animation/frontend/qmorphinganimation.cpp
index 63c0d68ca..96ea346bb 100644
--- a/src/animation/frontend/qmorphinganimation.cpp
+++ b/src/animation/frontend/qmorphinganimation.cpp
@@ -179,7 +179,7 @@ QMorphingAnimationPrivate::QMorphingAnimationPrivate()
QMorphingAnimationPrivate::~QMorphingAnimationPrivate()
{
- for (QList<float> *weights : qAsConst(m_weights))
+ for (QVector<float> *weights : qAsConst(m_weights))
delete weights;
}
@@ -189,7 +189,7 @@ void QMorphingAnimationPrivate::updateAnimation(float position)
if (!m_target || !m_target->geometry())
return;
- QList<int> relevantValues;
+ QVector<int> relevantValues;
float sum = 0.0f;
float interpolator = 0.0f;
m_morphKey.resize(m_morphTargets.size());
@@ -282,7 +282,7 @@ QMorphingAnimation::QMorphingAnimation(QObject *parent)
this, &QMorphingAnimation::updateAnimation);
}
-QList<float> QMorphingAnimation::targetPositions() const
+QVector<float> QMorphingAnimation::targetPositions() const
{
Q_D(const QMorphingAnimation);
return d->m_targetPositions;
@@ -321,7 +321,7 @@ QEasingCurve QMorphingAnimation::easing() const
/*!
Set morph \a targets to animation. Old targets are cleared.
*/
-void QMorphingAnimation::setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets)
+void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
{
Q_D(QMorphingAnimation);
d->m_morphTargets = targets;
@@ -353,7 +353,7 @@ void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
d->m_position = -1.0f;
}
-void QMorphingAnimation::setTargetPositions(const QList<float> &targetPositions)
+void QMorphingAnimation::setTargetPositions(const QVector<float> &targetPositions)
{
Q_D(QMorphingAnimation);
d->m_targetPositions = targetPositions;
@@ -365,7 +365,7 @@ void QMorphingAnimation::setTargetPositions(const QList<float> &targetPositions)
d->m_weights.resize(targetPositions.size());
for (int i = 0; i < d->m_weights.size(); ++i) {
if (d->m_weights[i] == nullptr)
- d->m_weights[i] = new QList<float>();
+ d->m_weights[i] = new QVector<float>();
}
}
d->m_position = -1.0f;
@@ -384,13 +384,13 @@ void QMorphingAnimation::setTarget(Qt3DRender::QGeometryRenderer *target)
/*!
Sets morph \a weights at \a positionIndex.
*/
-void QMorphingAnimation::setWeights(int positionIndex, const QList<float> &weights)
+void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)
{
Q_D(QMorphingAnimation);
if (d->m_weights.size() < positionIndex)
d->m_weights.resize(positionIndex + 1);
if (d->m_weights[positionIndex] == nullptr)
- d->m_weights[positionIndex] = new QList<float>();
+ d->m_weights[positionIndex] = new QVector<float>();
*d->m_weights[positionIndex] = weights;
d->m_position = -1.0f;
}
@@ -398,7 +398,7 @@ void QMorphingAnimation::setWeights(int positionIndex, const QList<float> &weigh
/*!
Return morph weights at \a positionIndex.
*/
-QList<float> QMorphingAnimation::getWeights(int positionIndex)
+QVector<float> QMorphingAnimation::getWeights(int positionIndex)
{
Q_D(QMorphingAnimation);
return *d->m_weights[positionIndex];
@@ -407,7 +407,7 @@ QList<float> QMorphingAnimation::getWeights(int positionIndex)
/*!
Return morph target list.
*/
-QList<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()
+QVector<QMorphTarget *> QMorphingAnimation::morphTargetList()
{
Q_D(QMorphingAnimation);
return d->m_morphTargets;
diff --git a/src/animation/frontend/qmorphinganimation.h b/src/animation/frontend/qmorphinganimation.h
index fab6f5b44..1a9a60695 100644
--- a/src/animation/frontend/qmorphinganimation.h
+++ b/src/animation/frontend/qmorphinganimation.h
@@ -54,7 +54,7 @@ class QMorphingAnimationPrivate;
class Q_3DANIMATIONSHARED_EXPORT QMorphingAnimation : public QAbstractAnimation
{
Q_OBJECT
- Q_PROPERTY(QList<float> targetPositions READ targetPositions WRITE setTargetPositions NOTIFY targetPositionsChanged)
+ Q_PROPERTY(QVector<float> targetPositions READ targetPositions WRITE setTargetPositions NOTIFY targetPositionsChanged)
Q_PROPERTY(float interpolator READ interpolator NOTIFY interpolatorChanged)
Q_PROPERTY(Qt3DRender::QGeometryRenderer *target READ target WRITE setTarget NOTIFY targetChanged)
Q_PROPERTY(QString targetName READ targetName WRITE setTargetName NOTIFY targetNameChanged)
@@ -71,31 +71,31 @@ public:
explicit QMorphingAnimation(QObject *parent = nullptr);
- QList<float> targetPositions() const;
+ QVector<float> targetPositions() const;
float interpolator() const;
Qt3DRender::QGeometryRenderer *target() const;
QString targetName() const;
QMorphingAnimation::Method method() const;
QEasingCurve easing() const;
- void setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets);
+ void setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets);
void addMorphTarget(Qt3DAnimation::QMorphTarget *target);
void removeMorphTarget(Qt3DAnimation::QMorphTarget *target);
- void setWeights(int positionIndex, const QList<float> &weights);
- QList<float> getWeights(int positionIndex);
+ void setWeights(int positionIndex, const QVector<float> &weights);
+ QVector<float> getWeights(int positionIndex);
- QList<Qt3DAnimation::QMorphTarget *> morphTargetList();
+ QVector<Qt3DAnimation::QMorphTarget *> morphTargetList();
public Q_SLOTS:
- void setTargetPositions(const QList<float> &targetPositions);
+ void setTargetPositions(const QVector<float> &targetPositions);
void setTarget(Qt3DRender::QGeometryRenderer *target);
void setTargetName(const QString name);
void setMethod(QMorphingAnimation::Method method);
void setEasing(const QEasingCurve &easing);
Q_SIGNALS:
- void targetPositionsChanged(const QList<float> &targetPositions);
+ void targetPositionsChanged(const QVector<float> &targetPositions);
void interpolatorChanged(float interpolator);
void targetChanged(Qt3DRender::QGeometryRenderer *target);
void targetNameChanged(const QString &name);
diff --git a/src/animation/frontend/qmorphinganimation_p.h b/src/animation/frontend/qmorphinganimation_p.h
index 5c501ef8d..c306f3309 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;
- QList<float> m_targetPositions;
- QList<QList<float>*> m_weights;
- QList<float> m_morphKey;
+ QVector<float> m_targetPositions;
+ QVector<QVector<float>*> m_weights;
+ QVector<float> m_morphKey;
QStringList m_attributeNames;
- QList<Qt3DAnimation::QMorphTarget *> m_morphTargets;
+ QVector<Qt3DAnimation::QMorphTarget *> m_morphTargets;
QMorphTarget *m_flattened;
QMorphingAnimation::Method m_method;
QEasingCurve m_easing;