Classes | Public Member Functions | Public Attributes

Fiber::LocalFromWorldPoint Class Reference

Use this class to compute a local cell index and fragment ID (if neccessary) of any coordinate field on a given slice and grid. More...

#include <LocalFromWorldPoint.hpp>

List of all members.

Classes

Public Member Functions

Public Attributes


Detailed Description

Use this class to compute a local cell index and fragment ID (if neccessary) of any coordinate field on a given slice and grid.

The reason this is encapulated in a class rather in a function is that there are several things done in the constructor once for initialisation once thus speeding up the get function. Also some inner classes are encapsulated and hidden for the user.


Constructor & Destructor Documentation

Fiber::LocalFromWorldPoint::LocalFromWorldPoint ( Slice SourceSliceP,
const RefPtr< Grid > &  SourceGridP,
const string &  Gridname,
const RefPtr< Field > &  SourceCoordsP,
double  res_scale = 1.0,
double  prec_scale = 0.1 
)

Constructor does some initialization, like iterating over the fragments to build a KDTree if not already found in the Field's intercube and storing fragmentids and bounding boxes back into the grids' bundle.

UniGridMappers are stored for each fragment in a separate grid object either at the provided slice or at the provided uniGrid pointer.

Parameters:
sliceP actual time slice
SourceGridP the grid of the coordinates
SourceCoordsP the field that contains the coordinates

References Fiber::PointSearch::FragmentBoxes.


Member Function Documentation

bool Fiber::LocalFromWorldPoint::get ( const point  position,
pair< point, string > &  data 
)

Get the local index coordinates of a world point and the fragment id of the fragment it is contained in.

Parameters:
position world point
data return float index (local position) and fragment name, which can be used to create a FragmentID object
Returns:
true if a point can be found, false if the world point is not contained in the coordinate space of the data. In the point (0,0,0) and an emtpy string if returned via the pair.
Todo:

should just return a pair<> here as return value, and rather use a fragment ID itself instead of a string

CHECK WHETHER PARAMETERS REALLY NEED TO BE COPIED HERE

bool Fiber::LocalFromWorldPoint::getBorderIntersectionNormal ( const point  worldposition,
const pair< point, string >  localpoint,
const tvector  direction,
point intersection,
bivector normal 
)

Some helper function that returns the point where the cell is left and the normal of the cells face.

A direction and a position (in world and local positions).

Todo:
CHECK WHETHER PARAMETERS REALLY NEED TO BE COPIED HERE

References numberOfBordersOfCell().

int Fiber::LocalFromWorldPoint::numberOfBordersOfCell ( const pair< point, string >  localdata,
int &  hint1,
int &  hint2 
)

returns the number of bordersurfaces of the given cell

Todo:
CHECK WHETHER PARAMETERS REALLY NEED TO BE COPIED HERE

Referenced by getBorderIntersectionNormal().