BoardLib::Shape Struct Reference

Abstract structure for a 2D shape. More...

#include <Shapes.h>

Inheritance diagram for BoardLib::Shape:

BoardLib::Circle BoardLib::Ellipse BoardLib::Line BoardLib::Polyline BoardLib::Rectangle BoardLib::Text BoardLib::Arrow BoardLib::GouraudTriangle List of all members.

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

Detailed Description

Abstract structure for a 2D shape.

Shape structure.


Constructor & Destructor Documentation

BoardLib::Shape::Shape ( Color  penColor,
Color  fillColor,
float  lineWidth,
const LineCap  cap,
const LineJoin  join,
unsigned int  depth 
) [inline]

Shape constructor.

Parameters:
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.


Member Function Documentation

bool BoardLib::Shape::filled (  )  const [inline]

Checks whether a shape is filled with a color or not.

Returns:
true if the shape is filled.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:
The rectangle of the bounding box.

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.

Returns:
A string of the properties suitable for inclusion in an svg tag.


Member Data Documentation

unsigned int BoardLib::Shape::depth

The depth of the shape.

Color BoardLib::Shape::penColor

The color of the shape.

Color BoardLib::Shape::fillColor

The color of the shape.

float BoardLib::Shape::lineWidth

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.)


The documentation for this struct was generated from the following files:
Generated on Fri Aug 24 19:07:40 2007 for Board by  doxygen 1.5.1