DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Data Fields
DGtal::CustomPen Struct Reference

#include <Board2D.h>

Inheritance diagram for DGtal::CustomPen:
Inheritance graph
[legend]
Collaboration diagram for DGtal::CustomPen:
Collaboration graph
[legend]

Public Member Functions

 CustomPen (const Color &penColor, const Color &fillColor, double lineWidth=1.0, Board2D::Shape::LineStyle lineStyle=Board2D::Shape::SolidStyle, Board2D::Shape::LineCap lineCap=Board2D::Shape::ButtCap, Board2D::Shape::LineJoin lineJoin=Board2D::Shape::MiterJoin)
virtual void setStyle (Board2D &aboard) const

Data Fields

Color myPenColor
Color myFillColor
double myLineWidth
Board2D::Shape::LineStyle myLineStyle
Board2D::Shape::LineCap myLineCap
Board2D::Shape::LineJoin myLineJoin
int myDepth

Detailed Description

Custom style class redefining the pen attributes. You may use Board2D::Color::None for transparent color.

Board2D board;
board << CustomPen( Board2D::Color::Green, Board2D::Color::Black,
3.0 );
...
See also:
Board2D
Examples:
io/boards/dgtalBoard2D-3-custom-classes.cpp, and logoDGtal.cpp.

Definition at line 386 of file Board2D.h.


Constructor & Destructor Documentation

DGtal::CustomPen::CustomPen ( const Color penColor,
const Color fillColor,
double  lineWidth = 1.0,
Board2D::Shape::LineStyle  lineStyle = Board2D::Shape::SolidStyle,
Board2D::Shape::LineCap  lineCap = Board2D::Shape::ButtCap,
Board2D::Shape::LineJoin  lineJoin = Board2D::Shape::MiterJoin 
)
inline

Constructor.

Parameters:
penColorspecifies the pen color.
fillColorspecifies the fill color.
lineWidthspecifies the width of the drawing line.
lineStylespecifies the drawing line style (SolidStyle, DashStyle, DotStyle, DashDotStyle, DashDotDotStyle, DashDotDotDotStyle )
lineCapspecifies the drawing line cap (ButtCap, RoundCap, SquareCap )
lineJoinspecifies the drawing line join (MiterJoin, RoundJoin, BevelJoin )

Definition at line 413 of file Board2D.h.

: myPenColor( penColor ), myFillColor( fillColor ),
myLineWidth( lineWidth ),
myLineStyle( lineStyle ), myLineCap ( lineCap ), myLineJoin( lineJoin )
{}

Member Function Documentation

virtual void DGtal::CustomPen::setStyle ( Board2D ) const
inlinevirtual

Operation to override. Does nothing by default.

Parameters:
boardany object of type Board.

Reimplemented from DGtal::DrawableWithBoard2D.

Definition at line 424 of file Board2D.h.

References myFillColor, myLineCap, myLineJoin, myLineStyle, myLineWidth, myPenColor, LibBoard::Board::setFillColor(), LibBoard::Board::setLineCap(), LibBoard::Board::setLineJoin(), LibBoard::Board::setLineStyle(), LibBoard::Board::setLineWidth(), and LibBoard::Board::setPenColor().

{
aboard.setPenColor( myPenColor );
aboard.setFillColor( myFillColor );
aboard.setLineWidth( myLineWidth );
aboard.setLineStyle( myLineStyle );
aboard.setLineCap( myLineCap );
aboard.setLineJoin( myLineJoin );
}

Field Documentation

int DGtal::CustomPen::myDepth

The depth of the shape.

Definition at line 394 of file Board2D.h.

Color DGtal::CustomPen::myFillColor

Definition at line 389 of file Board2D.h.

Referenced by setStyle().

Board2D::Shape::LineCap DGtal::CustomPen::myLineCap

The linecap attribute. (The way line terminates.)

Definition at line 392 of file Board2D.h.

Referenced by setStyle().

Board2D::Shape::LineJoin DGtal::CustomPen::myLineJoin

The linejoin attribute. (The shape of line junctions.)

Definition at line 393 of file Board2D.h.

Referenced by setStyle().

Board2D::Shape::LineStyle DGtal::CustomPen::myLineStyle

The line style (solid, dashed, etc.).

Definition at line 391 of file Board2D.h.

Referenced by setStyle().

double DGtal::CustomPen::myLineWidth

Definition at line 390 of file Board2D.h.

Referenced by setStyle().

Color DGtal::CustomPen::myPenColor

Definition at line 388 of file Board2D.h.

Referenced by setStyle().


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