| #pragma once |
| |
| #ifndef STROKEDEFORMATION_IMPL_H |
| #define STROKEDEFORMATION_IMPL_H |
| |
| |
| |
| |
| |
| #include "ext/StrokeDeformation.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZEXT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| #include "ExtUtil.h" |
| |
| #if defined(_MSC_VER) && (_MSC_VER <= 1200) |
| |
| #pragma warning(push) |
| #pragma warning(disable : 4251) |
| #endif |
| |
| namespace ToonzExt { |
| class DVAPI StrokeDeformationImpl { |
| private: |
| bool init(const ContextStatus *); |
| |
| bool computeStroke2Transform(const ContextStatus *s, |
| TStroke *&stroke2transform, double &w, |
| ToonzExt::Interval &extremes); |
| |
| ToonzExt::Potential *potential_; |
| |
| static TStroke |
| *copyOfLastSelectedStroke_; |
| |
| int cursorId_; |
| |
| protected: |
| TStroke *stroke2manipulate_; |
| |
| static TStroke *&getLastSelectedStroke(); |
| |
| static void setLastSelectedStroke(TStroke *); |
| |
| static int &getLastSelectedDegree(); |
| |
| static void setLastSelectedDegree(int degree); |
| |
| static ToonzExt::Intervals &getSpiresList(); |
| |
| static ToonzExt::Intervals &getStraightsList(); |
| |
| ToonzExt::StrokeParametricDeformer *deformer_; |
| |
| int shortcutKey_; |
| |
| double old_w0_; |
| |
| TPointD old_w0_pos_; |
| |
| |
| std::vector<TStroke *> strokes_; |
| |
| StrokeDeformationImpl(); |
| |
| |
| |
| |
| virtual bool check_(const ContextStatus *) = 0; |
| |
| |
| |
| |
| virtual bool findExtremes_(const ContextStatus *, Interval &) = 0; |
| |
| virtual double findActionLength() = 0; |
| |
| public: |
| virtual ~StrokeDeformationImpl(); |
| |
| ToonzExt::Interval getExtremes(); |
| |
| static const ContextStatus *&getImplStatus(); |
| |
| const TStroke *getStrokeSelected() const { |
| if (getImplStatus()) return this->getImplStatus()->stroke2change_; |
| return 0; |
| } |
| |
| const TStroke *getCopiedStroke() const { return this->getStrokeSelected(); } |
| |
| |
| |
| |
| virtual bool activate_impl(const ContextStatus *); |
| |
| |
| |
| |
| virtual void update_impl(const TPointD &delta); |
| |
| |
| |
| |
| virtual TStroke *deactivate_impl(); |
| |
| bool check(const ContextStatus *); |
| |
| |
| |
| |
| virtual void reset(); |
| |
| void setPotential(Potential *); |
| |
| |
| |
| |
| virtual void draw(Designer *); |
| |
| TStroke *getTransformedStroke(); |
| |
| ToonzExt::Potential *getPotential(); |
| |
| TPointD &oldW0(); |
| |
| int getShortcutKey() const { return shortcutKey_; } |
| |
| int getCursorId() const { return cursorId_; } |
| void setCursorId(int id) { cursorId_ = id; } |
| }; |
| } |
| |
| #if defined(_MSC_VER) && (_MSC_VER <= 1200) |
| #pragma warning(pop) |
| #endif |
| |
| #endif |
| |
| |
| |