Board 0.9.6
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LibBoard::ShapeList Struct Reference

A group of shapes. More...

#include <ShapeList.h>

Inheritance diagram for LibBoard::ShapeList:
LibBoard::Shape LibBoard::Board LibBoard::Group

Classes

struct  BreadthFirstIterator
 The BreadthFirstIterator struct allows to traverse the shape tree using a breadth-first strategy. More...
 
struct  DepthFirstIterator
 The DepthFirstIterator struct allows to traverse the shape tree using a depth-first strategy. More...
 
struct  TopLevelConstIterator
 The TopLevelConstIterator struct. More...
 
struct  TopLevelIterator
 The TopLevelIterator struct. More...
 

Public Types

typedef std::vector< Shape * >::size_type size_type
 

Public Member Functions

 ShapeList ()
 
 ShapeList (const ShapeList &other)
 
ShapeListoperator= (const ShapeList &other)
 
 ShapeList (ShapeList &&other)
 
ShapeListoperator= (ShapeList &&other)
 
 ShapeList (const Shape &shape, unsigned int times, double dx, double dy, double scale)
 
 ShapeList (const Shape &shape, unsigned int times, double dx, double dy, double scaleX, double scaleY, double angle)
 
template<typename S >
 ShapeList (const std::vector< S > &shapes)
 
 ~ShapeList () override
 
const std::string & name () const override
 
ShapeListclear ()
 
ShapeListrotate (double angle, const Point &center) override
 
ShapeList rotated (double angle, const Point &center)
 
ShapeListrotate (double angle) override
 
ShapeList rotated (double angle)
 
ShapeListtranslate (double dx, double dy) override
 
ShapeList translated (double dx, double dy)
 
ShapeListscale (double sx, double sy) override
 
ShapeListscale (double s) override
 
ShapeList scaled (double sx, double sy) const
 
ShapeList scaled (double s) const
 
void scaleAll (double s) override
 
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const override
 
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override
 
void flushSVG (std::ostream &stream, const TransformSVG &transform) const override
 
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const override
 
Rect boundingBox (LineWidthFlag) const override
 
ShapeListclone () const override
 
ShapeListpush_back (Shape *shape)
 
ShapeListoperator<< (const Shape &shape)
 
template<typename S >
ShapeListoperator<< (const std::vector< S > &shapes)
 
ShapeListoperator+= (const Shape &shape)
 
ShapeListappend (const Shape &shape, Direction direction=Direction::Right, Alignment alignment=Alignment::Center, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
 
void addRepeated (const Shape &shape, unsigned int times, double dx, double dy, double scaleX=1.0, double scaleY=1.0, double angle=0.0)
 
ShapeListduplicateLast (std::size_t copies=1)
 
template<typename T >
T & last (const std::size_t position=0)
 
Shapelast (const std::size_t position=0)
 
template<typename T >
T & topLevelFindLast (std::size_t position=0)
 
Shapetop ()
 
void accept (ShapeVisitor &visitor) override
 Accepts a visitor object.
 
void accept (const ShapeVisitor &visitor) override
 Accepts a visitor object.
 
void accept (ConstShapeVisitor &visitor) const override
 Accepts a const-shape visitor object.
 
void accept (const ConstShapeVisitor &visitor) const override
 Accepts a const-shape visitor object.
 
Shapeaccept (CompositeShapeTransform &transform) const override
 Accept a composite shape transform.
 
Shapeaccept (const CompositeShapeTransform &transform) const override
 Accept a constant composite shape transform.
 
TopLevelIterator begin ()
 begin
 
TopLevelIterator end ()
 end
 
TopLevelConstIterator begin () const
 begin
 
TopLevelConstIterator cbegin () const
 cbegin
 
TopLevelConstIterator end () const
 end
 
TopLevelConstIterator cend () const
 cend
 
DepthFirstIterator depthFirstBegin ()
 depthFirstBegin
 
DepthFirstIterator depthFirstEnd ()
 depthFirstEnd
 
BreadthFirstIterator breadthFirstBegin ()
 breadthFirstBegin
 
BreadthFirstIterator breadthFirstEnd ()
 breadthFirstEnd
 
std::size_t deepSize () const
 Recursively counts the number of shapes in the list.
 
std::size_t size () const
 The number of shapes in the list (at top level).
 
- 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)
 

