ucl.physiol.neuroconstruct.project
Class Region

java.lang.Object
  extended by ucl.physiol.neuroconstruct.project.Region
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConicalRegion, CylindricalRegion, RectangularBox, SphericalRegion

public abstract class Region
extends Object
implements Serializable

Base class for Regions in 3D. Any new Region must implement all the abstract methods here, most importantly, defining the internal variables which make the shape and implementing a 3D view for addPrimitiveForRegion()

Author:
Padraig Gleeson
See Also:
Serialized Form

Constructor Summary
Region()
           
Region(String description)
           
 
Method Summary
abstract  com.sun.j3d.utils.geometry.Primitive addPrimitiveForRegion(TransformGroup tg, Appearance app)
          Generate a shape of the region in 3D and add it to the TransformGroup
abstract  Object clone()
          Needs to be used when generating a copy.
abstract  boolean equals(Object obj)
           
 String getDescription()
           
abstract  float getHighestXValue()
           
abstract  float getHighestYValue()
           
abstract  float getHighestZValue()
           
abstract  float getLowestXValue()
          These functions need to be implemented in the subclass for packing purposes and for getting the general location of the region in a generic way
abstract  float getLowestYValue()
           
abstract  float getLowestZValue()
           
 InternalParameter[] getParameterList()
          This function is needed for automatic storage of the Parameters by XMLEncoder.
abstract  Region getTranslatedRegion(Vector3f trans)
          Gets a new Region of the same type, with coords translated by the specified Vector
abstract  double getVolume()
           
abstract  boolean isCellWithinRegion(Point3f point, Cell cell, boolean completelyInside)
          The function to check if the cell mentioned is within the region
abstract  boolean isPointInRegion(Point3f point)
           
protected  boolean parametersEqual(Region region)
           
 void setDescription(String description)
           
 void setParameter(String parameterName, float parameterValue)
          Sub classes should know what the parameters mean, and so this function could need to be overwritten, for better checking of values
 void setParameterList(InternalParameter[] parameterList)
           
abstract  String toString()
          Returns a short summary of the class's state, for GUIs etc.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Region

public Region()

Region

public Region(String description)
Method Detail

equals

public abstract boolean equals(Object obj)
Overrides:
equals in class Object

parametersEqual

protected boolean parametersEqual(Region region)

getParameterList

public InternalParameter[] getParameterList()
This function is needed for automatic storage of the Parameters by XMLEncoder. If the internal functioning of the subclasses only use these params, they don't need to worry about data saving.


setParameter

public void setParameter(String parameterName,
                         float parameterValue)
Sub classes should know what the parameters mean, and so this function could need to be overwritten, for better checking of values


setParameterList

public void setParameterList(InternalParameter[] parameterList)

toString

public abstract String toString()
Returns a short summary of the class's state, for GUIs etc. Included here (even though it's in Object) to force the subclasses to implement it

Overrides:
toString in class Object
Returns:
A string rep of internal state

getLowestXValue

public abstract float getLowestXValue()
These functions need to be implemented in the subclass for packing purposes and for getting the general location of the region in a generic way


getLowestYValue

public abstract float getLowestYValue()

getLowestZValue

public abstract float getLowestZValue()

getHighestXValue

public abstract float getHighestXValue()

getHighestYValue

public abstract float getHighestYValue()

getHighestZValue

public abstract float getHighestZValue()

clone

public abstract Object clone()
Needs to be used when generating a copy. Ideally just using the default constructor and copying the internal params but that can't be done here since the class is abstract

Overrides:
clone in class Object

isCellWithinRegion

public abstract boolean isCellWithinRegion(Point3f point,
                                           Cell cell,
                                           boolean completelyInside)
The function to check if the cell mentioned is within the region

Parameters:
point - The point at which the cell is translated to.
cell - The cell to be placed in the region
completelyInside - If true, all soma segments of the cell must be inside region if false, only the start point of the soma must be inside (centre for spherical somas)
Returns:
true if the cell can be placed inside the region

getTranslatedRegion

public abstract Region getTranslatedRegion(Vector3f trans)
Gets a new Region of the same type, with coords translated by the specified Vector


isPointInRegion

public abstract boolean isPointInRegion(Point3f point)

getVolume

public abstract double getVolume()

addPrimitiveForRegion

public abstract com.sun.j3d.utils.geometry.Primitive addPrimitiveForRegion(TransformGroup tg,
                                                                           Appearance app)
Generate a shape of the region in 3D and add it to the TransformGroup


getDescription

public String getDescription()

setDescription

public void setDescription(String description)