112 template <
typename S>
129 inline void clear(
unsigned char red,
unsigned char green,
unsigned char blue);
214 void drawDot(
double x,
double y);
223 void drawLine(
double x1,
double y1,
double x2,
double y2);
263 void drawTriangle(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
284 void fillTriangle(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
299 const Point & p3,
const Color & color3,
unsigned char divisions = 3);
316 const double x2,
const double y2,
const Color & color2,
317 const double x3,
const double y3,
const Color & color3,
unsigned char divisions = 3);
331 const Point & p2,
const float brightness2,
332 const Point & p3,
const float brightness3,
unsigned char divisions = 3);
350 const double x2,
const double y2,
const float brightness2,
351 const double x3,
const double y3,
const float brightness3,
352 unsigned char divisions = 3);
403 void drawCircle(
double x,
double y,
double radius);
412 void fillCircle(
double x,
double y,
double radius);
422 void drawEllipse(
double x,
double y,
double xRadius,
double yRadius);
432 void fillEllipse(
double x,
double y,
double xRadius,
double yRadius);
479 void drawText(
double x,
double y,
const std::string &
text);
515 Board &
setPenColorRGBi(
unsigned char red,
unsigned char green,
unsigned char blue,
unsigned char alpha = 255);
547 Board &
setFillColorRGBi(
unsigned char red,
unsigned char green,
unsigned char blue,
unsigned char alpha = 255);
678 void addDuplicates(
const Shape & shape, std::size_t times,
double dx,
double dy,
double scaleX,
double scaleY,
double angle = 0.0);
703 void save(
const char * filename,
double pageWidth,
double pageHeight,
double margin = 0.0,
Unit unit =
Unit::Millimeter)
const;
739 void saveEPS(std::ostream & out,
double pageWidth,
double pageHeight,
double margin = 0.0,
Unit unit =
Unit::Millimeter,
const std::string & title = std::string())
const;
752 void saveEPS(
const char * filename,
double pageWidth,
double pageHeight,
double margin = 0.0,
Unit unit =
Unit::Millimeter,
const std::string & title = std::string())
const;
870 void saveTikZ(
const char * filename,
double pageWidth,
double pageHeight,
double margin = 0.0)
const;
880 void saveTikZ(std::ostream & out,
double pageWidth,
double pageHeight,
double margin = 0.0)
const;
962Group grid(
Point topLeft,
size_t columns,
size_t rows,
double width,
double height,
1002Group array(
Point topLeft,
const std::vector<Color> & colors,
unsigned int columns,
unsigned int rows,
double pixelWidth,
double pixelHeight = 0.0,
double lineWidth = 0.0);
1016 double margin = 0.0,
1021 int sketchyCount = 0);
1061inline void Board::clear(
unsigned char red,
unsigned char green,
unsigned char blue)
1100 const double x2,
const double y2,
const Color & color2,
1101 const double x3,
const double y3,
const Color & color3,
1102 unsigned char divisions)
1108 const double x2,
const double y2,
const float brightness2,
1109 const double x3,
const double y3,
const float brightness3,
1110 unsigned char divisions)
1115template <
typename S>
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
The Exception type. @copyright This source code is part of the Board project, a C++ library whose pur...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Group text()
Definition board_font_text.cpp:17
Structure representing an RGB triple.
Definition Color.h:43
static const Color Null
Definition Color.h:155
Font
Definition PSFonts.h:51
Polyline bezierControls(const Bezier &bezier, const Style &style=Style::defaultStyle())
Produce a polyline of the Biezer vertices and control points.
Definition Board.cpp:1032
LineStyle
Definition Style.h:47
@ SolidStyle
Definition Style.h:48
Unit
Length units.
Definition Globals.h:81
PageSize
Page sizes.
Definition Globals.h:59
@ BoundingBox
No page size. The bounding box of the drawing will be used.
Group tiling(const Shape &shape, Point topLeftCorner, int columns, int rows, double spacing=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
Definition Board.cpp:995
Group cross(Point p, const Style &style=Style::defaultStyle())
Definition Board.cpp:1024
Group array(Point topLeft, const std::vector< Color > &colors, unsigned int columns, unsigned int rows, double pixelWidth, double pixelHeight=0.0, double lineWidth=0.0)
Produce a rectangular color matrix.
Definition Board.cpp:1053
LineCap
Definition Style.h:35
@ ButtCap
Definition Style.h:36
Group framed(const Shape &shape, double margin=0.0, const Color &penColor=Style::defaultPenColor(), const Color &fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), LineStyle lineStyle=Style::defaultLineStyle(), int sketchyCount=0)
Surround a shape with a rectangular frame.
Definition Board.cpp:1081
Group circled(const Shape &shape, double margin=0.0, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), LineStyle lineStyle=Style::defaultLineStyle())
Surround a shape with a cirle.
Definition Board.cpp:1015
Group grid(Point topLeft, size_t columns, size_t rows, double width, double height, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin)
Definition Board.cpp:967
LineWidthFlag
Definition Style.h:57
@ UseLineWidth
Definition Style.h:59
LineJoin
Definition Style.h:41
@ MiterJoin
Definition Style.h:42
ExtremityType
The ExtremityType enum.
Definition Arrow.h:44
A Bezier curve described by two series of 2D points (curve points and control points).
Definition Bezier.h:42
State()
Definition Board.cpp:97
double fontSize
Definition Board.h:935
Fonts::Font font
Definition Board.h:934
Style style
Definition Board.h:933
Class for EPS, FIG or SVG drawings.
Definition Board.h:61
Board & translate(double dx, double dy) override
Translate the board by a given vector.
Definition Board.cpp:169
Board & setFont(const Fonts::Font font, double fontSize)
Definition Board.cpp:280
static Rect pageRect(PageSize size, Unit unit)
Standard page size as a rectangle Rect(0,0,width,height)
Definition Board.cpp:896
void setClippingRectangle(double x, double y, double width, double height)
Definition Board.cpp:455
void fillPolyline(const std::vector< Point > &points)
Definition Board.cpp:377
State _state
Definition Board.h:938
Board & setFillColorHSV(float hue, float saturation, float value, float alpha=1.0f)
Definition Board.cpp:262
void setBackgroundColor(const Color &color)
Definition Board.cpp:293
Color _backgroundColor
Definition Board.h:939
void fillCircle(double x, double y, double radius)
Definition Board.cpp:352
AspectRatio
The AspectRatio enum.
Definition Board.h:70
@ Preserve
Preserve aspect ratio, e.g. for resize operations.
@ Ignore
Ignore aspect ratio, e.g. for resize operations.
void drawLine(double x1, double y1, double x2, double y2)
Definition Board.cpp:303
Board & setFontSize(double fontSize)
Definition Board.cpp:287
void fillGouraudTriangle(const Point &p1, const Color &color1, const Point &p2, const Color &color2, const Point &p3, const Color &color3, unsigned char divisions=3)
Definition Board.cpp:406
const Color & penColor() const
penColor
Definition Board.h:1084
void drawBoundingBox(LineWidthFlag lineWidthFlag)
Definition Board.cpp:448
void setClippingPath(const std::vector< Point > &points)
Definition Board.cpp:469
Board & operator<<(const Shape &shape)
Definition Board.cpp:126
void addDuplicates(const Shape &shape, std::size_t times, double dx, double dy, double scale=1.0)
Definition Board.cpp:491
void drawRectangle(double left, double top, double width, double height)
Definition Board.cpp:323
static void enableLineWidthScaling()
Definition Board.cpp:134
Board & scale(double sx, double sy) override
Scale the board in the x and y direction.
Definition Board.cpp:176
static double toMillimeter(double x, Unit unit)
Definition Board.cpp:914
void save(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:958
Board & setLineCap(LineCap cap)
Definition Board.h:1072
Board & setPenColor(const Color &color)
Definition Board.cpp:244
Board & operator=(const Board &other)
Definition Board.cpp:108
void saveFIG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:636
void drawArrow(double x1, double y1, double x2, double y2, Arrow::ExtremityType type=Arrow::ExtremityType::Plain)
Definition Board.cpp:313
void fillRectangle(double left, double top, double width, double height)
Definition Board.cpp:333
static void setLineWidthScaling(bool)
Definition Board.cpp:144
Board & setPenColorRGBi(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
Definition Board.cpp:232
void fillEllipse(double x, double y, double xRadius, double yRadius)
Definition Board.cpp:362
static const double Degree
Definition Board.h:64
void drawDot(double x, double y)
Definition Board.cpp:298
void drawText(double x, double y, const char *text)
Definition Board.cpp:428
~Board() override
Definition Board.cpp:132
Board & setPenColorRGBf(float red, float green, float blue, float alpha=1.0f)
Definition Board.cpp:238
void saveEPS(std::ostream &out, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const
Definition Board.cpp:539
Board & setFillColor(const Color &color)
Definition Board.cpp:268
void fillTriangle(double x1, double y1, double x2, double y2, double x3, double y3)
Definition Board.cpp:394
void saveTikZ(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0) const
Definition Board.cpp:856
Board translated(double dx, double dy)
Definition Board.cpp:217
const Style & style() const
Definition Board.h:1094
void drawPolyline(const std::vector< Point > &points)
Definition Board.cpp:367
Board scaled(double sx, double sy)
Definition Board.cpp:222
Board & rotate(double angle, const Point ¢er) override
Rotate the board by an angle around a point.
Definition Board.cpp:155
void drawTriangle(double x1, double y1, double x2, double y2, double x3, double y3)
Definition Board.cpp:382
Board & setFillColorRGBi(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
Definition Board.cpp:250
void drawEllipse(double x, double y, double xRadius, double yRadius)
Definition Board.cpp:357
const Color & fillColor() const
fillColor
Definition Board.h:1089
Board & setLineWidth(double width)
Definition Board.cpp:274
Board & setLineStyle(LineStyle style)
Definition Board.h:1066
void drawCircle(double x, double y, double radius)
Definition Board.cpp:347
Board & setFillColorRGBf(float red, float green, float blue, float alpha=1.0f)
Definition Board.cpp:256
Board & setLineJoin(LineJoin join)
Definition Board.h:1078
Path _clippingPath
Definition Board.h:940
static void disableLineWidthScaling()
Definition Board.cpp:139
void drawClosedPolyline(const std::vector< Point > &points)
Definition Board.cpp:372
void saveSVG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:765
Board rotated(double angle, const Point ¢er)
Definition Board.cpp:207
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition Group.h:40
A path, according to Postscript and SVG definition.
Definition Path.h:45
Struct representing a 2D point.
Definition Point.h:42
A polygonal line described by a series of 2D points.
Definition Polyline.h:38
Struct representing a rectangle on the plane.
Definition Rect.h:40
A group of shapes.
Definition ShapeList.h:47
Shape & top()
Definition ShapeList.cpp:438
std::size_t size() const
The number of shapes in the list (at top level).
Definition ShapeList.h:669
ShapeList & operator<<(const Shape &shape)
Definition ShapeList.cpp:150
ShapeList & clear()
Definition ShapeList.cpp:90
Abstract structure for a 2D shape.
Definition Shape.h:64
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition Shape.cpp:59
LineJoin lineJoin
Definition Style.h:75
Color fillColor
Definition Style.h:71
LineStyle lineStyle
Definition Style.h:73
Color penColor
Definition Style.h:70
static const Color & defaultPenColor()
defaultPenColor
Definition Style.h:279
static const Color & defaultFillColor()
defaultFillColor
Definition Style.h:284
static const double & defaultLineWidth()
defaultLineWidth
Definition Style.h:274
static const Style & defaultStyle()
defaultStyle
Definition Style.h:269
static const LineStyle & defaultLineStyle()
defaultLineStyle
Definition Style.h:289
LineCap lineCap
Definition Style.h:74