![]() |
![]() |
![]() |
---|---|---|
Class Hierarchy | The Document and Graphics Classes | The class Bounded |
Base Classes: Bounded, HierarchyNode, Selectable and Protocols.
The class GraphicsObject defines the interface common to all graphics objects.
For convenience of implementation, and because their interfaces are needed elsewhere in the class hierarchy as well, some parts of this interface are defined by the base classes:
provides instance variables for the vertical and horizontal dimensions of a graphics object and some related methods.
provides the default behavior for all methods related to the management of the object hierarchy in the document.
defines the generic interface and default behavior for selection.
has some variables that describe the object's capabilities.
GraphicsObject maintains no instance variables of its own, but uses those managed by its base classes.
Methods defined in GraphicsObject:
Return the weighted average of self and other. frac1 and frac2 are the weights (if self and other were numbers this should be frac1 * self + frac2 * other).
This method is used by the function Blend in
blend.py. If self and other can't be blended,
raise the blend.Mismatch
exception. This is the default
behaviour.
Return self as a PolyBezier object if possible.
If this is not possible, return None
.
The following methods are not implemented in GraphicsObject directly, but must be defined for every graphics object. The derived classes Primitive and Compound provide a default implementation for most objects.
Apply the transformation object trafo to self. Return undo info.
Translate (move) self by offset. offset is a point object. Return undo info.
Draw self on device. device is a graphics device .
The optional parameter clip is only provided if the object is used as a clip mask. If i