edu.unh.sdb.datasource
Class RayCastingIterator

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

public class RayCastingIterator
extends java.lang.Object
implements SDBIterator

Iterates through an arbitrary oriented cuboid. At each step a new ray perpendicular on the base of the cuboid is returned. The iterations continues untill the whole based is finished.

Author:
dlipsa

Constructor Summary
RayCastingIterator(DataSource dataSource, javax.vecmath.Vector3d initialOrientation, javax.vecmath.Matrix4d rot, javax.vecmath.Point3d start, double baseX, double baseY, double height)
          Start with a cuboid oriented along the Z axis, the base at z=-height/2 and the top at z = height/2.
 
Method Summary
 void end()
          Advance the iterator to the last valid value in the iteration.
 javax.vecmath.Vector3d getBaseNormal()
           
 double getBaseX()
           
 double getBaseY()
           
 double getBeginX()
           
 double getBeginY()
           
 RayIterator getCurrentRay()
           
 double getCurrentX()
           
 double getCurrentY()
           
 double getEndX()
           
 double getEndY()
           
 double getHeight()
           
 javax.vecmath.Matrix4d getRotation()
           
 javax.vecmath.Point3d getStart()
           
 double getStep()
           
 javax.vecmath.Vector3d getViewingDirection()
           
 void init()
          Perform any necessary initialization, and set the iterator value to the first value in the iteration.
 boolean isBacktoFront()
           
 boolean lastX()
           
 boolean lastY()
           
 boolean next()
          Advance the iterator by one step.
 void setBacktoFront(boolean backtoFront)
           
 void setBlockSize(IndexSpaceID blockSize)
           
 void setStep(double step)
           
 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
 

Constructor Detail

RayCastingIterator

public RayCastingIterator(DataSource dataSource,
                          javax.vecmath.Vector3d initialOrientation,
                          javax.vecmath.Matrix4d rot,
                          javax.vecmath.Point3d start,
                          double baseX,
                          double baseY,
                          double height)
Start with a cuboid oriented along the Z axis, the base at z=-height/2 and the top at z = height/2. The 'center' of the cuboid is at origin. Rotate the cuboid to get to 'initialOrientation'. Usually, this is a no-operation. Rotate the cuboid with 'rotation' and then move the center to 'start'.

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

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

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

lastX

public boolean lastX()

lastY

public boolean lastY()

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

getCurrentRay

public RayIterator getCurrentRay()

getBaseX

public double getBaseX()

getBeginX

public double getBeginX()

getEndX

public double getEndX()

getCurrentX

public double getCurrentX()

getBeginY

public double getBeginY()

getEndY

public double getEndY()

getCurrentY

public double getCurrentY()

getBaseY

public double getBaseY()

getHeight

public double getHeight()

getStart

public javax.vecmath.Point3d getStart()

getBaseNormal

public javax.vecmath.Vector3d getBaseNormal()

getRotation

public javax.vecmath.Matrix4d getRotation()

setBlockSize

public void setBlockSize(IndexSpaceID blockSize)

setStep

public void setStep(double step)

getStep

public double getStep()

isBacktoFront

public boolean isBacktoFront()

setBacktoFront

public void setBacktoFront(boolean backtoFront)

getViewingDirection

public javax.vecmath.Vector3d getViewingDirection()