#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 |
unsigned int | size () const |
void | setClosed (bool closed) |
Point | center () const |
Path & | operator<< (const Point &p) |
Path & | pop_back () |
Point & | operator[] (const unsigned int n) |
const Point & | operator[] (const unsigned int 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 |
Rect | boundingBox () const |
Protected Attributes | |
std::vector< Point > | _points |
bool | _closed |
The path structure.
Point LibBoard::Path::center | ( | ) | const |
Barycenter of the path
References LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
Referenced by LibBoard::Polyline::center(), rotate(), rotated(), LibBoard::Group::scale(), scale(), and LibBoard::Board::scale().
Add a point at the end of the path.
p |
const Point& LibBoard::Path::operator[] | ( | const unsigned int | n | ) | const [inline] |
Returns the n-th point of the polyline.
i |
Point& LibBoard::Path::operator[] | ( | const unsigned int | n | ) | [inline] |
Returns the n-th point of the polyline.
i |
Path & LibBoard::Path::pop_back | ( | ) |
Path & LibBoard::Path::rotate | ( | double | angle | ) |
angle | ||
center |
Referenced by LibBoard::GouraudTriangle::rotate(), LibBoard::Polyline::rotate(), LibBoard::Group::rotate(), rotate(), LibBoard::Board::rotate(), and rotated().
Path LibBoard::Path::rotated | ( | double | angle | ) | const |
angle | ||
center |
Path & LibBoard::Path::scale | ( | double | sx, | |
double | sy | |||
) |
sx | ||
sy |
References center(), translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by LibBoard::Polyline::scale(), LibBoard::Group::scale(), scale(), LibBoard::Board::scale(), and scaled().
void LibBoard::Path::scaleAll | ( | double | s | ) |
Scales all the points.
s | The scaling factor. |
Referenced by LibBoard::GouraudTriangle::scaleAll(), LibBoard::Rectangle::scaleAll(), and LibBoard::Polyline::scaleAll().
Path LibBoard::Path::scaled | ( | double | sx, | |
double | sy | |||
) | const |
Path & LibBoard::Path::translate | ( | double | dx, | |
double | dy | |||
) |
dx | ||
dy |
Referenced by LibBoard::Group::scale(), scale(), LibBoard::Board::scale(), LibBoard::Polyline::translate(), LibBoard::Group::translate(), and LibBoard::Board::translate().
Path LibBoard::Path::translated | ( | double | dx, | |
double | dy | |||
) | const |
dx | ||
dy |