Board 0.9.6
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/Rect.h>
32#include <board/Shape.h>
33namespace LibBoard
34{
35
36struct Path;
37
38namespace Tools
39{
40
41/*
42 * An euclidean line a.x + b.y + c = 0
43 */
45 EuclideanLine(double a, double b, double c) : a(a), b(b), c(c) {}
47 {
48 a = p1.y - p2.y;
49 b = p2.x - p1.x;
50 c = p1.x * (p2.y - p1.y) + p1.y * (p1.x - p2.x);
51 }
52 double a, b, c;
53};
54
55std::vector<Point> pathBoundaryPoints(const Path & path, double strokeWidth, LineCap lineCap, LineJoin lineJoin, double miterLimit = 4.0);
56
57Rect pathBoundingBox(const Path & path, double strokeWidth, LineCap lineCap, LineJoin lineJoin, double miterLimit = 4.0);
58
59} // namespace Tools
60
61} // namespace LibBoard
62
63#endif /* PATH_BOUNDARIES_H */
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Rect pathBoundingBox(const Path &path, double strokeWidth, LineCap lineCap, LineJoin lineJoin, double miterLimit=4.0)
Definition PathBoundaries.cpp:346
std::vector< Point > pathBoundaryPoints(const Path &path, double strokeWidth, LineCap lineCap, LineJoin lineJoin, double miterLimit=4.0)
Definition PathBoundaries.cpp:221
Definition Board.h:55
LineCap
Definition Style.h:35
LineJoin
Definition Style.h:41
A path, according to Postscript and SVG definition.
Definition Path.h:45
Struct representing a 2D point.
Definition Point.h:42
double y
Definition Point.h:44
double x
Definition Point.h:43
Struct representing a rectangle on the plane.
Definition Rect.h:40
Definition PathBoundaries.h:44
EuclideanLine(double a, double b, double c)
Definition PathBoundaries.h:45
EuclideanLine(Point p1, Point p2)
Definition PathBoundaries.h:46
double b
Definition PathBoundaries.h:52
double c
Definition PathBoundaries.h:52
double a
Definition PathBoundaries.h:52