Board  0.6.devel
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Macros
LibBoard::Group Struct Reference

#include <ShapeList.h>

Inheritance diagram for LibBoard::Group:
Collaboration diagram for LibBoard::Group:

Public Member Functions

 Group (int depthValue=-1)
 Group (const Group &other)
 ~Group ()
const std::string & name () const
Shaperotate (double angle, const Point &center)
Shaperotate (double angle)
Group rotated (double angle, const Point &center)
Group rotated (double angle)
Shapetranslate (double dx, double dy)
Group translated (double dx, double dy)
Shapescale (double sx, double sy)
Shapescale (double s)
Group scaled (double sx, double sy)
Group scaled (double s)
void setClippingRectangle (float x, float y, float width, float height)
void setClippingPath (const std::vector< Point > &points)
void setClippingPath (const Path &path)
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const
Groupoperator= (const Group &other)
Shapeclone () const
Rect boundingBox () const
- Public Member Functions inherited from LibBoard::ShapeList
 ShapeList (int depth=-1)
 ShapeList (const ShapeList &other)
 ~ShapeList ()
ShapeListclear ()
Point center () const
void scaleAll (double s)
virtual int minDepth () const
virtual int maxDepth () const
void shiftDepth (int shift)
ShapeListoperator= (const ShapeList &other)
ShapeListoperator<< (const Shape &shape)
ShapeListoperator+= (const Shape &shape)
ShapeListinsert (const Shape &shape, int depth)
ShapeListdup (unsigned int copies=1)
template<typename T >
T & last (const unsigned int position=0)
Shapelast (const unsigned int position=0)
Shapetop ()
- Public Member Functions inherited from LibBoard::Shape
 Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth)
virtual ~Shape ()
bool filled () const
ShaperotateDeg (double angle, const Point &center)
ShaperotateDeg (double angle)
Rect bbox ()
Shapeoperator-- ()
Shapeoperator++ ()
int depth () const
virtual void depth (int)
const DGtal::Color & penColor () const
const DGtal::Color & fillColor () const

Private Attributes

Path _clippingPath

Static Private Attributes

static const std::string _name
static unsigned int _clippingCount = 0

Additional Inherited Members

- Protected Member Functions inherited from LibBoard::ShapeList
void addShape (const Shape &shape, double scaleFactor)
void free ()
- Protected Member Functions inherited from LibBoard::Shape
std::string svgProperties (const TransformSVG &transform) const
std::string postscriptProperties () const
std::string tikzProperties (const TransformTikZ &transform) const
- Protected Attributes inherited from LibBoard::ShapeList
std::vector< Shape * > _shapes
int _nextDepth
- Protected Attributes inherited from LibBoard::Shape
int _depth
DGtal::Color _penColor
DGtal::Color _fillColor
double _lineWidth
LineStyle _lineStyle
LineCap _lineCap
LineJoin _lineJoin

Detailed Description

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.


Constructor & Destructor Documentation

LibBoard::Group::Group ( int  depthValue = -1)
inline

Referenced by clone(), rotated(), scaled(), and translated().

LibBoard::Group::Group ( const Group other)
inline
LibBoard::Group::~Group ( )
inline

Member Function Documentation

Rect LibBoard::Group::boundingBox ( ) const
virtual

Returns the bounding box of the figure.

Returns:
The rectangle of the bounding box.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, LibBoard::ShapeList::boundingBox(), LibBoard::Path::boundingBox(), and LibBoard::Path::size().

Referenced by flushFIG().

Shape * LibBoard::Group::clone ( ) const
virtual

Return a copy of the shape.

Returns:

Reimplemented from LibBoard::ShapeList.

References Group().

void LibBoard::Group::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< DGtal::Color, int > &  colormap 
) const
virtual

Writes the FIG code of the shape in a stream according to a transform.

Parameters:
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::ShapeList.

