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)
 
ShapeWithStyleoperator= (const ShapeWithStyle &other)
 
 ~ShapeWithStyle ()
 
const std::string & name () const
 
Shapeclone () const =0
 
const ColorpenColor () const
 
ShapeWithStylesetPenColor (const Color &)
 
const ColorfillColor () const
 
ShapeWithStylesetFillColor (const Color &)
 
double lineWidth () const
 
ShapeWithStylesetLineWidth (double)
 
LineStyle lineStyle () const
 
ShapeWithStylesetLineStyle (LineStyle)
 
LineCap lineCap () const
 
ShapeWithStylesetLineCap (LineCap)
 
LineJoin lineJoin () const
 
ShapeWithStylesetLineJoin (LineJoin)
 
Style style () const
 
ShapeWithStylesetStyle (const Style &)
 
bool filled () const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape ()
 
virtual ~Shape ()
 
virtual const std::string & name () const
 
virtual Shapeclone () const =0
 
virtual Point center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
 
virtual Shaperotate (double angle, const Point &center)=0
 
virtual Shaperotate (double angle)=0
 
ShaperotateDeg (double angle, const Point &center)
 
ShaperotateDeg (double angle)
 
virtual Shapetranslate (double dx, double dy)=0
 
ShapemoveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
ShapemoveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
virtual Shapescale (double sx, double sy)=0
 
virtual Shapescale (double s)=0
 
Shaperesize (double width, double height, LineWidthFlag lineWidthFlag)
 
ShapescaleToWidth (double w, LineWidthFlag lineWidthFlag)
 
ShapescaleToHeight (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 Shapeaccept (CompositeShapeTransform &transform) const
 Accept a composite shape transform.
 
virtual Shapeaccept (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: