|
Board
0.9.2
|
A path, according to Postscript and SVG definition. More...
#include <Path.h>
Public Member Functions | |
| Path (const std::vector< Point > &points, bool closed) | |
| Path (bool closed) | |
| void | clear () |
| bool | closed () const |
| bool | empty () const |
| std::size_t | size () const |
| void | setClosed (bool closed) |
| Point | center () const |
| Path & | operator<< (const Point &p) |
| Path & | pop_back () |
| Point & | operator[] (const std::size_t n) |
| const Point & | operator[] (const std::size_t n) const |
| Path & | rotate (double angle, const Point ¢er) |
| Path | rotated (double angle, const Point ¢er) const |
| Path & | rotate (double angle) |
| Path | rotated (double angle) const |
| Path & | translate (double dx, double dy) |
| Path | translated (double dx, double dy) const |
| Path & | scale (double sx, double sy) |
| Path & | scale (double s) |
| Path | scaled (double sx, double sy) const |
| Path | scaled (double s) const |
| void | scaleAll (double s) |
| void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const |
| void | flushFIG (std::ostream &stream, const TransformFIG &transform) const |
| void | flushSVGPoints (std::ostream &stream, const TransformSVG &transform) const |
| void | flushSVGCommands (std::ostream &stream, const TransformSVG &transform) const |
| void | flushTikZPoints (std::ostream &stream, const TransformTikZ &transform) const |
| Rect | boundingBox () const |
Protected Attributes | |
| std::vector< Point > | _points |
| bool | _closed |
A path, according to Postscript and SVG definition.
The path structure.
| Rect LibBoard::Path::boundingBox | ( | ) | const |
Compute the bounding box of the path.
References LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
Referenced by LibBoard::Group::boundingBox(), LibBoard::Polyline::boundingBox(), center(), LibBoard::Board::saveEPS(), LibBoard::Board::saveSVG(), and LibBoard::Board::saveTikZ().
| Point LibBoard::Path::center | ( | ) | const |
Center of the bounding box of the path.
References boundingBox().
Referenced by LibBoard::Polyline::center(), LibBoard::GouraudTriangle::center(), rotate(), rotated(), LibBoard::Board::scale(), scale(), and LibBoard::Group::scale().
Add a point at the end of the path.
| p | A point. |
|
inline |
Get the n-th point of the path.
| n | Index of a point in the path. |
|
inline |
Get the n-th point of the path (const version).
| n | Index of a point in the path. |
| Path & LibBoard::Path::pop_back | ( | ) |
Remove the last point of the path.
Referenced by LibBoard::Group::setClippingPath(), and LibBoard::Board::setClippingPath().
Rotate the path by a given angle and according to a rotation center.
| angle | The rotation angle (in radians). |
| center | The rotation center. |
Referenced by LibBoard::Board::rotate(), rotate(), LibBoard::Group::rotate(), LibBoard::Polyline::rotate(), LibBoard::GouraudTriangle::rotate(), and rotated().
| Path & LibBoard::Path::rotate | ( | double | angle | ) |
Return a rotated copy of the path, thanks to an angle and a rotation center.
| angle | The rotation angle (in radians). |
| center | The rotation center. |
| Path LibBoard::Path::rotated | ( | double | angle | ) | const |
| Path & LibBoard::Path::scale | ( | double | sx, |
| double | sy | ||
| ) |
Apply a scaling factor to the path along each axis.
| sx | The scaling factor along the x axis. |
| sy | The scaling factor along the y axis. |
References center(), translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by LibBoard::Board::scale(), scale(), LibBoard::Group::scale(), LibBoard::Polyline::scale(), and scaled().
| Path & LibBoard::Path::scale | ( | double | s | ) |
Apply a scaling factor to the path.
| s | The scaling factor. |
References scale().
| void LibBoard::Path::scaleAll | ( | double | s | ) |
Scale all the points.
| s | The scaling factor. |
Referenced by LibBoard::Polyline::scaleAll(), LibBoard::Rectangle::scaleAll(), and LibBoard::GouraudTriangle::scaleAll().
| Path LibBoard::Path::scaled | ( | double | sx, |
| double | sy | ||
| ) | const |
Return a scaled copy of the path.
| sx | The scaling factor along the x axis. |
| sy | The scaling factor along the y axis. |
References scale().
| Path LibBoard::Path::scaled | ( | double | s | ) | const |
Return a scaled copy of the path.
| s | The scaling factor along both axis's. |
References scale().
| Path & LibBoard::Path::translate | ( | double | dx, |
| double | dy | ||
| ) |
Translate the path.
| dx | The shift along the x axis. |
| dy | The shift along the y axis. |
Referenced by LibBoard::Board::scale(), scale(), LibBoard::Group::scale(), LibBoard::Board::translate(), LibBoard::Group::translate(), and LibBoard::Polyline::translate().
| Path LibBoard::Path::translated | ( | double | dx, |
| double | dy | ||
| ) | const |
Return a translated copy of the path.
| dx | The shift along the x axis. |
| dy | The shift along the y axis. |
1.8.10