edu.washington.biostr.sig.brainj3d.view3D
Class BrainInfoAtlasDataView

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.data.DefaultDataView<BrainInfoAtlasData>
      extended by edu.washington.biostr.sig.brainj3d.view3D.BrainInfoAtlasDataView
All Implemented Interfaces:
DataView, Plane3DView, Surface3DView, View3D

public class BrainInfoAtlasDataView
extends DefaultDataView<BrainInfoAtlasData>
implements Surface3DView, Plane3DView

Wrap the BrainInfoAtlasData so that it can be displayed in 3D. This allows several custom visualization modes that may be appropriate for atlas data.
These include a flat option that eliminates contour and the ability to assign each part a custom color. It also allows any subpart to be switched on or off. It may eventually support non photo realistic rendering.

Version:
1.1
Author:
Eider Moore

Field Summary
static String COLLECTION
          The subkey for changing the visibility of an entire collection.
static String COLOR
          The subkey for changing the color of the object.
static String FLAT
          The key to make the model flat.
static String NPR
          Not supported yet, eventually will allow non photo realistic rendering.
static String VISIBLE
          The subkey for changing the visibility of the object.
 
Fields inherited from interface edu.washington.biostr.sig.brainj3d.model.Surface3DView
AMBIENT, DIFFUSE, EMISSIVE, INVERT, SCREEN_DOOR, SPECULAR, TRANSPARENCY, VERTEX_COLORS
 
Constructor Summary
BrainInfoAtlasDataView()
           
BrainInfoAtlasDataView(FileGroup key, BrainInfoAtlasData data)
           
 
Method Summary
 boolean canChange()
          Subparts can be changed
 boolean canChangeAppearance()
          Appearence of subparts can be changed
 boolean canChangeColors()
          Color of subparts can be changed
 boolean canChangeNormals()
          Not supported in compound models
 boolean canChangeVertices()
          Not supported in compound models
 boolean canPick()
          If this object allows picking to select it, return this.
 boolean canPickGeometry()
          If we can do a detailed pick on this object and geometry (to determine the exact location on the model of the pick), this should be set to true.
 boolean canSwitchColors()
          If the view supports changing between per vertex color and appearance mode, this should return true.
 javax.media.j3d.Appearance getAppearance()
          Not supported in compound models
 AtlasGroup getAtlasGroup()
           
 DataController getController(DataKey dataKey, DoTarget target)
          Get the controller for this DataView.
 AtlasElement getElement(String substring)
           
 javax.media.j3d.GeometryArray[] getGeoArrays()
           
 javax.media.j3d.BranchGroup getNode()
          In order to display 3D Models we need to have a node that represents an object or set of objects.
 javax.media.j3d.BranchGroup[] getNodesToDetach()
          Get all of the nodes to detach.
 Plane3D getPlane3D()
          Get a Plane3D that this view contains.
 String getSpace()
           
 javax.media.j3d.Transform3D getSpaceTransform()
           
 String getUnit()
           
 String getViewName()
          Get a name that should identify this type of view, but not this individual view.
 boolean isPlane3D()
          If the object is a cutawaynode, return true.
 void setData(FileGroup dataKey, Data data)
          Initialize this view with the given data and the specified meta data (in the form of a map of tags).
throw an ImmutableException if it is called more than once.
 void setDefaultParameters(Set<Tag> metadata)
          Restore the defaults parameters.
protected  boolean setParameter(String parameter, Object value, Object oldValue, boolean beLazy)
          Set a parameter.
 void setSpaceTransform(String newSpace, javax.media.j3d.Transform3D trans)
           
 void setUnit(String newUnit)
           
 void setUseColors(boolean useColors)
          Sometimes a view can decide whether or not to use explicit colors for each vertex or the material color.
 boolean supportsAlternateAppearance()
          If we can set the alternate appearance in order to select this object, this should be true.
 
Methods inherited from class edu.washington.biostr.sig.brainj3d.data.DefaultDataView
addedToModel, equals, getCastData, getData, getDataKey, getInterval, getKey, getMaxTime, getMinTime, getParameter, getParameters, getTarget, hashCode, hasTime, removedFromModel, setParameter, setParameter, setParameters, setTarget, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.washington.biostr.sig.brainj3d.data.DataView
addedToModel, getData, getDataKey, getInterval, getKey, getMaxTime, getMinTime, getParameters, getTarget, hasTime, removedFromModel, setParameter, setParameters, setTarget
 

Field Detail

COLOR

public static final String COLOR
The subkey for changing the color of the object. The full key is prefixed with the object's id.

See Also:
Constant Field Values

VISIBLE

public static final String VISIBLE
The subkey for changing the visibility of the object. The full key is prefixed with the object's id.

See Also:
Constant Field Values

COLLECTION

public static final String COLLECTION
The subkey for changing the visibility of an entire collection. The full key is prefixed with the object's id.

See Also:
Constant Field Values

FLAT

public static final String FLAT
The key to make the model flat.

See Also:
Constant Field Values

NPR

public static final String NPR
Not supported yet, eventually will allow non photo realistic rendering.

See Also:
Constant Field Values
Constructor Detail

BrainInfoAtlasDataView

public BrainInfoAtlasDataView()

BrainInfoAtlasDataView

public BrainInfoAtlasDataView(FileGroup key,
                              BrainInfoAtlasData data)
Method Detail

getNode

public javax.media.j3d.BranchGroup getNode()
Description copied from interface: Surface3DView
In order to display 3D Models we need to have a node that represents an object or set of objects. Since this view will not only be added to a single parent, you should return the same node each time this is called. It may be compiled or made live after being returned so all capabilities that need to be set should be set before the object is returned.

