BoardLib::Polyline Struct Reference

A polygonal line described by a series of 2D points. More...

#include <Shapes.h>

Inheritance diagram for BoardLib::Polyline:

BoardLib::Shape BoardLib::GouraudTriangle BoardLib::Rectangle

List of all members.

Public Member Functions

 Polyline (const std::vector< Point > &points, bool closed, Color penColor, Color fillColor, float lineWidth, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1)
Point center () const
Shaperotate (double angle, const Point &center)
Shaperotate (double angle)
Shapetranslate (double dx, double dy)
Shapescale (double sx, double sy)
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
Rect boundingBox () const
Shapeclone () const

Protected Attributes

std::vector< Point_points
bool _closed


Detailed Description

A polygonal line described by a series of 2D points.

The polyline structure.


Member Function Documentation

Point BoardLib::Polyline::center (  )  const [virtual]

Returns the gravity center of the shape.

Returns:
The center of the shape.

Implements BoardLib::Shape.

Reimplemented in BoardLib::GouraudTriangle.

Shape & BoardLib::Polyline::rotate ( double  angle,
const Point center 
) [virtual]

Rotate the shape around a given center of rotation.

Parameters:
angle The rotation angle in radian.
center The center of rotation.
Returns:
A reference to the shape itself.

Implements BoardLib::Shape.

Reimplemented in BoardLib::GouraudTriangle.

Shape & BoardLib::Polyline::rotate ( double  angle  )  [virtual]

Rotate the shape around its center.

Parameters:
angle The rotation angle in radian.
Returns:
A reference to the shape itself.

Implements BoardLib::Shape.

Reimplemented in BoardLib::GouraudTriangle.

Shape & BoardLib::Polyline::translate ( double  dx,
double  dy 
) [virtual]

Translate the shape by a given offset.

Parameters:
dx The x offset.
dy The y offset.
Returns:
A reference to the shape itself.

Implements BoardLib::Shape.

Shape & BoardLib::Polyline::scale ( double  sx,
double  sy 
) [virtual]

Scale the shape along the x an y axis.

Parameters:
sx The scale factor along the x axis.
sy The scale factor along the y axis.
Returns:
The shape itself.

Implements BoardLib::Shape.

void BoardLib::Polyline::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const [virtual]

Writes the EPS code of the shape in a stream according to a transform.

Parameters:
stream The output stream.
transform A 2D transform to be applied.

Implements BoardLib::Shape.

Reimplemented in BoardLib::GouraudTriangle.

void BoardLib::Polyline::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const [virtual]

Writes the FIG code of the shape in a stream according to a transform.

Parameters:
stream The output stream.
transform A 2D transform to be applied.

Implements BoardLib::Shape.

Reimplemented in BoardLib::Rectangle, and BoardLib::GouraudTriangle.

void BoardLib::Polyline::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const [virtual]

Writes the SVG code of the shape in a stream according to a transform.

Parameters:
stream The output stream.
transform A 2D transform to be applied.

Implements BoardLib::Shape.

Reimplemented in BoardLib::Rectangle, and BoardLib::GouraudTriangle.

Rect BoardLib::Polyline::boundingBox (  )  const [virtual]

Returns the bounding box of the figure.

Returns:
The rectangle of the bounding box.

Implements BoardLib::Shape.

Shape* BoardLib::Polyline::clone (  )  const [inline, virtual]

Return a copy of the shape.

Returns:

Implements BoardLib::Shape.

Reimplemented in BoardLib::Rectangle, and BoardLib::GouraudTriangle.


The documentation for this struct was generated from the following files:
Generated on Mon Dec 17 11:15:52 2007 for Board by  doxygen 1.5.3-20071008