summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-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
-rw-r--r--src/core/resources/qframeallocator_p_p.h4
-rw-r--r--src/core/transforms/qabstractskeleton_p.h4
-rw-r--r--src/extras/3dtext/qextrudedtextgeometry.cpp14
-rw-r--r--src/extras/text/distancefieldtextrenderer.cpp4
-rw-r--r--src/extras/text/distancefieldtextrenderer_p.h4
-rw-r--r--src/extras/text/qdistancefieldglyphcache.cpp4
-rw-r--r--src/extras/text/qtext2dentity.cpp8
-rw-r--r--src/input/backend/movingaverage_p.h2
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp4
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp2
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.h4
-rw-r--r--src/render/backend/uniform.cpp2
-rw-r--r--src/render/backend/uniform_p.h6
-rw-r--r--src/render/geometry/gltfskeletonloader_p.h10
-rw-r--r--src/render/geometry/skeleton.cpp6
-rw-r--r--src/render/geometry/skeleton_p.h10
-rw-r--r--src/render/geometry/skeletondata_p.h6
-rw-r--r--src/render/jobs/updateskinningpalettejob.cpp2
45 files changed, 196 insertions, 198 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;
diff --git a/src/core/resources/qframeallocator_p_p.h b/src/core/resources/qframeallocator_p_p.h
index daf204f22..bf4e0a2b1 100644
--- a/src/core/resources/qframeallocator_p_p.h
+++ b/src/core/resources/qframeallocator_p_p.h
@@ -101,7 +101,7 @@ private:
private:
uint m_blockSize;
uchar m_nbrBlock;
- QList<QFrameChunk> m_chunks;
+ QVector<QFrameChunk> m_chunks;
QFrameChunk *m_lastAllocatedChunck;
QFrameChunk *m_lastFreedChunck;
};
@@ -128,7 +128,7 @@ public:
uint m_maxObjectSize;
uint m_alignment;
- QList<QFixedFrameAllocator> m_allocatorPool;
+ QVector<QFixedFrameAllocator> m_allocatorPool;
};
} // Qt3D
diff --git a/src/core/transforms/qabstractskeleton_p.h b/src/core/transforms/qabstractskeleton_p.h
index 01d8fc74e..333fa5fdf 100644
--- a/src/core/transforms/qabstractskeleton_p.h
+++ b/src/core/transforms/qabstractskeleton_p.h
@@ -78,8 +78,8 @@ public:
SkeletonType m_type;
int m_jointCount;
- QList<Sqt> m_localPoses;
- QList<QString> m_jointNames;
+ QVector<Sqt> m_localPoses;
+ QVector<QString> m_jointNames;
};
} // namespace Qt3DCore
diff --git a/src/extras/3dtext/qextrudedtextgeometry.cpp b/src/extras/3dtext/qextrudedtextgeometry.cpp
index 2f63f2175..a11b91fa6 100644
--- a/src/extras/3dtext/qextrudedtextgeometry.cpp
+++ b/src/extras/3dtext/qextrudedtextgeometry.cpp
@@ -75,10 +75,10 @@ struct TriangulationData {
int end;
};
- QList<QVector3D> vertices;
- QList<IndexType> indices;
- QList<Outline> outlines;
- QList<IndexType> outlineIndices;
+ QVector<QVector3D> vertices;
+ QVector<IndexType> indices;
+ QVector<Outline> outlines;
+ QVector<IndexType> outlineIndices;
bool inverted;
};
@@ -107,7 +107,7 @@ TriangulationData triangulate(const QString &text, const QFont &font)
// Extract polylines out of the path, this allows us to retrieve indices for each glyph outline
QPolylineSet polylines = qPolyline(path);
- QList<IndexType> tmpIndices;
+ QVector<IndexType> tmpIndices;
tmpIndices.resize(polylines.indices.size());
memcpy(tmpIndices.data(), polylines.indices.data(), polylines.indices.size() * sizeof(IndexType));
@@ -315,8 +315,8 @@ void QExtrudedTextGeometryPrivate::update()
QVector3D normal;
};
- QList<IndexType> indices;
- QList<Vertex> vertices;
+ QVector<IndexType> indices;
+ QVector<Vertex> vertices;
// TODO: keep 'vertices.size()' small when extruding
vertices.reserve(data.vertices.size() * 2);
diff --git a/src/extras/text/distancefieldtextrenderer.cpp b/src/extras/text/distancefieldtextrenderer.cpp
index 6fcb867db..af4840a36 100644
--- a/src/extras/text/distancefieldtextrenderer.cpp
+++ b/src/extras/text/distancefieldtextrenderer.cpp
@@ -129,8 +129,8 @@ DistanceFieldTextRenderer::~DistanceFieldTextRenderer()
}
void DistanceFieldTextRenderer::setGlyphData(Qt3DRender::QAbstractTexture *glyphTexture,
- const QList<float> &vertexData,
- const QList<quint16> &indexData)
+ const QVector<float> &vertexData,
+ const QVector<quint16> &indexData)
{
Q_D(DistanceFieldTextRenderer);
diff --git a/src/extras/text/distancefieldtextrenderer_p.h b/src/extras/text/distancefieldtextrenderer_p.h
index 0d71abc3b..fdb9a836f 100644
--- a/src/extras/text/distancefieldtextrenderer_p.h
+++ b/src/extras/text/distancefieldtextrenderer_p.h
@@ -75,8 +75,8 @@ public:
~DistanceFieldTextRenderer();
void setGlyphData(Qt3DRender::QAbstractTexture *glyphTexture,
- const QList<float> &vertexData,
- const QList<quint16> &indexData);
+ const QVector<float> &vertexData,
+ const QVector<quint16> &indexData);
void setColor(const QColor &color);
diff --git a/src/extras/text/qdistancefieldglyphcache.cpp b/src/extras/text/qdistancefieldglyphcache.cpp
index f1c2bd3e0..d367410c8 100644
--- a/src/extras/text/qdistancefieldglyphcache.cpp
+++ b/src/extras/text/qdistancefieldglyphcache.cpp
@@ -341,7 +341,7 @@ QList<QDistanceFieldGlyphCache::Glyph> QDistanceFieldGlyphCache::refGlyphs(const
DistanceFieldFont *dff = getOrCreateDistanceFieldFont(run.rawFont());
QList<QDistanceFieldGlyphCache::Glyph> ret;
- const QList<quint32> glyphs = run.glyphIndexes();
+ const auto glyphs = run.glyphIndexes();
for (quint32 glyph : glyphs)
ret << refAndGetGlyph(dff, glyph);
@@ -357,7 +357,7 @@ void QDistanceFieldGlyphCache::derefGlyphs(const QGlyphRun &run)
{
DistanceFieldFont *dff = getOrCreateDistanceFieldFont(run.rawFont());
- const QList<quint32> glyphs = run.glyphIndexes();
+ const auto glyphs = run.glyphIndexes();
for (quint32 glyph : glyphs)
dff->derefGlyph(glyph);
}
diff --git a/src/extras/text/qtext2dentity.cpp b/src/extras/text/qtext2dentity.cpp
index b373cf2f7..28e0bb770 100644
--- a/src/extras/text/qtext2dentity.cpp
+++ b/src/extras/text/qtext2dentity.cpp
@@ -211,8 +211,8 @@ float QText2DEntityPrivate::computeActualScale() const
struct RenderData {
int vertexCount = 0;
- QList<float> vertex;
- QList<quint16> index;
+ QVector<float> vertex;
+ QVector<quint16> index;
};
void QText2DEntityPrivate::setCurrentGlyphRuns(const QList<QGlyphRun> &runs)
@@ -224,8 +224,8 @@ void QText2DEntityPrivate::setCurrentGlyphRuns(const QList<QGlyphRun> &runs)
// process glyph runs
for (const QGlyphRun &run : runs) {
- const QList<quint32> glyphs = run.glyphIndexes();
- const QList<QPointF> pos = run.positions();
+ const auto glyphs = run.glyphIndexes();
+ const auto pos = run.positions();
Q_ASSERT(glyphs.size() == pos.size());
diff --git a/src/input/backend/movingaverage_p.h b/src/input/backend/movingaverage_p.h
index b2c85654b..67b2ec559 100644
--- a/src/input/backend/movingaverage_p.h
+++ b/src/input/backend/movingaverage_p.h
@@ -73,7 +73,7 @@ private:
unsigned int m_sampleCount;
unsigned int m_currentSample;
float m_total;
- QList<float> m_samples;
+ QVector<float> m_samples;
};
} // Input
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
index 6cf84f89e..7588eb517 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
@@ -2134,8 +2134,8 @@ QVariant GLTFImporter::parameterValueFromJSON(int type, const QJsonValue &value)
QVector2D vector2D;
QVector3D vector3D;
QVector4D vector4D;
- QList<float> dataMat2(4, 0.0f);
- QList<float> dataMat3(9, 0.0f);
+ QVector<float> dataMat2(4, 0.0f);
+ QVector<float> dataMat3(9, 0.0f);
switch (type) {
case GL_BYTE:
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index 664ac39ae..6847b4897 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -132,7 +132,7 @@ inline QJsonArray col2jsvec(const QColor &color, bool alpha = false)
}
template <typename T>
-inline QJsonArray vec2jsvec(const QList<T> &v)
+inline QJsonArray vec2jsvec(const QVector<T> &v)
{
QJsonArray arr;
for (int i = 0; i < v.count(); ++i)
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.h b/src/plugins/sceneparsers/gltfexport/gltfexporter.h
index dfa180ee4..3eeaa000f 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.h
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.h
@@ -161,8 +161,8 @@ private:
QHash<QString, QColor> colors;
QHash<QString, QString> textures;
QHash<QString, QVariant> values;
- QList<int> blendArguments;
- QList<int> blendEquations;
+ QVector<int> blendArguments;
+ QVector<int> blendEquations;
};
struct ProgramInfo {
diff --git a/src/render/backend/uniform.cpp b/src/render/backend/uniform.cpp
index 92fb077f7..193f92080 100644
--- a/src/render/backend/uniform.cpp
+++ b/src/render/backend/uniform.cpp
@@ -277,7 +277,7 @@ UniformValue UniformValue::fromVariant(const QVariant &variant)
}
template<>
-void UniformValue::setData<QMatrix4x4>(const QList<QMatrix4x4> &v)
+void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &v)
{
m_data.resize(16 * v.size());
m_valueType = ScalarValue;
diff --git a/src/render/backend/uniform_p.h b/src/render/backend/uniform_p.h
index b1ddcf01c..24bbcd76c 100644
--- a/src/render/backend/uniform_p.h
+++ b/src/render/backend/uniform_p.h
@@ -162,7 +162,7 @@ public:
}
#endif
- UniformValue(const QList<QMatrix4x4> &v)
+ UniformValue(const QVector<QMatrix4x4> &v)
: m_data(16 * v.size())
{
int offset = 0;
@@ -193,7 +193,7 @@ public:
UniformType storedType() const { return m_storedType; }
template<typename T>
- void setData(const QList<T> &v)
+ void setData(const QVector<T> &v)
{
m_elementByteSize = sizeof(T);
m_data.resize(v.size() * sizeof(T) / sizeof(float));
@@ -242,7 +242,7 @@ private:
};
template<>
-Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData<QMatrix4x4>(const QList<QMatrix4x4> &v);
+Q_3DRENDERSHARED_PRIVATE_EXPORT void UniformValue::setData<QMatrix4x4>(const QVector<QMatrix4x4> &v);
} // namespace Render
} // namespace Qt3DRender
diff --git a/src/render/geometry/gltfskeletonloader_p.h b/src/render/geometry/gltfskeletonloader_p.h
index 025c632ed..c52c71951 100644
--- a/src/render/geometry/gltfskeletonloader_p.h
+++ b/src/render/geometry/gltfskeletonloader_p.h
@@ -170,11 +170,11 @@ private:
QJsonDocument m_json;
QString m_basePath;
- QList<BufferData> m_bufferDatas;
- QList<BufferView> m_bufferViews;
- QList<AccessorData> m_accessors;
- QList<Skin> m_skins;
- QList<Node> m_nodes;
+ QVector<BufferData> m_bufferDatas;
+ QVector<BufferView> m_bufferViews;
+ QVector<AccessorData> m_accessors;
+ QVector<Skin> m_skins;
+ QVector<Node> m_nodes;
};
} // namespace Render
diff --git a/src/render/geometry/skeleton.cpp b/src/render/geometry/skeleton.cpp
index 8a3aeccc8..828382cd0 100644
--- a/src/render/geometry/skeleton.cpp
+++ b/src/render/geometry/skeleton.cpp
@@ -171,10 +171,10 @@ void Skeleton::setLocalPose(HJoint jointHandle, const Qt3DCore::Sqt &localPose)
m_skeletonData.localPoses[jointIndex] = localPose;
}
-QList<QMatrix4x4> Skeleton::calculateSkinningMatrixPalette()
+QVector<QMatrix4x4> Skeleton::calculateSkinningMatrixPalette()
{
- const QList<Sqt> &localPoses = m_skeletonData.localPoses;
- QList<JointInfo> &joints = m_skeletonData.joints;
+ const QVector<Sqt> &localPoses = m_skeletonData.localPoses;
+ QVector<JointInfo> &joints = m_skeletonData.joints;
for (int i = 0; i < m_skeletonData.joints.size(); ++i) {
// Calculate the global pose of this joint
JointInfo &joint = joints[i];
diff --git a/src/render/geometry/skeleton_p.h b/src/render/geometry/skeleton_p.h
index 93e72ec77..4c6c038c7 100644
--- a/src/render/geometry/skeleton_p.h
+++ b/src/render/geometry/skeleton_p.h
@@ -102,15 +102,15 @@ public:
QString name() const { return m_name; }
int jointCount() const { return m_skeletonData.joints.size(); }
- QList<JointInfo> joints() const { return m_skeletonData.joints; }
- QList<QString> jointNames() const { return m_skeletonData.jointNames; }
- QList<Qt3DCore::Sqt> localPoses() const { return m_skeletonData.localPoses; }
+ QVector<JointInfo> joints() const { return m_skeletonData.joints; }
+ QVector<QString> jointNames() const { return m_skeletonData.jointNames; }
+ QVector<Qt3DCore::Sqt> localPoses() const { return m_skeletonData.localPoses; }
Qt3DCore::QNodeId rootJointId() const { return m_rootJointId; }
// Called from jobs
void setLocalPose(HJoint jointHandle, const Qt3DCore::Sqt &localPose);
- QList<QMatrix4x4> calculateSkinningMatrixPalette();
+ QVector<QMatrix4x4> calculateSkinningMatrixPalette();
void clearData();
void setSkeletonData(const SkeletonData &data);
@@ -124,7 +124,7 @@ public:
#endif
private:
- QList<QMatrix4x4> m_skinningPalette;
+ QVector<QMatrix4x4> m_skinningPalette;
// QSkeletonLoader Properties
QUrl m_source;
diff --git a/src/render/geometry/skeletondata_p.h b/src/render/geometry/skeletondata_p.h
index 7106c0d4d..70a6f650d 100644
--- a/src/render/geometry/skeletondata_p.h
+++ b/src/render/geometry/skeletondata_p.h
@@ -86,9 +86,9 @@ struct Q_AUTOTEST_EXPORT SkeletonData
void reserve(int size);
- QList<JointInfo> joints;
- QList<Qt3DCore::Sqt> localPoses;
- QList<QString> jointNames;
+ QVector<JointInfo> joints;
+ QVector<Qt3DCore::Sqt> localPoses;
+ QVector<QString> jointNames;
QHash<HJoint, int> jointIndices;
};
diff --git a/src/render/jobs/updateskinningpalettejob.cpp b/src/render/jobs/updateskinningpalettejob.cpp
index 1277cee79..51a3bb030 100644
--- a/src/render/jobs/updateskinningpalettejob.cpp
+++ b/src/render/jobs/updateskinningpalettejob.cpp
@@ -95,7 +95,7 @@ void UpdateSkinningPaletteJob::run()
auto skeleton = skeletonManager->lookupResource(skeletonId);
Q_ASSERT(skeleton);
- const QList<QMatrix4x4> skinningPalette = skeleton->calculateSkinningMatrixPalette();
+ const QVector<QMatrix4x4> &skinningPalette = skeleton->calculateSkinningMatrixPalette();
armature->skinningPaletteUniform().setData(skinningPalette);
}
}