| #pragma once |
| |
| #ifndef PLASTICVERTEXSELECTION_H |
| #define PLASTICVERTEXSELECTION_H |
| |
| |
| #include "toonzqt/multipleselection.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TOONZQT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI PlasticVertexSelection : public MultipleSelection<int> { |
| typedef MultipleSelection<int> base_type; |
| |
| int m_skelId; |
| |
| public: |
| PlasticVertexSelection(int vIdx = -1, int skelId = -1) : m_skelId(skelId) { |
| if (vIdx >= 0) m_objects.push_back(vIdx); |
| } |
| |
| |
| |
| |
| PlasticVertexSelection(const std::vector<int> &vIdxs, int skelId = -1) |
| : base_type(vIdxs), m_skelId(skelId) {} |
| |
| void selectNone() { |
| m_skelId = -1; |
| base_type::selectNone(); |
| } |
| |
| operator int() const { |
| return (objects().size() == 1) ? objects().front() : -1; |
| } |
| |
| int skeletonId() const { return m_skelId; } |
| int &skeletonId() { return m_skelId; } |
| }; |
| |
| #endif |