BoardLib::Board Class Reference

Class for EPS, FIG or SVG drawings. More...

#include <Board.h>

Inheritance diagram for BoardLib::Board:

BoardLib::ShapeList BoardLib::ShapeList BoardLib::Shape BoardLib::Shape

List of all members.

Public Member Functions

 Board (const Color &backgroundColor=Color::none)
 Board (const Board &other)
Boardoperator= (const Board &other)
void clear (const Color &color=Color::none)
void clear (unsigned char red, unsigned char green, unsigned char blue)
void drawLine (float x1, float y1, float x2, float y2, int depth=-1)
void drawArrow (float x1, float y1, float x2, float y2, bool filled=false, int depth=-1)
void drawTriangle (float x1, float y1, float x2, float y2, float x3, float y3, int depth=-1)
void drawTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1)
void fillTriangle (float x1, float y1, float x2, float y2, float x3, float y3, int depth=-1)
void fillGouraudTriangle (const Point &p1, const Color &color1, const Point &p2, const Color &color2, const Point &p3, const Color &color3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const float x1, const float y1, const Color &color1, const float x2, const float y2, const Color &color2, const float x3, const float y3, const Color &color3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const Point &p1, const float brightness1, const Point &p2, const float brightness2, const Point &p3, const float brightness3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const float x1, const float y1, const float brightness1, const float x2, const float y2, const float brightness1, const float x3, const float y3, const float brightness1, unsigned char divisions=3, int depth=-1)
void fillTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1)
void drawRectangle (float x, float y, float width, float height, int depth=-1)
void fillRectangle (float x, float y, float width, float height, int depth=-1)
void drawCircle (float x, float y, float radius, int depth=-1)
void fillCircle (float x, float y, float radius, int depth=-1)
void drawEllipse (float x, float y, float xRadius, float yRadius, int depth=-1)
void fillEllipse (float x, float y, float xRadius, float yRadius, int depth=-1)
void drawPolyline (const std::vector< Point > &points, int depth=-1)
void drawClosedPolyline (const std::vector< Point > &points, int depth=-1)
void fillPolyline (const std::vector< Point > &points, int depth=-1)
void drawText (float x, float y, const char *text, int depth=-1)
BoardsetFont (std::string font, float fontSize)
BoardsetFontSize (float fontSize)
BoardsetPenColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
BoardsetPenColorRGBf (float red, float green, float blue, float alpha=1.0f)
BoardsetPenColor (const Color &color)
BoardsetFillColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
BoardsetFillColorRGBf (float red, float green, float blue, float alpha=1.0f)
BoardsetFillColor (const Color &color)
BoardsetLineWidth (float width)
BoardsetLineCap (Shape::LineCap cap)
BoardsetLineJoin (Shape::LineJoin join)
void backgroundColor (const Color &color)
void drawBoundingBox (int depth=-1)
void save (const char *filename) const
void saveEPS (const char *filename, float scale=1.0f) const
void saveFIG (const char *filename, float scale=1.0f) const
void saveSVG (const char *filename, float scale=1.0f) const
 Board (const Color &backgroundColor=Color::none)
 Board (const Board &other)
