27 #ifndef _BOARD_SHAPELIST_H_
28 #define _BOARD_SHAPELIST_H_
33 #if __cplusplus<201100
47 enum Direction { Top, Right, Bottom, Left };
48 enum Alignment { AlignTop, AlignBottom, AlignCenter, AlignLeft, AlignRight };
56 #if __cplusplus > 201100
91 double scaleX,
double scaleY,
101 const std::string &
name()
const;
115 ShapeList translated(
double dx,
double dy );
121 ShapeList scaled(
double sx,
double sy );
136 void flushFIG( std::ostream & stream,
138 std::map<Color,int> & colormap )
const;
140 void flushSVG( std::ostream & stream,
148 virtual int minDepth()
const;
150 virtual int maxDepth()
const;
152 void shiftDepth(
int shift );
191 LineWidthFlag lineWidthFlag = UseLineWidth );
210 double spacing = 0.0,
211 LineWidthFlag lineWidthFlag = UseLineWidth );
225 double dx,
double dy,
226 double scaleX = 1.0,
double scaleY = 1.0,
227 double angle = 0.0 );
255 T &
last(
const std::size_t position = 0 );
257 Shape &
last(
const std::size_t position = 0 );
284 static const std::string _name;
288 void addShape(
const Shape & shape,
double scaleFactor );
306 Group(
int depth = -1 )
307 :
ShapeList( depth ), _clippingPath(
true ) { }
310 :
ShapeList( other ), _clippingPath( other._clippingPath ) { }
319 const std::string &
name()
const;
325 Group rotated(
double angle,
const Point & center );
327 Group rotated(
double angle );
331 Group translated(
double dx,
double dy );
337 Group scaled(
double sx,
double sy );
339 Group scaled(
double s );
350 float width,
float height );
369 void flushFIG( std::ostream & stream,
371 std::map<Color,int> & colormap )
const;
373 void flushSVG( std::ostream & stream,
386 static const std::string _name;
388 static std::size_t _clippingCount;
392 #include "ShapeList.ih"
397 #if __cplusplus<201100
Abstract structure for a 2D shape.
Definition: Shapes.h:62
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Definition: ShapeList.cpp:803
void setClippingPath(const std::vector< Point > &points)
Definition: ShapeList.cpp:720
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Definition: ShapeList.cpp:497
ShapeList & operator<<(const Shape &shape)
Definition: ShapeList.cpp:167
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition: ShapeList.h:304
void setClippingRectangle(float x, float y, float width, float height)
Definition: ShapeList.cpp:710
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
Definition: ShapeList.cpp:763
ShapeList & operator+=(const Shape &shape)
Definition: ShapeList.cpp:241
A path, according to Postscript and SVG definition.
Definition: Path.h:41
void repeat(const Shape &shape, unsigned int times, double dx, double dy, double scaleX=1.0, double scaleY=1.0, double angle=0.0)
Definition: ShapeList.cpp:286
ShapeList & dup(std::size_t copies=1)
Definition: ShapeList.cpp:228
Struct representing a 2D point.
Definition: Point.h:39
ShapeList & insert(const Shape &shape, int depth)
Definition: ShapeList.cpp:349
void scaleAll(double s)
Definition: ShapeList.cpp:441
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: ShapeList.cpp:481
const std::string & name() const
Definition: ShapeList.cpp:625
ShapeList & rotate(double angle, const Point ¢er)
Definition: ShapeList.cpp:356
ShapeList & append(const Shape &shape, Direction direction, Alignment alignment, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
Definition: ShapeList.cpp:299
Group & rotate(double angle, const Point ¢er)
Definition: ShapeList.cpp:631
Group & addTiling(const Shape &shape, Point topLeftCorner, std::size_t columns, std::size_t rows, double spacing=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
Definition: ShapeList.cpp:259
A group of shapes.
Definition: ShapeList.h:45
ShapeList * clone() const
Definition: ShapeList.cpp:581
virtual void accept(ShapeVisitor &visitor)
Accepts a visitor object.
Definition: ShapeList.cpp:599
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: ShapeList.cpp:780
void free()
Definition: ShapeList.cpp:102
int _nextDepth
Definition: ShapeList.h:291
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Rect boundingBox(LineWidthFlag) const
Definition: ShapeList.cpp:813
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
Definition: ShapeList.cpp:466
T & last(const std::size_t position=0)
Definition: ShapeList.h:40
ShapeList & translate(double dx, double dy)
Definition: ShapeList.cpp:387
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: ShapeList.cpp:451
Rect boundingBox(LineWidthFlag) const
Definition: ShapeList.cpp:513
std::vector< Shape * > _shapes
Definition: ShapeList.h:290
const std::string & name() const
Definition: ShapeList.cpp:47
Shape & top()
Definition: ShapeList.cpp:593
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition: Shapes.cpp:101
Group * clone() const
Definition: ShapeList.cpp:823
Definition: ShapeVisitor.h:40
Struct representing a rectangle on the plane.
Definition: Rect.h:38
Group & scale(double sx, double sy)
Definition: ShapeList.cpp:655
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: ShapeList.cpp:743
ShapeList & scale(double sx, double sy)
Definition: ShapeList.cpp:405
Group & translate(double dx, double dy)
Definition: ShapeList.cpp:647