motris
Class SceneDescription

java.lang.Object
  extended bymotris.SceneDescription
All Implemented Interfaces:
ParameterizedObject.ParameterChangedListener

public class SceneDescription
extends java.lang.Object
implements ParameterizedObject.ParameterChangedListener

This class contains functions for Managing the Scene, ie adding/removing actors and computing the geometry. As lots of other classes access this functionality, all WRITING functionality is synchronized

Author:
dahlkamp

Nested Class Summary
static interface SceneDescription.ActorListChangedListener
           
 
Field Summary
 java.awt.Color[] actorGroupColors
           
 java.util.Vector actorGroupLists
           
 java.util.Vector actorGroupNames
           
 java.util.Vector actorList
           
private  java.util.Vector actorListChangedNotifyList
           
 Camera cam
           
 java.lang.Integer edgeSemaphor
           
private  Experiment experiment
           
private  int lastActorCheckedCache
           
private  int lastPolyCheckedCache
           
(package private)  java.util.Hashtable modelNames
           
 int numberOfActors
           
 int runningActorNumber
           
 
Constructor Summary
SceneDescription(Experiment _experiment, Camera _cam)
           
 
Method Summary
 void addActor(Actor _actor, java.lang.String groupName)
           
private  void addActorGroup(java.lang.String groupName)
          create new Experiment
 void addActorListChangedListener(SceneDescription.ActorListChangedListener l)
           
 DoubleArray findVisibleIntersections(double startX, double startY, double endX, double endY)
           
 void fireActorListChanged()
           
 int getActorNumberForName(java.lang.String name)
           
 Actor getActorVisibleAt(double posX, double posY, boolean noOcclusionCheck, boolean[] shadowVisible)
          Determine, which actor is visible at a certain image position.
 void parameterChanged(ParameterizedObject source)
           
 boolean removeActor(Actor _actor)
           
 boolean removeActorListChangedListener(SceneDescription.ActorListChangedListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actorList

public java.util.Vector actorList

numberOfActors

public int numberOfActors

runningActorNumber

public int runningActorNumber

actorGroupLists

public java.util.Vector actorGroupLists

actorGroupNames

public java.util.Vector actorGroupNames

actorGroupColors

public java.awt.Color[] actorGroupColors

modelNames

java.util.Hashtable modelNames

cam

public Camera cam

experiment

private Experiment experiment

edgeSemaphor

public java.lang.Integer edgeSemaphor

actorListChangedNotifyList

private java.util.Vector actorListChangedNotifyList

lastActorCheckedCache

private int lastActorCheckedCache

lastPolyCheckedCache

private int lastPolyCheckedCache
Constructor Detail

SceneDescription

public SceneDescription(Experiment _experiment,
                        Camera _cam)
Method Detail

addActorGroup

private void addActorGroup(java.lang.String groupName)
create new Experiment


addActor

public void addActor(Actor _actor,
                     java.lang.String groupName)

getActorNumberForName

public int getActorNumberForName(java.lang.String name)

removeActor

public boolean removeActor(Actor _actor)

addActorListChangedListener

public void addActorListChangedListener(SceneDescription.ActorListChangedListener l)

fireActorListChanged

public void fireActorListChanged()

removeActorListChangedListener

public boolean removeActorListChangedListener(SceneDescription.ActorListChangedListener l)

findVisibleIntersections

public DoubleArray findVisibleIntersections(double startX,
                                            double startY,
                                            double endX,
                                            double endY)

getActorVisibleAt

public Actor getActorVisibleAt(double posX,
                               double posY,
                               boolean noOcclusionCheck,
                               boolean[] shadowVisible)
Determine, which actor is visible at a certain image position. N.B.: If there is more than one actor at the position, one random point of each is taken and the closest actor is computed to be the one where the random point is closest to the camera

Parameters:
posX -
posY -
noOcclusionCheck - speedup, return the first actor found (i.e. no check if one actor occludes another)
shadowVisible - is a return value stating whether the point was on the actors' shadow
Returns:
null if no actor is at that position

parameterChanged

public void parameterChanged(ParameterizedObject source)
Specified by:
parameterChanged in interface ParameterizedObject.ParameterChangedListener