JavaView® v2.12

jv.viewer
Class PvScene

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.viewer.PvScene
All Implemented Interfaces:
java.lang.Cloneable, PsUpdateIf, java.io.Serializable

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.

Version:
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)
Author:
Konrad Polthier
See Also:
jv.project.PvGeometry, PgGeometryIf, PvDisplayIf, Serialized Form

Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS
 
Constructor Summary
PvScene()
          Constructor.
 
Method Summary
 void addGeometry(jv.viewer.PvGeometry aGeometry)
          Register geometry to be displayed
 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 g, PvDisplayIf disp)
           
 jv.viewer.PvGeometry removeGeometry(jv.viewer.PvGeometry aGeometry)
          Remove geometry from list of registered geometries and return new current geometry container.
 void selectGeometry(jv.viewer.PvGeometry aGeometry)
           
 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, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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(jv.viewer.PvGeometry aGeometry)
Register geometry to be displayed

removeGeometry

public jv.viewer.PvGeometry removeGeometry(jv.viewer.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.

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

selectGeometry

public void selectGeometry(jv.viewer.PvGeometry aGeometry)

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.
Overrides:
update in class PsObject
Following copied from class: jv.object.PsObject
See Also:
PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)

paint

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

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.