Board  0.9.4
TransformMatrix.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
26 #ifndef _BOARD_TRANSFORM_MATRIX_H_
27 #define _BOARD_TRANSFORM_MATRIX_H_
28 
29 #include <cmath>
30 #include <iostream>
31 #include "Point.h"
32 
33 namespace LibBoard {
34 
36 public:
37 
38  enum Type { SVG, Postscript };
39 
40  inline TransformMatrix();
41  inline TransformMatrix(double m11, double m12, double m13,
42  double m21, double m22, double m23);
43 
44  static TransformMatrix translation(double dx, double dy);
45  static TransformMatrix translation(const Point &);
46  static TransformMatrix scaling(double sx, double sy);
47  static TransformMatrix rotation(double angle, Type type );
48  static TransformMatrix rotation(double angle, const Point & center, Type type );
49 
50  TransformMatrix operator*(const TransformMatrix & ) const;
51 
52  TransformMatrix & operator*=(const TransformMatrix & );
53 
54  Point operator*( const Point & point ) const;
55 
56  TransformMatrix operator+( const Point & ) const;
57 
58  TransformMatrix & operator+=( const Point & );
59 
60  void flushSVG(std::ostream & ) const;
61 
62  void flushEPS(std::ostream & ) const;
63 
64 
65 private:
66  double _m11, _m12, _m13;
67  double _m21, _m22, _m23;
68 };
69 
70 } // namespace LibBoard
71 
72 #include "TransformMatrix.ih"
73 
74 #endif /* _TRANSFORMS_MATRIX_H_ */
Definition: TransformMatrix.h:35
Definition: Board.h:41
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
Struct representing a 2D point.
Definition: Point.h:39