References boundingBox(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Transform::mapX(), LibBoard::TransformFIG::mapY(), LibBoard::Rect::top, and LibBoard::Rect::width.

void LibBoard::Group::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
virtual

Writes the EPS code of the shape in a stream according to a transform.

Parameters:
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::ShapeList.

References _clippingCount, _clippingPath, LibBoard::Path::flushPostscript(), and LibBoard::Path::size().

void LibBoard::Group::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
virtual

Writes the SVG code of the shape in a stream according to a transform.

Parameters:
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::ShapeList.

References _clippingCount, _clippingPath, LibBoard::Path::flushSVGCommands(), and LibBoard::Path::size().

void LibBoard::Group::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
virtual

Writes the TikZ code of the shape in a stream according to a transform.

Parameters:
streamThe output stream.
transformA 2D transform to be applied.

Reimplemented from LibBoard::ShapeList.

const std::string & LibBoard::Group::name ( ) const
virtual

Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)

Returns:

Reimplemented from LibBoard::ShapeList.

References _name.

Group & LibBoard::Group::operator= ( const Group other)
Shape & LibBoard::Group::rotate ( double  angle,
const Point center 
)
virtual

Rotate the shape around a given center of rotation.

Parameters:
angleThe rotation angle in radian.
centerThe center of rotation.
Returns:
A reference to the shape itself.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, and LibBoard::Path::rotate().

Referenced by rotate().

Shape & LibBoard::Group::rotate ( double  angle)
virtual

Rotate the shape around its center.

Parameters:
angleThe rotation angle in radian.
Returns:
A reference to the shape itself.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, LibBoard::ShapeList::center(), LibBoard::Path::rotate(), and rotate().

Group LibBoard::Group::rotated ( double  angle,
const Point center 
)

Reimplemented from LibBoard::ShapeList.

References Group().

Group LibBoard::Group::rotated ( double  angle)

Reimplemented from LibBoard::ShapeList.

References Group().

Shape & LibBoard::Group::scale ( double  sx,
double  sy 
)
virtual

Scale the shape along the x an y axis.

Parameters:
sxThe scale factor along the x axis.
syThe scale factor along the y axis.
Returns:
The shape itself.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, LibBoard::ShapeList::center(), LibBoard::Path::center(), LibBoard::Path::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by scale().

Shape & LibBoard::Group::scale ( double  s)
virtual

Scale the shape along both axis.

Parameters:
sThe scale factor along both axis.
Returns:
The shape itself.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, LibBoard::ShapeList::center(), LibBoard::Path::center(), LibBoard::Path::scale(), scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.

Group LibBoard::Group::scaled ( double  sx,
double  sy 
)

Reimplemented from LibBoard::ShapeList.

References Group().

Group LibBoard::Group::scaled ( double  s)

Reimplemented from LibBoard::ShapeList.

References Group().

void LibBoard::Group::setClippingPath ( const std::vector< Point > &  points)

Define a clipping path for the group.

Parameters:
pointsA path.

References _clippingPath, and LibBoard::Path::clear().

void LibBoard::Group::setClippingPath ( const Path path)

Define a clipping path for the group.

Parameters:
pointsA path.

References _clippingPath, LibBoard::Path::pop_back(), LibBoard::Path::setClosed(), and LibBoard::Path::size().

void LibBoard::Group::setClippingRectangle ( float  x,
float  y,
float  width,
float  height 
)

Define a clipping rectangle for the group.

Parameters:
x
y
width
height

References _clippingPath, and LibBoard::Path::clear().

Shape & LibBoard::Group::translate ( double  dx,
double  dy 
)
virtual

Translate the shape by a given offset.

Parameters:
dxThe x offset.
dyThe y offset.
Returns:
A reference to the shape itself.

Reimplemented from LibBoard::ShapeList.

References _clippingPath, and LibBoard::Path::translate().

Group LibBoard::Group::translated ( double  dx,
double  dy 
)

Reimplemented from LibBoard::ShapeList.

References Group().


Field Documentation

unsigned int LibBoard::Group::_clippingCount = 0
staticprivate

Referenced by flushPostscript(), and flushSVG().

Path LibBoard::Group::_clippingPath
private
const std::string LibBoard::Group::_name
staticprivate

The generic name of the shape.

Reimplemented from LibBoard::ShapeList.

Referenced by name().


The documentation for this struct was generated from the following files: