libatomprobe
Library for Atom Probe Tomography (APT) computation
Public Member Functions | Friends | List of all members
AtomProbe::BoundCube Class Reference

Helper class to define a bounding cube. More...

#include <boundcube.h>

Public Member Functions

 BoundCube ()
 
 BoundCube (const std::vector< Point3D > &pts)
 
 BoundCube (const std::vector< IonHit > &pts)
 
 BoundCube (const Point3D &p1, const Point3D &p2)
 
bool operator== (const BoundCube &other) const
 
void setBounds (float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
 Set the bounds by passing in minima and maxima of each dimension. More...
 
void setBound (unsigned int bound, unsigned int minMax, float value)
 Set an individual bound. More...
 
void setBounds (const BoundCube &b)
 Set the bounding cube to be the same as a different cube. More...
 
void setBounds (const Point3D *ptArray, unsigned int nPoints)
 Obtain bounds from an array of Point3Ds. More...
 
void setBounds (const Point3D &p, const Point3D &q)
 Use two points to set bounds – does not need to be high,low. This is worked out. More...
 
void setBounds (const std::vector< Point3D > &ptArray)
 Obtain bounds from an array of Point3Ds. More...
 
void setBounds (const std::vector< IonHit > &ptArray)
 Obtain bounds from an array of IonHits. More...
 
void setBounds (const Point3D &p, float radius)
 Set the bounds using a single point and radius. More...
 
void setInverseLimits ()
 Set the cube to be "inside out" at the limits of numeric results;. More...
 
float getBound (unsigned int bound, unsigned int minMax) const
 Return the bound on the given dimension. More...
 
Point3D getCentroid () const
 Return the centroid. More...
 
void getBounds (Point3D &low, Point3D &high) const
 Get the bounds of the cube as two points, the lower left (minimum bound) and upper right corner (max bound) More...
 
Point3D min () const
 
Point3D max () const
 
float getSize (unsigned int dim) const
 Return the size of the side parallel to the given dimension. More...
 
bool isFlat () const
 Returns true if any bound is of null thickness. More...
 
bool intersects (const Point3D &pt, float sqrRad) const
 Checks if a point intersects a sphere of centre Pt, radius^2 sqrRad. More...
 
bool intersects (const BoundCube &b) const
 Check to see if this box intersects another. More...
 
bool contains (const BoundCube &b) const
 Does this bounding box entirely contain another. More...
 
bool containsPt (const Point3D &pt) const
 Check to see if the point is contained in, or part of the walls of the cube. More...
 
bool containedInSphere (const Point3D &origin, float radius) const
 Returns true if this box is contained by the sphere, represented by the origin+radius. More...
 
BoundCube makeUnion (const BoundCube &b) const
 Create the box containing a union of two bounding cubes. More...
 
BoundCube makeIntersection (const BoundCube &b) const
 Create the box which is the intersection of two bounding cubes this is either null, or a box. More...
 
float getMaxDistanceToBox (const Point3D &pt) const
 Returns maximum distance to box corners (which is an upper bound on max box distance). More...
 
float getLargestDim () const
 Get the largest dimension of the bound cube. More...
 
float getVolume () const
 Obtain the volume of the cube. More...
 
void setLimits ()
 Set min-max bounds to fp min/max. More...
 
unsigned int segmentTriple (unsigned int dim, float slice) const
 Return a triplet to indicate a spatial partition value lies in. More...
 
BoundCube operator= (const BoundCube &)
 
void expand (const BoundCube &b)
 Expand (as needed) volume such that the argument bounding cube is enclosed by this one. More...
 
void expand (const Point3D &p)
 Expand such that point is contained in this volume. Existing volume must be valid. More...
 
void expand (float f)
 Expand the bounding cube by this value in each dimension (upper and lower) More...
 

Friends

class K3DTreeExact
 
class K3DTreeApprox
 
std::ostream & operator<< (std::ostream &stream, const BoundCube &b)
 

Detailed Description

Helper class to define a bounding cube.

Definition at line 29 of file boundcube.h.

Constructor & Destructor Documentation

◆ BoundCube() [1/4]

AtomProbe::BoundCube::BoundCube ( )
inline

Definition at line 39 of file boundcube.h.

Referenced by BoundCube().

◆ BoundCube() [2/4]

AtomProbe::BoundCube::BoundCube ( const std::vector< Point3D > &  pts)
inline

Definition at line 46 of file boundcube.h.

References setBounds().

Here is the call graph for this function:

◆ BoundCube() [3/4]

AtomProbe::BoundCube::BoundCube ( const std::vector< IonHit > &  pts)
inline

◆ BoundCube() [4/4]

AtomProbe::BoundCube::BoundCube ( const Point3D p1,
const Point3D p2 
)

Definition at line 26 of file boundcube.cpp.

Member Function Documentation

◆ containedInSphere()

bool AtomProbe::BoundCube::containedInSphere ( const Point3D origin,
float  radius 
) const

Returns true if this box is contained by the sphere, represented by the origin+radius.

Definition at line 379 of file boundcube.cpp.

Referenced by BoundCube(), and AtomProbe::K3DTreeExact::ptsInSphere().

◆ contains()

bool AtomProbe::BoundCube::contains ( const BoundCube b) const

Does this bounding box entirely contain another.

Definition at line 360 of file boundcube.cpp.

References containsPt(), and getBounds().

Referenced by BoundCube().

Here is the call graph for this function:

◆ containsPt()

bool AtomProbe::BoundCube::containsPt ( const Point3D pt) const

Check to see if the point is contained in, or part of the walls of the cube.

Definition at line 367 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube(), contains(), AtomProbe::Mesh::getContainedNodes(), AtomProbe::Voxels< T >::getEdgeEnds(), AtomProbe::Voxels< T >::getInterpolatedData(), intersects(), AtomProbe::marchingCubes(), and AtomProbe::Mesh::pointsInside().

◆ expand() [1/3]

void AtomProbe::BoundCube::expand ( const BoundCube b)

Expand (as needed) volume such that the argument bounding cube is enclosed by this one.

Definition at line 148 of file boundcube.cpp.

Referenced by BoundCube(), AtomProbe::Mesh::divideMeshSurface(), and AtomProbe::Voxels< T >::getEdgeEnds().

◆ expand() [2/3]

void AtomProbe::BoundCube::expand ( const Point3D p)

Expand such that point is contained in this volume. Existing volume must be valid.

Definition at line 181 of file boundcube.cpp.

◆ expand() [3/3]

void AtomProbe::BoundCube::expand ( float  f)

Expand the bounding cube by this value in each dimension (upper and lower)

Definition at line 197 of file boundcube.cpp.

◆ getBound()

float AtomProbe::BoundCube::getBound ( unsigned int  bound,
unsigned int  minMax 
) const

Return the bound on the given dimension.

bound - the dimension [x=0,y=1,z=2] minMax - 0 for lower bound, 1 for upper bound

Definition at line 86 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube().

◆ getBounds()

void AtomProbe::BoundCube::getBounds ( Point3D low,
Point3D high 
) const

Get the bounds of the cube as two points, the lower left (minimum bound) and upper right corner (max bound)

Definition at line 302 of file boundcube.cpp.

References ASSERT, and AtomProbe::Point3D::setValue().

Referenced by BoundCube(), contains(), AtomProbe::Voxels< T >::init(), and intersects().

Here is the call graph for this function:

◆ getCentroid()

Point3D AtomProbe::BoundCube::getCentroid ( ) const

Return the centroid.

Definition at line 486 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube().

◆ getLargestDim()

float AtomProbe::BoundCube::getLargestDim ( ) const

Get the largest dimension of the bound cube.

Definition at line 335 of file boundcube.cpp.

References getSize().

Referenced by BoundCube().

Here is the call graph for this function:

◆ getMaxDistanceToBox()

float AtomProbe::BoundCube::getMaxDistanceToBox ( const Point3D pt) const

Returns maximum distance to box corners (which is an upper bound on max box distance).

Definition at line 499 of file boundcube.cpp.

References ASSERT, and AtomProbe::Point3D::sqrDist().

Referenced by BoundCube().

Here is the call graph for this function:

◆ getSize()

float AtomProbe::BoundCube::getSize ( unsigned int  dim) const

Return the size of the side parallel to the given dimension.

Definition at line 343 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube(), getLargestDim(), getVolume(), and AtomProbe::ReconstructionSphereOnCone::reconstruct().

◆ getVolume()

float AtomProbe::BoundCube::getVolume ( ) const

Obtain the volume of the cube.

Definition at line 355 of file boundcube.cpp.

References getSize().

Referenced by BoundCube(), and AtomProbe::ReconstructionSphereOnCone::reconstruct().

Here is the call graph for this function:

◆ intersects() [1/2]

bool AtomProbe::BoundCube::intersects ( const Point3D pt,
float  sqrRad 
) const

Checks if a point intersects a sphere of centre Pt, radius^2 sqrRad.

Definition at line 434 of file boundcube.cpp.

References AtomProbe::Point3D::getValueArr(), AtomProbe::Point3D::setValue(), and AtomProbe::Point3D::sqrDist().

Referenced by BoundCube(), AtomProbe::K3DTreeApprox::findNearest(), AtomProbe::K3DTreeExact::findNearestUntagged(), and AtomProbe::K3DTreeExact::ptsInSphere().

Here is the call graph for this function:

◆ intersects() [2/2]

bool AtomProbe::BoundCube::intersects ( const BoundCube b) const

Check to see if this box intersects another.

Definition at line 465 of file boundcube.cpp.

References containsPt(), and getBounds().

Here is the call graph for this function:

◆ isFlat()

bool AtomProbe::BoundCube::isFlat ( ) const

Returns true if any bound is of null thickness.

Definition at line 136 of file boundcube.cpp.

Referenced by BoundCube(), and main().

◆ makeIntersection()

BoundCube AtomProbe::BoundCube::makeIntersection ( const BoundCube b) const

Create the box which is the intersection of two bounding cubes this is either null, or a box.

Definition at line 416 of file boundcube.cpp.

References setBound().

Referenced by BoundCube().

Here is the call graph for this function:

◆ makeUnion()

BoundCube AtomProbe::BoundCube::makeUnion ( const BoundCube b) const

Create the box containing a union of two bounding cubes.

Definition at line 399 of file boundcube.cpp.

References setBound().

Referenced by BoundCube().

Here is the call graph for this function:

◆ max()

Point3D AtomProbe::BoundCube::max ( ) const

Definition at line 324 of file boundcube.cpp.

References ASSERT, and AtomProbe::Point3D::setValue().

Referenced by BoundCube(), and AtomProbe::Voxels< T >::setBounds().

Here is the call graph for this function:

◆ min()

Point3D AtomProbe::BoundCube::min ( ) const

Definition at line 312 of file boundcube.cpp.

References ASSERT, and AtomProbe::Point3D::setValue().

Referenced by BoundCube(), and AtomProbe::Voxels< T >::setBounds().

Here is the call graph for this function:

◆ operator=()

BoundCube AtomProbe::BoundCube::operator= ( const BoundCube b)

Definition at line 546 of file boundcube.cpp.

Referenced by BoundCube().

◆ operator==()

bool AtomProbe::BoundCube::operator== ( const BoundCube other) const

Definition at line 38 of file boundcube.cpp.

Referenced by BoundCube().

◆ segmentTriple()

unsigned int AtomProbe::BoundCube::segmentTriple ( unsigned int  dim,
float  slice 
) const

Return a triplet to indicate a spatial partition value lies in.

Returns which segment (lower:0, inside:1, higher:2) the given slice coordinate is at the specified dimension (eg, for a box [-1,1] in y, segmentTriple(1,-2) would return 0.

Definition at line 529 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube().

◆ setBound()

void AtomProbe::BoundCube::setBound ( unsigned int  bound,
unsigned int  minMax,
float  value 
)

Set an individual bound.

bound : dimension of bound, 0=x,1=y,2=z minMax : 0 for lower bound, 1 for upper bound

Definition at line 76 of file boundcube.cpp.

References ASSERT.

Referenced by BoundCube(), makeIntersection(), and makeUnion().

◆ setBounds() [1/7]

void AtomProbe::BoundCube::setBounds ( float  xMin,
float  yMin,
float  zMin,
float  xMax,
float  yMax,
float  zMax 
)

◆ setBounds() [2/7]

void AtomProbe::BoundCube::setBounds ( const BoundCube b)

Set the bounding cube to be the same as a different cube.

Definition at line 60 of file boundcube.cpp.

◆ setBounds() [3/7]

void AtomProbe::BoundCube::setBounds ( const Point3D ptArray,
unsigned int  nPoints 
)

Obtain bounds from an array of Point3Ds.

Definition at line 210 of file boundcube.cpp.

◆ setBounds() [4/7]

void AtomProbe::BoundCube::setBounds ( const Point3D p,
const Point3D q 
)

Use two points to set bounds – does not need to be high,low. This is worked out.

Definition at line 244 of file boundcube.cpp.

◆ setBounds() [5/7]

void AtomProbe::BoundCube::setBounds ( const std::vector< Point3D > &  ptArray)

Obtain bounds from an array of Point3Ds.

Definition at line 273 of file boundcube.cpp.

References setBounds().

Here is the call graph for this function:

◆ setBounds() [6/7]

void AtomProbe::BoundCube::setBounds ( const std::vector< IonHit > &  ptArray)

Obtain bounds from an array of IonHits.

Obtain bounds from an array of Point3Ds.

Definition at line 279 of file boundcube.cpp.

References setInverseLimits().

Here is the call graph for this function:

◆ setBounds() [7/7]

void AtomProbe::BoundCube::setBounds ( const Point3D p,
float  radius 
)

Set the bounds using a single point and radius.

Bounds will be minimal sphere enclosing, where the sphere is defined by the (p,radius) pair

Definition at line 259 of file boundcube.cpp.

◆ setInverseLimits()

void AtomProbe::BoundCube::setInverseLimits ( )

Set the cube to be "inside out" at the limits of numeric results;.

Definition at line 94 of file boundcube.cpp.

Referenced by BoundCube(), AtomProbe::Mesh::divideMeshSurface(), AtomProbe::IonHit::getIonDataLimits(), and setBounds().

◆ setLimits()

void AtomProbe::BoundCube::setLimits ( )

Set min-max bounds to fp min/max.

Definition at line 115 of file boundcube.cpp.

Referenced by BoundCube().

Friends And Related Function Documentation

◆ K3DTreeApprox

friend class K3DTreeApprox
friend

Definition at line 172 of file boundcube.h.

◆ K3DTreeExact

friend class K3DTreeExact
friend

Definition at line 171 of file boundcube.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const BoundCube b 
)
friend

Definition at line 563 of file boundcube.cpp.

Referenced by BoundCube().


The documentation for this class was generated from the following files: