IpeObject Class Reference
[Ipe Objects]

Base class for all Ipe objects, composite or leaf. More...

Inherited by IpeFillable, IpeImage, IpeReference, and IpeText.

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Member Functions

Static Protected Member Functions


Detailed Description

Base class for all Ipe objects, composite or leaf.

All Ipe objects are derived from this class. It provides functionality common to all objects, and carries the standard attributes.

All IpeObject's provide a constant time copy constructor (and a virtual IpeObject::Clone() method). Objects of non-constant size realize this by separating the implementation and using reference counting. In particular, copying a composite objects does not create new copies of the components.

The common attributes are stroke and fill color, line style and width, and the transformation matrix for coordinates.


Constructor & Destructor Documentation

IpeObject::~IpeObject (  )  [pure virtual]

Pure virtual destructor.

IpeObject::IpeObject (  )  [explicit, protected]

Create object with null stroke and identity matrix.

IpeObject::IpeObject ( const IpeAllAttributes attr  )  [explicit, protected]

Create object by taking stroke color from attr and setting identity matrix.

IpeObject::IpeObject ( IpeRepository rep,
const IpeXmlAttributes attr 
) [explicit, protected]

Construct from XML stream.

IpeObject::IpeObject ( const IpeObject rhs  )  [protected]

Copy constructor.


Member Function Documentation

virtual void IpeObject::Accept ( IpeVisitor visitor  )  const [pure virtual]

Calls VisitXXX method of the visitor.

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

virtual IpeObject* IpeObject::Clone (  )  const [pure virtual]

Make a (shallow) copy of this object.

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

IpeFillable * IpeObject::AsFillable (  )  [virtual]

Return pointer to this object if it is an IpeFillable, 0 otherwise.

Reimplemented in IpeFillable.

IpeGroup * IpeObject::AsGroup (  )  [virtual]

Return pointer to this object if it is an IpeGroup, 0 otherwise.

Reimplemented in IpeGroup.

IpeText * IpeObject::AsText (  )  [virtual]

Return pointer to this object if it is an IpeText, 0 otherwise.

Reimplemented in IpeText.

IpeMark * IpeObject::AsMark (  )  [virtual]

Return pointer to this object if it is an IpeMark, 0 otherwise.

Reimplemented in IpeMark.

IpePath * IpeObject::AsPath (  )  [virtual]

Return pointer to this object if it is an IpePath, 0 otherwise.

Reimplemented in IpePath.

IpeImage * IpeObject::AsImage (  )  [virtual]

Return pointer to this object if it is an IpeImage , 0 otherwise.

Reimplemented in IpeImage.

IpeReference * IpeObject::AsReference (  )  [virtual]

Return pointer to this object if it is an IpeRef, 0 otherwise.

Reimplemented in IpeReference.

TPinned IpeObject::pinned (  )  const [inline]

Return pinning mode of the object.

Reimplemented in IpeGroup.

void IpeObject::setPinned ( TPinned  pin  ) 

Set pinning mode of the object.

virtual void IpeObject::SaveAsXml ( IpePainter painter,
IpeStream stream,
IpeString  layer 
) const [pure virtual]

Save the object in XML format.

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

virtual void IpeObject::Draw ( IpePainter painter  )  const [pure virtual]

Draw the object.

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

virtual double IpeObject::Distance ( const IpeVector v,
const IpeMatrix m,
double  bound 
) const [pure virtual]

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

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

virtual void IpeObject::AddToBBox ( IpeRect box,
const IpeMatrix m 
) const [pure virtual]

Extend box to include the object transformed by m.

For Ipe objects in a page, don't call this directly. The IpePgObject caches the bounding box, so it is far more efficient to call IpePgObject::BBox.

If called with an empty box, 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).

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

void IpeObject::AddToGraphicBBox ( IpeRect box,
IpeStyleSheet sheet,
IpeMatrix m 
) const [virtual]

Extend box to include the graphic representation of the object.

Unlike AddToBBox, this function takes into account the graphic representation of the object, that is, its line width, arrow size, mark size, etc. The default implementation calls AddToBBox.

virtual void IpeObject::SnapVtx ( const IpeVector mouse,
const IpeMatrix m,
IpeVector pos,
double &  bound 
) const [pure virtual]

Compute possible vertex snapping position for transformed object.

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

Implemented in IpeGroup, IpeImage, IpeMark, IpePath, IpeReference, and IpeText.

void IpeObject::CheckStyle ( const IpeStyleSheet sheet,
IpeAttributeSeq seq 
) const [virtual]

Check symbolic attributes of object.

Reimplemented in IpeGroup, IpeMark, IpeFillable, IpePath, IpeReference, and IpeText.

void IpeObject::SnapBnd ( const IpeVector mouse,
const IpeMatrix m,
IpeVector 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 in IpeGroup, IpePath, and IpeReference.

void IpeObject::SetStroke ( IpeAttribute  stroke  ) 

Set stroke color.

void IpeObject::SetMatrix ( const IpeMatrix matrix  ) 

Set the transformation matrix.

Don't use this on the IpeObject in an IpePgObject, because it wouldn't invalidate its bounding box. Call IpePgObject::Transform instead.

IpeAttribute IpeObject::Stroke (  )  const [inline]

Return object stroke color.

const IpeMatrix & IpeObject::Matrix (  )  const [inline]

Return transformation matrix.

void IpeObject::SaveAttributesAsXml ( IpePainter painter,
IpeStream stream,
IpeString  layer 
) const [protected]

Write layer, stroke and matrix to XML stream.


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