------------------------------------------------------------------------------ LIGHTS: ------------------------------------------------------------------------------ lgtobj = Nnew_light /*returns handle to new light or -1 if all lights have already been used */ /* set light attributes */ set_ambient r g b set_color r g b set_position x y z local switch on|off /* turn ALL lights on/off */ Nlights on|off ------------------------------------------------------------------------------ DRAWING: ------------------------------------------------------------------------------ /*clear screen with background color 'color' or default bg color*/ Nclear [color] Nset_draw front|back|both /*buffers*/ Ndraw_model /*draw lighting sphere */ Ndraw_X x y /* x &y floats in real world coords */ Ndraw_line_on_surf x1 y1 x2 y2 /* x1, y1, x2, y2 floats in world coords */ Ndraw_wire id Nquick_draw /* draw all surfaces in wireframe */ Nsurf_draw_all Nvect_draw_all Nsite_draw_all write_rgb filename /* write current contents of drawing win to file */ Nset_background ------------------------------------------------------------------------------ MAP OBJECTS: ------------------------------------------------------------------------------ note: type = surf|site|vect att = topo|color|mask|transp|shine|emit map_obj = Nnew_map_obj type [filename] /*returns handle to new object of type 'type' */ n = Nnum_map_obj type /* how many of type 'type'? */ delete /* delete map_obj */ draw /* draw map_obj with current draw modes & color */ NOTE: xtrans, ytrans, ztrans in map units get_trans /* returns: {xtrans ytrans ztrans} */ set_trans xtrans ytrans ztrans /*the following options are only appropriate if map_obj is type surf */ get_exag_guess /* returns: guess (approx exag for init value)*/ set_exag /* sets exag value for this map_obj *? set_drawmode poly|wire|wire_poly get_res wire|poly|both /*returns {xres yres [xres2 yres2]} */ set_res wire|poly|both xres yres [xres2 yres2] set_wirecolor 0xaabbggrr set_att att 'constant'|filename [value] unset_att att set_nozero att 0|1 /* att = color or topo */ /*the following are only appropriate if map_obj is type vect or site*/ /*select/unselect surface with which vect or site is associated */ select_surf sfid surf_is_selected sfid unselect_surf sfid /* color & width for either vect or site, last 4 site only */ /* useatt = z|color|0 where attribute value of site file is used */ /* either as height or color of marker or not at all. 0 is default */ set_mode color width [size marker useatt] is_masked x y /* returns 0|1 */ ------------------------------------------------------------------------------ MOVEMENT & LOCATION: ------------------------------------------------------------------------------ {x y z} = get_to {x y z} = get_from look_here sx sy /* set focus to where screen x & y point */ set_focus_map [id] /* if no id sets no focus */ moveto x y z /* change viewer position */ set_fov fov {n s e w} = get_region /* given screen x & y, returns point & surfaceto which mouse is pointing */ {x y z id} = get_pt_on_surf sx sy dim = get_longdim /* XYrange: used to compute appropriate default height */ {min max} = get_zrange [doexag] [nz] {min max mid} = get_zextents id /* zrange for a single map */ /* global exageration */ exag = get_exag set_exag exag ------------------------------------------------------------------------------ CUTTING PLANES: ------------------------------------------------------------------------------ plane_obj = Nnew_cutplane_obj id_num /* up to six */ plane_obj draw [surf1 surf2] /* if surfs specified only draws btwn s1 & s2 */ on off set_rot dx dy dz set_trans dx dy dz ----------------------------------------------------------------------- COMPOSITE (i.e. tcl procs for widget callbacks) ----------------------------------------------------------------------- set_persp persp set_xy x y /*viewer position */ set_height hgt /*viewer position */ draw_all /* window is resized or exposed */ resize expose