edu.unh.sdb.datasource
Class RayIterator

java.lang.Object
  extended by edu.unh.sdb.datasource.RayIterator
All Implemented Interfaces:
SDBIterator
Direct Known Subclasses:
RayIteratorStep

public abstract class RayIterator
extends java.lang.Object
implements SDBIterator

Author:
dlipsa

Field Summary
protected  DataSource dataSource
           
protected  TransferFunction transferFunction
           
 
Constructor Summary
RayIterator(DataSource dataSource)
           
 
Method Summary
protected static javax.vecmath.Vector3d calculateNormal(double beginX, double beginY, double beginZ, double endX, double endY, double endZ)
          Calculate the normal in the plane XZ on the line that conects the two points line eq: _x = _p0 + t * _d plane perpendic.
static RayIterator create(DataSource dataSource, javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
           
static RayIterator create(DataSource dataSource, javax.vecmath.Point3d begin, javax.vecmath.Point3d end, IndexSpaceID blockSize, double step)
           
static RayIterator create(DataSource dataSource, javax.vecmath.Point3i p1, javax.vecmath.Point3i p2)
           
abstract  void end()
          Advance the iterator to the last valid value in the iteration.
abstract  javax.vecmath.Point3d getBeginPoint()
          Returns the begin, current and end point or block coordinates.
abstract  java.lang.Object getCurrentElement()
           
abstract  int getCurrentElementIndex()
          Data is stored in a vector.
abstract  javax.vecmath.Point3d getCurrentPoint()
           
abstract  byte[] getElementsData()
           
abstract  int getElementsDimension()
           
abstract  javax.vecmath.Point3d getEndPoint()
           
abstract  javax.vecmath.Vector3d getLineNormal()
           
abstract  javax.vecmath.Point3d getOriginalBeginPoint()
           
abstract  javax.vecmath.Point3d getOriginalEndPoint()
           
 TransferFunction getTransferFunction()
           
abstract  void init()
          Perform any necessary initialization, and set the iterator value to the first value in the iteration.
abstract  boolean next()
          Advance the iterator by one step.
abstract  boolean valid()
          Return true if the iterator currently has a valid value, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected DataSource dataSource

transferFunction

protected TransferFunction transferFunction
Constructor Detail

RayIterator

public RayIterator(DataSource dataSource)
Method Detail

create

public static RayIterator create(DataSource dataSource,
                                 javax.vecmath.Point3i p1,
                                 javax.vecmath.Point3i p2)

create

public static RayIterator create(DataSource dataSource,
                                 javax.vecmath.Point3d p1,
                                 javax.vecmath.Point3d p2)

create

public static RayIterator create(DataSource dataSource,
                                 javax.vecmath.Point3d begin,
                                 javax.vecmath.Point3d end,
                                 IndexSpaceID blockSize,
                                 double step)

init

public abstract void init()
Description copied from interface: SDBIterator
Perform any necessary initialization, and set the iterator value to the first value in the iteration.

Specified by:
init in interface SDBIterator

next

public abstract boolean next()
Description copied from interface: SDBIterator
Advance the iterator by one step. If the iterator cannot be advanced to produce a valid value, the value of the iterator is undefined, but the next() method will return false, as will a subsequent call to valid().

Specified by:
next in interface SDBIterator

valid

public abstract boolean valid()
Description copied from interface: SDBIterator
Return true if the iterator currently has a valid value, false otherwise.

Specified by:
valid in interface SDBIterator

end

public abstract void end()
Description copied from interface: SDBIterator
Advance the iterator to the last valid value in the iteration. (optional operation)

Specified by:
end in interface SDBIterator

getBeginPoint

public abstract javax.vecmath.Point3d getBeginPoint()
Returns the begin, current and end point or block coordinates. The 'original' versions for the begin and end coordinates are necessar because the sometimes the scan conversion routines switch the original begin and end points.


getOriginalBeginPoint

public abstract javax.vecmath.Point3d getOriginalBeginPoint()

getCurrentPoint

public abstract javax.vecmath.Point3d getCurrentPoint()

getEndPoint

public abstract javax.vecmath.Point3d getEndPoint()

getOriginalEndPoint

public abstract javax.vecmath.Point3d getOriginalEndPoint()

getLineNormal

public abstract javax.vecmath.Vector3d getLineNormal()

getCurrentElementIndex

public abstract int getCurrentElementIndex()
Data is stored in a vector. The index and the dimension is given in elements not in bytes. If data is already converted in RGBA we use getElementsData to get the array that stores the elements otherwise we use getCurrentElement to get the object that stores the current element.


getCurrentElement

public abstract java.lang.Object getCurrentElement()

getElementsData

public abstract byte[] getElementsData()

getElementsDimension

public abstract int getElementsDimension()

getTransferFunction

public final TransferFunction getTransferFunction()

calculateNormal

protected static javax.vecmath.Vector3d calculateNormal(double beginX,
                                                        double beginY,
                                                        double beginZ,
                                                        double endX,
                                                        double endY,
                                                        double endZ)
Calculate the normal in the plane XZ on the line that conects the two points line eq: _x = _p0 + t * _d plane perpendic. on the line that goes through origin: _x * _d = 0 the normal is in plane XZ: y = 0