Board  0.9.4
PathBoundaries.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
26 #ifndef _BOARD_PATH_BOUNDARIES_H_
27 #define _BOARD_PATH_BOUNDARIES_H_
28 
29 #include <vector>
30 #include "board/Point.h"
31 #include "board/Shapes.h"
32 #include "board/Rect.h"
33 namespace LibBoard {
34 
35 struct Path;
36 
37 namespace Tools {
38 
39 /*
40  * An euclidean line a.x + b.y + c = 0
41  */
42 struct EuclideanLine {
43  EuclideanLine(double a, double b, double c)
44  :a(a),b(b),c(c) {
45  }
46  EuclideanLine(Point p1, Point p2) {
47  a = p1.y - p2.y;
48  b = p2.x - p1.x;
49  c = p1.x * (p2.y-p1.y) + p1.y * (p1.x-p2.x);
50  }
51  double a,b,c;
52 };
53 
54 
55 std::vector<Point> pathBoundaryPoints(const Path & path,
56  double strokeWidth,
57  Shape::LineCap lineCap,
58  Shape::LineJoin lineJoin,
59  double miterLimit = 4.0);
60 
61 Rect pathBoundingBox(const Path & path,
62  double strokeWidth,
63  Shape::LineCap lineCap,
64  Shape::LineJoin lineJoin,
65  double miterLimit = 4.0);
66 
67 
68 
69 
70 
71 } // namespace Tools
72 
73 } // namespace LibBoard
74 
75 #endif /* _PATH_BOUNDARIES_H_ */
Definition: Board.h:41
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
A path, according to Postscript and SVG definition.
Definition: Path.h:41
Struct representing a 2D point.
Definition: Point.h:39
double x
Definition: Point.h:40
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Definition: PathBoundaries.h:42
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
double y
Definition: Point.h:41
Struct representing a rectangle on the plane.
Definition: Rect.h:38