public class CircleCursor3D<T> extends Object implements Cursor<T>
CircleCursor
,
Midpoint circle algorithm on Wikipedia.Modifier and Type | Field and Description |
---|---|
protected double[] |
center |
protected Localizable |
centerPoint |
protected double[] |
doublePos |
protected boolean |
hasNext |
protected long[] |
longPos |
protected RandomAccess<T> |
ra |
protected long |
radius |
protected RandomAccessible<T> |
rai |
protected long |
x |
protected double[] |
xBasis |
protected double[] |
xVec |
protected long |
y |
protected double[] |
yBasis |
protected double[] |
yVec |
Constructor and Description |
---|
CircleCursor3D(RandomAccessible<T> rai,
Localizable center,
long radius,
double[] circleNorm)
Iterates over a Bresenham circle in the target
RandomAccessible . |
CircleCursor3D(RandomAccessible<T> rai,
Localizable center,
long radius,
double[] xBasis,
double[] yBasis)
Iterates over a Bresenham circle in the target
RandomAccessible . |
Modifier and Type | Method and Description |
---|---|
Sampler<T> |
copy() |
Cursor<T> |
copyCursor() |
void |
fwd() |
T |
get() |
double |
getDoublePosition(int d) |
float |
getFloatPosition(int d) |
int |
getIntPosition(int d) |
long |
getLongPosition(int d) |
boolean |
hasNext() |
void |
jumpFwd(long steps) |
void |
localize(double[] position) |
void |
localize(float[] position) |
void |
localize(int[] position) |
void |
localize(long[] position) |
T |
next() |
int |
numDimensions() |
void |
reset() |
protected void |
roundPos(double[] doublePos,
long[] longPos) |
protected void |
setPos(long xScale,
long yScale) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
localize, positionAsLongArray, positionAsPoint
localize, positionAsDoubleArray, positionAsRealPoint
protected final RandomAccessible<T> rai
protected final RandomAccess<T> ra
protected final Localizable centerPoint
protected final double[] center
protected final double[] xBasis
protected final double[] yBasis
protected final long radius
protected double[] xVec
protected double[] yVec
protected long[] longPos
protected double[] doublePos
protected long x
protected long y
protected boolean hasNext
public CircleCursor3D(RandomAccessible<T> rai, Localizable center, long radius, double[] circleNorm)
RandomAccessible
.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.rai
- the random accessible. It is the caller's responsibility to
ensure it can be accessed everywhere the circle will be
iterated.center
- the circle center. Must be at least of dimension 3. Dimensions
0, 1 and 2 are used to specify the circle center.radius
- the circle radius.circleNorm
- the unit normal to the circle plane, must be 3-dimensional. The "new"
x and y basis vectors will be constructed from this vector.public CircleCursor3D(RandomAccessible<T> rai, Localizable center, long radius, double[] xBasis, double[] yBasis)
RandomAccessible
.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.rai
- the random accessible. It is the caller responsibility to
ensure it can be accessed everywhere the circle will be
iterated.center
- the circle center.radius
- the circle radius.xBasis
- the vector representing the "new" x-axis of the circle plane. Should be orthogonal to both the
circle normal and the yBasisyBasis
- the vector representing the "new" y-axis of the circle plane. Should be orthogonal to both the circle
normal and the xBasispublic Cursor<T> copyCursor()
copyCursor
in interface Cursor<T>
copyCursor
in interface RealCursor<T>
public void jumpFwd(long steps)
public void fwd()
protected void setPos(long xScale, long yScale)
protected void roundPos(double[] doublePos, long[] longPos)
public void reset()
public void localize(float[] position)
localize
in interface RealLocalizable
public void localize(double[] position)
localize
in interface RealLocalizable
public void localize(int[] position)
localize
in interface Localizable
public void localize(long[] position)
localize
in interface Localizable
public int getIntPosition(int d)
getIntPosition
in interface Localizable
public long getLongPosition(int d)
getLongPosition
in interface Localizable
public float getFloatPosition(int d)
getFloatPosition
in interface Localizable
getFloatPosition
in interface RealLocalizable
public double getDoublePosition(int d)
getDoublePosition
in interface Localizable
getDoublePosition
in interface RealLocalizable
public int numDimensions()
numDimensions
in interface EuclideanSpace
Copyright © 2015–2021 Fiji. All rights reserved.