/* TEACH GO_ARC                                Ben Rabau, 27th Aug 1993

This file refers to arc objects in GO. A special case is a full circle
for which a special class has been made. See TEACH * GO_CIRCLE.

For more general detailed information see

HELP * GO
REF * GO

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

 -- Example
 -- Appearance
 -- Editing: Direct Manipulation
 -- Orientation test

 */

;;; This requires the following files to be loaded:
uses go;
uses go_arc;

;;; It also requires an active go_pane (see TEACH * GO_PANE and
;;; TEACH * GO_RC_WINDOW):
go_init_rc();

/*
-- Example ------------------------------------------------------------
 */
;;; An example arc: starting at 45 degrees aver an arc of 270 degrees
vars an_arc = instance go_arc;
                     go_radius       =  50;
                     go_start_angle  =  45;
                     go_arc          = 270;
              endinstance;
go_add_to( an_arc, go_default_pane );

/*
-- Appearance ---------------------------------------------------------
 */
;;; You can fill and colour it:
true -> go_filled( an_arc );
'lightslateblue' -> go_bgcolour( an_arc );


;;; You can scale it directly or indirectly (by changing the bounding box):
2 -> go_xscale( an_arc );
go_bounding_height( an_arc ) =>;
60 -> go_bounding_height( an_arc );

;;; You can move the starting angle with:
75 -> go_start_angle( an_arc );

;;; You can decrease the arc with:
25 -> go_arc( an_arc );

/*
-- Editing: Direct Manipulation ---------------------------------------
 */
;;; Or influence it with the editors:
go_make_editable( an_arc );

;;; One editor sets go_start_angle (the starting point of the arc), the other
;;; changes the length of the go_arc itself. The centre editor allows the
;;; relocation of the centre of the object.

;;; To finish do:
go_make_uneditable( an_arc );

;;; An arc of 360 degrees is of course a circle. But if all you want is
;;; a circle then use the go_circle object (see TEACH * GO_CIRCLE).  This
;;; object does not have an editor to adjust the arc...


/*
-- Orientation test ---------------------------------------------------
 */

;;; Full test cycle:
vars arc = an_arc;
vars pane = go_default_pane;

;;; Test one of these test against all the scale combinations (see below):

;;; Test 1
vars i, j;
for i from 0 by 30 to 360 do
    i -> go_start_angle(arc);
    for j from 0 by 30 to 360 do j -> go_arc(arc); syssleep(1); endfor;
endfor;

;;; Test 2
50 -> go_start_angle(arc); 75 -> go_arc(arc);

;;; Test 3
false -> go_filled(arc);

;;; Test 4
3 -> go_xscale(arc);

;;; Cycle over all scale combinations:
( 1, 1, 1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1, 1, 1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1,-1, 1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1, 1,-1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1, 1, 1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1,-1, 1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1, 1,-1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1, 1, 1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1,-1,-1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1,-1, 1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1, 1,-1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1,-1,-1, 1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1,-1, 1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1, 1,-1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
( 1,-1,-1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);
(-1,-1,-1,-1) -> (pane.go_xscale,pane.go_yscale,arc.go_xscale,arc.go_yscale);

;;; eof

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