edu.unh.sdb.datasource
Class RayIteratorStep

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

public class RayIteratorStep
extends RayIterator

Reads data from a DataSource along a line segment.

Author:
dlipsa

Field Summary
 
Fields inherited from class edu.unh.sdb.datasource.RayIterator
dataSource, transferFunction
 
Constructor Summary
RayIteratorStep(DataSource dataSource, javax.vecmath.Point3d begin, javax.vecmath.Point3d end, IndexSpaceID blockSize, double step)
          Reads data from dataSource along the line seqment between p1 and p2.
 
Method Summary
 void end()
          Advance the iterator to the last valid value in the iteration.
 javax.vecmath.Point3d getBeginPoint()
          Returns the begin, current and end point or block coordinates.
 java.lang.Object getCurrentElement()
           
 int getCurrentElementIndex()
          Data is stored in a vector.
 javax.vecmath.Point3d getCurrentPoint()
           
 byte[] getElementsData()
           
 int getElementsDimension()
           
 javax.vecmath.Point3d getEndPoint()
           
 javax.vecmath.Vector3d getLineNormal()
           
 javax.vecmath.Point3d getOriginalBeginPoint()
           
 javax.vecmath.Point3d getOriginalEndPoint()
           
 double getStep()
           
 void init()
          Perform any necessary initialization, and set the iterator value to the first value in the iteration.
 boolean next()
          Advance the iterator by one step.
 boolean valid()
          Return true if the iterator currently has a valid value, false otherwise.
 
Methods inherited from class edu.unh.sdb.datasource.RayIterator
calculateNormal, create, create, create, getTransferFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RayIteratorStep

public RayIteratorStep(DataSource dataSource,
                       javax.vecmath.Point3d begin,
                       javax.vecmath.Point3d end,
                       IndexSpaceID blockSize,
                       double step)
Reads data from dataSource along the line seqment between p1 and p2.

Method Detail

init

public 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
Specified by:
init in class RayIterator

next

public 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
Specified by:
next in class RayIterator

valid

public 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
Specified by:
valid in class RayIterator

end

public 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
Specified by:
end in class RayIterator

getBeginPoint

public 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 algorithm switches the original begin and end points.

Specified by:
getBeginPoint in class RayIterator

getOriginalBeginPoint

public javax.vecmath.Point3d getOriginalBeginPoint()
Specified by:
getOriginalBeginPoint in class RayIterator

getCurrentPoint

public javax.vecmath.Point3d getCurrentPoint()
Specified by:
getCurrentPoint in class RayIterator

getEndPoint

public javax.vecmath.Point3d getEndPoint()
Specified by:
getEndPoint in class RayIterator

getOriginalEndPoint

public javax.vecmath.Point3d getOriginalEndPoint()
Specified by:
getOriginalEndPoint in class RayIterator

getLineNormal

public javax.vecmath.Vector3d getLineNormal()
Specified by:
getLineNormal in class RayIterator

getCurrentElementIndex

public int getCurrentElementIndex()
Description copied from class: RayIterator
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.

Specified by:
getCurrentElementIndex in class RayIterator

getElementsData

public byte[] getElementsData()
Specified by:
getElementsData in class RayIterator

getCurrentElement

public java.lang.Object getCurrentElement()
Specified by:
getCurrentElement in class RayIterator

getElementsDimension

public int getElementsDimension()
Specified by:
getElementsDimension in class RayIterator

getStep

public double getStep()