Go to the documentation of this file.
26 #ifndef BOARD_TRANSFORMS_H
27 #define BOARD_TRANSFORMS_H
49 virtual double mapX(
double x)
const;
50 virtual double mapY(
double y)
const = 0;
52 virtual void apply(
double & x,
double & y)
const;
53 virtual double scale(
double x)
const;
55 virtual double rounded(
double x)
const;
56 virtual void setBoundingBox(
const Rect & rect,
const double pageWidth,
const double pageHeight,
const double margin) = 0;
57 static inline double round(
const double & x);
72 double mapWidth(
double w)
const;
73 double mapY(
double y)
const;
74 void setBoundingBox(
const Rect & rect,
const double pageWidth,
const double pageHeight,
const double margin);
75 double scaleBackMM(
double);
76 Rect pageBoundingBox()
const;
79 Rect _pageBoundingBox;
89 double rounded(
double x)
const;
90 double mapY(
double y)
const;
91 int mapWidth(
double width)
const;
92 void setBoundingBox(
const Rect & rect,
const double pageWidth,
const double pageHeight,
const double margin);
93 unsigned int shapeDepth(
const Shape *)
const;
94 unsigned int mapDepth(
unsigned int depth)
const;
95 void setDepthMap(
const std::map<const Shape *, unsigned int> *,
unsigned int min);
98 unsigned int _maxDepth;
99 unsigned int _minDepth;
100 double _postscriptScale;
101 const std::map<const Shape *, unsigned int> * _depthMap;
110 double rounded(
double x)
const;
111 double mapY(
double y)
const;
112 double mapWidth(
double width)
const;
113 void setBoundingBox(
const Rect & rect,
const double pageWidth,
const double pageHeight,
const double margin);
114 double scaleBackMM(
double);
116 Point translation()
const;
117 double deltaX()
const;
118 double deltaY()
const;
134 #define HAS_MSVC_MAX true
137 Transform::Transform() : _scale(1.0), _deltaX(0.0), _deltaY(0.0), _height(0.0) {}
139 TransformFIG::TransformFIG() : _maxDepth(std::numeric_limits<int>::max()), _minDepth(0), _postscriptScale(1.0)
144 double Transform::round(
const double & x)
146 return std::floor(x + 0.5);
149 #if defined(HAS_MSVC_MAX)
150 #define max(A, B) ((A) > (B) ? (A) : (B))
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
Struct representing a rectangle on the plane.
Definition: Rect.h:39
Struct representing a 2D point.
Definition: Point.h:42
Abstract structure for a 2D shape.
Definition: Shape.h:63
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...