|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultGeometrySearch
cz.cuni.jagrlib.testing.UniformGrid
public class UniformGrid
Uniform grid for fast searching.
Nested Class Summary | |
---|---|
protected class |
UniformGrid.CenterIterator
Custom iterator for center pass. |
protected static class |
UniformGrid.GridHeapItem
Support class for grid-pass. |
protected class |
UniformGrid.RayIteratorOld
Custom iterator for ray-segment-pass (old version). |
protected class |
UniformGrid.RaySegmentIterator2D
Custom iterator for ray-segment-pass (new version - 2DDDA). |
protected class |
UniformGrid.RayTriangleIterator3D
Custom iterator for ray-triangle-pass (3DDDA). |
Field Summary | |
---|---|
protected int[] |
accel
Accelerator array. |
protected boolean |
alt
Use alternative implementation? |
static java.lang.String |
ALTERNATIVE
|
protected static java.lang.String |
CATEGORY
Object category. |
protected static int |
CELL_GRANUL
Cell granularity (the rest of each cell is filled by NULL ). |
protected int[] |
cells
Actual number of cells. |
protected double[] |
cellSize
Actual cell size. |
protected int |
ctx
Actual context. |
protected int[][] |
data
Array of individual cells. |
protected int[] |
deferred
Deferred inserted items. |
protected int |
dim
Actual dimensionality of the grid. |
static java.lang.String |
DIM
|
protected int |
entity
Actual entity type ( VERTEX , EDGE or FACE are supported). |
protected Brep |
geometry
Accelarator - reference to Brep instance. |
protected static double |
GRID_EPSILON
Tolerance for cell-boundary tests. |
protected long |
heapCounter
Statistics: heap operations (insert, remove first). |
protected double[] |
leftBound
Actual left boundary. |
static java.lang.String |
MAX_GRID_SIZE
|
protected int |
maxGrid
Maximal grid size (in one dimension). |
protected long |
pointBoxCounter
Statistics: point to box distance. |
protected long |
pointPointCounter
Statistics: point to point distance. |
static RegPiece |
reg
Static registration instance for this class. |
protected double[] |
rightBound
Actual right boundary (relative to the leftBound ). |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
UniformGrid()
|
Method Summary | |
---|---|
boolean |
buildDirectory(int entity,
int ctx)
Builds the whole data structure (directory) from scratch. |
BrepIterator |
centerPass(double[] center,
double radius,
BrepIterator pre)
Initializes a new center pass. |
protected void |
computeAccelerators()
Computes array-indexing accelerators. |
protected void |
computeBounds()
Computes coordinate bounds of the whole data set. |
protected void |
computeBoundsDeferred()
Computes coordinate bounds of the current set plus deferred insertions. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
int |
getStatistics(long[] counters)
Returns (and resets) counters (for statistics, profiling). |
protected void |
insert(int index,
int id)
Inserts a new item into the given cell. |
protected void |
insertEdge(int id,
double[] coords,
int[] vert,
int[][] icoords,
int[] ind)
Inserts a new edge 'id'. |
protected int[] |
insertFace(int id,
double[] coords,
int[] vert,
int[][] icoords,
int[] ind)
Inserts a new face 'id'. |
protected void |
insertVertex(int id,
double[] coords)
Inserts a new vertex 'id'. |
protected boolean |
nextCoord(int[] ind,
int[] mi,
int[] ma)
Computes nex integer-coordinate vector, returns true if succeeded. |
boolean |
optimizeDirectory()
Optimizes the data structure (directory). |
BrepIterator |
rayPass(double[] start,
double[] direction,
BrepIterator pre)
Initializes a new ray-casting pass. |
boolean |
resetDirectory(int entity,
int ctx)
(Re-)initializes the data structure (directory). |
protected void |
scaleGrid()
Determines grid scale and sets the cells[] array. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.DefaultGeometrySearch |
---|
finishedSegment, getProgress, insertObject, intervalQuery, intervalQuery, localize, localize, removeObject, sweepPass |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected static final double GRID_EPSILON
protected int maxGrid
protected int dim
protected boolean alt
protected double[] leftBound
protected double[] rightBound
leftBound
).
protected double[] cellSize
protected int[] cells
protected int[] accel
accel[0]
.. total array size,
accel[1]
.. horizontal size (y++),
accel[2]
.. depth layer size (z++), ..
protected int[][] data
protected Brep geometry
protected int entity
VERTEX
, EDGE
or FACE
are supported).
protected int ctx
protected static final int CELL_GRANUL
NULL
).
protected int[] deferred
protected long pointBoxCounter
protected long pointPointCounter
protected long heapCounter
public static final java.lang.String MAX_GRID_SIZE
public static final java.lang.String DIM
public static final java.lang.String ALTERNATIVE
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public UniformGrid()
Method Detail |
---|
protected void computeBounds()
protected void computeBoundsDeferred()
protected final void computeAccelerators()
protected final void scaleGrid()
protected final void insert(int index, int id)
protected final boolean nextCoord(int[] ind, int[] mi, int[] ma)
true
if succeeded.
protected final void insertVertex(int id, double[] coords)
protected final void insertEdge(int id, double[] coords, int[] vert, int[][] icoords, int[] ind)
protected final int[] insertFace(int id, double[] coords, int[] vert, int[][] icoords, int[] ind)
public boolean buildDirectory(int entity, int ctx)
buildDirectory
in interface GeometrySearch
buildDirectory
in class DefaultGeometrySearch
entity
- Type of stored entities (VERTEX
, EDGE
or
FACE
from interface Brep
).ctx
- Handle to the used Brep
-context.
true
if this service is implemented.resetDirectory(int, int)
,
optimizeDirectory()
,
Brep.VERTEX
,
Brep.EDGE
,
Brep.SOLID
public boolean resetDirectory(int entity, int ctx)
resetDirectory
in interface GeometrySearch
resetDirectory
in class DefaultGeometrySearch
entity
- Type of stored entities (VERTEX
, EDGE
or
FACE
from interface Brep
).ctx
- Handle to the used Brep
-context.
true
if this service is implemented.buildDirectory(int, int)
,
optimizeDirectory()
,
Brep.VERTEX
,
Brep.EDGE
,
Brep.SOLID
public boolean optimizeDirectory()
optimizeDirectory
in interface GeometrySearch
optimizeDirectory
in class DefaultGeometrySearch
true
if this service is implemented.buildDirectory(int, int)
,
resetDirectory(int, int)
public BrepIterator centerPass(double[] center, double radius, BrepIterator pre)
centerPass
in interface GeometrySearch
centerPass
in class DefaultGeometrySearch
center
- Center of a pass.radius
- Maximum radius to be searched.pre
- Pre-allocated BrepIterator
object (can be null
).
DefaultGeometrySearch.getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])
public BrepIterator rayPass(double[] start, double[] direction, BrepIterator pre)
rayPass
in interface GeometrySearch
rayPass
in class DefaultGeometrySearch
start
- Starting point of the ray.direction
- Direction vector of the ray.pre
- Pre-allocated BrepIterator
object (can be null
).
DefaultGeometrySearch.getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])
public int getStatistics(long[] counters)
counters[0] .. number of point-to-point distance calculations.
counters[1] .. number of point-to-box distance calculations.
counters[2] .. number of log(N) heap operations.
getStatistics
in interface GeometrySearch
getStatistics
in class DefaultGeometrySearch
counters
- Array to hold result. If null
functions returns required length.
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |