| |
| |
| #ifndef TSTROKES_DEFORMATIONS_H |
| #define TSTROKES_DEFORMATIONS_H |
| |
| |
| #include "tgeometry.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| |
| #ifdef TVRENDER_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| class TStroke; |
| |
| |
| |
| |
| |
| |
| class DVAPI TStrokeDeformation |
| { |
| public: |
| TStrokeDeformation() {} |
| virtual ~TStrokeDeformation() {} |
| |
| |
| |
| |
| |
| |
| |
| |
| virtual TThickPoint getDisplacement(const TStroke &stroke, double w) const = 0; |
| |
| |
| |
| |
| |
| |
| |
| |
| virtual TThickPoint getDisplacementForControlPoint(const TStroke &stroke, UINT n) const = 0; |
| virtual TThickPoint getDisplacementForControlPointLen(const TStroke &stroke, double cpLen) const = 0; |
| |
| |
| |
| |
| |
| |
| |
| virtual double getDelta(const TStroke &stroke, double w) const = 0; |
| |
| |
| |
| |
| |
| |
| virtual double getMaxDiff() const = 0; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TStrokePointDeformation : public TStrokeDeformation |
| { |
| protected: |
| struct Imp; |
| Imp *m_imp; |
| |
| public: |
| |
| |
| |
| TStrokePointDeformation(const TPointD ¢er = TPointD(), |
| double radius = 40.0); |
| |
| |
| |
| |
| TStrokePointDeformation(const TPointD &vect, |
| const TPointD ¢er = TPointD(), |
| double radius = 40.0); |
| |
| virtual ~TStrokePointDeformation(); |
| |
| TThickPoint getDisplacement(const TStroke &stroke, double s) const; |
| TThickPoint getDisplacementForControlPoint(const TStroke &s, UINT n) const; |
| TThickPoint getDisplacementForControlPointLen(const TStroke &stroke, double cpLen) const; |
| |
| double getDelta(const TStroke &stroke, double w) const; |
| double getMaxDiff() const; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TStrokeParamDeformation : public TStrokeDeformation |
| { |
| private: |
| const TStroke *m_pRef; |
| double m_startParameter; |
| double m_lengthOfDeformation; |
| TPointD *m_vect; |
| |
| public: |
| |
| |
| |
| |
| |
| |
| |
| TStrokeParamDeformation(const TStroke *stroke, |
| double parameterOfNearest, |
| double lengthOfDeformation = 100); |
| |
| |
| |
| |
| TStrokeParamDeformation(const TStroke *stroke, |
| const TPointD &vect, |
| double parameterOfNearest, |
| double lengthOfDeformation = 100); |
| |
| virtual ~TStrokeParamDeformation(); |
| |
| TThickPoint getDisplacement(const TStroke &, double) const; |
| TThickPoint getDisplacementForControlPoint(const TStroke &stroke, UINT n) const; |
| TThickPoint getDisplacementForControlPointLen(const TStroke &stroke, double cpLen) const; |
| |
| double getDelta(const TStroke &, double) const; |
| |
| double getMaxDiff() const; |
| }; |
| |
| |
| |
| |
| |
| |
| class DVAPI TStrokeThicknessDeformation : public TStrokeDeformation |
| { |
| private: |
| double m_lengthOfDeformation; |
| double m_startParameter; |
| double m_versus; |
| TPointD *m_vect; |
| const TStroke *m_pRef; |
| |
| public: |
| |
| |
| |
| |
| |
| |
| |
| TStrokeThicknessDeformation(const TStroke *stroke, |
| double parameterOfNearest, |
| double lengthOfDeformation = 100); |
| |
| |
| |
| |
| TStrokeThicknessDeformation(const TStroke *stroke, |
| const TPointD &vect, |
| double parameterOfNearest, |
| double lengthOfDeformation = 100, |
| double versus = 1.0); |
| |
| virtual ~TStrokeThicknessDeformation(); |
| |
| TThickPoint getDisplacement(const TStroke &, double) const; |
| TThickPoint getDisplacementForControlPoint(const TStroke &stroke, UINT n) const; |
| TThickPoint getDisplacementForControlPointLen(const TStroke &stroke, double cpLen) const; |
| |
| double getDelta(const TStroke &, double) const; |
| |
| double getMaxDiff() const; |
| }; |
| |
| |
| |
| |
| class DVAPI TStrokeBenderDeformation : public TStrokeDeformation |
| { |
| private: |
| const TStroke *m_pRef; |
| double m_startLength; |
| double m_lengthOfDeformation; |
| TPointD *m_vect; |
| int m_versus; |
| |
| double m_angle; |
| |
| public: |
| enum VERSUS { |
| INNER = 0, |
| OUTER |
| }; |
| |
| |
| |
| |
| |
| |
| |
| TStrokeBenderDeformation(const TStroke *stroke, |
| double parameterOfNearest, |
| double lengthOfDeformation = 50); |
| |
| |
| |
| |
| TStrokeBenderDeformation(const TStroke *stroke, |
| const TPointD ¢erOfRot, |
| double angle, |
| double parameterOfNearest, |
| int innerOrOuter = INNER, |
| double lengthOfDeformation = 50); |
| |
| virtual ~TStrokeBenderDeformation(); |
| |
| TThickPoint getDisplacement(const TStroke &, double s) const; |
| TThickPoint getDisplacementForControlPoint(const TStroke &, UINT n) const; |
| TThickPoint getDisplacementForControlPointLen(const TStroke &stroke, double cpLen) const; |
| |
| double getDelta(const TStroke &, double) const; |
| double getMaxDiff() const; |
| }; |
| |
| |
| |
| |
| |
| |
| class DVAPI TStrokeTwirlDeformation : public TStrokeDeformation |
| { |
| private: |
| TPointD m_center; |
| double m_innerRadius2; |
| TPointD m_vectorOfMovement; |
| double m_outerRadius; |
| |
| public: |
| |
| |
| |
| |
| TStrokeTwirlDeformation(const TPointD ¢er, double radius); |
| |
| TStrokeTwirlDeformation(const TPointD ¢er, double radius, const TPointD &v); |
| |
| virtual ~TStrokeTwirlDeformation(); |
| |
| TThickPoint getDisplacement(const TStroke &, double s) const; |
| double getDelta(const TStroke &, double) const; |
| double getMaxDiff() const; |
| }; |
| |
| |
| |
| |
| |
| |
| class DVAPI TPointDeformation |
| { |
| const TStroke *m_strokeRef; |
| TPointD m_center; |
| double m_radius; |
| |
| |
| double getCPDensity(double s) const; |
| |
| public: |
| TPointDeformation(const TStroke *, const TPointD &, double center); |
| |
| TPointDeformation(); |
| |
| virtual ~TPointDeformation(); |
| |
| TThickPoint getDisplacement(double s) const; |
| |
| |
| |
| |
| |
| |
| |
| |
| double getCPCountInRange(double s0, double s1) const; |
| |
| |
| double getMinCPDensity() const; |
| }; |
| |
| |
| #endif |
| |