Public Member Functions | Protected Attributes

LibBoard::Path Struct Reference

A path, according to Postscript and SVG definition. More...

#include <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
Pathoperator<< (const Point &p)
Pathpop_back ()
Pointoperator[] (const unsigned int n)
const Pointoperator[] (const unsigned int n) const
Pathrotate (double angle, const Point &center)
Path rotated (double angle, const Point &center) const
Pathrotate (double angle)
Path rotated (double angle) const
Pathtranslate (double dx, double dy)
Path translated (double dx, double dy) const
Pathscale (double sx, double sy)
Pathscale (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

Detailed Description

A path, according to Postscript and SVG definition.

The path structure.


Constructor & Destructor Documentation

LibBoard::Path::Path (  )  [inline]

Referenced by scaled().

LibBoard::Path::Path ( const std::vector< Point > &  points,
bool  closedPath 
) [inline]
LibBoard::Path::Path ( bool  closedPath  )  [inline]

Member Function Documentation

Rect LibBoard::Path::boundingBox (  )  const
Point LibBoard::Path::center (  )  const
void LibBoard::Path::clear (  )  [inline]
bool LibBoard::Path::closed (  )  const [inline]
bool LibBoard::Path::empty (  )  const [inline]
void LibBoard::Path::flushFIG ( std::ostream &  stream,
const TransformFIG transform 
) const
void LibBoard::Path::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
void LibBoard::Path::flushSVGCommands ( std::ostream &  stream,
const TransformSVG transform 
) const
void LibBoard::Path::flushSVGPoints ( std::ostream &  stream,
const TransformSVG transform 
) const
Path & LibBoard::Path::operator<< ( const Point p  ) 

Add a point at the end of the path.

Parameters:
p 
Returns:

References _points.

Point& LibBoard::Path::operator[] ( const unsigned int  n  )  [inline]

Returns the n-th point of the polyline.

Parameters:
i 
Returns:

References _points.

const Point& LibBoard::Path::operator[] ( const unsigned int  n  )  const [inline]

Returns the n-th point of the polyline.

Parameters:
i 
Returns:

References _points.

Path & LibBoard::Path::pop_back (  ) 
Path & LibBoard::Path::rotate ( double  angle,
const Point center 
)
Path & LibBoard::Path::rotate ( double  angle  ) 
Parameters:
angle 
Returns:

References center(), and rotate().

Path LibBoard::Path::rotated ( double  angle,
const Point center 
) const
Parameters:
angle 
center 
Returns:

References _points.

Path LibBoard::Path::rotated ( double  angle  )  const
Parameters:
angle 
Returns:

References center(), and rotate().

Path & LibBoard::Path::scale ( double  sx,
double  sy 
)
Path & LibBoard::Path::scale ( double  s  ) 
Parameters:
s 
Returns:

References scale().

void LibBoard::Path::scaleAll ( double  s  ) 

Scales all the points.

Parameters:
s The scaling factor.

References _points.

Referenced by LibBoard::GouraudTriangle::scaleAll(), LibBoard::Rectangle::scaleAll(), and LibBoard::Polyline::scaleAll().

Path LibBoard::Path::scaled ( double  sx,
double  sy 
) const
Parameters:
sx 
sy 
Returns:

References Path().

Path LibBoard::Path::scaled ( double  s  )  const

References Path().

void LibBoard::Path::setClosed ( bool  closed  )  [inline]
unsigned int LibBoard::Path::size (  )  const [inline]
Path & LibBoard::Path::translate ( double  dx,
double  dy 
)
Path LibBoard::Path::translated ( double  dx,
double  dy 
) const
Parameters:
dx 
dy 
Returns:

References _points.


Field Documentation

bool LibBoard::Path::_closed [protected]
std::vector<Point> LibBoard::Path::_points [protected]

The documentation for this struct was generated from the following files: