Board  0.9.5
Functions
Board.cpp File Reference

@copyright This source code is part of the Board project, a C++ library whose purpose is to allow simple drawings in EPS, FIG or SVG files. Copyright (C) 2007 Sebastien Fourey http://foureys.users.greyc.fr/ More...

#include "Board.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <typeinfo>
#include "board/PSFonts.h"
#include "board/Point.h"
#include "board/Rect.h"
#include "board/Shape.h"
#include "board/ShapeVisitor.h"
#include "board/Tools.h"

Functions

Group LibBoard::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)
 
Group LibBoard::grid (Point topLeft, size_t columns, size_t rows, double width, double height, const Style &style=Style::defaultStyle())
 
Group LibBoard::cross (Point p, const Style &style=Style::defaultStyle())
 
Polyline LibBoard::bezierControls (const Bezier &bezier, const Style &style=Style::defaultStyle())
 Produce a polyline of the Biezer vertices and control points. More...
 
Group LibBoard::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. More...
 
Group LibBoard::framed (const Shape &shape, const Color &color=Style::defaultPenColor(), double lineWidth=Style::defaultLineWidth(), double margin=0.0, int sketchyCount=0)
 Surround a shape with a rectangular frame. More...
 

Detailed Description

@copyright This source code is part of the Board project, a C++ library whose purpose is to allow simple drawings in EPS, FIG or SVG files. Copyright (C) 2007 Sebastien Fourey http://foureys.users.greyc.fr/

Author
Sebastien Fourey (GREYC)
Date
Aug 2007

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Function Documentation

◆ array()

Group LibBoard::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.

Parameters
topLeft
colors
columns
rows
pixelWidth
pixelHeightif zero (default), then it take the same value as pixelHeight
lineWidthif zero, pixels are drawn with Color::Null outline (i.e. color is "none")
Returns
A group of rows x columns rectangles colored after given vector

References LibBoard::array().

Referenced by LibBoard::array().

◆ bezierControls()

Polyline LibBoard::bezierControls ( const Bezier bezier,
const Style style = Style::defaultStyle() 
)

Produce a polyline of the Biezer vertices and control points.

Parameters
bezierA Bezier
styleStyle of the polyline
Returns
A polyline showing the Bezier points and controls
Examples
examples/bezier.cpp.

References LibBoard::Path::back(), and LibBoard::bezierControls().

Referenced by LibBoard::bezierControls().

◆ cross()

Group LibBoard::cross ( Point  p,
const Style style = Style::defaultStyle() 
)

Make a small cross

Parameters
p
style
Returns
A cross made of two lines, centered at point p
Examples
examples/bezier.cpp, examples/clipping.cpp, and examples/traversal.cpp.

References LibBoard::cross(), and LibBoard::Point::translated().

Referenced by LibBoard::cross().

◆ framed()

Group LibBoard::framed ( const Shape shape,
const Color color = Style::defaultPenColor(),
double  lineWidth = Style::defaultLineWidth(),
double  margin = 0.0,
int  sketchyCount = 0 
)

Surround a shape with a rectangular frame.

Parameters
shapeA shape
colorFrame color
lineWidthFrame line width
marginFrame inner mergin
sketchyCountIf set to zero, the frame is a straight one, otherwise a sketchy frame is produced with given repetition count.
Returns
A group of the shape with its frame

References LibBoard::framed().

Referenced by LibBoard::framed().

◆ grid() [1/2]

Group LibBoard::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 
)

Build a grid with specified number of rows and columns and a given size.

Parameters
topLeftCoordinates of the top left point of the grid.
columnsNumber of columns of the grid.
rowsNumber of rows of the grid.
widthWidth of the grid.
heightHeight of the grid.
penColorColor of the lines.
fillColorBackground color.
lineWidthLine width.
styleLine style (default is Board::SolidStyle).
capLine cap (default is Board::ButtCap).
joinLine join (default is Board::MiterJoin).
Returns
The grid as a group.
Examples
examples/tilings.cpp.

References LibBoard::grid().

Referenced by LibBoard::grid().

◆ grid() [2/2]

Group LibBoard::grid ( Point  topLeft,
size_t  columns,
size_t  rows,
double  width,
double  height,
const Style style = Style::defaultStyle() 
)

Build a grid with specified number of rows and columns and a given size.

Parameters
topLeftCoordinates of the top left point of the grid.
columnsNumber of columns of the grid.
rowsNumber of rows of the grid.
widthWidth of the grid.
heightHeight of the grid.
styleShape style
Returns
The grid as a group.

References LibBoard::grid().