Version: 5.1.6

multipr.DecimationAccelGrid Class Reference

#include <MULTIPR_DecimationAccel.hxx>

Inheritance diagram for multipr.DecimationAccelGrid:
Inheritance graph

Public Member Functions

 DecimationAccelGrid ()
 Builds an empty DecimationAccelGrid (default constructor).
virtual ~DecimationAccelGrid ()
 Destructor.
void reset ()
 Resets this object in its state by default (empty).
virtual void configure (const char *pArgv)
 Configures this acceleration structure.
virtual void create (const std::vector< PointOfField > &pPts)
 Creates a new acceleration structure and fills it with the given list of points.
virtual std::vector< PointOfFieldfindNeighbours (med_float pCenterX, med_float pCenterY, med_float pCenterZ, med_float pRadius) const
 Finds all the points in a sphere defined by its center (x,y,z) and its radius.
void getCellCoord (med_float pX, med_float pY, med_float pZ, int *pIx, int *pIy, int *pIz) const
 Returns the coordinates of the cell which contain the point (x,y,z).
int getCellIndex (int pI, int pJ, int pK) const
 Returns the index of the cell whose coordinates are (i, j, k).
std::vector< PointOfField > & getCell (const PointOfField &pPt)
 Returns the list of points contained in the cell of pPt.
void computeBBox (const std::vector< PointOfField > &pPts)
 Computes the axis-aligned bounding box of a set of points.
 DecimationAccelGrid (const DecimationAccelGrid &)
DecimationAccelGridoperator= (const DecimationAccelGrid &)
bool operator== (const DecimationAccelGrid &)

Data Fields

int mNum
 Number of points in the grid.
med_float mMin [3]
 Bounding box, min corner.
med_float mMax [3]
 Bounding box, max corner.
med_float mInvLen [3]
 1/length of cells, along each dimension; used to accelerate getCellCoord().
med_int mSize [3]
 Number of cells along each dimension.
std::vector< PointOfField > * mGrid
 Flatten grid structure; each cell is a vector of PointOfField.

Friends

std::ostream & operator<< (std::ostream &pOs, DecimationAccelGrid &pG)
 Dumps any GaussLoc to the given output stream.

Constructor & Destructor Documentation

multipr.DecimationAccelGrid::DecimationAccelGrid (  ) 

Builds an empty DecimationAccelGrid (default constructor).

References multipr.DecimationAccelGrid.mGrid, NULL, and multipr.DecimationAccelGrid.reset().

multipr.DecimationAccelGrid::~DecimationAccelGrid (  )  [virtual]

Destructor.

Removes everything.

References multipr.DecimationAccelGrid.reset().

multipr.DecimationAccelGrid.DecimationAccelGrid ( const DecimationAccelGrid  ) 

Member Function Documentation

void multipr.DecimationAccelGrid::reset (  ) 
void multipr.DecimationAccelGrid::configure ( const char *  pArgv  )  [virtual]

Configures this acceleration structure.

String is used for genericity.

Parameters:
pArgv assumes "size_x size_y size_z": number of cells along each axis.

Implements multipr.DecimationAccel.

References multipr.DecimationAccelGrid.mSize, NULL, multipr.DecimationAccelGrid.reset(), and testMEDMEM.ret.

void multipr.DecimationAccelGrid::create ( const std::vector< PointOfField > &  pPts  )  [virtual]

Creates a new acceleration structure and fills it with the given list of points.

setSize() must have been called before.

Parameters:
pPts list of points to be inserted in the acceleration structure.
Exceptions:
IllegalStateException if setSize() has not been called before.

Implements multipr.DecimationAccel.

References multipr.DecimationAccelGrid.computeBBox(), multipr.DecimationAccelGrid.getCell(), multipr.DecimationAccelGrid.mGrid, multipr.DecimationAccelGrid.mNum, multipr.DecimationAccelGrid.mSize, and test_NonCoincidentDEC.size.

vector< PointOfField > multipr.DecimationAccelGrid::findNeighbours ( med_float  pCenterX,
med_float  pCenterY,
med_float  pCenterZ,
med_float  pRadius 
) const [virtual]

Finds all the points in a sphere defined by its center (x,y,z) and its radius.

Parameters:
pCenterX x-coordinates of the center of the sphere.
pCenterY y-coordinates of the center of the sphere.
pCenterZ z-coordinates of the center of the sphere.
pRadius radius of the sphere.
Returns:
all the points in a sphere defined by its center (x,y,z) and its radius.

Implements multipr.DecimationAccel.

References multipr.DecimationAccelGrid.getCellCoord(), multipr.DecimationAccelGrid.getCellIndex(), multipr.DecimationAccelGrid.mGrid, multipr.PointOfField.mXYZ, and med_test1.norm.

void multipr.DecimationAccelGrid::getCellCoord ( med_float  pX,
med_float  pY,
med_float  pZ,
int pIx,
int pIy,
int pIz 
) const

Returns the coordinates of the cell which contain the point (x,y,z).

Clamping is performed on (pIx, pIy, pIz) to avoid out of bounds.

Parameters:
pX (in) X-coordinates of the point.
pY (in) Y-coordinates of the point.
pZ (in) Z-coordinates of the point.
pIx (out) X-index of the cell which contain the point (x,y,z).
pIy (out) Y-index.
pIz (out) Z-index.

References multipr.DecimationAccelGrid.mInvLen, multipr.DecimationAccelGrid.mMin, and multipr.DecimationAccelGrid.mSize.

int multipr.DecimationAccelGrid::getCellIndex ( int  pI,
int  pJ,
int  pK 
) const

Returns the index of the cell whose coordinates are (i, j, k).

Parameters:
pI 
pJ 
pK 
Returns:
the index of the cell (i, j, k).

References medClient_test.index, and multipr.DecimationAccelGrid.mSize.

vector< PointOfField > & multipr.DecimationAccelGrid::getCell ( const PointOfField pPt  ) 

Returns the list of points contained in the cell of pPt.

Parameters:
pPt any point which coordinates are in the bbox of this acceleration structure.
Returns:
the list of points contained in the cell of pPt.

References multipr.DecimationAccelGrid.getCellCoord(), multipr.DecimationAccelGrid.getCellIndex(), medClient_test.index, multipr.DecimationAccelGrid.mGrid, and multipr.PointOfField.mXYZ.

void multipr.DecimationAccelGrid::computeBBox ( const std::vector< PointOfField > &  pPts  ) 

Computes the axis-aligned bounding box of a set of points.

Sets the fields mMin/mMax.

Parameters:
pPts list of points.

References multipr.DecimationAccelGrid.mInvLen, multipr.DecimationAccelGrid.mMax, multipr.DecimationAccelGrid.mMin, and multipr.DecimationAccelGrid.mSize.

DecimationAccelGrid& multipr.DecimationAccelGrid.operator= ( const DecimationAccelGrid  ) 

Reimplemented from multipr.DecimationAccel.

bool multipr.DecimationAccelGrid.operator== ( const DecimationAccelGrid  ) 

Reimplemented from multipr.DecimationAccel.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOs,
DecimationAccelGrid pG 
) [friend]

Dumps any GaussLoc to the given output stream.

Parameters:
pOs any output stream.
pG any DecimationAccelGrid.
Returns:
the output stream pOs.

Reimplemented from multipr.DecimationAccel.


Field Documentation

Number of points in the grid.

Bounding box, min corner.

Bounding box, max corner.

1/length of cells, along each dimension; used to accelerate getCellCoord().

Number of cells along each dimension.

Flatten grid structure; each cell is a vector of PointOfField.