Boardoperator= (const Board &other)
void clear (const Color &color=Color::none)
void clear (unsigned char red, unsigned char green, unsigned char blue)
void drawLine (float x1, float y1, float x2, float y2, int depth=-1)
void drawArrow (float x1, float y1, float x2, float y2, bool filled=false, int depth=-1)
void drawTriangle (float x1, float y1, float x2, float y2, float x3, float y3, int depth=-1)
void drawTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1)
void fillTriangle (float x1, float y1, float x2, float y2, float x3, float y3, int depth=-1)
void fillGouraudTriangle (const Point &p1, const Color &color1, const Point &p2, const Color &color2, const Point &p3, const Color &color3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const float x1, const float y1, const Color &color1, const float x2, const float y2, const Color &color2, const float x3, const float y3, const Color &color3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const Point &p1, const float brightness1, const Point &p2, const float brightness2, const Point &p3, const float brightness3, unsigned char divisions=3, int depth=-1)
void fillGouraudTriangle (const float x1, const float y1, const float brightness1, const float x2, const float y2, const float brightness1, const float x3, const float y3, const float brightness1, unsigned char divisions=3, int depth=-1)
void fillTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1)
void drawRectangle (float x, float y, float width, float height, int depth=-1)
void fillRectangle (float x, float y, float width, float height, int depth=-1)
void drawCircle (float x, float y, float radius, int depth=-1)
void fillCircle (float x, float y, float radius, int depth=-1)
void drawEllipse (float x, float y, float xRadius, float yRadius, int depth=-1)
void fillEllipse (float x, float y, float xRadius, float yRadius, int depth=-1)
void drawPolyline (const std::vector< Point > &points, int depth=-1)
void drawClosedPolyline (const std::vector< Point > &points, int depth=-1)
void fillPolyline (const std::vector< Point > &points, int depth=-1)
void drawText (float x, float y, const char *text, int depth=-1)
BoardsetFont (std::string font, float fontSize)
BoardsetFontSize (float fontSize)
BoardsetPenColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
BoardsetPenColorRGBf (float red, float green, float blue, float alpha=1.0f)
BoardsetPenColor (const Color &color)
BoardsetFillColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
BoardsetFillColorRGBf (float red, float green, float blue, float alpha=1.0f)
BoardsetFillColor (const Color &color)
BoardsetLineWidth (float width)
BoardsetLineCap (Shape::LineCap cap)
BoardsetLineJoin (Shape::LineJoin join)
void backgroundColor (const Color &color)
void drawBoundingBox (int depth=-1)
void save (const char *filename) const
void saveEPS (const char *filename, float scale=1.0f) const
void saveFIG (const char *filename, float scale=1.0f) const
void saveSVG (const char *filename, float scale=1.0f) const

Protected Attributes

State _state
Color _backgroundColor

Classes

struct  State


Detailed Description

Class for EPS, FIG or SVG drawings.

The Board class.

Version:
0.5

Constructor & Destructor Documentation

BoardLib::Board::Board ( const Color backgroundColor = Color::none  ) 

Constructs a new board and sets the background color, if any.

Parameters:
backgroundColor A color for the drawing's background.

BoardLib::Board::Board ( const Board other  ) 

Copy constructor.

Parameters:
other The object to be copied.

BoardLib::Board::Board ( const Color backgroundColor = Color::none  ) 

Constructs a new board and sets the background color, if any.

Parameters:
backgroundColor A color for the drawing's background.

BoardLib::Board::Board ( const Board other  ) 

Copy constructor.

Parameters:
other The object to be copied.


Member Function Documentation

Board & BoardLib::Board::operator= ( const Board other  ) 

The operator =

Parameters:
other The object to be copied.
Returns:
A reference to the left operand.

void BoardLib::Board::clear ( const Color color = Color::none  ) 

Clears the board with a given background color.

Parameters:
color The board background color (may be Color::none).

void BoardLib::Board::clear ( unsigned char  red,
unsigned char  green,
unsigned char  blue 
) [inline]

Clears the board and set the background color from an RGB triple.

Parameters:
red 
green 
blue 

void BoardLib::Board::drawLine ( float  x1,
float  y1,
float  x2,
float  y2,
int  depth = -1 
)

Draws a line from (x1,y1) to (x2,y2).

Parameters:
x1 First coordinate of the first extremity.
y1 Second coordinate of the first extremity.
x2 First coordinate of the second extremity.
y2 Second coordinate of the second extremity.
depth Depth of the line.

void BoardLib::Board::drawArrow ( float  x1,
float  y1,
float  x2,
float  y2,
bool  filled = false,
int  depth = -1 
)

Draws a line from (x1,y1) to (x2,y2) with an arrow at (x2,y2).

Parameters:
x1 First coordinate of the first extremity.
y1 Second coordinate of the first extremity.
x2 First coordinate of the second extremity.
y2 Second coordinate of the second extremity.
filled Whether or not the arrow is filled.
depth Depth of the line.

void BoardLib::Board::drawTriangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
int  depth = -1 
)

Draws a triangle.

Parameters:
x1 First coordinate of the first vertex.
y1 Second coordinate of the first vertex.
x2 First coordinate of the second vertex.
y3 Second coordinate of the second vertex.
x3 First coordinate of the third vertex.
y3 Second coordinate of the third vertex.
depth Depth of the triangle.

void BoardLib::Board::drawTriangle ( const Point p1,
const Point p2,
const Point p3,
int  depth = -1 
)

Draws a triangle.

Parameters:
p1 First vertex.
p2 Second vertex.
p3 Third vertex.
depth Depth of the triangle.

void BoardLib::Board::fillTriangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
int  depth = -1 
)

Draws a filled triangle.

