#include <Shapes.h>
Inheritance diagram for BoardLib::Shape:
Public Types | |
enum | LineCap { ButtCap = 0, RoundCap, SquareCap } |
enum | LineJoin { MiterJoin = 0, RoundJoin, BevelJoin } |
Public Member Functions | |
Shape (Color penColor, Color fillColor, float lineWidth, const LineCap cap, const LineJoin join, unsigned int depth) | |
virtual | ~Shape () |
bool | filled () const |
virtual void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const=0 |
virtual void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const=0 |
virtual void | flushSVG (std::ostream &stream, const TransformSVG &transform) const=0 |
virtual Rect | boundingBox () const=0 |
Public Attributes | |
unsigned int | depth |
Color | penColor |
Color | fillColor |
float | lineWidth |
LineCap | lineCap |
LineJoin | lineJoin |
Protected Member Functions | |
std::string | svgProperties (const TransformSVG &transform) const |
Shape structure.
BoardLib::Shape::Shape | ( | Color | penColor, | |
Color | fillColor, | |||
float | lineWidth, | |||
const LineCap | cap, | |||
const LineJoin | join, | |||
unsigned int | depth | |||
) | [inline] |
Shape constructor.
penColor | The pen color of the shape. | |
fillColor | The fill color of the shape. | |
lineWidth | The line thickness. | |
depth | The depth of the shape. |
virtual BoardLib::Shape::~Shape | ( | ) | [inline, virtual] |
Shape destructor.
bool BoardLib::Shape::filled | ( | ) | const [inline] |
Checks whether a shape is filled with a color or not.
virtual void BoardLib::Shape::flushPostscript | ( | std::ostream & | stream, | |
const TransformEPS & | transform | |||
) | const [pure virtual] |
Writes the EPS code of the shape in a stream according to a transform.
stream | The output stream. | |
transform | A 2D transform to be applied. |
Implemented in BoardLib::Line, BoardLib::Arrow, BoardLib::Polyline, BoardLib::GouraudTriangle, BoardLib::Rectangle, BoardLib::Circle, BoardLib::Ellipse, and BoardLib::Text.
virtual void BoardLib::Shape::flushFIG | ( | std::ostream & | stream, | |
const TransformFIG & | transform, | |||
std::map< Color, int > & | colormap | |||
) | const [pure virtual] |
Writes the FIG code of the shape in a stream according to a transform.
stream | The output stream. | |
transform | A 2D transform to be applied. |
Implemented in BoardLib::Line, BoardLib::Arrow, BoardLib::Polyline, BoardLib::GouraudTriangle, BoardLib::Rectangle, BoardLib::Circle, BoardLib::Ellipse, and BoardLib::Text.
virtual void BoardLib::Shape::flushSVG | ( | std::ostream & | stream, | |
const TransformSVG & | transform | |||
) | const [pure virtual] |
Writes the SVG code of the shape in a stream according to a transform.
stream | The output stream. | |
transform | A 2D transform to be applied. |
Implemented in BoardLib::Line, BoardLib::Arrow, BoardLib::Polyline, BoardLib::GouraudTriangle, BoardLib::Rectangle, BoardLib::Circle, BoardLib::Ellipse, and BoardLib::Text.
virtual Rect BoardLib::Shape::boundingBox | ( | ) | const [pure virtual] |
Returns the bounding box of the figure.
Implemented in BoardLib::Line, BoardLib::Polyline, BoardLib::Rectangle, BoardLib::Circle, BoardLib::Ellipse, and BoardLib::Text.
std::string BoardLib::Shape::svgProperties | ( | const TransformSVG & | transform | ) | const [protected] |
Return a string of the svg properties lineWidth, opacity, penColor, fillColor, lineCap, and lineJoin.
unsigned int BoardLib::Shape::depth |
The depth of the shape.
The color of the shape.
The color of the shape.
The line thickness.
LineCap BoardLib::Shape::lineCap |
The linecap attribute. (The way line terminates.)
LineJoin BoardLib::Shape::lineJoin |
The linejoin attribute. (The shape of line junctions.)