gov.nasa.worldwindx.examples.lineofsight
Class LineIntersector
java.lang.Object
gov.nasa.worldwindx.examples.lineofsight.LineIntersector
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- ShapeLineIntersector, TerrainLineIntersector
public abstract class LineIntersector
- extends Object
- implements Runnable
Base class for intersectors that compute intersections with a line. The line is specified by a single origin (see
setReferencePosition(gov.nasa.worldwind.geom.Position)) and a list of end positions (see setPositions(Iterable)).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
allIntersections
protected Map<Position,List<Intersection>> allIntersections
endTime
protected long endTime
numPositions
protected int numPositions
numProcessedPositions
protected AtomicInteger numProcessedPositions
numThreads
protected int numThreads
positions
protected Iterable<Position> positions
referencePoint
protected Vec4 referencePoint
referencePosition
protected Position referencePosition
startTime
protected long startTime
terrain
protected Terrain terrain
threadPool
protected ThreadPoolExecutor threadPool
LineIntersector
protected LineIntersector(Terrain terrain,
int numThreads)
doPerformIntersection
protected abstract void doPerformIntersection(Position position)
throws InterruptedException
- Called to execute an intersection test for one position.
- Parameters:
position - the position to test.
- Throws:
InterruptedException - if the operation is interrupted.s
getAllIntersections
public Map<Position,List<Intersection>> getAllIntersections()
getEndTime
public long getEndTime()
getIntersections
public List<Intersection> getIntersections(Position position)
getNumProcessedPositions
public int getNumProcessedPositions()
getNumThreads
public int getNumThreads()
getPositions
public Iterable<Position> getPositions()
getReferencePosition
public Position getReferencePosition()
getStartTime
public long getStartTime()
getTerrain
public Terrain getTerrain()
performIntersection
protected void performIntersection(Position position)
throws InterruptedException
- Throws:
InterruptedException
run
public void run()
- Specified by:
run in interface Runnable
setPositions
public void setPositions(Iterable<Position> positions)
- Specifies the end positions of all lines to intersect. Intersection tests are performed for each position, using
the position as the line's end and the current reference position as the line's origin.
- Parameters:
positions - the positions.
setReferencePosition
public void setReferencePosition(Position referencePosition)
- Sets the origin of the lines to intersect.
- Parameters:
referencePosition - the origin to use for all lines.