FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Classes | Public Member Functions | Public Attributes | List of all members
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>

Inheritance diagram for Fiber::LocalFromWorldPoint:
MemCore::ReferenceBase< LocalFromWorldPoint >

Classes

class  BBSelectorMemoryTree
 Select fragment candidates out of all the candidates by doing a query into the KDTree and provide a method to step through the candidates. More...
 
class  FindCell
 Base class for finding the cell containing the point in a fragment. More...
 
class  HexaHedralCellNewton
 Finds a cell containing a world point by using the UniGridMapper. More...
 
class  ProjectiveCell
 

Public Member Functions

RefPtr< Grid > & grid ()
 
 LocalFromWorldPoint (Slice &SourceSliceP, const RefPtr< Grid > &SourceGridP, const string &Gridname, double res_scale=1.0, double prec_scale=0.1, tvector tree_query_scale=tvector(1., 1., 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.
 
 ~LocalFromWorldPoint ()
 Destructor.
 
bool get (const point &position, LocalPoint &result)
 Get the local index coordinates of a world point and the fragment id of the fragment it is contained in.
 
bool getViaTree (LocalPoint &result)
 
void setBlockBoundaryEpsilon (const double block_epsilonP)
 
int numberOfBordersOfCell (const pair< point, string > localdata, int &hint1, int &hint2)
 returns the number of bordersurfaces of the given cell
 
bool 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.
 
- Public Member Functions inherited from MemCore::ReferenceBase< LocalFromWorldPoint >
auto getObjectCountID () const noexcept
 
bool isIdentical (const WeakPtr< Object, Object > &PossibleSelf) const noexcept
 
void mkAutoDestructive ()
 
refcount_t refcount () const noexcept
 
 ReferenceBase (Object *that) noexcept
 
const auto & self () const
 
refcount_t wrefcount () const noexcept
 

Public Attributes

double block_epsilon
 
double res_scale
 
double prec_scale
 
int MaxListSize
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< LocalFromWorldPoint >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 
- Protected Member Functions inherited from MemCore::ReferenceBase< LocalFromWorldPoint >
virtual void extremeUnction ()
 
ReferenceBaseoperator= (const ReferenceBase &R)
 
void suicide ()
 

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

◆ LocalFromWorldPoint()

Fiber::LocalFromWorldPoint::LocalFromWorldPoint ( Slice SourceSliceP,
const RefPtr< Grid > &  SourceGridP,
const string &  Gridname,
double  res_scale = 1.0,
double  prec_scale = 0.1,
tvector  tree_query_scale = tvector(1.,1.,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
slicePactual time slice
SourceGridPthe grid of the coordinates
res_scalethis is a scaling factor to influence the number of cells created for the uniform grid of the unigrid mapper. A higher value will result in a higher resolution of the uniform grid.
prec_scaleinfluences the precision of the newton interation

References Fiber::PointSearch::FragmentBoxes.

Member Function Documentation

◆ get()

bool Fiber::LocalFromWorldPoint::get ( const point position,
LocalPoint result 
)

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

Parameters
positionworld point
datareturn 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

References std::cout, std::endl(), and std::exception::what().

◆ getBorderIntersectionNormal()

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 floor(), and numberOfBordersOfCell().

◆ 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

References floor().

Referenced by getBorderIntersectionNormal().