/* TEACH MAKE_EDITABLE                             Ben Rabau, 27th Aug 1993

This file is incomplete, at present there is no full Direct Manipulation (DM)
l8ibrary for Poplog/GO.

HELP * GO
REF * GO


Object manipulation is described in TEACH * GO_DRAG


         CONTENTS - (Use <ENTER> g to access required sections)

 -- using simple editors
 -- using multiple editors
 -- SPECIAL CASE

 */

;;; method MAKE_EDITABLE:  !!! PROTOTYPE CODE !!!
;;; ---------------------
;;; This method tries to attach DM features to a go_regular go_polygon.

/*
-- using simple editors -----------------------------------------------
 */
;;; This time we use a go_regular go_polygon's go_radius:

uses go_polygon;

;;; The examples require the GO window to be active.
;;; If you don't have an active window do:
go_init_rc();


;;; First make an object (see TEACH * GO):
vars poly = newgo_polygon();
7 -> go_npoints( poly );
go_add_to( poly , go_default_pane );

;;; Then add the editors: for a regular polygon this is the centre and
;;; the reference point (sets the angle and radius):
go_make_editable( poly );

;;; The same can be done when the object has its own scaling.
;;; The following scales the objects local coordinates (note that when
;;; rotated the object does not change its flattened basic shape):
0.5 -> go_yscale( poly );

;;; To get rid of the editors:
go_make_uneditable( poly );

/*
-- using multiple editors ---------------------------------------------
 */
;;; The following allows to  edit a closed polyline (irregular polygon)
;;; NOTE that it updates the world coordinates AND the go_bounding_box
;;; See also TEACH * GO_POINT.

false -> poly.go_regular;
go_make_editable( poly );

;;; This allows the user to make any shape: for instance by using
;;; go_rounding. You can go_smooth several times (see also TEACH * RC_OBJECT).
go_smooth( poly );

;;; or later:
go_roughen( poly );

;;; To get rid of the editors:
go_make_uneditable( poly );

/*
-- SPECIAL CASE -------------------------------------------------------
 */
;;; An interesting case is the basic polyline: an open, irregular go_polygon
;;; with two points. This represents an simple line and has the
;;; advantage of being completely compatible and extensible to a polyline.
vars go_pline=newgo_polyline();
2 -> go_npoints( go_pline );
go_add_to( go_pline , go_default_pane );

go_make_editable( go_pline );

;;; If you want to extend this line do:
4 -> go_npoints( go_pline );

;;; Note that some of the points might overlap existing points (try to
;;; move the editors...)


;;; eof;

--- C.all/lib/proto/go/teach/go_make_editable
--- Copyright University of Sussex 1993. All rights reserved.
