class interface DRAWABLE_BEZIER
creation
make
-- Create.
feature(s) from DRAWABLE_POLYLINE
-- Position
empty: BOOLEAN
-- Is the polyline empty (no points)?
reset
-- Reset the point list representing the polyline.
ensure
done: empty
add_point (pt: POINT)
-- Add a new point at the end of the polyline.
require
valid_point: pt /= Void
ensure
ok: not empty
feature(s) from DRAWABLE_BEZIER
-- Position
set_start_point (pt: POINT)
-- Set the starting point
require
valid_point: pt /= Void;
empty: empty
add_curve (cp1, cp2, final: POINT)
-- Add a new bezier curve component. It will start from the
-- end of the previous curve or the starting point, and will
-- finish at the 'final' point. 'cp1' and 'cp2' are the control
-- points.
require
valid_points: cp1 /= Void and cp2 /= Void and final /= Void;
not_empty: not empty
invariant
valid_position: line /= Void;
bezier_curve: line.count /= 0 implies line.count \\ 3 = 1;
end of DRAWABLE_BEZIER