Public Member Functions | Private Attributes | Static Private Attributes

LibBoard::Group Struct Reference

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 <ShapeList.h>

Inheritance diagram for LibBoard::Group:
Inheritance graph
[legend]
Collaboration diagram for LibBoard::Group:
Collaboration graph
[legend]

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< Color, int > &colormap) const
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
Groupoperator= (const Group &other)
Shapeclone () const
Rect boundingBox () const

Private Attributes

Path _clippingPath

Static Private Attributes

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

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::Path::boundingBox(), LibBoard::ShapeList::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< Color, int > &  colormap 
) const [virtual]

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

Parameters:
stream The output stream.
transform A 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:
stream The output stream.
transform A 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:
stream The output stream.
transform A 2D transform to be applied.

Reimplemented from LibBoard::ShapeList.

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

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:
angle The rotation angle in radian.
center The 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:
angle The 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  s  )  [virtual]

Scale the shape along both axis.

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

Reimplemented from LibBoard::ShapeList.

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

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

Scale the shape along the x an y axis.

Parameters:
sx The scale factor along the x axis.
sy The 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().

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

Reimplemented from LibBoard::ShapeList.

References Group().

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

Reimplemented from LibBoard::ShapeList.

References Group().

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

Define a clipping path for the group.

Parameters:
points A path.

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

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

Define a clipping path for the group.

Parameters:
points A path.

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

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:
dx The x offset.
dy The 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 [static, private]

Referenced by flushPostscript(), and flushSVG().

const std::string LibBoard::Group::_name [static, private]

The generic name of the shape.

Reimplemented from LibBoard::ShapeList.

Referenced by name().


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