Prev
Up
Next
devguide-10.html
Class Hierarchy
devguide-9.html
The Document and Graphics Classes
devguide-12.html
The class Bounded
The class
GraphicsObject
Base Classes:
devguide-12.html#N2
Bounded
,
devguide-13.html#N2
HierarchyNode
,
devguide-15.html#N2
Selectable
and
devguide-14.html#N2
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:
devguide-12.html#N2
Bounded
provides instance variables for
the vertical and horizontal dimensions of a graphics object and
some related methods.
devguide-13.html#N2
HierarchyNode
provides the default
behavior for all methods related to the management of the
object hierarchy in the document.
devguide-15.html#N2
Selectable
defines the generic interface
and default behavior for selection.
devguide-14.html#N2
Protocols
has some variables that
describe the object's capabilities.
Instance Variables
GraphicsObject
maintains no instance variables of its own, but uses
those managed by its base classes.
Methods
Methods defined in
GraphicsObject
:
Blend(
other
,
frac1
,
frac2
)
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
behavior.
AsBezier()
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
devguide-16.html#N2
Primitive
and
devguide-17.html#N2
Compound
provide a default implementation for most objects.
Transform(
trafo
)
Apply the
devguide-7.html
transformation object
trafo
to self. Return undo info.
Translate(
offset
)
Translate (move) self by
offset
.
offset
is a
devguide-5.html
point object
. Return undo info.
DrawShape(
device
[,
clip
])
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 it is provided its value is 1.
Objects that can be used as clip masks (their
is_clip
flag
is true) request appropriate clipping from the graphics device.
Objects that cannot be used as clip masks don't need to accept
it.
(Note: The clipping interface for the high level drawing
operations of the graphics devices is somewhat experimental)
SaveToFile(
file
)
Save self to file. The argument
file
is currently an
instance of the class
SKSaver
which provides
special methods for the object types currently implemented in
Skencil.
devguide-10.html
Class Hierarchy
devguide-9.html
The Document and Graphics Classes
devguide-12.html
The class Bounded
Prev
Up
Next
