cz.cuni.jagrlib.iface
Interface GeometrySearch

All Superinterfaces:
Property
All Known Implementing Classes:
DefaultGeometrySearch, UniformGrid

public interface GeometrySearch
extends Property

General interface for geometry searching in 2D and 3D (for various types of search-trees).

Since:
0.10
See Also:
GeometrySearch.java, Brep

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
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.
 double finishedSegment(BrepIterator iter)
          Returns end value (coordinate) of already finished pass-segment.
 double getProgress(BrepIterator iter, int[] count)
          Returns progress parameters of the given pass.
 int getStatistics(long[] counters)
          Returns (and resets) counters (for statistics, profiling):
counters[0] .. number of point-to-point distance calculations.
 void insertObject(int handle)
          Inserts another object into the directory.
 BrepIterator intervalQuery(double[] min, double[] max, BrepIterator pre)
          Initializes a new interval query for floating-point coordinates.
 BrepIterator intervalQuery(int[] min, int[] max, BrepIterator pre)
          Initializes a new interval query for integer coordinates.
 int localize(double[] coord)
          Localizes the given point - finds the object which contains it (first of such objects).
 int localize(int[] coord)
          Localizes the given point - finds the object which contains it (first of such objects).
 boolean optimizeDirectory()
          Optimizes the data structure (directory).
 BrepIterator rayPass(double[] start, double[] direction, BrepIterator pre)
          Initializes a new ray-casting pass.
 boolean removeObject(int handle)
          Removes the given object from the directory.
 boolean resetDirectory(int entity, int ctx)
          (Re-)initializes the data structure (directory).
 BrepIterator sweepPass(double[] plane, double[] origin, BrepIterator pre)
          Initializes a new sweep-plane pass.
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Method Detail

buildDirectory

boolean buildDirectory(int entity,
                       int ctx)
Builds the whole data structure (directory) from scratch.

Parameters:
entity - Type of stored entities (VERTEX, EDGE or FACE from Brep).
ctx - Handle to the used Brep-context.
Returns:
true if this service is implemented.
See Also:
resetDirectory(int, int), optimizeDirectory(), Brep.VERTEX, Brep.EDGE, Brep.SOLID

resetDirectory

boolean resetDirectory(int entity,
                       int ctx)
(Re-)initializes the data structure (directory).

Parameters:
entity - Type of stored entities (VERTEX, EDGE or FACE from Brep).
ctx - Handle to the used Brep-context.
Returns:
true if this service is implemented.
See Also:
buildDirectory(int, int), optimizeDirectory(), Brep.VERTEX, Brep.EDGE, Brep.SOLID

insertObject

void insertObject(int handle)
Inserts another object into the directory. Should be called after resetDirectory(int, int).

Parameters:
handle - Handle to an inserted object (its entity type and context were defined in advance).
See Also:
resetDirectory(int, int)

removeObject

boolean removeObject(int handle)
Removes the given object from the directory.

Parameters:
handle - Handle to a removed object (its entity type and context were defined in advance).
Returns:
true if this service is implemented and if the object was successfully removed.
See Also:
resetDirectory(int, int)

optimizeDirectory

boolean optimizeDirectory()
Optimizes the data structure (directory). Can be used for finishing of the update phase or for explicit data structure optimization. Non-mandatory. (but application has to call it at the end of update phase).

Returns:
true if this service is implemented.
See Also:
buildDirectory(int, int), resetDirectory(int, int)

localize

int localize(int[] coord)
Localizes the given point - finds the object which contains it (first of such objects).

Parameters:
coord - Coordinate vector of the localized point.
Returns:
Handle to the result object or NULL if not found (or the service is not implemented).
See Also:
localize(double[])

localize

int localize(double[] coord)
Localizes the given point - finds the object which contains it (first of such objects).

Parameters:
coord - Coordinate vector of the localized point.
Returns:
Handle to the result object or NULL if not found (or the service is not implemented).
See Also:
localize(int[])

intervalQuery

BrepIterator intervalQuery(int[] min,
                           int[] max,
                           BrepIterator pre)
Initializes a new interval query for integer coordinates.

Parameters:
min - Coordinate vector of minimum-vertex.
max - Coordinate vector of maximum-vertex. Non-mandatory ?
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
intervalQuery(double[],double[],BrepIterator), getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])

intervalQuery

BrepIterator intervalQuery(double[] min,
                           double[] max,
                           BrepIterator pre)
Initializes a new interval query for floating-point coordinates.

Parameters:
min - Coordinate vector of minimum-vertex.
max - Coordinate vector of maximum-vertex. Non-mandatory ?
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
intervalQuery(int[],int[],BrepIterator), getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])

rayPass

BrepIterator rayPass(double[] start,
                     double[] direction,
                     BrepIterator pre)
Initializes a new ray-casting pass.

Parameters:
start - Starting point of the ray.
direction - Direction vector of the ray.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])

centerPass

BrepIterator centerPass(double[] center,
                        double radius,
                        BrepIterator pre)
Initializes a new center pass. Objects are enumerated in order defined by increasing distance from the given center point.

Parameters:
center - Center of a pass.
radius - Maximum radius to be searched.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])

sweepPass

BrepIterator sweepPass(double[] plane,
                       double[] origin,
                       BrepIterator pre)
Initializes a new sweep-plane pass. Objects are enumerated in order defined by the given sweep-plane.

Parameters:
plane - (Oriented) normal vector of the sweep-plane.
origin - Starting point of a pass.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
getProgress(cz.cuni.jagrlib.iface.BrepIterator, int[])

finishedSegment

double finishedSegment(BrepIterator iter)
Returns end value (coordinate) of already finished pass-segment. Semantics depends on pass type: safely processed distance from pass/ray origin, ..

Parameters:
iter - Pass data.
Returns:
Safely processed distance from pass origin.

getProgress

double getProgress(BrepIterator iter,
                   int[] count)
Returns progress parameters of the given pass.

Parameters:
iter - Pass data.
count - Array to hold two counters: count[0] .. number of objects yet passed, count[1] .. total number of objects relevant to this pass (non-mandatory). Can be null.
Returns:
Actual pass-distance (or similar metric).

getStatistics

int getStatistics(long[] counters)
Returns (and resets) counters (for statistics, profiling):
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.

Parameters:
counters - Array to hold result. If null functions returns required length.
Returns:
Required array length.