Board 0.9.6
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
32namespace LibBoard
33{
34
40struct Group : public ShapeList {
41
42 Group() : _clippingPath(Path::Closed) {}
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
118private:
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 */
ShapeList class.
Definition Board.h:55
LineWidthFlag
Definition Style.h:57
A CompositeShapeTransform may be used to duplicate/transform a composite shape tree.
Definition ShapeVisitor.h:104
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
Group()
Definition Group.h:42
const std::string & name() const override
Definition Group.cpp:51
void setClippingRectangle(double x, double y, double width, double height)
Definition Group.cpp:125
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const override
Definition Group.cpp:155
Group(const Group &other)
Definition Group.h:44
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const override
Definition Group.cpp:204
Group * accept(CompositeShapeTransform &transform) const override
Accept a composite shape transform.
Definition Group.cpp:221
Group rotated(double angle, const Point &center)
Definition Group.cpp:100
~Group() override
Definition Group.cpp:49
void flushSVG(std::ostream &stream, const TransformSVG &transform) const override
Definition Group.cpp:183
Group * clone() const override
Definition Group.cpp:247
Group scaled(double sx, double sy)
Definition Group.cpp:115
Group & scale(double sx, double sy) override
Definition Group.cpp:77
Rect boundingBox(LineWidthFlag) const override
Definition Group.cpp:212
Group & operator=(const Group &other)
Definition Group.cpp:252
Group translated(double dx, double dy)
Definition Group.cpp:110
Group & rotate(double angle, const Point &center) override
Definition Group.cpp:56
void setClippingPath(const std::vector< Point > &points)
Definition Group.cpp:134
Group & translate(double dx, double dy) override
Definition Group.cpp:70
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override
Definition Group.cpp:173
A path, according to Postscript and SVG definition.
Definition Path.h:45
Struct representing a 2D point.
Definition Point.h:42
Struct representing a rectangle on the plane.
Definition Rect.h:40
A group of shapes.
Definition ShapeList.h:47
void accept(ShapeVisitor &visitor) override
Accepts a visitor object.
Definition ShapeList.cpp:443
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition Shape.cpp:59
Structure representing a scaling and translation suitable for an EPS output.
Definition Transforms.h:71
Structure representing a scaling and translation suitable for an XFig output.
Definition Transforms.h:87
Structure representing a scaling and translation suitable for an SVG output.
Definition Transforms.h:109
Structure representing a scaling and translation suitable for an TikZ output.
Definition Transforms.h:126