| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef __CDRTRANSFORMS_H__ |
| 11 |
#define __CDRTRANSFORMS_H__ |
| 12 |
|
| 13 |
#include <vector> |
| 14 |
#include <librevenge/librevenge.h> |
| 15 |
|
| 16 |
namespace libcdr |
| 17 |
{ |
| 18 |
|
| 19 |
class CDRTransform |
| 20 |
{ |
| 21 |
public: |
| 22 |
CDRTransform(); |
| 23 |
CDRTransform(double v0, double v1, double x0, double v3, double v4, double y0); |
| 24 |
CDRTransform(const CDRTransform &trafo) = default; |
| 25 |
|
| 26 |
CDRTransform &operator=(const CDRTransform &trafo) = default; |
| 27 |
|
| 28 |
void applyToPoint(double &x, double &y) const; |
| 29 |
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &endx, double &endy) const; |
| 30 |
double getScaleX() const; |
| 31 |
double getScaleY() const; |
| 32 |
double getTranslateX() const; |
| 33 |
double getTranslateY() const; |
| 34 |
bool getFlipX() const; |
| 35 |
bool getFlipY() const; |
| 36 |
|
| 37 |
librevenge::RVNGString toString() const; |
| 38 |
|
| 39 |
private: |
| 40 |
double _getScaleX() const; |
| 41 |
double _getScaleY() const; |
| 42 |
double m_v0; |
| 43 |
double m_v1; |
| 44 |
double m_x0; |
| 45 |
double m_v3; |
| 46 |
double m_v4; |
| 47 |
double m_y0; |
| 48 |
}; |
| 49 |
|
| 50 |
class CDRTransforms |
| 51 |
{ |
| 52 |
public: |
| 53 |
CDRTransforms(); |
| 54 |
CDRTransforms(const CDRTransforms &trafos) = default; |
| 55 |
~CDRTransforms(); |
| 56 |
|
| 57 |
CDRTransforms &operator=(const CDRTransforms &trafo) = default; |
| 58 |
|
| 59 |
void append(double v0, double v1, double x0, double v3, double v4, double y0); |
| 60 |
void append(const CDRTransform &trafo); |
| 61 |
void clear(); |
| 62 |
bool empty() const; |
| 63 |
|
| 64 |
void applyToPoint(double &x, double &y) const; |
| 65 |
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &x, double &y) const; |
| 66 |
double getScaleX() const; |
| 67 |
double getScaleY() const; |
| 68 |
double getTranslateX() const; |
| 69 |
double getTranslateY() const; |
| 70 |
bool getFlipX() const; |
| 71 |
bool getFlipY() const; |
| 72 |
|
| 73 |
private: |
| 74 |
double _getScaleX() const; |
| 75 |
double _getScaleY() const; |
| 76 |
std::vector<CDRTransform> m_trafos; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
#endif |
| 82 |
|