State< 3, T > Class Template Reference

Hold the state for a 3-D closest point transform. More...

Inheritance diagram for State< 3, T >:
StateBase< 3, T >

List of all members.

Public Types

typedef Base::Number Number
 The number type.
typedef Base::Point Point
 A point in 3-D.
typedef Base::IndexedFace IndexedFace
 An indexed face in 3-D.
typedef Base::Index Index
 An index in 3-D.
typedef Base::Range Range
 An index range in 3-D.
typedef Base::BBox BBox
 A bounding box.
typedef Base::Lattice Lattice
 The grid geometry.
typedef Base::Grid Grid
 The grid.
typedef Base::BRep BRep
 The b-rep.

Public Member Functions

Constructors, etc.

 State ()
 Default constructor.
 ~State ()
 Destructor.
Closest point transform.

std::pair< int, int > computeClosestPointTransform ()
 Compute the closest point transform for signed distance.
std::pair< int, int > computeClosestPointTransformUnsigned ()
 Compute the closest point transform for unsigned distance.
Inside/outside.

template<bool A1, bool A2>
std::pair< int, int > determinePointsInside (const BBox &domain, ads::Array< 3, bool, A1 > *areInside, ads::Array< 3, Number, A2 > *distance)
 Determine which grid points are inside the solid (non-positive distance).
std::pair< int, int > determinePointsInside (const Number *domain, const int *extents, bool *areInside, Number *distance)
 Wrapper for the above function.
template<bool A1>
std::pair< int, int > determinePointsInside (const BBox &domain, ads::Array< 3, bool, A1 > *areInside)
 Determine which grid points are inside the solid (non-positive distance).
std::pair< int, int > determinePointsInside (const Number *domain, const int *extents, bool *areInside)
 Wrapper for the above function.
template<bool A1, bool A2>
std::pair< int, int > determinePointsOutside (const BBox &domain, ads::Array< 3, bool, A1 > *areOutside, ads::Array< 3, Number, A2 > *distance)
 Determine which grid points are outside the solid (positive distance).
std::pair< int, int > determinePointsOutside (const Number *domain, const int *extents, bool *areOutside, Number *distance)
 Wrapper for the above function.
template<bool A1>
std::pair< int, int > determinePointsOutside (const BBox &domain, ads::Array< 3, bool, A1 > *areOutside)
 Determine which grid points are outside the solid (positive distance).
std::pair< int, int > determinePointsOutside (const Number *domain, const int *extents, bool *areOutside)
 Wrapper for the above function.

Detailed Description

template<typename T>
class State< 3, T >

Hold the state for a 3-D closest point transform.

Most of the functionality is dimension independent and is thus implemented in the base class cpt::StateBase.

To perform the closest point transform, you must call:

  1. cpt::StateBase<N,T>::setParameters() to specify the Cartesian domain of interest and how far to compute the distance. Note that the computational complexity of the alorithm is proportional to this maximum distance. (The number of grid points for which the distance is computed is proportional to the maximum distance.) If performance is an issue, make sure that the max_distance parameter is no larger than needed.
  2. cpt::StateBase<N,T>::setLattice() to specify the lattice on which the grids lie.
  3. cpt::StateBase<N,T>::insertGrid() for each grid on the lattice. Here you specify arrays that hold the distance, and optionally the gradient of distance, closest point and closest face fields. setLattice() must be called before any calls to insertGrid().
  4. cpt::StateBase<N,T>::setBRep() or cpt::StateBase<N,T>::setBRepWithNoClipping() to specify the surface. The triangle surface is a boundary representation, b-rep, of the volume that is inside the surface. cpt::StateBase<N,T>::setParameters() must be called before calling cpt::StateBase<N,T>::setBRep().
  5. computeClosestPointTransform() to compute the the CPT on the specified grids.

To compute the CPT for a new b-rep, call:

  1. cpt::StateBase<N,T>::setBRep().
  2. computeClosestPointTransform().

To compute the CPT for a different set of grids, call the following:

  1. cpt::StateBase<N,T>::clearGrids() to clear the old grids.
  2. cpt::StateBase<N,T>::setLattice() if the lattice has changed.
  3. cpt::StateBase<N,T>::insertGrid() for each new grid on the lattice.
  4. computeClosestPointTransform().

For AMR grids, one must follow these steps for each each level of the AMR grid. (Each level of the AMR grid is a separate lattice.)

To determine which grid points are inside/outside the solid, call:

  1. cpt::StateBase<N,T>::setBRepWithNoClipping() to specify the boundary of the solid. Do not call cpt::StateBase<N,T>::setBRep().
  2. Either determinePointsInside() or determinePointsOutside().

Member Function Documentation

template<typename T >
std::pair< int, int > State< 3, T >::computeClosestPointTransform (  )  [inline]

