DGtal 1.3.0
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
DGtal::CustomPen Struct Reference

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

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

Inheritance diagram for DGtal::CustomPen:
DGtal::DrawableWithBoard2D

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 void setStyle (Board2D &) const
 
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 );
...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
Custom style class redefining the pen attributes. You may use Board2D::Color::None for transparent co...
Definition: Board2D.h:374
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

◆ CustomPen()

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 {}
Color myFillColor
Definition: Board2D.h:376
Board2D::Shape::LineStyle myLineStyle
Definition: Board2D.h:378
Board2D::Shape::LineJoin myLineJoin
Definition: Board2D.h:380
Color myPenColor
Definition: Board2D.h:375
Board2D::Shape::LineCap myLineCap
Definition: Board2D.h:379
double myLineWidth
Definition: Board2D.h:377

Member Function Documentation

◆ setStyle()

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.

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 }

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().

Field Documentation

◆ myDepth

int DGtal::CustomPen::myDepth

The depth of the shape.

Definition at line 381 of file Board2D.h.

◆ myFillColor

Color DGtal::CustomPen::myFillColor

Definition at line 376 of file Board2D.h.

Referenced by setStyle().

◆ myLineCap

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

The linecap attribute. (The way line terminates.)

Definition at line 379 of file Board2D.h.

Referenced by setStyle().

◆ myLineJoin

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

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

Definition at line 380 of file Board2D.h.

Referenced by setStyle().

◆ myLineStyle

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

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

Definition at line 378 of file Board2D.h.

Referenced by setStyle().

◆ myLineWidth

double DGtal::CustomPen::myLineWidth

Definition at line 377 of file Board2D.h.

Referenced by setStyle().

◆ myPenColor

Color DGtal::CustomPen::myPenColor

Definition at line 375 of file Board2D.h.

Referenced by setStyle().


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