Go to the documentation of this file.
29 #include <initializer_list>
47 typedef std::vector<Point>::size_type size_type;
55 Path() : _openClosed(OpenPath) {}
57 Path(
const std::vector<Point> & points, OpenClosed openClosed) : _points(points), _openClosed(openClosed) {}
59 Path(std::initializer_list<Point> points);
63 explicit Path(OpenClosed openClosed) : _openClosed(openClosed) {}
67 inline bool isClosed()
const;
69 inline bool isOpen()
const;
71 inline bool empty()
const;
73 inline std::size_t size()
const;
77 inline OpenClosed openClosed()
const;
81 inline void setOpenClosed(OpenClosed openClosed);
312 void flushPostscript(std::ostream & stream,
const TransformEPS & transform)
const;
314 void flushFIG(std::ostream & stream,
const TransformFIG & transform)
const;
316 void flushSVGPoints(std::ostream & stream,
const TransformSVG & transform)
const;
318 void flushSVGCommands(std::ostream & stream,
const TransformSVG & transform)
const;
320 void flushTikZPoints(std::ostream & stream,
const TransformTikZ & transform)
const;
365 const std::vector<Point> & points()
const;
367 std::ostream & flush(std::ostream &)
const;
369 inline std::vector<Point>::const_iterator begin()
const;
370 inline std::vector<Point>::const_iterator cbegin()
const;
371 inline std::vector<Point>::const_iterator end()
const;
372 inline std::vector<Point>::const_iterator cend()
const;
375 std::vector<Point> _points;
376 OpenClosed _openClosed;
405 std::vector<Point>::const_iterator Path::begin()
const
407 return _points.begin();
410 std::vector<Point>::const_iterator Path::cbegin()
const
412 return _points.begin();
415 std::vector<Point>::const_iterator Path::end()
const
417 return _points.end();
420 std::vector<Point>::const_iterator Path::cend()
const
422 return _points.cend();
425 bool Path::isClosed()
const
427 return _openClosed == ClosedPath;
430 bool Path::isOpen()
const
432 return _openClosed == OpenPath;
435 bool Path::empty()
const
437 return _points.empty();
440 std::size_t Path::size()
const
442 return _points.size();
447 _openClosed = ClosedPath;
450 Path::OpenClosed Path::openClosed()
const
457 _openClosed = OpenPath;
462 return _points.front();
467 return _points.back();
472 std::ostream & operator<<(std::ostream & out,
const LibBoard::Path & path);
const Point & front() const
Definition: Path.h:460
Point center() const
Definition: Path.cpp:70
Path & scale(double sx, double sy)
Definition: Path.cpp:167
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
Path getCounterclockwise() const
Return a counterclockwise copy of the path.
Definition: Path.cpp:349
void setCounterclockwise()
Make the path counterclockwise.
Definition: Path.cpp:335
Path rotated(double angle, const Point ¢er) const
Definition: Path.cpp:91
Path mid(const Path &a, const Path &b, double time)
Definition: Path.cpp:387
bool isCounterclockwise() const
Tell if the points of the path are ordered counterclockwise.
Definition: Path.cpp:323
Struct representing a rectangle on the plane.
Definition: Rect.h:39
Path & moveCenter(double x, double y)
Translate the center to a given position.
Definition: Path.cpp:153
Path & operator<<(const Point &p)
Definition: Path.cpp:47
Path rotatedDeg(double angle, const Point ¢er) const
Definition: Path.cpp:103
Path & translate(double dx, double dy)
Definition: Path.cpp:128
void scaleAll(double s)
Definition: Path.cpp:194
Path getClockwise() const
Return a clockwise copy of the path.
Definition: Path.cpp:342
Path & pop_back()
Definition: Path.cpp:35
Path scaled(double sx, double sy) const
Definition: Path.cpp:184
Struct representing a 2D point.
Definition: Point.h:42
const Point & back() const
Definition: Path.h:465
Path & push_back(const Point &p)
Definition: Path.cpp:41
Rect boundingBox() const
Definition: Path.cpp:356
Path & rotate(double angle, const Point ¢er)
Definition: Path.cpp:75
bool isClockwise() const
Tell if the points of the path are ordered clockwise.
Definition: Path.cpp:302
A path, according to Postscript and SVG definition.
Definition: Path.h:45
Point & operator[](const std::size_t n)
Definition: Path.h:395
Path translated(double dx, double dy) const
Definition: Path.cpp:140
void setClockwise()
Make the path clockwise.
Definition: Path.cpp:328
Path & rotateDeg(double angle, const Point ¢er)
Definition: Path.cpp:86
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...