DGtal
1.4.2
|
A path, according to Postscript and SVG definition. More...
#include <Board/Path.h>
Public Member Functions | |
Path () | |
Path (const std::vector< Point > &points, bool closedPath) | |
Path (bool closedPath) | |
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 |
void | flushCairoPoints (cairo_t *cr, const TransformCairo &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.
|
inline |
|
inline |
Rect LibBoard::Path::boundingBox | ( | ) | const |
Definition at line 272 of file Path.cpp.
References _points, LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
Referenced by LibBoard::Group::boundingBox(), LibBoard::Polyline::boundingBox(), center(), LibBoard::Board::saveCairo(), LibBoard::Board::saveEPS(), LibBoard::Board::saveSVG(), and LibBoard::Board::saveTikZ().
Point LibBoard::Path::center | ( | ) | const |
Barycenter of the path
Definition at line 36 of file Path.cpp.
References boundingBox(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
Referenced by LibBoard::Polyline::center(), rotate(), rotated(), LibBoard::Board::scale(), scale(), and LibBoard::Group::scale().
|
inline |
Definition at line 231 of file Path.h.
References _points.
Referenced by LibBoard::Board::setClippingPath(), LibBoard::Group::setClippingPath(), LibBoard::Board::setClippingRectangle(), and LibBoard::Group::setClippingRectangle().
|
inline |
Definition at line 237 of file Path.h.
References _closed.
Referenced by LibBoard::Polyline::flushCairo(), LibBoard::Polyline::flushFIG(), LibBoard::Polyline::flushSVG(), and LibBoard::Polyline::flushTikZ().
|
inline |
Definition at line 243 of file Path.h.
References _points.
Referenced by LibBoard::Polyline::flushCairo(), LibBoard::Polyline::flushFIG(), LibBoard::Polyline::flushPostscript(), LibBoard::Polyline::flushSVG(), and LibBoard::Polyline::flushTikZ().
void LibBoard::Path::flushCairoPoints | ( | cairo_t * | cr, |
const TransformCairo & | transform | ||
) | const |
Definition at line 235 of file Path.cpp.
References _points.
Referenced by LibBoard::Polyline::flushCairo().
void LibBoard::Path::flushFIG | ( | std::ostream & | stream, |
const TransformFIG & | transform | ||
) | const |
Definition at line 173 of file Path.cpp.
References _closed, and _points.
Referenced by LibBoard::Polyline::flushFIG(), LibBoard::Rectangle::flushFIG(), and LibBoard::Image::flushFIG().
void LibBoard::Path::flushPostscript | ( | std::ostream & | stream, |
const TransformEPS & | transform | ||
) | const |
Definition at line 154 of file Path.cpp.
References _closed, and _points.
Referenced by LibBoard::Group::flushPostscript(), LibBoard::Polyline::flushPostscript(), and LibBoard::Board::saveEPS().
void LibBoard::Path::flushSVGCommands | ( | std::ostream & | stream, |
const TransformSVG & | transform | ||
) | const |
Definition at line 193 of file Path.cpp.
References _closed, and _points.
Referenced by LibBoard::Group::flushSVG(), LibBoard::Board::saveSVG(), and LibBoard::Board::saveTikZ().
void LibBoard::Path::flushSVGPoints | ( | std::ostream & | stream, |
const TransformSVG & | transform | ||
) | const |
Definition at line 215 of file Path.cpp.
References _points.
Referenced by LibBoard::Polyline::flushSVG().
void LibBoard::Path::flushTikZPoints | ( | std::ostream & | stream, |
const TransformTikZ & | transform | ||
) | const |
Definition at line 255 of file Path.cpp.
References _points.
Referenced by LibBoard::Polyline::flushTikZ().
|
inline |
|
inline |
Path & LibBoard::Path::pop_back | ( | ) |
Definition at line 22 of file Path.cpp.
References _points.
Referenced by LibBoard::Board::setClippingPath(), and LibBoard::Group::setClippingPath().
Path & LibBoard::Path::rotate | ( | double | angle | ) |
angle | angle |
center | center |
Definition at line 43 of file Path.cpp.
References _points.
Referenced by rotate(), LibBoard::Board::rotate(), LibBoard::Group::rotate(), LibBoard::Polyline::rotate(), and LibBoard::GouraudTriangle::rotate().
Path LibBoard::Path::rotated | ( | double | angle | ) | const |
Path & LibBoard::Path::scale | ( | double | s | ) |
Path & LibBoard::Path::scale | ( | double | sx, |
double | sy | ||
) |
sx | scale factor |
sy | scale factor |
Definition at line 108 of file Path.cpp.
References _points, center(), translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), and LibBoard::Polyline::scale().
void LibBoard::Path::scaleAll | ( | double | s | ) |
Scales all the points.
s | The scaling factor. |
Definition at line 143 of file Path.cpp.
References _points.
Referenced by LibBoard::Polyline::scaleAll(), LibBoard::Rectangle::scaleAll(), and LibBoard::GouraudTriangle::scaleAll().
Path LibBoard::Path::scaled | ( | double | s | ) | const |
Path LibBoard::Path::scaled | ( | double | sx, |
double | sy | ||
) | const |
|
inline |
Definition at line 255 of file Path.h.
References _closed.
Referenced by LibBoard::Board::setClippingPath(), and LibBoard::Group::setClippingPath().
|
inline |
Definition at line 249 of file Path.h.
References _points.
Referenced by LibBoard::Group::boundingBox(), LibBoard::Polyline::flushFIG(), LibBoard::Group::flushPostscript(), LibBoard::Group::flushSVG(), LibBoard::Board::saveCairo(), LibBoard::Board::saveEPS(), LibBoard::Board::saveSVG(), LibBoard::Board::saveTikZ(), LibBoard::Board::setClippingPath(), and LibBoard::Group::setClippingPath().
Path & LibBoard::Path::translate | ( | double | dx, |
double | dy | ||
) |
dx | translation vector |
dy | translation vector |
Definition at line 81 of file Path.cpp.
References _points.
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 |
dx | translation vector |
dy | translation vector |
|
protected |
Definition at line 227 of file Path.h.
Referenced by closed(), flushFIG(), flushPostscript(), flushSVGCommands(), and setClosed().
|
protected |
Definition at line 226 of file Path.h.
Referenced by boundingBox(), clear(), empty(), flushCairoPoints(), flushFIG(), flushPostscript(), flushSVGCommands(), flushSVGPoints(), flushTikZPoints(), operator<<(), operator[](), pop_back(), rotate(), scale(), scaleAll(), size(), and translate().