Specified by:
getNode in interface Surface3DView
Returns:
a group that contains all sub models.

getAppearance

public javax.media.j3d.Appearance getAppearance()
Not supported in compound models

Specified by:
getAppearance in interface Surface3DView
Returns:
null

canChangeAppearance

public boolean canChangeAppearance()
Appearence of subparts can be changed

Specified by:
canChangeAppearance in interface Surface3DView
Returns:
true

canChangeColors

public boolean canChangeColors()
Color of subparts can be changed

Specified by:
canChangeColors in interface Surface3DView
Returns:
true

canChangeNormals

public boolean canChangeNormals()
Not supported in compound models

Specified by:
canChangeNormals in interface Surface3DView
Returns:
false

canChangeVertices

public boolean canChangeVertices()
Not supported in compound models

Specified by:
canChangeVertices in interface Surface3DView
Returns:
false

canChange

public boolean canChange()
Subparts can be changed

Specified by:
canChange in interface Surface3DView
Returns:
true

canPick

public boolean canPick()
Description copied from interface: Surface3DView
If this object allows picking to select it, return this.

Specified by:
canPick in interface Surface3DView
Returns:
See Also:
PickTools.INTERSECT_TEST

canPickGeometry

public boolean canPickGeometry()
Description copied from interface: Surface3DView
If we can do a detailed pick on this object and geometry (to determine the exact location on the model of the pick), this should be set to true.

Specified by:
canPickGeometry in interface Surface3DView
Returns:
See Also:
PickTools.INTERSECT_FULL

isPlane3D

public boolean isPlane3D()
Description copied from interface: Surface3DView
If the object is a cutawaynode, return true.

Specified by:
isPlane3D in interface Surface3DView
Returns:

supportsAlternateAppearance

public boolean supportsAlternateAppearance()
Description copied from interface: Surface3DView
If we can set the alternate appearance in order to select this object, this should be true.

Specified by:
supportsAlternateAppearance in interface Surface3DView
Returns:

setUseColors

public void setUseColors(boolean useColors)
Description copied from interface: Surface3DView
Sometimes a view can decide whether or not to use explicit colors for each vertex or the material color. If it supports these behaviors, this should switch between them. Otherwise it should return quietly.

Specified by:
setUseColors in interface Surface3DView

canSwitchColors

public boolean canSwitchColors()
Description copied from interface: Surface3DView
If the view supports changing between per vertex color and appearance mode, this should return true.

Specified by:
canSwitchColors in interface Surface3DView
Returns:

getGeoArrays

public javax.media.j3d.GeometryArray[] getGeoArrays()
Specified by:
getGeoArrays in interface Surface3DView

setUnit

public void setUnit(String newUnit)
Specified by:
setUnit in interface View3D

getUnit

public String getUnit()
Specified by:
getUnit in interface View3D

getSpace

public String getSpace()
Specified by:
getSpace in interface View3D

setSpaceTransform

public void setSpaceTransform(String newSpace,
                              javax.media.j3d.Transform3D trans)
Specified by:
setSpaceTransform in interface View3D

getSpaceTransform

public javax.media.j3d.Transform3D getSpaceTransform()
Specified by:
getSpaceTransform in interface View3D

getController

public DataController getController(DataKey dataKey,
                                    DoTarget target)
Description copied from interface: DataView
Get the controller for this DataView.

Specified by:
getController in interface DataView
target - The target or null if the target remains unchanged
Returns:

setData

public void setData(FileGroup dataKey,
                    Data data)
             throws ClassCastException
Description copied from interface: DataView
Initialize this view with the given data and the specified meta data (in the form of a map of tags).
throw an ImmutableException if it is called more than once. If the data is an inappropriate type, this should throw a ClassCastException. Acceptable types should be clearly documented.

Specified by:
setData in interface DataView
Overrides:
setData in class DefaultDataView<BrainInfoAtlasData>
Throws:
ClassCastException - if data's class is the wrong type.

getNodesToDetach

public javax.media.j3d.BranchGroup[] getNodesToDetach()
Description copied from interface: Surface3DView
Get all of the nodes to detach. This is called immediately after removedFromModel

Specified by:
getNodesToDetach in interface Surface3DView
Returns:

setParameter

protected boolean setParameter(String parameter,
                               Object value,
                               Object oldValue,
                               boolean beLazy)
Description copied from class: DefaultDataView
Set a parameter. When a bulk set is performed, this is called multiple times.
Default implementation just returns false.

Overrides:
setParameter in class DefaultDataView<BrainInfoAtlasData>
Returns:
true if anything changed.

getElement

public AtlasElement getElement(String substring)

setDefaultParameters

public void setDefaultParameters(Set<Tag> metadata)
Description copied from class: DefaultDataView
Restore the defaults parameters.

Specified by:
setDefaultParameters in interface DataView
Overrides:
setDefaultParameters in class DefaultDataView<BrainInfoAtlasData>
Parameters:
metadata - Use metadata to customize the view.

getViewName

public String getViewName()
Description copied from interface: DataView
Get a name that should identify this type of view, but not this individual view.

Specified by:
getViewName in interface DataView
Returns:

getPlane3D

public Plane3D getPlane3D()
Description copied from interface: Plane3DView
Get a Plane3D that this view contains. If for whatever reason it doesn't have one, return null.

Specified by:
getPlane3D in interface Plane3DView
Returns:
A Plane3D or null.

getAtlasGroup

public AtlasGroup getAtlasGroup()
Returns:
The compound model.


Copyright © 2006 University of Washington. All Rights Reserved.