Board  0.9.5
Group.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
27 #ifndef BOARD_GROUP_H
28 #define BOARD_GROUP_H
29 
30 #include "board/ShapeList.h"
31 
32 namespace LibBoard
33 {
34 
40 struct Group : public ShapeList {
41 
42  Group() : _clippingPath(Path::ClosedPath) {}
43 
44  Group(const Group & other) : ShapeList(other), _clippingPath(other._clippingPath) {}
45 
46  ~Group() override;
47 
53  const std::string & name() const override;
54 
55  Group & rotate(double angle, const Point & center) override;
56 
57  Group & rotate(double angle) override;
58 
59  Group rotated(double angle, const Point & center);
60 
61  Group rotated(double angle);
62 
63  Group & translate(double dx, double dy) override;
64 
65  Group translated(double dx, double dy);
66 
67  Group & scale(double sx, double sy) override;
68 
69  Group & scale(double s) override;
70 
71  Group scaled(double sx, double sy);
72 
73  Group scaled(double s);
74 
83  void setClippingRectangle(double x, double y, double width, double height);
84 
90  void setClippingPath(const std::vector<Point> & points);
91 
96  void setClippingPath(const Path & path);
97 
98  void flushPostscript(std::ostream & stream, const TransformEPS & transform) const override;
99 
100  void flushFIG(std::ostream & stream, const TransformFIG & transform, std::map<Color, int> & colormap) const override;
101 
102  void flushSVG(std::ostream & stream, const TransformSVG & transform) const override;
103 
104  void flushTikZ(std::ostream & stream, const TransformTikZ & transform) const override;
105 
106  Group & operator=(const Group & other);
107 
108  Group * clone() const override;
109 
110  Rect boundingBox(LineWidthFlag) const override;
111 
112  using ShapeList::accept;
113 
114  Group * accept(CompositeShapeTransform & transform) const override;
115 
116  Group * accept(const CompositeShapeTransform & transform) const override;
117 
118 private:
119  static const std::string _name;
120  Path _clippingPath;
121  static std::size_t _clippingCount;
122 };
123 
124 // Inline methods and functions
125 
126 } // namespace LibBoard
127 
128 #endif /* BOARD_GROUP_H */
LibBoard::ShapeList::accept
void accept(ShapeVisitor &visitor) override
Accepts a visitor object.
Definition: ShapeList.cpp:457
ShapeList.h
ShapeList class.
LibBoard::Group::scale
Group & scale(double sx, double sy) override
Definition: Group.cpp:77
LibBoard::Group::setClippingPath
void setClippingPath(const std::vector< Point > &points)
Definition: Group.cpp:134
LibBoard::Group::accept
Group * accept(CompositeShapeTransform &transform) const override
Accept a composite shape transform.
Definition: Group.cpp:221
LibBoard::Group::flushSVG
void flushSVG(std::ostream &stream, const TransformSVG &transform) const override
Definition: Group.cpp:183
LibBoard::Group::name
const std::string & name() const override
Definition: Group.cpp:51
LibBoard::Rect
Struct representing a rectangle on the plane.
Definition: Rect.h:39
LibBoard::Group::translate
Group & translate(double dx, double dy) override
Definition: Group.cpp:70
LibBoard::Group::clone
Group * clone() const override
Definition: Group.cpp:247
LibBoard::CompositeShapeTransform
A CompositeShapeTransform may be used to duplicate/transform a composite shape tree.
Definition: ShapeVisitor.h:103
LibBoard::Point
Struct representing a 2D point.
Definition: Point.h:42
LibBoard::Group::setClippingRectangle
void setClippingRectangle(double x, double y, double width, double height)
Definition: Group.cpp:125
LibBoard::TransformEPS
Structure representing a scaling and translation suitable for an EPS output.
Definition: Transforms.h:71
LibBoard::Group::flushTikZ
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const override
Definition: Group.cpp:204
LibBoard::Path
A path, according to Postscript and SVG definition.
Definition: Path.h:45
LibBoard::TransformTikZ
Structure representing a scaling and translation suitable for an TikZ output.
Definition: Transforms.h:126
LibBoard::Group
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition: Group.h:40
LibBoard::Group::rotate
Group & rotate(double angle, const Point &center) override
Definition: Group.cpp:56
LibBoard::TransformFIG
Structure representing a scaling and translation suitable for an XFig output.
Definition: Transforms.h:87
LibBoard::ShapeList
A group of shapes.
Definition: ShapeList.h:46
LibBoard::Shape::center
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition: Shape.cpp:59
LibBoard::Group::flushPostscript
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const override
Definition: Group.cpp:155
LibBoard::Group::boundingBox
Rect boundingBox(LineWidthFlag) const override
Definition: Group.cpp:212
LibBoard::Group::flushFIG
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override
Definition: Group.cpp:173
LibBoard::TransformSVG
Structure representing a scaling and translation suitable for an SVG output.
Definition: Transforms.h:109