libatomprobe
Library for Atom Probe Tomography (APT) computation
|
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) |
Helper class to define a bounding cube.
Definition at line 29 of file boundcube.h.
|
inline |
Definition at line 39 of file boundcube.h.
Referenced by BoundCube().
|
inline |
Definition at line 46 of file boundcube.h.
References setBounds().
|
inline |
Definition at line 51 of file boundcube.h.
References BoundCube(), containedInSphere(), contains(), containsPt(), expand(), getBound(), getBounds(), getCentroid(), getLargestDim(), getMaxDistanceToBox(), getSize(), getVolume(), intersects(), isFlat(), makeIntersection(), makeUnion(), max(), min(), operator<<, operator=(), operator==(), segmentTriple(), setBound(), setBounds(), setInverseLimits(), and setLimits().
Definition at line 26 of file boundcube.cpp.
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().
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().
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().
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().
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.
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.
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().
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().
Point3D AtomProbe::BoundCube::getCentroid | ( | ) | const |
Return the centroid.
Definition at line 486 of file boundcube.cpp.
References ASSERT.
Referenced by BoundCube().
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().
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().
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().
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().
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().
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().
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().
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().
Create the box containing a union of two bounding cubes.
Definition at line 399 of file boundcube.cpp.
References setBound().
Referenced by BoundCube().
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().
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().
Definition at line 546 of file boundcube.cpp.
Referenced by BoundCube().
bool AtomProbe::BoundCube::operator== | ( | const BoundCube & | other | ) | const |
Definition at line 38 of file boundcube.cpp.
Referenced by BoundCube().
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().
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().
void AtomProbe::BoundCube::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.
Definition at line 49 of file boundcube.cpp.
Referenced by BoundCube(), AtomProbe::Mesh::divideMeshSurface(), AtomProbe::generate1DAxialDistHist(), AtomProbe::generate1DAxialDistHistSweep(), AtomProbe::BodyCentredCubicGen::generateLattice(), AtomProbe::IonHit::getBoundCube(), AtomProbe::K3DTreeExact::getBoundCube(), AtomProbe::Mesh::getBounds(), AtomProbe::Voxels< T >::getBounds(), AtomProbe::Voxels< T >::getEdgeEnds(), AtomProbe::marchingCubes(), AtomProbe::Mesh::pointsInside(), AtomProbe::Mesh::print(), AtomProbe::ReconstructionSphereOnCone::reconstruct(), AtomProbe::K3DTreeExact::resetPts(), and setBounds().
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.
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.
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.
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().
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().
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.
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().
void AtomProbe::BoundCube::setLimits | ( | ) |
Set min-max bounds to fp min/max.
Definition at line 115 of file boundcube.cpp.
Referenced by BoundCube().
|
friend |
Definition at line 172 of file boundcube.h.
|
friend |
Definition at line 171 of file boundcube.h.
|
friend |
Definition at line 563 of file boundcube.cpp.
Referenced by BoundCube().