- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

# IpePgObject Class Reference
[Ipe Objects]

A (selectable) object on an IpePage. More...

List of all members.

## Public Types

- enum TSelect { ENone = 0, EPrimary, ESecondary }

## Public Member Functions

- IpePgObject (TSelect sel, int layer, IpeObject *obj)
- IpePgObject (const IpePgObject &rhs)
- IpePgObject & operator= (const IpePgObject &rhs)
- ~IpePgObject ()
- IpeObject * Object ()
- const IpeObject * Object () const
- TSelect Select () const
- int Layer () const
- void SetSelect (TSelect sel)
- void SetLayer (int layer)
- void ReplaceObject (IpeObject *obj)
- IpeRect BBox () const
- void Transform (const IpeMatrix &m)
- double Distance (const IpeVector &v, double bound) const
- void SnapVtx (const IpeVector &mouse, IpeVector &pos, double &bound) const
- void SnapBnd (const IpeVector &mouse, IpeVector &pos, double &bound) const
- void InvalidateBBox () const

## Related Functions

(Note that these are not member functions.)

- typedef std::list< IpePgObject > IpePgObjectSeq

## Detailed Description

A (selectable) object on an IpePage.

Adds selection status and layer to IpeObject.

## Member Enumeration Documentation

enum IpePgObject::TSelect

Selection status of an object on the page.

## Constructor & Destructor Documentation

IpePgObject::IpePgObject | ( | TSelect | sel,
|  | int | layer,
|  | IpeObject * | obj |
| ) |  |  | `[inline, explicit]`

Constructor takes ownership of object.

IpePgObject::IpePgObject | ( | const IpePgObject & | rhs | ) |

Copy constructor clones object.

IpePgObject::~IpePgObject | ( |  | ) |

Destructor.

## Member Function Documentation

IpeObject* IpePgObject::Object | ( |  | ) | `[inline]`

Return IpeObject.

const IpeObject* IpePgObject::Object | ( |  | ) | const`[inline]`

Return IpeObject (const version).

TSelect IpePgObject::Select | ( |  | ) | const`[inline]`

Return selection status.

int IpePgObject::Layer | ( |  | ) | const`[inline]`

Return layer.

void IpePgObject::SetSelect | ( | TSelect | sel | ) | `[inline]`

Set selection status.

void IpePgObject::SetLayer | ( | int | layer | ) | `[inline]`

Set layer.

void IpePgObject::ReplaceObject | ( | IpeObject * | obj | ) |

Replace the object.

IpeRect IpePgObject::BBox | ( |  | ) | const

Return a bounding box for the object.

IpePgObject caches the box the first time it is computed.

Make sure you call IpePgObject::Transform instead of IpeObject::SetMatrix, as the latter would not invalidate the bounding box.

void IpePgObject::Transform | ( | const IpeMatrix & | m | ) |

Transform the object.

Use this function instead of calling IpeObject::SetMatrix directly, as the latter doesn't invalidate the cached bounding box.

double IpePgObject::Distance | ( | const IpeVector & | v,
|  | double | bound |
| ) |  |  | const

Return distance between object and v.

But may just return bound if the distance is larger. This function uses the cached bounded box, and is faster than calling IpeObject::Distance directly.

void IpePgObject::SnapVtx | ( | const IpeVector & | mouse,
|  | IpeVector & | pos,
|  | double & | bound |
| ) |  |  | const

Compute possible vertex snapping position.

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

void IpePgObject::SnapBnd | ( | const IpeVector & | mouse,
|  | IpeVector & | pos,
|  | double & | bound |
| ) |  |  | const

Compute possible boundary snapping position.

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

void IpePgObject::InvalidateBBox | ( |  | ) | const

Invalidate the bounding box (the object is somehow changed).

## Friends And Related Function Documentation

typedef std::list<IpePgObject> IpePgObjectSeq`[related]`

List of objects on a page.

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

- ipeobj.h
- ipeobj.cpp
- ipepage.h