Parameters:
x1 First coordinate of the first vertex.
y1 Second coordinate of the first vertex.
x2 First coordinate of the second vertex.
y3 Second coordinate of the second vertex.
x3 First coordinate of the third vertex.
y3 Second coordinate of the third vertex.
depth Depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const Point p1,
const Color color1,
const Point p2,
const Color color2,
const Point p3,
const Color color3,
unsigned char  divisions = 3,
int  depth = -1 
)

Draws a triangle with Gouraud-like shaded colors.

Parameters:
p1 
color1 
p2 
color2 
p3 
color3 
divisions number of triangle subdivisions.
depth The depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const float  x1,
const float  y1,
const Color color1,
const float  x2,
const float  y2,
const Color color2,
const float  x3,
const float  y3,
const Color color3,
unsigned char  divisions = 3,
int  depth = -1 
) [inline]

Draws a triangle with Gouraud-like shaded colors.

Parameters:
x1 
y1 
color1 
x2 
y2 
color2 
x3 
y3 
color3 
divisions 
depth 

void BoardLib::Board::fillGouraudTriangle ( const Point p1,
const float  brightness1,
const Point p2,
const float  brightness2,
const Point p3,
const float  brightness3,
unsigned char  divisions = 3,
int  depth = -1 
)

Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.

Parameters:
p1 
brightness1 
p2 
brightness2 
p3 
brightness3 
divisions number of triangle subdivisions.
depth The depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const float  x1,
const float  y1,
const float  brightness1,
const float  x2,
const float  y2,
const float  brightness1,
const float  x3,
const float  y3,
const float  brightness1,
unsigned char  divisions = 3,
int  depth = -1 
) [inline]

Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.

Parameters:
x1 
y1 
brightness1 
x2 
y2 
brightness2 
x3 
y3 
brightness3 
divisions 
depth 

void BoardLib::Board::fillTriangle ( const Point p1,
const Point p2,
const Point p3,
int  depth = -1 
)

Draws a filled triangle.

Parameters:
p1 First vertex.
p2 Second vertex.
p3 Third vertex.
depth Depth of the triangle.

void BoardLib::Board::drawRectangle ( float  x,
float  y,
float  width,
float  height,
int  depth = -1 
)

Draws a rectangle.

Parameters:
x First coordinate of the upper left corner.
y Second coordinate of the upper left corner.
width Width of the rectangle.
height Height of the rectangle.
depth Depth of the rectangle.

void BoardLib::Board::fillRectangle ( float  x,
float  y,
float  width,
float  height,
int  depth = -1 
)

Draws a rectangle filled with the current pen color.

Parameters:
x First coordinate of the upper left corner.
y Second coordinate of the upper left corner.
width Width of the rectangle.
height Height of the rectangle.
depth Depth of the rectangle.

void BoardLib::Board::drawCircle ( float  x,
float  y,
float  radius,
int  depth = -1 
)

Draws a circle.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::fillCircle ( float  x,
float  y,
float  radius,
int  depth = -1 
)

Draws a circle filled with the current pen color.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::drawEllipse ( float  x,
float  y,
float  xRadius,
float  yRadius,
int  depth = -1 
)

Draws an ellipse.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::fillEllipse ( float  x,
float  y,
float  xRadius,
float  yRadius,
int  depth = -1 
)

Draws an ellipse filled with the current pen color.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
xRadius X axis radius of the ellipse.
yRadius Y axis radius of the ellipse.
depth Depth of the circle.

void BoardLib::Board::drawPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a polygonal line.

Parameters:
points A vector of points.
depth The depth of the polyline.

void BoardLib::Board::drawClosedPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a closed polygonal line.

Parameters:
points A vector of points.
depth The depth of the polyline.

void BoardLib::Board::fillPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a filled polygon.

Parameters:
points A vector of points.
depth The depth of the polygon.

void BoardLib::Board::drawText ( float  x,
float  y,
const char *  text,
int  depth = -1 
)

Draws a string of text.

Parameters:
x The first coordinates of the lower left corner.
y The second coordinates of the lower left corner.
text The text.
depth The depth of the text.

Board & BoardLib::Board::setFont ( std::string  font,
float  fontSize 
)

Changes the current font and font size.

Parameters:
font The name of the font.
fontSize The new font size.
Returns:
The board itself.

Board & BoardLib::Board::setFontSize ( float  fontSize  ) 

Changes the font size.

Parameters:
fontSize The new font size.
Returns:
The board itself.

Board & BoardLib::Board::setPenColorRGBi ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha = 255 
)

Changes the current pen color.

Parameters:
red Red component.
green Green component.
blue Blue component.
Returns:
The board itself.

