a1canvas window ?options ...?The available options for the a1canvas widget are:
- -background or -bg color
- -cursor cursor
- -height pixelWidth
- -width pixelWidth
A group of Tcl commands implement various packages of functionality related to the a1canvas. These Tcl commands generally take the a1canvas name as there first argument.
- a1canvas configure ?option value ...?
- This allows the user to change any of the above listed options after creation of the widget.
The first Tcl command is the dl_viewing command for controlling 3D viewing:
The dl_display command controls what is displayed in a canvas:
- dl_viewing a1canvas motion x y
- Normally this, and the next 5 commands are bound (via the Tcl/Tk bind command) to mouse actions. Motion takes an x and a y value and updates the current view, based on the current viewing mode. This is normally used in conjunction with a Motion event.
- dl_viewing a1canvas pointerup x y
- The pointerup command prepairs the a1canvas' internals for the assumed upcomming view transformation. Normally this is called at the time of a ButtonPress event.
- dl_viewing a1canvas pointerdown x y
- The pointerdown command cleans up the current viewing transformation. Normally this is called at the time of a ButtonRelease event.
- dl_viewing a1canvas curr_view_mode mode
- The curr_view_mode command sets the current viewing mode. Valid viewing modes are: zoom, scale, pan_and_zoom, xy_pan, xy_rotate, y_rotate, z_rotate, hither, yon, input_3d, and z_translate.
- dl_viewing a1canvas perspective 0 | 1
- The perspective command will turn on (1) or turn off (0) perspective viewing.
- dl_viewing a1canvas continuous 0 | 1
- The continuous command will turn on (1) or turn off (0) continuous viewing.
- dl_viewing a1canvas fast_display 0 | 1
- The fast_display command will turn on (1) or turn off (0) fast_display viewing.
- dl_viewing a1canvas view action
- The view command transforms the current view based on the action argument. Valid actions are: save, undo, redo, restore, reset, center, front, back, top, bottom, left, right, and selected.
The dl_property command controls the appearance of various objects.
- dl_display a1canvas select x y ?clear?
- The select command takes an x and a y value and determines if the location was near an object. If it was, that object is selected. By including the clear argument, any currently selected objects will be unselected.
- dl_display a1canvas select all
- The select command will select all objects.
- dl_display a1canvas unshow selected
- The unshow command will unshow all selected objects.
- dl_display a1canvas background selected
- The background command will move all selected objects to the background group.
- dl_display a1canvas clear
- The clear command clears the window.
The a1_file command reads files and named objects:
- dl_property a1canvas depthcue 0 | 1
- The depthcue command will turn on (1) or turn off (0) depthcueing.
- dl_property a1canvas { crvfineness | srffineness } fineness #
- dl_property a1canvas { polys | curve | meshes | isolines | normals | shaded } 0 | 1
- These property commands change the displayed properties of objects in the canvas. The crvfineness and srffineness options take an additional fineness number describing the fineness of all the curves or surfaces being displayed. The polys, curve, meshes, isolines, normals, and shaded options change the displayed properties of selected objects by specifing a 0 or 1 to turn off or turn on the property.
The dl_animation command controlls animation previewing for a canvas:
- a1_file a1canvas { read | named_obj } name
- The a1_file command performs I/O operations for the a1canvas. If the third argument is read, the file specified by name will be read in and all the objects contained in that file displayed. If the third argument is named_obj, the named object is loaded and displayed.
- dl_animation a1canvas init
- dl_animation a1canvas time { start | stop } ?time?
- dl_animation a1canvas show time
- The animate command performs operations necessary for controlling any animation in the a1canvas. The init command initializes the internal start and stop variables to correspond to the start and stop time of the animation. If there is no current animation in the a1canvas, the start and stop variables are set to 0 and -1 respectively. The init command should be called before either the time or the show commands. The time command takes an additional start or stop command. By adding a final ?time? argument, the start or stop times are changed, otherwise the start or stop times are returned. The show command will display the current animation at the specified time.