Protected Member Functions

void addShape (const Shape &shape, double scaleFactor)
 
void deleteShapes ()
 

Protected Attributes

std::vector< Shape * > _shapes
 

Detailed Description

A group of shapes.

The ShapeList structure.

Examples
examples/bezier.cpp, examples/example4.cpp, examples/images.cpp, examples/rough.cpp, examples/stroke_path.cpp, and examples/traversal.cpp.

Member Typedef Documentation

◆ size_type

typedef std::vector<Shape*>::size_type LibBoard::ShapeList::size_type

Constructor & Destructor Documentation

◆ ShapeList() [1/6]

LibBoard::ShapeList::ShapeList ( )
inline

◆ ShapeList() [2/6]

LibBoard::ShapeList::ShapeList ( const ShapeList other)

References _shapes, and end().

◆ ShapeList() [3/6]

LibBoard::ShapeList::ShapeList ( ShapeList &&  other)

References _shapes.

◆ ShapeList() [4/6]

LibBoard::ShapeList::ShapeList ( const Shape shape,
unsigned int  times,
double  dx,
double  dy,
double  scale 
)

Create a ShapeList by repeating a shape (translation & scaling)

Parameters
shapeThe shape to be repeated.
timesThe number of repetitions.
dxThe x shift between two repetitions.
dyThe y shift between two repetitions.
scaleThe scaling factor between two repetitions.

References LibBoard::Shape::clone(), scale(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().

◆ ShapeList() [5/6]

LibBoard::ShapeList::ShapeList ( const Shape shape,
unsigned int  times,
double  dx,
double  dy,
double  scaleX,
double  scaleY,
double  angle 
)

Create a ShapeList by repeating a shape (translation, scaling & rotation)

Parameters
shapeThe shape to be repeated.
timesThe number of repetitions.
dxThe x shift between two repetitions.
dyThe y shift between two repetitions.
scaleXThe x scaling factor between two repetitions.
scaleYThe y scaling factor between two repetitions.
angleThe rotation angle between two repetitions.

References LibBoard::Shape::clone(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().

◆ ShapeList() [6/6]

template<typename S >
LibBoard::ShapeList::ShapeList ( const std::vector< S > &  shapes)

Construct a ShapeList from a vector of shapes

Parameters
shapesA vector of shapes

◆ ~ShapeList()

LibBoard::ShapeList::~ShapeList ( )
override

References deleteShapes().

Member Function Documentation

◆ accept() [1/6]

Shape * LibBoard::ShapeList::accept ( CompositeShapeTransform transform) const
overridevirtual

Accept a composite shape transform.

Parameters
transformA composite shape transform object.

Reimplemented from LibBoard::Shape.

References _shapes, push_back(), and ShapeList().

◆ accept() [2/6]

Shape * LibBoard::ShapeList::accept ( const CompositeShapeTransform transform) const
overridevirtual

Accept a constant composite shape transform.

Parameters
transformA constant composite shape transform object..

Reimplemented from LibBoard::Shape.

References _shapes, push_back(), and ShapeList().

◆ accept() [3/6]

void LibBoard::ShapeList::accept ( const ConstShapeVisitor visitor) const
overridevirtual

Accepts a const-shape visitor object.

Parameters
visitorA const-shape visitor object.

Reimplemented from LibBoard::Shape.

References _shapes, LibBoard::Shape::accept(), and end().

◆ accept() [4/6]

void LibBoard::ShapeList::accept ( const ShapeVisitor visitor)
overridevirtual

Accepts a visitor object.

Parameters
visitorA visitor object.

Reimplemented from LibBoard::Shape.

References _shapes, accept(), and end().

◆ accept() [5/6]

void LibBoard::ShapeList::accept ( ConstShapeVisitor visitor) const
overridevirtual

Accepts a const-shape visitor object.

Parameters
visitorA const-shape visitor object.

Reimplemented from LibBoard::Shape.

References _shapes, LibBoard::Shape::accept(), and end().

◆ accept() [6/6]

void LibBoard::ShapeList::accept ( ShapeVisitor visitor)
overridevirtual

Accepts a visitor object.

Parameters
visitorA visitor object.

Reimplemented from LibBoard::Shape.

References _shapes, accept(), and end().

Referenced by accept(), accept(), deepSize(), and LibBoard::Board::saveFIG().

◆ addRepeated()

void LibBoard::ShapeList::addRepeated ( const Shape shape,
unsigned int  times,
double  dx,
double  dy,
double  scaleX = 1.0,
double  scaleY = 1.0,
double  angle = 0.0 
)

Add a repeated shape (with translation, scaling & rotation)

Parameters
shapeThe shape to be repeated.
timesThe number of repetitions.
dxThe x shift between two repetitions.
dyThe y shift between two repetitions.
scaleXThe x scaling factor between two repetitions.
scaleYThe y scaling factor between two repetitions.
angleThe rotation angle between two repetitions.

References LibBoard::Shape::clone(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().

◆ addShape()

void LibBoard::ShapeList::addShape ( const Shape shape,
double  scaleFactor 
)
protected

◆ append()

ShapeList & LibBoard::ShapeList::append ( const Shape shape,
Direction  direction = Direction::Right,
Alignment  alignment = Alignment::Center,
double  margin = 0.0,
LineWidthFlag  lineWidthFlag = UseLineWidth 
)

Append a shape beside the shapelist.

Parameters
shapeA shape.
directionThe direction where the shape should be appended.
alignmentThe alignement with the current shapelist.
marginA margin between the shapelist and the shape.
lineWidthFlagShould the line width be considered when computing bounding boxes.
Returns
The shapelist itself, after the shape has been appended.
Examples
examples/Huffman.cpp, examples/array.cpp, examples/bezier.cpp, examples/board_font_text.cpp, examples/holes.cpp, examples/interpolate.cpp, examples/rough.cpp, examples/stroke_path.cpp, examples/tilings.cpp, examples/traversal.cpp, and examples/xkcd.cpp.

References _shapes, LibBoard::Bottom, LibBoard::Rect::bottom(), LibBoard::Shape::boundingBox(), boundingBox(), LibBoard::Center, LibBoard::Rect::center(), LibBoard::Shape::clone(), LibBoard::Tools::error, LibBoard::Rect::height, LibBoard::Left, LibBoard::Rect::left, LibBoard::Shape::moveCenter(), LibBoard::Right, LibBoard::Rect::right(), LibBoard::Top, LibBoard::Rect::top, LibBoard::Rect::width, LibBoard::Point::x, and LibBoard::Point::y.

Referenced by ell(), findAll(), generateGroup(), hachures(), LeaveBox(), main(), polygons(), rough(), and text().

◆ begin() [1/2]

ShapeList::TopLevelIterator LibBoard::ShapeList::begin ( )
inline

begin

Returns
An iterator referencing the first shape of the ShapeList.

References _shapes.

Referenced by LibBoard::ShapeList::BreadthFirstIterator::BreadthFirstIterator(), and LibBoard::ShapeList::DepthFirstIterator::DepthFirstIterator().

◆ begin() [2/2]

ShapeList::TopLevelConstIterator LibBoard::ShapeList::begin ( ) const
inline

begin

Returns
A const iterator referencing the first shape of the ShapeList.

References _shapes.

◆ boundingBox()

Rect LibBoard::ShapeList::boundingBox ( LineWidthFlag  ) const
overridevirtual

◆ breadthFirstBegin()

ShapeList::BreadthFirstIterator LibBoard::ShapeList::breadthFirstBegin ( )
inline

breadthFirstBegin

Returns
A breadth-first iterator at the begining of the ShapeList shapes.
Examples
examples/traversal.cpp.

Referenced by main().

◆ breadthFirstEnd()

ShapeList::BreadthFirstIterator LibBoard::ShapeList::breadthFirstEnd ( )
inline

breadthFirstEnd

Returns
A breadth-first iterator at the end of the ShapeList shapes.
Examples
examples/traversal.cpp.

Referenced by main().

◆ cbegin()

ShapeList::TopLevelConstIterator LibBoard::ShapeList::cbegin ( ) const
inline

cbegin

Returns
A const iterator referencing the first shape of the ShapeList.

References _shapes.

◆ cend()

ShapeList::TopLevelConstIterator LibBoard::ShapeList::cend ( ) const
inline

cend

Returns
A const iterator pointing at the end of the ShapeList.

References _shapes.

◆ clear()

ShapeList & LibBoard::ShapeList::clear ( )

Remove all shapes from the list.

Returns
The ShapeList itself
Examples
examples/bezier.cpp, examples/example4.cpp, and examples/stroke_path.cpp.

References _shapes, and deleteShapes().

Referenced by LibBoard::Board::clear(), LibBoard::Board::clear(), main(), and merge().

◆ clone()

ShapeList * LibBoard::ShapeList::clone ( ) const
overridevirtual

Return a copy of the shape.

Returns
A copy of the shape.

Implements LibBoard::Shape.

References ShapeList().

Referenced by LibBoard::Board::fillRectangle().

◆ deepSize()

std::size_t LibBoard::ShapeList::deepSize ( ) const

Recursively counts the number of shapes in the list.

Returns
The total number of shapes in the
Examples
examples/traversal.cpp.

References accept(), and LibBoard::ShapeCounter::value().

Referenced by main().

◆ deleteShapes()

void LibBoard::ShapeList::deleteShapes ( )
protected

Free the memory used by the shapes in the shape vector.

References _shapes.

Referenced by clear(), LibBoard::Board::operator=(), operator=(), operator=(), and ~ShapeList().

◆ depthFirstBegin()

ShapeList::DepthFirstIterator LibBoard::ShapeList::depthFirstBegin ( )
inline

depthFirstBegin

Returns
A depth-first iterator at the begining of the ShapeList shapes.
Examples
examples/traversal.cpp.

Referenced by main().

◆ depthFirstEnd()

ShapeList::DepthFirstIterator LibBoard::ShapeList::depthFirstEnd ( )
inline

depthFirstEnd

Returns
A depth-first iterator at the end of the ShapeList shapes.
Examples
examples/traversal.cpp.

Referenced by main().

◆ duplicateLast()

ShapeList & LibBoard::ShapeList::duplicateLast ( std::size_t  copies = 1)

Duplicates the last inserted shape.

Parameters
copiesThe number of copies.

References _shapes, and LibBoard::Tools::warning.

◆ end() [1/2]

ShapeList::TopLevelIterator LibBoard::ShapeList::end ( )
inline

◆ end() [2/2]

ShapeList::TopLevelConstIterator LibBoard::ShapeList::end ( ) const
inline

end

Returns
A const iterator pointing at the end of the ShapeList.

References _shapes.

◆ flushFIG()

void LibBoard::ShapeList::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const
overridevirtual

Write the FIG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.
colormap

Implements LibBoard::Shape.

References _shapes.

Referenced by LibBoard::Group::flushFIG().

◆ flushPostscript()

void LibBoard::ShapeList::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
overridevirtual

Write the EPS code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References _shapes.

Referenced by LibBoard::Group::flushPostscript().

◆ flushSVG()

void LibBoard::ShapeList::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
overridevirtual

Write the SVG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References _shapes.

Referenced by LibBoard::Group::flushSVG().

◆ flushTikZ()

void LibBoard::ShapeList::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
overridevirtual

Write the TikZ code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References _shapes.

Referenced by LibBoard::Group::flushTikZ().

◆ last() [1/2]

template<typename T >
T & LibBoard::ShapeList::last ( const std::size_t  position = 0)

Return the last inserted shape with its actual type.

Parameters
positionThe position. 0 is the last inserted shape, 1 is the one before, etc.
Returns
A reference to the addressed shape.
Examples
examples/array.cpp, examples/arrows.cpp, examples/ellipse.cpp, examples/example2.cpp, examples/holes.cpp, examples/logo.cpp, examples/ruler.cpp, examples/test_arrow.cpp, and examples/traversal.cpp.

References _shapes, and LibBoard::Tools::error.

Referenced by main().

◆ last() [2/2]

Shape & LibBoard::ShapeList::last ( const std::size_t  position = 0)

Return a reference to the last inserted Shape.

Parameters
positionThe position. 0 is the last inserted shape, 1 is the one before, etc.
Returns
A reference to the addressed shape.

◆ name()

const std::string & LibBoard::ShapeList::name ( ) const
overridevirtual

Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)

Returns

Reimplemented from LibBoard::Shape.

Examples
examples/traversal.cpp.

Referenced by main(), and topLevelFindLast().

◆ operator+=()

ShapeList & LibBoard::ShapeList::operator+= ( const Shape shape)

Adds a shape to the list of shape, always preserving the shape's depth.

Parameters
shape
Returns

References _shapes, LibBoard::Shape::clone(), and end().

◆ operator<<() [1/2]

ShapeList & LibBoard::ShapeList::operator<< ( const Shape shape)

Adds a shape to the shape list. If the shape has no given depth or is a compound shape (ShapeList) then it is placed on top of the shapes stack. Otherwise, the shape depth is left unchanged.

Parameters
shape
Returns

References _shapes, and LibBoard::Shape::clone().

Referenced by LibBoard::Board::operator<<().

◆ operator<<() [2/2]

template<typename S >
ShapeList & LibBoard::ShapeList::operator<< ( const std::vector< S > &  shapes)

Add of shapes from a vector to the shape list.

◆ operator=() [1/2]

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

References _shapes, deleteShapes(), and end().

Referenced by LibBoard::Group::operator=().

◆ operator=() [2/2]

ShapeList & LibBoard::ShapeList::operator= ( ShapeList &&  other)

References _shapes, and deleteShapes().

◆ push_back()

ShapeList & LibBoard::ShapeList::push_back ( Shape shape)

Add a shape to the list, taking ownership.

Parameters
shapeThe shape to be inserted.
Returns
The shapelist itself.
Examples
examples/Julia.cpp, examples/board_font_text.cpp, examples/example1.cpp, examples/example2.cpp, and examples/triangles.cpp.

References _shapes.

Referenced by LibBoard::Group::accept(), accept(), LibBoard::Group::accept(), accept(), julia(), main(), LibBoard::makeRough(), and text().

◆ rotate() [1/2]

ShapeList & LibBoard::ShapeList::rotate ( double  angle)
overridevirtual

Rotate the shape list around its bounding box's center.

Parameters
angleRotation angle in radian
Returns
The ShapeList itself.

Implements LibBoard::Shape.

◆ rotate() [2/2]

ShapeList & LibBoard::ShapeList::rotate ( double  angle,
const Point center 
)
overridevirtual

Rotate the shape around a given center of rotation.

Parameters
angleThe rotation angle in radian.
centerThe center of rotation.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

References _shapes, and end().

Referenced by LibBoard::Group::accept(), LibBoard::Group::accept(), LibBoard::Board::rotate(), LibBoard::Group::rotate(), LibBoard::Board::rotate(), and LibBoard::Group::rotate().

◆ rotated() [1/2]

ShapeList LibBoard::ShapeList::rotated ( double  angle)

Get a rotated copy of the shape list around its bounding box's center.

Parameters
angleRotation angle in radian
Returns
Rotated copy of the ShapeList object.

References LibBoard::Shape::center(), and ShapeList().

◆ rotated() [2/2]

ShapeList LibBoard::ShapeList::rotated ( double  angle,
const Point center 
)

Get a rotated copy of the shape list around a specified rotation center.

Parameters
angleRotation angle in radian
centerCenter of rotation
Returns
Rotated copy of the ShapeList object.
Examples
examples/bezier.cpp, and examples/example4.cpp.

Referenced by main().

◆ scale() [1/2]

ShapeList & LibBoard::ShapeList::scale ( double  s)
overridevirtual

Scale the shape list.

Parameters
sThe scaling factor
Returns
The ShapeList itself.

Implements LibBoard::Shape.

References scale().

◆ scale() [2/2]

ShapeList & LibBoard::ShapeList::scale ( double  sx,
double  sy 
)
overridevirtual

Scale the shape list in X and Y directions.

Parameters
sxx scaling factor
syy scaling factor
Returns
The ShapeList itself.

Implements LibBoard::Shape.

Examples
examples/traversal.cpp.

References _shapes, LibBoard::Shape::center(), end(), translate(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by main(), LibBoard::Board::scale(), LibBoard::Group::scale(), scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), and ShapeList().

◆ scaleAll()

void LibBoard::ShapeList::scaleAll ( double  s)
overridevirtual

Scales all the values (positions, dimensions, etc.) associated with the shape.

Parameters
sThe scaling factor.

Implements LibBoard::Shape.

References _shapes, end(), and scaleAll().

Referenced by scaleAll().

◆ scaled() [1/2]

ShapeList LibBoard::ShapeList::scaled ( double  s) const

Get a scaled copy of the shape list.

Parameters
sscaling factor
Returns
Scaled copy of the ShapeList object.

References ShapeList().

◆ scaled() [2/2]

ShapeList LibBoard::ShapeList::scaled ( double  sx,
double  sy 
) const

Get a scaled copy of the shape list.

Parameters
sxx scaling factor
syy scaling factor
Returns
Scaled copy of the ShapeList object.
Examples
examples/bezier.cpp.

References ShapeList().

Referenced by LibBoard::boardFontText(), and main().

◆ size()

std::size_t LibBoard::ShapeList::size ( ) const
inline

◆ top()

Shape & LibBoard::ShapeList::top ( )

Convenience function that simply calls last(0).

Returns
A reference to the last inserted shape

Referenced by LibBoard::Board::drawRectangle(), and LibBoard::Board::fillRectangle().

◆ topLevelFindLast()

template<typename T >
T & LibBoard::ShapeList::topLevelFindLast ( std::size_t  position = 0)

Find the n-th most recently inserted shape with type T.

Returns
A reference to the n-th most recently inserted shape with type T.
Examples
examples/traversal.cpp.

References _shapes, and name().

Referenced by findAll().

◆ translate()

ShapeList & LibBoard::ShapeList::translate ( double  dx,
double  dy 
)
overridevirtual

Translate the shape list.

Parameters
dxx shift value
dyy shift value
Returns
The ShapeList itself.

Implements LibBoard::Shape.

Examples
examples/example4.cpp.

References _shapes, and end().

Referenced by LibBoard::boardFontText(), main(), scale(), LibBoard::Board::translate(), and LibBoard::Group::translate().

◆ translated()

ShapeList LibBoard::ShapeList::translated ( double  dx,
double  dy 
)

Get a translated copy of the shape list.

Parameters
dxx shift value
dyy shift value
Returns
Translated copy of the ShapeList object.
Examples
examples/bezier.cpp.

Referenced by main().

Member Data Documentation

◆ _shapes

std::vector<Shape *> LibBoard::ShapeList::_shapes
protected

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