Board & BoardLib::Board::setPenColorRGBf ( float  red,
float  green,
float  blue,
float  alpha = 1.0f 
)

Changes the current pen color.

Parameters:
red Red
green 
blue 
alpha 
Returns:
The board itself.

Board & BoardLib::Board::setPenColor ( const Color color  ) 

Changes the current pen color.

In order to use no pen, one may set the pen color to Color::none.

Parameters:
color The pen color.
Returns:
The board itself.

Board & BoardLib::Board::setFillColorRGBi ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha = 255 
)

Changes the current fill color.

Parameters:
red Red component.
green Green component.
blue Blue component.
alpha The opacity.
Returns:
The board itself.

Board & BoardLib::Board::setFillColorRGBf ( float  red,
float  green,
float  blue,
float  alpha = 1.0f 
)

Changes the current fill color.

Parameters:
red Red component.
green Green component.
blue Blue component.
alpha The opacity.
Returns:
The board itself.

Board & BoardLib::Board::setFillColor ( const Color color  ) 

Changes the current fill color.

In order to use no fill color, one may set this color to Color::none.

Parameters:
color The fill color.
Returns:
The board itself.

Board & BoardLib::Board::setLineWidth ( float  width  ) 

Changes the current line thickness (1/72 inche unit).

Parameters:
width The new line thickness.
Returns:
The board itself.

Board & BoardLib::Board::setLineCap ( Shape::LineCap  cap  )  [inline]

Set the line cap style.

Parameters:
cap The cap-style which can be Shape::ButtCap, Shape::RoundCap or Shape::SquareCap.
Returns:
The board itself.

Board & BoardLib::Board::setLineJoin ( Shape::LineJoin  join  )  [inline]

Set the line joine style.

Parameters:
cap The join-style which can be Shape::MiterJoin, Shape::RoundJoin or Shape::BevelJoin.
Returns:
The board itself.

void BoardLib::Board::backgroundColor ( const Color color  ) 

Changes the background color of the whole drawing.

Parameters:
color A color (may be Color::none).

void BoardLib::Board::drawBoundingBox ( int  depth = -1  ) 

Draws the current drawing's bounding box as a rectangle.

Parameters:
depth The depth of the rectangle.

void BoardLib::Board::save ( const char *  filename  )  const

Save the drawing in an EPS, XFIG of SVG file depending on the filename extension.

Parameters:
filename Path of the file to be created.

void BoardLib::Board::saveEPS ( const char *  filename,
float  scale = 1.0f 
) const

Saves the drawing in an EPS file.

Parameters:
filename The EPS file name.
scale A scale factor to be applied to the while figure before saving.

void BoardLib::Board::saveFIG ( const char *  filename,
float  scale = 1.0f 
) const

Saves the drawing in an XFig file.

Parameters:
filename The name of the FIG file.
scale A scale factor to be applied to the while figure before saving.

void BoardLib::Board::saveSVG ( const char *  filename,
float  scale = 1.0f 
) const

Save the drawing in an SVG file.

Parameters:
filename The name of the file.
scale A scale factor to be applied to the while figure before saving.

Board& BoardLib::Board::operator= ( const Board other  ) 

The operator =

Parameters:
other The object to be copied.
Returns:
A reference to the left operand.

void BoardLib::Board::clear ( const Color color = Color::none  ) 

Clears the board with a given background color.

Parameters:
color The board background color (may be Color::none).

void BoardLib::Board::clear ( unsigned char  red,
unsigned char  green,
unsigned char  blue 
) [inline]

Clears the board and set the background color from an RGB triple.

Parameters:
red 
green 
blue 

void BoardLib::Board::drawLine ( float  x1,
float  y1,
float  x2,
float  y2,
int  depth = -1 
)

Draws a line from (x1,y1) to (x2,y2).

Parameters:
x1 First coordinate of the first extremity.
y1 Second coordinate of the first extremity.
x2 First coordinate of the second extremity.
y2 Second coordinate of the second extremity.
depth Depth of the line.

void BoardLib::Board::drawArrow ( float  x1,
float  y1,
float  x2,
float  y2,
bool  filled = false,
int  depth = -1 
)

Draws a line from (x1,y1) to (x2,y2) with an arrow at (x2,y2).

Parameters:
x1 First coordinate of the first extremity.
y1 Second coordinate of the first extremity.
x2 First coordinate of the second extremity.
y2 Second coordinate of the second extremity.
filled Whether or not the arrow is filled.
depth Depth of the line.

