Board  0.9.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LibBoard::ShapeWithStyle Struct Referenceabstract

Abstract structure for a 2D shape. More...

#include <ShapeWithStyle.h>

Inheritance diagram for LibBoard::ShapeWithStyle:
LibBoard::Shape LibBoard::Bezier LibBoard::Dot LibBoard::Ellipse LibBoard::Line LibBoard::Polyline LibBoard::Text LibBoard::Arrow LibBoard::GouraudTriangle

Public Member Functions

 ShapeWithStyle (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join)
 
 ShapeWithStyle (const Style &style)
 
 ShapeWithStyle (const ShapeWithStyle &other)
 
ShapeWithStyle & operator= (const ShapeWithStyle &other)
 
 ~ShapeWithStyle ()
 
const std::string & name () const
 
Shape * clone () const =0
 
const Color & penColor () const
 
ShapeWithStyle & setPenColor (const Color &)
 
const Color & fillColor () const
 
ShapeWithStyle & setFillColor (const Color &)
 
double lineWidth () const
 
ShapeWithStyle & setLineWidth (double)
 
LineStyle lineStyle () const
 
ShapeWithStyle & setLineStyle (LineStyle)
 
LineCap lineCap () const
 
ShapeWithStyle & setLineCap (LineCap)
 
LineJoin lineJoin () const
 
ShapeWithStyle & setLineJoin (LineJoin)
 
Style style () const
 
ShapeWithStyle & setStyle (const Style &)
 
bool filled () const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape ()
 
virtual ~Shape ()
 
virtual Point center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
 
virtual Shape & rotate (double angle, const Point &center)=0
 
virtual Shape & rotate (double angle)=0
 
Shape & rotateDeg (double angle, const Point &center)
 
Shape & rotateDeg (double angle)
 
virtual Shape & translate (double dx, double dy)=0
 
Shape & moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
Shape & moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
virtual Shape & scale (double sx, double sy)=0
 
virtual Shape & scale (double s)=0
 
Shape & resize (double width, double height, LineWidthFlag lineWidthFlag)
 
Shape & scaleToWidth (double w, LineWidthFlag lineWidthFlag)
 
Shape & scaleToHeight (double h, LineWidthFlag lineWidthFlag)
 
virtual Rect boundingBox (LineWidthFlag) const =0
 
Rect bbox (LineWidthFlag) const
 
virtual void scaleAll (double s)=0
 
virtual void flushPostscript (std::ostream &stream, const TransformEPS &transform) const =0
 
virtual void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const =0
 
virtual void flushSVG (std::ostream &stream, const TransformSVG &transform) const =0
 
virtual void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const =0
 
virtual void accept (ShapeVisitor &visitor)
 Accepts a visitor object. More...
 
virtual void accept (const ShapeVisitor &visitor)
 Accepts a visitor object. More...
 
virtual void accept (ConstShapeVisitor &visitor) const
 Accepts a const-shape visitor object. More...
 
virtual void accept (const ConstShapeVisitor &visitor) const
 Accepts a const-shape visitor object. More...
 
virtual Shape * accept (CompositeShapeTransform &transform) const
 Accept a composite shape transform. More...
 
virtual Shape * accept (const CompositeShapeTransform &transform) const
 Accept a constant composite shape transform. More...
 
 Shape (const Shape &other)
 

Static Public Member Functions

static void setLineWidthScaling (bool)
 

Protected Member Functions

void updateLineWidth (double s)
 

Protected Attributes

Style _style
 

Detailed Description

Abstract structure for a 2D shape.

ShapeWithStyle structure.

Constructor & Destructor Documentation

◆ ShapeWithStyle() [1/2]

LibBoard::ShapeWithStyle::ShapeWithStyle ( Color  penColor,
Color  fillColor,
double  lineWidth,
LineStyle  style,
const LineCap  cap,
const LineJoin  join 
)
inline

ShapeWithStyle constructor.

Parameters
penColorThe pen color of the shape.
fillColorThe fill color of the shape.
lineWidthThe line thickness.
styleThe line style.
capThe line cap style.
joinThe line join style.

◆ ShapeWithStyle() [2/2]

LibBoard::ShapeWithStyle::ShapeWithStyle ( const Style &  style)
inline

ShapeWithStyle constructor.

Parameters
styleStyle properties

◆ ~ShapeWithStyle()

LibBoard::ShapeWithStyle::~ShapeWithStyle ( )

Shape destructor.

Member Function Documentation

◆ clone()

Shape* LibBoard::ShapeWithStyle::clone ( ) const
pure virtual

Return a copy of the shape.

Returns
A copy of the shape.

Implements LibBoard::Shape.

Implemented in LibBoard::GouraudTriangle, LibBoard::Bezier, LibBoard::Polyline, LibBoard::Arrow, LibBoard::Text, LibBoard::Dot, LibBoard::Ellipse, and LibBoard::Line.

◆ filled()

bool LibBoard::ShapeWithStyle::filled ( ) const
inline

Checks whether a shape is filled with a color or not.

Returns
true if the shape is filled.

Referenced by LibBoard::Ellipse::flushFIG(), LibBoard::Ellipse::flushPostscript(), and LibBoard::Polyline::flushPostscript().

◆ name()

const std::string & LibBoard::ShapeWithStyle::name ( ) const
virtual
Returns
"ShapeWithStyle"

Reimplemented from LibBoard::Shape.

Reimplemented in LibBoard::Text.

◆ setLineWidthScaling()

void LibBoard::ShapeWithStyle::setLineWidthScaling ( bool  on)
static

Globally enable/disable linewidth scaling when using scale functions.

Referenced by LibBoard::Board::disableLineWidthScaling(), LibBoard::Board::enableLineWidthScaling(), and LibBoard::Board::setLineWidthScaling().


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