27 #ifndef _BOARD_SHAPELIST_H_
28 #define _BOARD_SHAPELIST_H_
43 enum Direction { Top, Right, Bottom, Left };
44 enum Alignment { AlignTop, AlignBottom, AlignCenter, AlignLeft, AlignRight };
52 #if __cplusplus > 201100
71 double dx,
double dy,
double scale );
86 double scaleX,
double scaleY,
96 const std::string &
name()
const;
110 ShapeList translated(
double dx,
double dy );
116 ShapeList scaled(
double sx,
double sy );
131 void flushFIG( std::ostream & stream,
133 std::map<Color,int> & colormap )
const;
135 void flushSVG( std::ostream & stream,
143 virtual int minDepth()
const;
145 virtual int maxDepth()
const;
147 void shiftDepth(
int shift );
182 Alignment alignment );
197 std::size_t columns, std::size_t rows,
198 double spacing = 0.0 );
225 T &
last(
const std::size_t position = 0 );
227 Shape &
last(
const std::size_t position = 0 );
240 static const std::string _name;
244 void addShape(
const Shape & shape,
double scaleFactor );
262 Group(
int depth = -1 )
263 :
ShapeList( depth ), _clippingPath(
true ) { }
266 :
ShapeList( other ), _clippingPath( other._clippingPath ) { }
275 const std::string &
name()
const;
281 Group rotated(
double angle,
const Point & center );
283 Group rotated(
double angle );
287 Group translated(
double dx,
double dy );
293 Group scaled(
double sx,
double sy );
295 Group scaled(
double s );
306 float width,
float height );
325 void flushFIG( std::ostream & stream,
327 std::map<Color,int> & colormap )
const;
329 void flushSVG( std::ostream & stream,
342 static const std::string _name;
344 static std::size_t _clippingCount;
348 #include "ShapeList.ih"
Abstract structure for a 2D shape.
Definition: Shapes.h:56
Group & addTiling(const Shape &shape, Point topLeftCorner, std::size_t columns, std::size_t rows, double spacing=0.0)
Definition: ShapeList.cpp:257
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Definition: ShapeList.cpp:760
Rect boundingBox() const
Definition: ShapeList.cpp:770
void setClippingPath(const std::vector< Point > &points)
Definition: ShapeList.cpp:677
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Definition: ShapeList.cpp:473
virtual Point center() const
Definition: Shapes.cpp:88
ShapeList & operator<<(const Shape &shape)
Definition: ShapeList.cpp:165
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition: ShapeList.h:260
void setClippingRectangle(float x, float y, float width, float height)
Definition: ShapeList.cpp:667
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
Definition: ShapeList.cpp:720
ShapeList & operator+=(const Shape &shape)
Definition: ShapeList.cpp:239
A path, according to Postscript and SVG definition.
Definition: Path.h:41
ShapeList & dup(std::size_t copies=1)
Definition: ShapeList.cpp:226
Struct representing a 2D point.
Definition: Point.h:38
ShapeList & insert(const Shape &shape, int depth)
Definition: ShapeList.cpp:325
Rect boundingBox() const
Definition: ShapeList.cpp:489
void scaleAll(double s)
Definition: ShapeList.cpp:417
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: ShapeList.cpp:457
const std::string & name() const
Definition: ShapeList.cpp:582
ShapeList & rotate(double angle, const Point ¢er)
Definition: ShapeList.cpp:332
ShapeList & append(const Shape &shape, Direction direction, Alignment alignment)
Definition: ShapeList.cpp:282
Group & rotate(double angle, const Point ¢er)
Definition: ShapeList.cpp:588
A group of shapes.
Definition: ShapeList.h:41
ShapeList * clone() const
Definition: ShapeList.cpp:557
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: ShapeList.cpp:737
void free()
Definition: ShapeList.cpp:100
int _nextDepth
Definition: ShapeList.h:247
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
Definition: ShapeList.cpp:442
T & last(const std::size_t position=0)
Definition: ShapeList.h:40
ShapeList & translate(double dx, double dy)
Definition: ShapeList.cpp:363
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: ShapeList.cpp:427
std::vector< Shape * > _shapes
Definition: ShapeList.h:246
const std::string & name() const
Definition: ShapeList.cpp:46
Shape & top()
Definition: ShapeList.cpp:569
Group * clone() const
Definition: ShapeList.cpp:780
Struct representing a rectangle on the plane.
Definition: Rect.h:38
Group & scale(double sx, double sy)
Definition: ShapeList.cpp:612
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: ShapeList.cpp:700
ShapeList & scale(double sx, double sy)
Definition: ShapeList.cpp:381
Group & translate(double dx, double dy)
Definition: ShapeList.cpp:604