org.jdesktop.wonderland.server.spatial.impl
Class SpatialCellImpl

java.lang.Object
  extended by org.jdesktop.wonderland.server.spatial.impl.SpatialCellImpl
All Implemented Interfaces:
SpatialCell, ViewUpdateListener
Direct Known Subclasses:
ViewCellImpl

public class SpatialCellImpl
extends java.lang.Object
implements SpatialCell, ViewUpdateListener

Author:
paulby

Nested Class Summary
static interface SpatialCellImpl.TransformChangeListener
           
static interface SpatialCellImpl.WorldBoundsChangeListener
           
 
Constructor Summary
SpatialCellImpl(CellID id, java.math.BigInteger dsID)
           
 
Method Summary
 void acquireRootReadLock()
           
 void addChild(SpatialCell child, com.sun.sgs.auth.Identity identity)
          Add the supplied object as a child of this.
 void addViewUpdateListener(ViewUpdateListener viewUpdateListener)
          Listener for changes to any view to which this cell is close
 void destroy()
          Destroy this cell, removing it from all the view caches
 CellID getCellID()
           
 com.jme.bounding.BoundingVolume getLocalBounds()
          Users should call acquireRootReadLock while they are using the results of this call
 CellTransform getLocalTransform()
          Users should call acquireRootReadLock while they are using the results of this call
 com.jme.bounding.BoundingVolume getWorldBounds()
          Users should call acquireRootReadLock while they are using the results of this call
 CellTransform getWorldTransform()
           
 void releaseRootReadLock()
           
 void removeChild(SpatialCell child)
          Remove the specified child from this SpatialCell
 void removeViewUpdateListener(ViewUpdateListener viewUpdateListener)
          Remove the specified ViewUpdateListener
 void revalidate()
          Notify the view caches that this cell needs to be revalidated
 void revalidateListeners(com.sun.sgs.auth.Identity identity)
          Re-notify each listener of the position of this cell
 void setAttribute(java.lang.Object attr)
          Set the current state of an attibute
 void setLocalBounds(com.jme.bounding.BoundingVolume localBounds)
          Set the bounds of this object in the local coordinate system.
 void setLocalTransform(CellTransform transform, com.sun.sgs.auth.Identity identity)
          Set the local transform for this object.
 void viewLoggedIn(CellID cell, CellID viewCellID)
          Notification that a view that is displaying this cell logged in.
 void viewLoggedOut(CellID cell, CellID viewCellID)
          Notification that a view logged out
 void viewTransformChanged(CellID cell, CellID viewCellID, CellTransform viewWorldTransform)
          This may be called concurrently from multiple threads, so implentations must be thread safe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialCellImpl

public SpatialCellImpl(CellID id,
                       java.math.BigInteger dsID)
Method Detail

getLocalBounds

public com.jme.bounding.BoundingVolume getLocalBounds()
Users should call acquireRootReadLock while they are using the results of this call

Specified by:
getLocalBounds in interface SpatialCell
Returns:

setLocalBounds

public void setLocalBounds(com.jme.bounding.BoundingVolume localBounds)
Description copied from interface: SpatialCell
Set the bounds of this object in the local coordinate system. Note the system guarantees that the bounds of a parent fully enclose the bounds of a child, so this call may cause the world bounds of parent cells to be updated.

Specified by:
setLocalBounds in interface SpatialCell
Parameters:
localBounds - the localBounds to set

getWorldBounds

public com.jme.bounding.BoundingVolume getWorldBounds()
Users should call acquireRootReadLock while they are using the results of this call

Specified by:
getWorldBounds in interface SpatialCell
Returns:

getLocalTransform

public CellTransform getLocalTransform()
Users should call acquireRootReadLock while they are using the results of this call

Specified by:
getLocalTransform in interface SpatialCell
Returns:

setLocalTransform

public void setLocalTransform(CellTransform transform,
                              com.sun.sgs.auth.Identity identity)
Description copied from interface: SpatialCell
Set the local transform for this object. Note the system guarantees that the bounds of a parent fully enclose the bounds of a child, so this call may cause the world bounds of parent cells to be updated.

Specified by:
setLocalTransform in interface SpatialCell
Parameters:
transform - the transform to set

getWorldTransform

public CellTransform getWorldTransform()

addChild

public void addChild(SpatialCell child,
                     com.sun.sgs.auth.Identity identity)
Description copied from interface: SpatialCell
Add the supplied object as a child of this.

Specified by:
addChild in interface SpatialCell

addViewUpdateListener

public void addViewUpdateListener(ViewUpdateListener viewUpdateListener)
Listener for changes to any view to which this cell is close

Specified by:
addViewUpdateListener in interface SpatialCell
Parameters:
viewUpdateListener -

removeViewUpdateListener

public void removeViewUpdateListener(ViewUpdateListener viewUpdateListener)
Description copied from interface: SpatialCell
Remove the specified ViewUpdateListener

Specified by:
removeViewUpdateListener in interface SpatialCell
Parameters:
listener -

revalidateListeners

public void revalidateListeners(com.sun.sgs.auth.Identity identity)
Re-notify each listener of the position of this cell

Specified by:
revalidateListeners in interface SpatialCell

removeChild

public void removeChild(SpatialCell child)
Description copied from interface: SpatialCell
Remove the specified child from this SpatialCell

Specified by:
removeChild in interface SpatialCell

setAttribute

public void setAttribute(java.lang.Object attr)
Description copied from interface: SpatialCell
Set the current state of an attibute

Specified by:
setAttribute in interface SpatialCell
Parameters:
attr - the attr state

getCellID

public CellID getCellID()

acquireRootReadLock

public void acquireRootReadLock()

releaseRootReadLock

public void releaseRootReadLock()

revalidate

public void revalidate()
Notify the view caches that this cell needs to be revalidated

Specified by:
revalidate in interface SpatialCell

destroy

public void destroy()
Description copied from interface: SpatialCell
Destroy this cell, removing it from all the view caches

Specified by:
destroy in interface SpatialCell

viewLoggedIn

public void viewLoggedIn(CellID cell,
                         CellID viewCellID)
Description copied from interface: ViewUpdateListener
Notification that a view that is displaying this cell logged in.

Specified by:
viewLoggedIn in interface ViewUpdateListener
viewCellID - the view that has this cell in its cache

viewTransformChanged

public void viewTransformChanged(CellID cell,
                                 CellID viewCellID,
                                 CellTransform viewWorldTransform)
Description copied from interface: ViewUpdateListener
This may be called concurrently from multiple threads, so implentations must be thread safe

Specified by:
viewTransformChanged in interface ViewUpdateListener

viewLoggedOut

public void viewLoggedOut(CellID cell,
                          CellID viewCellID)
Description copied from interface: ViewUpdateListener
Notification that a view logged out

Specified by:
viewLoggedOut in interface ViewUpdateListener
Parameters:
cell - the cell that is being monitored
viewCellID - the view cell that logged out


Open Wonderland - http://openwonderland.org