Board
0.9.6
examples/tilings.cpp
#include <
Board.h
>
using namespace
LibBoard
;
int
main
(
int
,
char
*[])
{
Board
board;
board.
clear
(Color::White);
Style::setDefaultLineWidth(0.1);
Style::setDefaultLineStyle(SolidStyle);
Style::setDefaultLineCap(RoundCap);
Style::setDefaultLineJoin(RoundJoin);
Group
g;
g << circle(10, 10, 20, Color::Blue, Color::Null);
Group
grid;
grid <<
Line
(0, 0, 100, 0, Color::Blue);
grid <<
Line
(0, 0, 0, -200, Color::Blue);
Polyline
l(Path::Open, Color::Blue, Color::Null);
l <<
Point
(-10, 0) <<
Point
(0, 0) <<
Point
(0, 10);
grid << tiling(l,
Point
(0, 0), 10, 20, 0.0, IgnoreLineWidth);
grid.
rotateDeg
(45);
board << grid;
Ellipse
circle =
LibBoard::circle
(10, 10, 20, Color::Blue, Color::Null, 1.0);
Rect
bbox = board.
boundingBox
(UseLineWidth);
Line
separator(bbox.
topRight
(), bbox.
bottomRight
(), Color::Black);
board.
append
(separator, Direction::Right, Alignment::Center);
board.
append
(circle, Direction::Right, Alignment::Top);
board.
append
(separator, Direction::Right, Alignment::Center);
board.
append
(circle, Direction::Right, Alignment::Center);
board.
append
(separator, Direction::Right, Alignment::Center);
board.
append
(circle, Direction::Right, Alignment::Bottom);
bbox = board.
boundingBox
(UseLineWidth);
separator =
Line
(bbox.
bottomLeft
(), bbox.
bottomRight
(), Color::Black);
board.
append
(separator, Direction::Bottom, Alignment::Left);
board.
append
(circle, Direction::Bottom, Alignment::Left);
board.
append
(separator, Direction::Bottom, Alignment::Left);
board.
append
(circle, Direction::Bottom, Alignment::Center);
board.
append
(separator, Direction::Bottom, Alignment::Left);
board.
append
(circle, Direction::Bottom, Alignment::Right);
board.
append
(separator, Direction::Bottom, Alignment::Left);
bbox = board.
boundingBox
(UseLineWidth);
separator =
Line
(bbox.
topRight
(), bbox.
bottomRight
(), Color::Black);
board.
append
(separator, Direction::Right, Alignment::Center);
board.
append
(
LibBoard::grid
(
Point
(0, 0), 12, 6, 120, 60, Color::Red, Color::Null, 0.5, SolidStyle, ButtCap, RoundJoin), Direction::Right, Alignment::Center);
board.
saveEPS
(
"tilings.eps"
);
board.
scaleToWidth
(25, UseLineWidth);
board.
saveSVG
(
"tilings.svg"
, PageSize::BoundingBox, 0.0, Unit::Centimeter);
}
Board.h
Declaration of the Board class.
main
int main(int argc, char *argv[])
Definition
arithmetic.cpp:16
LibBoard
Definition
Board.h:55
LibBoard::circle
Ellipse circle(double x, double y, double radius, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle())
Definition
Ellipse.cpp:371
LibBoard::grid
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
LibBoard::Board
Class for EPS, FIG or SVG drawings.
Definition
Board.h:61
LibBoard::Board::saveEPS
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
LibBoard::Board::clear
void clear(const Color &color=Color::Null)
Definition
Board.cpp:149
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition
Board.cpp:765
LibBoard::Ellipse
An ellipse.
Definition
Ellipse.h:38
LibBoard::Group
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
LibBoard::Line
A line between two points.
Definition
Line.h:38
LibBoard::Point
Struct representing a 2D point.
Definition
Point.h:42
LibBoard::Polyline
A polygonal line described by a series of 2D points.
Definition
Polyline.h:38
LibBoard::Rect
Struct representing a rectangle on the plane.
Definition
Rect.h:40
LibBoard::Rect::bottomLeft
Point bottomLeft() const
bottomLeft Bottom-left point of the rectangle
Definition
Rect.h:89
LibBoard::Rect::bottomRight
Point bottomRight() const
bottomRight Bottom-right point of the rectangle
Definition
Rect.h:95
LibBoard::Rect::topRight
Point topRight() const
topRight Top-right point of the rectangle
Definition
Rect.h:83
LibBoard::ShapeList::boundingBox
Rect boundingBox(LineWidthFlag) const override
Definition
ShapeList.cpp:405
LibBoard::ShapeList::append
ShapeList & append(const Shape &shape, Direction direction=Direction::Right, Alignment alignment=Alignment::Center, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
Definition
ShapeList.cpp:232
LibBoard::Shape::rotateDeg
Shape & rotateDeg(double angle, const Point ¢er)
Definition
Shape.h:337
LibBoard::Shape::scaleToWidth
Shape & scaleToWidth(double w, LineWidthFlag lineWidthFlag)
Definition
Shape.cpp:85
Generated by
1.9.7