32#include <initializer_list>
94 inline bool isOpen()
const;
100 inline bool empty()
const;
106 inline std::size_t
size()
const;
373 const std::vector<Point> &
points()
const;
375 std::ostream &
flush(std::ostream &)
const;
377 inline std::vector<Point>::const_iterator
begin()
const;
378 inline std::vector<Point>::const_iterator
cbegin()
const;
379 inline std::vector<Point>::const_iterator
end()
const;
380 inline std::vector<Point>::const_iterator
cend()
const;
std::ostream & operator<<(std::ostream &out, const LibBoard::Path &path)
Definition Path.cpp:407
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...
Path mix(const Path &a, const Path &b, double time)
Interpolate two paths according to a time (0 is a, 1 is b)
Definition Path.cpp:390
A path, according to Postscript and SVG definition.
Definition Path.h:45
const std::vector< Point > & points() const
Definition Path.cpp:371
void setCounterclockwise()
Make the path counterclockwise.
Definition Path.cpp:337
Path translated(double dx, double dy) const
Return a translated copy of the path.
Definition Path.cpp:142
bool isClosed() const
Is the path closed?
Definition Path.h:433
bool isOpen() const
Is the path open?
Definition Path.h:438
Path & push_back(const Point &p)
Add a point to the path.
Definition Path.cpp:43
std::vector< Point >::size_type size_type
Definition Path.h:47
Path & moveCenter(double x, double y)
Translate the center to a given position.
Definition Path.cpp:155
std::vector< Point >::const_iterator begin() const
Definition Path.h:413
void clear()
Remove all points of the path.
Definition Path.h:398
void setOpenClosed(OpenClosed openClosed)
Set the open/closed flag of the path.
Definition Path.cpp:67
std::vector< Point >::const_iterator cend() const
Definition Path.h:428
std::ostream & flush(std::ostream &) const
Definition Path.cpp:376
Path & pop_back()
Remove the last point of the path.
Definition Path.cpp:37
const Point & front() const
The first point of the path.
Definition Path.h:468
Path rotatedDeg(double angle, const Point ¢er) const
Return a rotated copy of the path, thanks to an angle and a rotation center.
Definition Path.cpp:105
std::vector< Point > _points
Definition Path.h:383
Path & scale(double sx, double sy)
Apply a scaling factor to the path along each axis.
Definition Path.cpp:169
void flushFIG(std::ostream &stream, const TransformFIG &transform) const
Definition Path.cpp:222
void close()
Close the path.
Definition Path.h:453
Path & operator<<(const Point &p)
Add a point at the end of the path.
Definition Path.cpp:49
Point center() const
Center of the bounding box of the path.
Definition Path.cpp:72
Point & operator[](const std::size_t n)
Get the n-th point of the path.
Definition Path.h:403
std::size_t size() const
The number of points in the path.
Definition Path.h:448
bool isCounterclockwise() const
Tell if the points of the path are ordered counterclockwise.
Definition Path.cpp:325
Path getCounterclockwise() const
Return a counterclockwise copy of the path.
Definition Path.cpp:351
Path getClockwise() const
Return a clockwise copy of the path.
Definition Path.cpp:344
OpenClosed
The OpenClosed enum.
Definition Path.h:53
@ Closed
The is closed.
Definition Path.h:55
@ Open
The path is open.
Definition Path.h:54
void flushSVGPoints(std::ostream &stream, const TransformSVG &transform) const
Definition Path.cpp:261
void setClockwise()
Make the path clockwise.
Definition Path.cpp:330
void open()
Open the path.
Definition Path.h:463
OpenClosed _openClosed
Definition Path.h:384
Path transformed(const Transform &transform) const
Compute the path obtained after a transform.
Definition Path.cpp:295
bool empty() const
Check if the path is empty (i.e. has no points)
Definition Path.h:443
std::vector< Point >::const_iterator cbegin() const
Definition Path.h:418
Path & rotateDeg(double angle, const Point ¢er)
Rotate the path by a given angle, in degrees, and according to a rotation center.
Definition Path.cpp:88
void scaleAll(double s)
Scale all the points.
Definition Path.cpp:196
Path scaled(double sx, double sy) const
Return a scaled copy of the path.
Definition Path.cpp:186
const Point & back() const
The last point of the path.
Definition Path.h:473
std::vector< Point >::const_iterator end() const
Definition Path.h:423
Path()
Definition Path.h:58
Rect boundingBox() const
Definition Path.cpp:358
Path(OpenClosed openClosed)
Construct an open or closed empty path.
Definition Path.h:77
Path rotated(double angle, const Point ¢er) const
Return a rotated copy of the path, thanks to an angle and a rotation center.
Definition Path.cpp:93
OpenClosed openClosed() const
The open/closed status of the path.
Definition Path.h:458
Path & translate(double dx, double dy)
Translate the path.
Definition Path.cpp:130
bool isClockwise() const
Tell if the points of the path are ordered clockwise.
Definition Path.cpp:304
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition Path.cpp:206
void flushSVGCommands(std::ostream &stream, const TransformSVG &transform) const
Definition Path.cpp:238
void flushTikZPoints(std::ostream &stream, const TransformTikZ &transform) const
Definition Path.cpp:280
Path(const std::vector< Point > &points, OpenClosed openClosed)
Construct a path from a vector of points.
Definition Path.h:65
Path & rotate(double angle, const Point ¢er)
Rotate the path by a given angle and according to a rotation center.
Definition Path.cpp:77
Struct representing a 2D point.
Definition Point.h:42
Struct representing a rectangle on the plane.
Definition Rect.h:40