diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-09-26 15:21:50 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-09-27 12:51:00 +0000 |
commit | 78175fa89bc95b88466ecf1ac8b42244762e62e2 (patch) | |
tree | b5fe152b2e3288878a185cb95501da0fa1f4ecf8 /src/animation/backend/channelmapper_p.h | |
parent | a286529cbe2ae51e6bf19aaea4203afd6b4884de (diff) |
Add convenience function to ChannelMapper to return list of Mappings
Caches the resolution of node ids to ChannelMappings. Updated test to
check this new feature.
Change-Id: I0c2f539c2bd91e7918b98c5b60c9ca486b63ec08
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'src/animation/backend/channelmapper_p.h')
-rw-r--r-- | src/animation/backend/channelmapper_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/animation/backend/channelmapper_p.h b/src/animation/backend/channelmapper_p.h index 710de01ab..8d8f03511 100644 --- a/src/animation/backend/channelmapper_p.h +++ b/src/animation/backend/channelmapper_p.h @@ -74,10 +74,22 @@ public: void setMappingIds(const QVector<Qt3DCore::QNodeId> &mappingIds) { m_mappingIds = mappingIds; } QVector<Qt3DCore::QNodeId> mappingIds() const { return m_mappingIds; } + QVector<ChannelMapping*> mappings() const + { + if (m_isDirty) + updateMappings(); + return m_mappings; + } + private: void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL; + void updateMappings() const; QVector<Qt3DCore::QNodeId> m_mappingIds; + + // Cached data + mutable QVector<ChannelMapping*> m_mappings; + mutable bool m_isDirty; }; } // namespace Animation |