void BoardLib::Board::drawTriangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
int  depth = -1 
)

Draws a triangle.

Parameters:
x1 First coordinate of the first vertex.
y1 Second coordinate of the first vertex.
x2 First coordinate of the second vertex.
y3 Second coordinate of the second vertex.
x3 First coordinate of the third vertex.
y3 Second coordinate of the third vertex.
depth Depth of the triangle.

void BoardLib::Board::drawTriangle ( const Point p1,
const Point p2,
const Point p3,
int  depth = -1 
)

Draws a triangle.

Parameters:
p1 First vertex.
p2 Second vertex.
p3 Third vertex.
depth Depth of the triangle.

void BoardLib::Board::fillTriangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
int  depth = -1 
)

Draws a filled triangle.

Parameters:
x1 First coordinate of the first vertex.
y1 Second coordinate of the first vertex.
x2 First coordinate of the second vertex.
y3 Second coordinate of the second vertex.
x3 First coordinate of the third vertex.
y3 Second coordinate of the third vertex.
depth Depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const Point p1,
const Color color1,
const Point p2,
const Color color2,
const Point p3,
const Color color3,
unsigned char  divisions = 3,
int  depth = -1 
)

Draws a triangle with Gouraud-like shaded colors.

Parameters:
p1 
color1 
p2 
color2 
p3 
color3 
divisions number of triangle subdivisions.
depth The depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const float  x1,
const float  y1,
const Color color1,
const float  x2,
const float  y2,
const Color color2,
const float  x3,
const float  y3,
const Color color3,
unsigned char  divisions = 3,
int  depth = -1 
) [inline]

Draws a triangle with Gouraud-like shaded colors.

Parameters:
x1 
y1 
color1 
x2 
y2 
color2 
x3 
y3 
color3 
divisions 
depth 

void BoardLib::Board::fillGouraudTriangle ( const Point p1,
const float  brightness1,
const Point p2,
const float  brightness2,
const Point p3,
const float  brightness3,
unsigned char  divisions = 3,
int  depth = -1 
)

Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.

Parameters:
p1 
brightness1 
p2 
brightness2 
p3 
brightness3 
divisions number of triangle subdivisions.
depth The depth of the triangle.

void BoardLib::Board::fillGouraudTriangle ( const float  x1,
const float  y1,
const float  brightness1,
const float  x2,
const float  y2,
const float  brightness1,
const float  x3,
const float  y3,
const float  brightness1,
unsigned char  divisions = 3,
int  depth = -1 
) [inline]

Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.

Parameters:
x1 
y1 
brightness1 
x2 
y2 
brightness2 
x3 
y3 
brightness3 
divisions 
depth 

void BoardLib::Board::fillTriangle ( const Point p1,
const Point p2,
const Point p3,
int  depth = -1 
)

Draws a filled triangle.

Parameters:
p1 First vertex.
p2 Second vertex.
p3 Third vertex.
depth Depth of the triangle.

void BoardLib::Board::drawRectangle ( float  x,
float  y,
float  width,
float  height,
int  depth = -1 
)

Draws a rectangle.

Parameters:
x First coordinate of the upper left corner.
y Second coordinate of the upper left corner.
width Width of the rectangle.
height Height of the rectangle.
depth Depth of the rectangle.

void BoardLib::Board::fillRectangle ( float  x,
float  y,
float  width,
float  height,
int  depth = -1 
)

Draws a rectangle filled with the current pen color.

Parameters:
x First coordinate of the upper left corner.
y Second coordinate of the upper left corner.
width Width of the rectangle.
height Height of the rectangle.
depth Depth of the rectangle.

void BoardLib::Board::drawCircle ( float  x,
float  y,
float  radius,
int  depth = -1 
)

Draws a circle.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::fillCircle ( float  x,
float  y,
float  radius,
int  depth = -1 
)

Draws a circle filled with the current pen color.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::drawEllipse ( float  x,
float  y,
float  xRadius,
float  yRadius,
int  depth = -1 
)

Draws an ellipse.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
radius Radius of the circle.
depth Depth of the circle.

void BoardLib::Board::fillEllipse ( float  x,
float  y,
float  xRadius,
float  yRadius,
int  depth = -1 
)

Draws an ellipse filled with the current pen color.

Parameters:
x First coordinate of the circle's center.
y Second coordinate of the circle's center.
xRadius X axis radius of the ellipse.
yRadius Y axis radius of the ellipse.
depth Depth of the circle.

void BoardLib::Board::drawPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a polygonal line.

