A path is a line going through a set of points. There are two kinds
of paths:
poly Straight line segments connect the points smooth A smooth (curved) line connects the points
The line of a path has a graphical->texture
and a graphical->pen
(thickness). The first and last point of the path may be connected (path->closed)
and the interior of the path may be filled with an image
object using
path->fill.
Class path is a
subclass of class joint
and therefore may have joint->arrows
attached.
Paths can be used for numerous purposes:
->kind:
smooth may be used for simple smoothing of the diagram, while path->mark
may be used to mark the
control-points.
Defaults: @off
|{foreground,background}*Defaults: @nil (not filled)
smooth, this is a chain of interpolated
points. The interpolation is recomputed each time the path has been
modified and needs to be painted. See also graphical->request_compute.
Defaults: Resource defined (10).
<->intervals
and the
chain object holding
all interpolated points is available in
path<-interpolation.
Defaults: poly (line segments).
Defaults: @nil
<-points
of the path if the path is painted. See also
path->reference and path->relative_move.unexpected_type on failure. On
successs, it replaces the path<-points
chain of the path with the argument. The argument thus becomes a part of
the path object. See
also path->initialise.poly lines. Not yet
implemented.
Defaults: 0 (non-rounded corners).
<-device
coordinate system. path->insert
may be used to insert points in the middle or prepend points.
<-area
from the path<-points
and path<-interpolation
from path<-points
if
path<-kind
= smooth.<-point.->resize.<-kind.
When path<-kind
equals smooth, the second argument specifies the path<-intervals.
If the
points arguments is supplied, the method path->points
is invoked using this argument to specify the initial set of
control-points.<-segment
may be used to find the point to insert after.
<-offset
(default) or by adjusting each of the
path<-points.<-device’s
coordinate system.
|event|graphical -> int<-position
is used), compute the distance of this point to the path-line. If the
path is interpolated, the distance to the interpolation is computed.
If the argument is a graphical, use graphical<-distance.
See also line<-distance
and graphical->in_event_area.
<-device
coordinate system) of the last point of the path. See also path<-start.
|event,
max_distance=[int] -> pointSee also path<-segment.
Defaults: The default maximum distance (2nd argument) is 10.
Diagnostics: Fails silently if no such point exist.
|event,
accept=[0..] -> point<-position.
May be used to interactively
path->insert
new points:
send(Path, click_gesture(left, '', single,
message(@receiver, insert,
?(@event, position, @receiver?device),
?(@receiver, segment, @event)))).
See also path<-point.
<-end.