Board 0.9.6
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 const std::string & name () const
 
virtual Shape * clone () const =0
 
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.
 
virtual void accept (const ShapeVisitor &visitor)
 Accepts a visitor object.
 
virtual void accept (ConstShapeVisitor &visitor) const
 Accepts a const-shape visitor object.
 
virtual void accept (const ConstShapeVisitor &visitor) const
 Accepts a const-shape visitor object.
 
virtual Shape * accept (CompositeShapeTransform &transform) const
 Accept a composite shape transform.
 
virtual Shape * accept (const CompositeShapeTransform &transform) const
 Accept a constant composite shape transform.
 
 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/3]

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/3]

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

ShapeWithStyle constructor.

Parameters
styleStyle properties

◆ ShapeWithStyle() [3/3]

LibBoard::ShapeWithStyle::ShapeWithStyle ( const ShapeWithStyle &  other)

◆ ~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::Arrow, LibBoard::Bezier, LibBoard::Dot, LibBoard::Ellipse, LibBoard::Line, LibBoard::Polyline, LibBoard::GouraudTriangle, and LibBoard::Text.

◆ fillColor()

const Color & LibBoard::ShapeWithStyle::fillColor ( ) const
inline

◆ 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.

References fillColor(), and LibBoard::Color::Null.

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

◆ lineCap()

LineCap LibBoard::ShapeWithStyle::lineCap ( ) const
inline

◆ lineJoin()

LineJoin LibBoard::ShapeWithStyle::lineJoin ( ) const
inline

◆ lineStyle()

LineStyle LibBoard::ShapeWithStyle::lineStyle ( ) const
inline

◆ lineWidth()

double LibBoard::ShapeWithStyle::lineWidth ( ) const
inline

◆ name()

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

Reimplemented from LibBoard::Shape.

Reimplemented in LibBoard::Text.

◆ operator=()

ShapeWithStyle & LibBoard::ShapeWithStyle::operator= ( const ShapeWithStyle &  other)

References _style.

◆ penColor()

const Color & LibBoard::ShapeWithStyle::penColor ( ) const
inline

◆ setFillColor()

ShapeWithStyle & LibBoard::ShapeWithStyle::setFillColor ( const Color &  color)
inline

◆ setLineCap()

ShapeWithStyle & LibBoard::ShapeWithStyle::setLineCap ( LineCap  cap)
inline

References _style, and LibBoard::Style::lineCap.

◆ setLineJoin()

ShapeWithStyle & LibBoard::ShapeWithStyle::setLineJoin ( LineJoin  join)
inline

◆ setLineStyle()

ShapeWithStyle & LibBoard::ShapeWithStyle::setLineStyle ( LineStyle  style)
inline

◆ setLineWidth()

ShapeWithStyle & LibBoard::ShapeWithStyle::setLineWidth ( double  width)
inline

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

◆ setPenColor()

ShapeWithStyle & LibBoard::ShapeWithStyle::setPenColor ( const Color &  color)
inline

References _style, and LibBoard::Style::penColor.

Referenced by ell().

◆ setStyle()

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

References _style, and style().

◆ style()

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

◆ updateLineWidth()

void LibBoard::ShapeWithStyle::updateLineWidth ( double  s)
inlineprotected

Member Data Documentation

◆ _style

Style LibBoard::ShapeWithStyle::_style
protected

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