jv.viewer

## Class PvScene

- java.lang.Object
- - jv.object.PsObject
  - - jv.viewer.PvScene

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf

      public final class PvScene
      extends PsObject

  Container class for display. This class holds a set of geometries of class PvGeometry. Each PgGeometry registered in a PvDisplay is stored in the PvScene class associated with the display.
  See Also:
    `PvGeometryIf`, `PgGeometryIf`, `PvDisplayIf`, Serialized Form
  Author:
    Konrad Polthier
  Version:
    21.04.14, 3.01 revised (kp) Computation of zNear and zFar corrected in paint().
    11.02.14, 2.40 revised (kp) Bug in z-buffered depthcue, now exclude special geometries in max z-depth calculation.
    06.02.05, 2.30 revised (kp) Internal height variables removed if last geometry is removed.
    18.01.04, 2.40 revised (kp) Lighting of textured surfaces implemented.
    17.03.03, 2.30 revised (kp) Scene bounding box clipping implemented.
    07.12.02, 2.20 revised (kp) Perspectivity implemented.
    02.07.00, 2.10 revised (kp) Maximal number of registered geometries now automatically adjusted if necessary.
    09.04.00, 2.00 revised (kp) Renamed to PvScene from PvPaint.
    21.06.99, 1.02 revised (kp) Clipping activated.
    02.01.99, 1.01 revised (kp) Additional integer argument for setList calls.
    00.00.97, 1.00 created (kp)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `m_bTiming` Print timer information into display.

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PvScene()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGeometry(PvGeometry aGeometry)` Register geometry in scene for display.
    `boolean` | `containsGeometry(PgGeometryIf aGeometry)` Checks whether geometry is registered in PvGeometry
    `PdVector[]` | `getBounds()` Compute bounding box of all items in the scene, or return null if no items available.
    `double` | `getDiameter()` Compute diameter if scene has items, otherwise return 0
    `void` | `init()` If instance has missing name then assign default name 'Object_NUMBER' where number is the total number of already created instances.
    `void` | `paint(java.awt.Graphics gPaintSceneGraphicsxxxxxxxxxxxxxxx, PvDisplayIf disp)` Major paint method of JavaView.
    `PvGeometry` | `removeGeometry(PvGeometry aGeometry)` Remove geometry from list of registered geometries and return new current geometry container.
    `void` | `selectGeometry(PvGeometry aGeometry)` Select current geometry which may become null if only special geometries are left.
    `void` | `setState(int aKey, boolean aState)`
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### m_bTiming

          public static boolean m_bTiming

      Print timer information into display.

  - ### Constructor Detail

    - #### PvScene

          public PvScene()

      Constructor.

  - ### Method Detail

    - #### init

          public void init()

      Description copied from class: `PsObject`
      If instance has missing name then assign default name 'Object_NUMBER' where number is the total number of already created instances.
      Overrides:
        `init` in class `PsObject`

    - #### addGeometry

          public void addGeometry(PvGeometry aGeometry)

      Register geometry in scene for display.
      Version:
        25.10.01, 1.10 revised (kp) JAX did not replace a cast to PvGeometry.

    - #### removeGeometry

          public PvGeometry removeGeometry(PvGeometry aGeometry)

      Remove geometry from list of registered geometries and return new current geometry container. The current geometry changes if it was the removed geometry. The visible geometry with smallest index is taken, otherwise the first geometry.

      Remark: (Internal Note) The internal index of the current geometry also changes if it was the last one in the geometry array.

      Returns:
        PvGeometry new current geometry container
      Version:
        05.05.05, 1.20 revised (kp) Preferably return a visible geometry.
        29.10.00, 1.10 revised (kp) Update of current geometry corrected.

    - #### selectGeometry

          public void selectGeometry(PvGeometry aGeometry)

      Select current geometry which may become null if only special geometries are left.
      Version:
        03.05.14, 1.30 revised (kp) Selection of null geometry now clears m_currentGeom.
        24.07.04, 1.20 revised (kp) Activated again: select special geometries.
        21.04.04, 1.10 revised (kp) No longer select special geometries.

    - #### containsGeometry

          public boolean containsGeometry(PgGeometryIf aGeometry)

      Checks whether geometry is registered in PvGeometry

    - #### setState

          public void setState(int aKey,
                               boolean aState)

    - #### getBounds

          public PdVector[] getBounds()

      Compute bounding box of all items in the scene, or return null if no items available. All items are multiplied with their modelling matrix before bounding box calculation.

    - #### getDiameter

          public double getDiameter()

      Compute diameter if scene has items, otherwise return 0

    - #### update

          public boolean update(java.lang.Object event)

      Update the class whenever a child has changed. Method is usually invoked from the children.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PsObject`
      Parameters:
        `event` - carries a lot of information
      Returns:
        true if event has been handled, otherwise false
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`
      Version:
        30.10.04, 1.10 revised (kp) Update index list only if numItem have changed.

    - #### paint

          public void paint(java.awt.Graphics gPaintSceneGraphicsxxxxxxxxxxxxxxx,
                            PvDisplayIf disp)

      Major paint method of JavaView. All geometry items are z-sorted and drawn using Painter's algorithm. For each geometry items exists a reference by index to its geometry whose drawing method is invoked.

      It is possible to draw a single geometry in the background first, and another geometry in the foreground after all major drawing has happened. Back- and foreground geometry are drawn by applying Painter's only to their own geometry items.

      Version:
        21.04.14, 3.01 revised (kp) Computation of zNear and zFar corrected.

"

The software JavaView? is copyright protected. All Rights Reserved.
"