# ipe::Group Class Reference
[Ipe Objects]

The group object. More...

`#include <ipegroup.h>`

Inherits ipe::Object.

List of all members.

## Classes

- struct Imp

## Public Types

- typedef List::const_iterator const_iterator

## Public Member Functions

- Group ()
- Group (const Group &rhs)
- virtual ~Group ()
- Group (const XmlAttributes &attr)
- Group & operator= (const Group &rhs)
- virtual Object * clone () const
- virtual Group * asGroup ()
- virtual Type type () const
- virtual TPinned pinned () const
- virtual void accept (Visitor &visitor) const
- virtual void saveAsXml (Stream &stream, String layer) const
- virtual void draw (Painter &painter) const
- virtual void drawSimple (Painter &painter) const
- virtual void addToBBox (Rect &box, const Matrix &m, bool cp) const
- virtual double distance (const Vector &v, const Matrix &m, double bound) const
- virtual void snapVtx (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
- virtual void snapBnd (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
- const Shape & clip () const
- void setClip (const Shape &clip)
- int count () const
- const Object * object (int i) const
- const_iterator begin () const
- const_iterator end () const
- void push_back (Object *)
- void saveComponentsAsXml (Stream &stream) const
- virtual void checkStyle (const Cascade *sheet, AttributeSeq &seq) const
- virtual bool setAttribute (Property prop, Attribute value, Attribute stroke, Attribute fill)

## Detailed Description

The group object.

Ipe objects can be grouped together, and the resulting composite can be used like any Ipe object.

This is an application of the "Composite" pattern.

## Member Typedef Documentation

typedef List::const_iterator ipe::Group::const_iterator

## Constructor & Destructor Documentation

Group::Group | ( |  | ) | `[explicit]`

Create empty group (objects can be added later).

Group::Group | ( | const Group & | rhs | ) |

Copy constructor. Constant time --- components are not copied!

Group::~Group | ( |  | ) | `[virtual]`

Destructor.

Group::Group | ( | const XmlAttributes & | attr | ) | `[explicit]`

Create empty group with these attributes (objects can be added later).

## Member Function Documentation

Group & Group::operator= | ( | const Group & | rhs | ) |

Assignment operator (constant-time).

Object * Group::clone | ( |  | ) | const`[virtual]`

Clone a group object (constant-time).

Implements ipe::Object.

Group * Group::asGroup | ( |  | ) | `[virtual]`

Return pointer to this object.

Reimplemented from ipe::Object.

Object::Type Group::type | ( |  | ) | const`[virtual]`

Implements ipe::Object.

TPinned Group::pinned | ( |  | ) | const`[virtual]`

Return total pinning status of group and its elements.

Reimplemented from ipe::Object.

void Group::accept | ( | Visitor & | visitor | ) | const`[virtual]`

Call visitGroup of visitor.

Implements ipe::Object.

void Group::saveAsXml | ( | Stream & | stream,
|  | String | layer |
| ) |  |  | const`[virtual]`

Save the object in XML format.

Implements ipe::Object.

void Group::draw | ( | Painter & | painter | ) | const`[virtual]`

Draw the object.

Implements ipe::Object.

void Group::drawSimple | ( | Painter & | painter | ) | const`[virtual]`

Draw simple version for selecting and transforming.

Implements ipe::Object.

void Group::addToBBox | ( | Rect & | box,
|  | const Matrix & | m,
|  | bool | cp |
| ) |  |  | const`[virtual]`

Extend box to include the object transformed by m.

For objects in a page, don't call this directly. The Page caches the bounding box of each object, so it is far more efficient to call Page::bbox.

Control points that lie outside the visual object are included if cp is true.

If called with an empty box and cp == `false`, the result of this function is a tight bounding box for the object, with a little leeway in case the boundary is determined by a spline (it has to be approximated to perform this operation).

Implements ipe::Object.

double Group::distance | ( | const Vector & | v,
|  | const Matrix & | m,
|  | double | bound |
| ) |  |  | const`[virtual]`

Return distance of transformed object to point v. If larger than bound, can just return bound.

Implements ipe::Object.

void Group::snapVtx | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound |
| ) |  |  | const`[virtual]`

Compute possible vertex snapping position for transformed object.

Looks only for positions closer than bound. If successful, modify pos and bound.

Implements ipe::Object.

void Group::snapBnd | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound |
| ) |  |  | const`[virtual]`

Compute boundary snapping position for transformed object.

Looks only for positions closer than bound. If successful, modify pos and bound. The default implementation does nothing.

Reimplemented from ipe::Object.

const Shape& ipe::Group::clip | ( |  | ) | const`[inline]`

void Group::setClip | ( | const Shape & | clip | ) |

Set clip path for this group.

Any previously set clip path is deleted.

int ipe::Group::count | ( |  | ) | const`[inline]`

Return number of component objects.

const Object* ipe::Group::object | ( | int | i | ) | const`[inline]`

Return object at index i.

const_iterator ipe::Group::begin | ( |  | ) | const`[inline]`

Return iterator for first object.

const_iterator ipe::Group::end | ( |  | ) | const`[inline]`

Return iterator for end of sequence.

void Group::push_back | ( | Object * | obj | ) |

Add an object.

Takes ownership of the object. This will panic if the object shares its implementation! The method is only useful right after construction of the group.

void Group::saveComponentsAsXml | ( | Stream & | stream | ) | const

Save all the components, one by one, in XML format.

void Group::checkStyle | ( | const Cascade * | sheet,
|  | AttributeSeq & | seq |
| ) |  |  | const`[virtual]`

Check all symbolic attributes.

Reimplemented from ipe::Object.

bool Group::setAttribute | ( | Property | prop,
|  | Attribute | value,
|  | Attribute | stroke,
|  | Attribute | fill |
| ) |  |  | `[virtual]`

Set attribute on all children.

Reimplemented from ipe::Object.

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

- ipegroup.h
- ipegroup.cpp