DGtal  0.9.3beta
Public Member Functions | Data Fields
DGtal::CustomPen Struct Reference

#include <DGtal/io/boards/Board2D.h>

Inheritance diagram for DGtal::CustomPen:
[legend]
Collaboration diagram for DGtal::CustomPen:
[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
 
- Public Member Functions inherited from DGtal::DrawableWithBoard2D
virtual ~DrawableWithBoard2D ()
 

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 io/boards/logoDGtal.cpp.

Definition at line 373 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 400 of file Board2D.h.

406  : myPenColor( penColor ), myFillColor( fillColor ),
407  myLineWidth( lineWidth ),
408  myLineStyle( lineStyle ), myLineCap ( lineCap ), myLineJoin( lineJoin )
409  {}
double myLineWidth
Definition: Board2D.h:377
Board2D::Shape::LineCap myLineCap
Definition: Board2D.h:379
Board2D::Shape::LineStyle myLineStyle
Definition: Board2D.h:378
Color myFillColor
Definition: Board2D.h:376
Color myPenColor
Definition: Board2D.h:375
Board2D::Shape::LineJoin myLineJoin
Definition: Board2D.h:380

Member Function Documentation

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

Operation to override. Does nothing by default.

Reimplemented from DGtal::DrawableWithBoard2D.

Definition at line 411 of file Board2D.h.

References LibBoard::Board::setFillColor(), LibBoard::Board::setLineCap(), LibBoard::Board::setLineJoin(), LibBoard::Board::setLineStyle(), LibBoard::Board::setLineWidth(), and LibBoard::Board::setPenColor().

412  {
413  aboard.setPenColor( myPenColor );
414  aboard.setFillColor( myFillColor );
415  aboard.setLineWidth( myLineWidth );
416  aboard.setLineStyle( myLineStyle );
417  aboard.setLineCap( myLineCap );
418  aboard.setLineJoin( myLineJoin );
419  }
double myLineWidth
Definition: Board2D.h:377
Board2D::Shape::LineCap myLineCap
Definition: Board2D.h:379
Board2D::Shape::LineStyle myLineStyle
Definition: Board2D.h:378
Color myFillColor
Definition: Board2D.h:376
Color myPenColor
Definition: Board2D.h:375
Board2D::Shape::LineJoin myLineJoin
Definition: Board2D.h:380

Field Documentation

int DGtal::CustomPen::myDepth

The depth of the shape.

Definition at line 381 of file Board2D.h.

Color DGtal::CustomPen::myFillColor

Definition at line 376 of file Board2D.h.

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

The linecap attribute. (The way line terminates.)

Definition at line 379 of file Board2D.h.

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

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

Definition at line 380 of file Board2D.h.

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

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

Definition at line 378 of file Board2D.h.

double DGtal::CustomPen::myLineWidth

Definition at line 377 of file Board2D.h.

Color DGtal::CustomPen::myPenColor

Definition at line 375 of file Board2D.h.


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