#include #include "poser.h" Poser::Poser(const std::vector &bones) : m_bones(bones), m_jointNodeTree(&bones) { for (decltype(m_bones.size()) i = 0; i < m_bones.size(); i++) { m_boneNameToIndexMap[m_bones[i].name] = i; } } Poser::~Poser() { } int Poser::findBoneIndex(const QString &name) { auto findResult = m_boneNameToIndexMap.find(name); if (findResult == m_boneNameToIndexMap.end()) return -1; return findResult->second; } const AutoRiggerBone *Poser::findBone(const QString &name) { auto findResult = m_boneNameToIndexMap.find(name); if (findResult == m_boneNameToIndexMap.end()) return nullptr; return &m_bones[findResult->second]; } const std::vector &Poser::bones() const { return m_bones; } const std::vector &Poser::resultNodes() const { return m_jointNodeTree.nodes(); } void Poser::commit() { m_jointNodeTree.recalculateTransformMatrices(); } void Poser::reset() { m_jointNodeTree.reset(); } std::map> &Poser::parameters() { return m_parameters; }