| #pragma once |
| |
| #ifndef DEFORMATIONSELECTOR_H |
| #define DEFORMATIONSELECTOR_H |
| |
| #include "ext/StrokeDeformationImpl.h" |
| |
| namespace ToonzExt |
| { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DeformationSelector |
| { |
| typedef std::pair<StrokeDeformationImpl *, int> Deformation; |
| std::vector<Deformation> ref_; |
| |
| DeformationSelector(); |
| DeformationSelector(const DeformationSelector &); |
| DeformationSelector operator=(const DeformationSelector &); |
| |
| public: |
| ~DeformationSelector(); |
| |
| static DeformationSelector * |
| instance(); |
| |
| void |
| add(StrokeDeformationImpl *deformation, |
| int priority); |
| |
| StrokeDeformationImpl * |
| getDeformation(const ContextStatus *status); |
| }; |
| } |
| |
| |
| |
| |
| |
| #define REGISTER(myClass, priority) \ |
| static bool add_in_array() \ |
| { \ |
| DeformationSelector::instance()->add(myClass::instance(), priority); \ |
| return true; \ |
| } \ |
| static bool done = add_in_array(); |
| |
| #endif |
| |
| |
| |
| |