Parameters:
points A vector of points.
depth The depth of the polyline.

void BoardLib::Board::drawClosedPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a closed polygonal line.

Parameters:
points A vector of points.
depth The depth of the polyline.

void BoardLib::Board::fillPolyline ( const std::vector< Point > &  points,
int  depth = -1 
)

Draws a filled polygon.

Parameters:
points A vector of points.
depth The depth of the polygon.

void BoardLib::Board::drawText ( float  x,
float  y,
const char *  text,
int  depth = -1 
)

Draws a string of text.

Parameters:
x The first coordinates of the lower left corner.
y The second coordinates of the lower left corner.
text The text.
depth The depth of the text.

Board& BoardLib::Board::setFont ( std::string  font,
float  fontSize 
)

Changes the current font and font size.

Parameters:
font The name of the font.
fontSize The new font size.
Returns:
The board itself.

Board& BoardLib::Board::setFontSize ( float  fontSize  ) 

Changes the font size.

Parameters:
fontSize The new font size.
Returns:
The board itself.

Board& BoardLib::Board::setPenColorRGBi ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha = 255 
)

Changes the current pen color.

Parameters:
red Red component.
green Green component.
blue Blue component.
Returns:
The board itself.

Board& BoardLib::Board::setPenColorRGBf ( float  red,
float  green,
float  blue,
float  alpha = 1.0f 
)

Changes the current pen color.

Parameters:
red Red
green 
blue 
alpha 
Returns:
The board itself.

Board& BoardLib::Board::setPenColor ( const Color color  ) 

Changes the current pen color.

In order to use no pen, one may set the pen color to Color::none.

Parameters:
color The pen color.
Returns:
The board itself.

Board& BoardLib::Board::setFillColorRGBi ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha = 255 
)

Changes the current fill color.

Parameters:
red Red component.
green Green component.
blue Blue component.
alpha The opacity.
Returns:
The board itself.

Board& BoardLib::Board::setFillColorRGBf ( float  red,
float  green,
float  blue,
float  alpha = 1.0f 
)

Changes the current fill color.

Parameters:
red Red component.
green Green component.
blue Blue component.
alpha The opacity.
Returns:
The board itself.

Board& BoardLib::Board::setFillColor ( const Color color  ) 

Changes the current fill color.

In order to use no fill color, one may set this color to Color::none.

Parameters:
color The fill color.
Returns:
The board itself.

Board& BoardLib::Board::setLineWidth ( float  width  ) 

Changes the current line thickness (1/72 inche unit).

Parameters:
width The new line thickness.
Returns:
The board itself.

Board& BoardLib::Board::setLineCap ( Shape::LineCap  cap  )  [inline]

Set the line cap style.

Parameters:
cap The cap-style which can be Shape::ButtCap, Shape::RoundCap or Shape::SquareCap.
Returns:
The board itself.

Board& BoardLib::Board::setLineJoin ( Shape::LineJoin  join  )  [inline]

Set the line joine style.

Parameters:
cap The join-style which can be Shape::MiterJoin, Shape::RoundJoin or Shape::BevelJoin.
Returns:
The board itself.

void BoardLib::Board::backgroundColor ( const Color color  ) 

Changes the background color of the whole drawing.

Parameters:
color A color (may be Color::none).

void BoardLib::Board::drawBoundingBox ( int  depth = -1  ) 

Draws the current drawing's bounding box as a rectangle.

Parameters:
depth The depth of the rectangle.

void BoardLib::Board::save ( const char *  filename  )  const

Save the drawing in an EPS, XFIG of SVG file depending on the filename extension.

Parameters:
filename Path of the file to be created.

void BoardLib::Board::saveEPS ( const char *  filename,
float  scale = 1.0f 
) const

Saves the drawing in an EPS file.

Parameters:
filename The EPS file name.
scale A scale factor to be applied to the while figure before saving.

void BoardLib::Board::saveFIG ( const char *  filename,
float  scale = 1.0f 
) const

Saves the drawing in an XFig file.

Parameters:
filename The name of the FIG file.
scale A scale factor to be applied to the while figure before saving.

void BoardLib::Board::saveSVG ( const char *  filename,
float  scale = 1.0f 
) const

Save the drawing in an SVG file.

Parameters:
filename The name of the file.
scale A scale factor to be applied to the while figure before saving.


Member Data Documentation

State BoardLib::Board::_state [protected]

The current state.

Color BoardLib::Board::_backgroundColor [protected]

The color of the background.


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