Compute the closest point transform for signed distance.

Compute the signed distance. Compute the gradient of the distance, the closest face and closest point if their arrays specified in insertGrid() are nonzero.

The algorithm uses polyhedron scan conversion to determine which grid points are close to the shapes comprising the surface.

The unknown distances, gradients, and closest points are set to std::numeric_limits<Number>::max(). The unknown closest faces are set to -1.

References StateBase< N, T >::getNumberOfGrids(), StateBase< N, T >::hasBRepBeenSet(), and StateBase< N, T >::initializeGrids().

template<typename T >
std::pair< int, int > State< 3, T >::computeClosestPointTransformUnsigned (  )  [inline]

Compute the closest point transform for unsigned distance.

Compute the unsigned distance. Compute the gradient of the distance, the closest face and closest point if their arrays specified in insertGrid() are nonzero.

The algorithm uses polyhedron scan conversion to determine which grid points are close to the shapes comprising the surface.

The unknown distances, gradients, and closest points are set to std::numeric_limits<Number>::max(). The unknown closest faces are set to -1.

References StateBase< N, T >::getNumberOfGrids(), StateBase< N, T >::hasBRepBeenSet(), and StateBase< N, T >::initializeGrids().

template<typename T >
std::pair< int, int > State< 3, T >::determinePointsInside ( const Number domain,
const int *  extents,
bool *  areInside 
) [inline]

Wrapper for the above function.

Parameters:
domain The array {xmin, ymin, zmin, xmax, ymax, zmax}.
extents The array extents.
areInside Boolean array is set to whether each grid point is inside the solid.
template<typename T >
template<bool A1>
std::pair<int,int> State< 3, T >::determinePointsInside ( const BBox domain,
ads::Array< 3, bool, A1 > *  areInside 
) [inline]

Determine which grid points are inside the solid (non-positive distance).

Use this interface if you only determine which points are inside one time. This function allocates a distance array and calls the function above.

template<typename T >
std::pair< int, int > State< 3, T >::determinePointsInside ( const Number domain,
const int *  extents,
bool *  areInside,
Number distance 
) [inline]

Wrapper for the above function.

Parameters:
domain The array {xmin, ymin, zmin, xmax, ymax, zmax}.
extents The array extents.
areInside Boolean array is set to whether each grid point is inside the solid.
distance Number array that is used in the computation.
template<typename T >
template<bool A1, bool A2>
std::pair< int, int > State< 3, T >::determinePointsInside ( const BBox domain,
ads::Array< 3, bool, A1 > *  areInside,
ads::Array< 3, Number, A2 > *  distance 
) [inline]

Determine which grid points are inside the solid (non-positive distance).

Use this interface if you repeatedly determine which points are inside. The distance array is needed for determining the sign of the distance. With this interface, the distance array is not allocated anew for each function call.

References StateBase< N, T >::clearGrids(), computeMaximum(), StateBase< N, T >::floodFillAtBoundary(), StateBase< N, T >::insertGrid(), StateBase< N, T >::setLattice(), and StateBase< N, T >::setParameters().

template<typename T >
std::pair< int, int > State< 3, T >::determinePointsOutside ( const Number domain,
const int *  extents,
bool *  areOutside 
) [inline]

Wrapper for the above function.

Parameters:
domain The array {xmin, ymin, zmin, xmax, ymax, zmax}.
extents The array extents.
areOutside Boolean array is set to whether each grid point is outside the solid.
template<typename T >
template<bool A1>
std::pair<int,int> State< 3, T >::determinePointsOutside ( const BBox domain,
ads::Array< 3, bool, A1 > *  areOutside 
) [inline]

Determine which grid points are outside the solid (positive distance).

Use this interface if you only determine which points are outside one time. This function allocates a distance array and calls the function above.

template<typename T >
std::pair< int, int > State< 3, T >::determinePointsOutside ( const Number domain,
const int *  extents,
bool *  areOutside,
Number distance 
) [inline]

Wrapper for the above function.

Parameters:
domain The array {xmin, ymin, zmin, xmax, ymax, zmax}.
extents The array extents.
areOutside Boolean array is set to whether each grid point is outside the solid.
distance Number array that is used in the computation.
template<typename T >
template<bool A1, bool A2>
std::pair<int,int> State< 3, T >::determinePointsOutside ( const BBox domain,
ads::Array< 3, bool, A1 > *  areOutside,
ads::Array< 3, Number, A2 > *  distance 
) [inline]

Determine which grid points are outside the solid (positive distance).

Use this interface if you repeatedly determine which points are outside. The distance array is needed for determining the sign of the distance. With this interface, the distance array is not allocated anew for each function call.


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:53 2016 for Closest Point Transform by  doxygen 1.6.3