Inherits IpeObject.
A reference reuses an object defined in an Ipe style sheet. The object is defined as a named template in the style sheet, and can be reused arbitrarily often in the document. This can, for instance, be used for backgrounds on multi-page documents.
It is admissible to refer to an undefined object (that is, the current style sheet cascade does not define a template with the given name).
IpeReference::IpeReference | ( | IpeRepository * | rep, | |
const IpeXmlAttributes & | attr, | |||
IpeString | data | |||
) | [explicit] |
Create from XML stream.
IpeReference::IpeReference | ( | const IpeStyleSheet * | sheet, | |
IpeAttribute | name | |||
) | [explicit] |
Create a reference to the named object in stylesheet.
IpeReference::IpeReference | ( | const IpeReference & | rhs | ) |
Copy constructor.
IpeReference * IpeReference::AsReference | ( | ) | [virtual] |
void IpeReference::Accept | ( | IpeVisitor & | visitor | ) | const [virtual] |
void IpeReference::SaveAsXml | ( | IpePainter & | painter, | |
IpeStream & | stream, | |||
IpeString | layer | |||
) | const [virtual] |
void IpeReference::Draw | ( | IpePainter & | painter | ) | const [virtual] |
Draw reference.
If the symbolic attribute is not defined in the current style sheet, nothing is drawn at all.
Implements IpeObject.
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).
Implements IpeObject.
double IpeReference::Distance | ( | const IpeVector & | v, | |
const IpeMatrix & | m, | |||
double | bound | |||
) | const [virtual] |
Return distance of transformed object to point v. If larger than bound, can just return bound.
Implements IpeObject.
void IpeReference::SnapVtx | ( | const IpeVector & | mouse, | |
const IpeMatrix & | m, | |||
IpeVector & | 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 IpeObject.
void IpeReference::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 from IpeObject.
void IpeReference::CheckStyle | ( | const IpeStyleSheet * | sheet, | |
IpeAttributeSeq & | seq | |||
) | const [virtual] |
IpeAttribute IpeReference::Name | ( | ) | const [inline] |
Return symbolic name.
const IpeObject* IpeReference::Object | ( | ) | const [inline] |
Return pointer to cached object.