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

Viewing multiple objects from one set of data (MultipleObjs)


A view can include multiple Graphics Display Kit objects. In this tutorial, we create a view consisting of four objects, each derived from the same set of data.

Starting up

  1. 1.      Start AVS/Express and choose Single-window DataViewer with no viewer (select None as the Viewer type) from the startup dialog, from an existing AVS/Express session, start a new Single-window DataViewer with no viewer by selecting the appropriate entries from the File->New Application... dialog, or clear an existing SingleWindowApp workspace, as appropriate.
  2. Instance Viewer3D

    Uviewer3D is a full-featured 3D viewer, complete with a top-level object, a window, a view, and related editors. At the end of this tutorial, we explore the features of Uviewer3D.

    Instance into the SingleWindowApp workspace the object Uviewer3D.

     

    GENERATE/FH413319.gif

    Notice in Libraries.Main.Viewers:

    •      There are three different full-featured viewers, called Uviewer3D, Uviewer2D, and Uviewer. They differ in how they render Graphics Display Kit objects. Uviewer3D renders all objects in 3D. Uviewer2D renders all objects in 2D. Uviewer can do both; connect objects to be rendered in 3D to Uviewer's first input port, and objects to be rendered in 2D to its second input port.

    Create four objects

    We now create four Graphics Display Kit objects, each derived from the same set of data. We use Diamond3D to create the data to render, then four instances of the Data Visualization Kit's scale object to create the four objects.

    Instance Diamond3D and scale (four copies), then connect them together and to UViewer3D, as shown in the diagram below. 

     

    GENERATE/FH031347.gif

    The application renders the four objects. At first, though, it appears that only one object is present. This is because the four are overlapping.

    Separate the four objects.

  3. 1.      Select the Translate icon from the toolbar in the application window.
  4. With the Control key pressed, select the first object with the left mouse button. Release the control key.

    With the left mouse button, drag the object to a corner of the window.

    Repeate the process for the other objects.

    Manipulate the objects

    Use Uviewer3D's capabilities to manipulate the objects.  For example, here is a series of steps for testing the inheritance of properties:

  5. 1.      Display the object selector by pressing the SelectObject button.
  6. Select the top-level object (Top3D) and select the Apply button.

    Display the properties editor by selecting Editors->Object, then selecting Properties from the Object option menu.

    In the properties editor, select Primary Color from the Object Color option menu. Use the dials to change the color. Notice that all objects change. By default, an object inherits the properties of its parent, so when we change the top-level object, all objects change.

    In the object selector, select one of the other objects and select Apply. Now the properties editor shows that object's current properties. (You could also have selected the object itself using the mouse inside the view.)

    In the properties editor, change the object's color. Notice that the color of that object changes.

    Explore Uviewer3D's capabilities

    Explore Uviewer3D's editors and mouse operations.  The tables below summarize Uviewer3D's capabilities.

    Editors under
    Uviewer3D

     

    Description

     

    Editors->View

    An editor for the view's basic information.

    Editors->Transform

    An editor for transforming the selected object as well as specifying interactor behavior.

    Editors->Light

    An editor for the view's light information..

    Editors->Camera

    An editor for the view's camera.

    Editors->Object

    An editor for the selected object's basic information, properties, modes and texture.

    Editors->Datamap

    An editor for controlling the conversion of scalar node or cell data to colors. Our object does not have node or cell data.

    SelectObject...

    A dialog box that allows you to select an object from a list of objects in the view.

     

    Standard
    Mouse-controlled operations

     

    What to do

     

    Pick

    Hold down the Control key and press the left mouse button.

    XY Translate

    Select Translate icon from the tool bar in the application and drag the object with the left mouse button.

    Z Translate

    Select Z Translate from the tool bar in the application and drag the object with the left mouse button.

    Rotate

    Select Rotate from the tool bar in the application and drag the object with the left mouse button.

    Scale

    Select Scale from the tool bar in the application and drag the object with the left mouse button.

     

    If you have a three-button mouse, some of the standard operations can also be performed using the middle mouse button.

    Accelerated
    Mouse-controlled operations

     

    What to do

     

    XY Translate

    Drag the object with Control middle mouse button.

    Rotate

    Drag the object with the middle mouse button.

    Scale

    Drag the object with Shift middle mouse button.

     

    Clean up

    This completes the tutorial. The completed tutorial is available in Libraries.Examples.Graphics_Display.MultipleObjs.

    Delete the application.



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