Board  0.9.5
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LibBoard::Style Struct Reference

#include <Style.h>

Public Member Functions

 Style ()
 
 Style (Color penColor, Color fillColor, double lineWidth, LineStyle linestyle, LineCap lineCap, LineJoin lineJoin)
 
std::string svgProperties (const TransformSVG &transform) const
 
std::string postscriptProperties (const TransformEPS &transform) const
 
std::string tikzProperties (const TransformTikZ &transform) const
 
Style withPenColor (const Color &color) const
 
Style withFillColor (const Color &color) const
 
Style withLineWidth (double width) const
 
Style withLineStyle (LineStyle lineStyle) const
 
Style withLineCap (LineCap lineCap) const
 
Style withLineJoin (LineJoin lineJoin) const
 

Static Public Member Functions

static void setDefaultStyle (const Style &)
 
static void setDefaultLineWidth (double)
 
static void setDefaultPenColor (Color)
 
static void setDefaultFillColor (Color)
 
static void setDefaultLineStyle (LineStyle)
 
static void setDefaultLineCap (LineCap)
 
static void setDefaultLineJoin (LineJoin)
 
static const StyledefaultStyle ()
 defaultStyle More...
 
static const double & defaultLineWidth ()
 defaultLineWidth More...
 
static const ColordefaultPenColor ()
 defaultPenColor More...
 
static const ColordefaultFillColor ()
 defaultFillColor More...
 
static const LineStyle & defaultLineStyle ()
 defaultLineStyle More...
 
static const LineCap & defaultLineCap ()
 defaultLineCap More...
 
static const LineJoin & defaultLineJoin ()
 defaultLineJoin More...
 
static void push ()
 
static void pop ()
 

Public Attributes

Color penColor
 
Color fillColor
 
double lineWidth
 
LineStyle lineStyle
 
LineCap lineCap
 
LineJoin lineJoin
 

Detailed Description

Structure describing shape style properties.

Examples
examples/line_style.cpp.

Constructor & Destructor Documentation

◆ Style()

LibBoard::Style::Style ( )

Create a style with (current) default values.

Member Function Documentation

◆ defaultFillColor()

const LibBoard::Color & LibBoard::Style::defaultFillColor ( )
inlinestatic

defaultFillColor

Returns
Default fill color for shapes (initialized as Color::None)

◆ defaultLineCap()

const LibBoard::LineCap & LibBoard::Style::defaultLineCap ( )
inlinestatic

defaultLineCap

Returns
Default line cap for shapes (initialized as ButtCap)

◆ defaultLineJoin()

const LibBoard::LineJoin & LibBoard::Style::defaultLineJoin ( )
inlinestatic

defaultLineJoin

Returns
Default line join for shapes (initialized as MiterJoin)

◆ defaultLineStyle()

const LibBoard::LineStyle & LibBoard::Style::defaultLineStyle ( )
inlinestatic

defaultLineStyle

Returns
Default line style for shapes (initialized as SolidStyle)

◆ defaultLineWidth()

const double & LibBoard::Style::defaultLineWidth ( )
inlinestatic

defaultLineWidth

Returns
Default lineWidth value for shapes (intialized as 1.0).

◆ defaultPenColor()

const LibBoard::Color & LibBoard::Style::defaultPenColor ( )
inlinestatic

defaultPenColor

Returns
Default pen color for shapes (initialized as Black)
Examples
examples/holes.cpp.

◆ defaultStyle()

const LibBoard::Style & LibBoard::Style::defaultStyle ( )
inlinestatic

defaultStyle

Returns
Default shape style.

◆ pop()

void LibBoard::Style::pop ( )
static

Restore the top of the style stack as the new default style (and pop it).

◆ postscriptProperties()

std::string LibBoard::Style::postscriptProperties ( const TransformEPS transform) const

Return a string of the properties lineWidth, penColor, lineCap, and lineJoin as Postscript commands.

Returns
A string of the Postscript commands.

Referenced by LibBoard::Dot::flushPostscript(), LibBoard::Polyline::flushPostscript(), and LibBoard::Line::flushPostscript().

◆ push()

void LibBoard::Style::push ( )
static

Push the current default style on top of the style stack.

◆ svgProperties()

std::string LibBoard::Style::svgProperties ( const TransformSVG transform) const

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.

Referenced by LibBoard::Dot::flushSVG(), LibBoard::Ellipse::flushSVG(), and LibBoard::Line::flushSVG().

◆ tikzProperties()

std::string LibBoard::Style::tikzProperties ( const TransformTikZ transform) const

Return a string of the properties lineWidth, penColor, lineCap, and lineJoin as TikZ commands.

Returns
A string of the TikZ commands.

References LibBoard::Color::tikz().

Referenced by LibBoard::Ellipse::flushTikZ(), LibBoard::Text::flushTikZ(), LibBoard::Arrow::flushTikZ(), LibBoard::Polyline::flushTikZ(), and LibBoard::Line::flushTikZ().

◆ withFillColor()

LibBoard::Style LibBoard::Style::withFillColor ( const Color color) const
inline

Returns a copy of the style, with modified fill color.

Parameters
colorNew fill color.
Returns
A copy of the style, with modified fill color.

◆ withLineCap()

LibBoard::Style LibBoard::Style::withLineCap ( LibBoard::LineCap  lineCap) const
inline

Returns a copy of the style, with modified line cap.

Parameters
lineCapNew line cap.
Returns
A copy of the style, with modified line cap.

◆ withLineJoin()

LibBoard::Style LibBoard::Style::withLineJoin ( LibBoard::LineJoin  lineJoin) const
inline

Returns a copy of the style, with modified line join.

Parameters
lineJoinNew line join.
Returns
A copy of the style, with modified line join.

◆ withLineStyle()

LibBoard::Style LibBoard::Style::withLineStyle ( LibBoard::LineStyle  lineStyle) const
inline

Returns a copy of the style, with modified line style.

Parameters
lineStyleNew line style.
Returns
A copy of the style, with modified line style.
Examples
examples/line_style.cpp.

◆ withLineWidth()

LibBoard::Style LibBoard::Style::withLineWidth ( double  width) const
inline

Returns a copy of the style, with modified line width.

Parameters
widthNew line width.
Returns
A copy of the style, with modified line width.

◆ withPenColor()

LibBoard::Style LibBoard::Style::withPenColor ( const Color color) const
inline

Returns a copy of the style, with modified pen color.

Parameters
colorNew pen color.
Returns
A copy of the style, with modified pen color.

The documentation for this struct was generated from the following files: