GDexIndex.gif Previous-2.gif Next-3.gif

Sketch and edit in a 2D view (EditMesh)


The following example illustrates how to use the EditMesh module to edit a drawing that has been built using the ClickSketch module on top of a slice from a volume.

 

GENERATE/FH885431.gif

Starting up

  1. 1.      Start AVS/Express and choose None from the startup dialog, or if you have an existing AVS/Express session, delete or close any existing application workspaces that you have open.
  2. Instance the example

    Instance EditMesh into the empty NE workspace.

    This example is found in Libraries.Examples.Graphics_Display. Upon being instanced, the example renders a slice from hydrogen.fld in the viewer's window.

    Construct the drawing

    We are now ready to construct a drawing in the view.

    Select Editors->Modules to make the modules user interface panel visible. Select ClickSketch from the Modules option menu. This causes the user interface for the ClickSketch module to appear.

    By default, the ClickSketch module is set up to draw a polyline. Other primitives that are available are point, line, box, and polygon.

    Choose the type of primitive that you want to generate from the radio box options at the top of the ClickSketch user interface.

    Begin building a drawing, using the add point operation.

    The mouse operations that control the drawing in the ClickSketch module are:

    Mouse-controlled operations

     

    Gesture

     

    Add point

    Press the right button.

    Erase point

    Hold down the Shift key and press the right button.

    Close region

    Hold down the Control key and press the right button. This completes the primitive that is in progress. This operation applies only to the polyline and polygon primitives.

     

    If you have chosen:

    •      The point primitive, each add point operation causes a small rectangle in the build color to be drawn.

    •      The line primitive, for every two add point operations, a line is drawn.

    •      The box primitive, for every two add point operations, a box is drawn.

    •      The polyline primitive, each add point operation adds another point to the polyline. The polyline is terminated with the close operation.

    •      The polygon primitive, each add point operation adds another point to the polygon. The polygon is terminated and automatically closed with the close operation.

    Conversion of screen space primitives into an AVS/Express field.

    This example has the ClickSketch module configured so that upon completion of a primitive it is immediately converted into an AVS/Express field. When this happens, the color of the primitives you have drawn on the slice changes from the build color to either the map color, if the Use Map Color toggle is set, or the primary color as specified by the Graphics Display Kit object's properties.

    This touches on only a small portion of the capabilities in the ClickSketch module.

    Edit the drawing

    We are now ready to edit the drawing in the view.

    Select EditMesh from the Modules option menu. This causes the user interface for the EditMesh module to appear.

    By default, the EditMesh is set up to edit a primitive. Points or cells can also be edited.

    Select to edit either a point, primitive or cell from the radio box options at the top of the EditMesh user interface.

    Edit the drawing by performing a select/move primitive operation.

    The mouse operations that control editing in the EditMesh module are:

    Mouse-controlled operations

     

    Gesture

     

    Select

    Press Control left button while the mouse is over a point or line in the drawing.

    Move primitive

    Hold down the Control key and drag the primitive while depressing the middle button.

     

    When the select operation takes place, the point, primitive or cell selected is drawn in the highlight color. The highlight of the point is done with a small rectangle.

    When the move primitive operation is in progress, the current position of the updated primitive is echoed in the highlight color. By default, the EditMesh module is configured so when the move primitive operation is completed, the field is updated. This causes the drawing to be rerendered to reflect its new contents.

    Points, primitives, and cells may also deleted by clicking on the Delete button after a select operation is done.

    Cleanup

    This completes the example.

    Delete the EditMesh application.

     



    GDexIndex.gif Previous-2.gif Next-3.gif