Board 0.9.6
|
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a FIG file, it is a true compound element. More...
#include <Group.h>
Public Member Functions | |
Group () | |
Group (const Group &other) | |
~Group () override | |
const std::string & | name () const override |
Group & | rotate (double angle, const Point ¢er) override |
Group & | rotate (double angle) override |
Group | rotated (double angle, const Point ¢er) |
Group | rotated (double angle) |
Group & | translate (double dx, double dy) override |
Group | translated (double dx, double dy) |
Group & | scale (double sx, double sy) override |
Group & | scale (double s) override |
Group | scaled (double sx, double sy) |
Group | scaled (double s) |
void | setClippingRectangle (double x, double y, double width, double height) |
void | setClippingPath (const std::vector< Point > &points) |
void | setClippingPath (const Path &path) |
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 |
Group & | operator= (const Group &other) |
Group * | clone () const override |
Rect | boundingBox (LineWidthFlag) const override |
Group * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. | |
Group * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. | |
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. | |
Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. | |
Shape * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. | |
Public Member Functions inherited from LibBoard::ShapeList | |
ShapeList () | |
ShapeList (const ShapeList &other) | |
ShapeList & | operator= (const ShapeList &other) |
ShapeList (ShapeList &&other) | |
ShapeList & | operator= (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 |
ShapeList & | clear () |
ShapeList & | rotate (double angle, const Point ¢er) override |
ShapeList | rotated (double angle, const Point ¢er) |
ShapeList & | rotate (double angle) override |
ShapeList | rotated (double angle) |
ShapeList & | translate (double dx, double dy) override |
ShapeList | translated (double dx, double dy) |
ShapeList & | scale (double sx, double sy) override |
ShapeList & | scale (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 |
ShapeList * | clone () const override |
ShapeList & | push_back (Shape *shape) |
ShapeList & | operator<< (const Shape &shape) |
template<typename S > | |
ShapeList & | operator<< (const std::vector< S > &shapes) |
ShapeList & | operator+= (const Shape &shape) |
ShapeList & | append (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) |
ShapeList & | duplicateLast (std::size_t copies=1) |
template<typename T > | |
T & | last (const std::size_t position=0) |
Shape & | last (const std::size_t position=0) |
template<typename T > | |
T & | topLevelFindLast (std::size_t position=0) |
Shape & | top () |
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. | |
Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. | |
Shape * | accept (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 Shape * | clone () const =0 |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
virtual Shape & | rotate (double angle, const Point ¢er)=0 |
virtual Shape & | rotate (double angle)=0 |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
virtual Shape & | translate (double dx, double dy)=0 |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
virtual Shape & | scale (double sx, double sy)=0 |
virtual Shape & | scale (double s)=0 |
Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (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 Shape * | accept (CompositeShapeTransform &transform) const |
Accept a composite shape transform. | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const |
Accept a constant composite shape transform. | |
Shape (const Shape &other) | |
Additional Inherited Members | |
Public Types inherited from LibBoard::ShapeList | |
typedef std::vector< Shape * >::size_type | size_type |
Protected Member Functions inherited from LibBoard::ShapeList | |
void | addShape (const Shape &shape, double scaleFactor) |
void | deleteShapes () |
Protected Attributes inherited from LibBoard::ShapeList | |
std::vector< Shape * > | _shapes |
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a FIG file, it is a true compound element.
The Group structure.
|
inline |
|
inline |
|
override |
|
overridevirtual |
Accept a composite shape transform.
transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accept a composite shape transform.
transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeList::_shapes, LibBoard::Shape::accept(), LibBoard::ShapeList::end(), Group(), and LibBoard::ShapeList::push_back().
Referenced by LibBoard::boardFontText(), and text().
|
overridevirtual |
Accept a constant composite shape transform.
transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeList::ShapeList().
|
overridevirtual |
Accept a constant composite shape transform.
transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeList::_shapes, LibBoard::Shape::accept(), LibBoard::ShapeList::end(), Group(), and LibBoard::ShapeList::push_back().
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::Shape::center(), and LibBoard::ShapeList::rotate().
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::Shape::center(), and LibBoard::ShapeList::rotate().
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::Shape::center().
|
overridevirtual |
Compute the bounding box of the figure.
Implements LibBoard::Shape.
References LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), and LibBoard::Path::size().
Referenced by flushFIG(), main(), merge(), and text().
|
overridevirtual |
Return a copy of the shape.
Implements LibBoard::Shape.
References Group().
|
overridevirtual |
Write the FIG code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
colormap |
Implements LibBoard::Shape.
References LibBoard::Shape::bbox(), boundingBox(), LibBoard::ShapeList::flushFIG(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Transform::mapX(), LibBoard::TransformFIG::mapY(), LibBoard::Rect::top, LibBoard::UseLineWidth, and LibBoard::Rect::width.
|
overridevirtual |
Write the EPS code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
References LibBoard::Path::flushPostscript(), LibBoard::ShapeList::flushPostscript(), and LibBoard::Path::size().
|
overridevirtual |
Write the SVG code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
References LibBoard::ShapeList::flushSVG(), LibBoard::Path::flushSVGCommands(), and LibBoard::Path::size().
|
overridevirtual |
Write the TikZ code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
References LibBoard::ShapeList::flushTikZ().
|
overridevirtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeList::operator=().
|
overridevirtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Referenced by main().
References LibBoard::Shape::center(), and Group().
|
overridevirtual |
Scale the shape along both axis.
s | The scaling factor along both axis. |
Implements LibBoard::Shape.
References LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Scale the shape along the x an y axis.
sx | The scaling factor along the x axis. |
sy | The scaling factor along the y axis. |
Implements LibBoard::Shape.
References LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by main().
Group LibBoard::Group::scaled | ( | double | sx, |
double | sy | ||
) |
References Group().
Referenced by main().
void LibBoard::Group::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the group.
path | A path. |
References LibBoard::Path::close(), LibBoard::Path::pop_back(), and LibBoard::Path::size().
void LibBoard::Group::setClippingPath | ( | const std::vector< Point > & | points | ) |
Define a clipping path for the group.
points | A path. |
References LibBoard::Path::clear(), and LibBoard::ShapeList::end().
Referenced by main().
void LibBoard::Group::setClippingRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Define a clipping rectangle for the group.
x | |
y | |
width | |
height |
References LibBoard::Path::clear().
|
overridevirtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
References LibBoard::Path::translate(), and LibBoard::ShapeList::translate().
Referenced by main().
Group LibBoard::Group::translated | ( | double | dx, |
double | dy | ||
) |