17 #ifndef ATOMPROBE_BOUNDCUBE_H 18 #define ATOMPROBE_BOUNDCUBE_H 61 void setBounds(
float xMin,
float yMin,
float zMin,
62 float xMax,
float yMax,
float zMax);
68 void setBound(
unsigned int bound,
unsigned int minMax,
float value) ;
77 void setBounds(
const std::vector<Point3D> &ptArray);
79 void setBounds(
const std::vector<IonHit> &ptArray);
89 bool isValid(
unsigned int dim)
const;
101 float getBound(
unsigned int bound,
unsigned int minMax)
const ;
115 float getSize(
unsigned int dim)
const;
158 unsigned int segmentTriple(
unsigned int dim,
float slice)
const;
bool containsPt(const Point3D &pt) const
Check to see if the point is contained in, or part of the walls of the cube.
void setInverseLimits()
Set the cube to be "inside out" at the limits of numeric results;.
BoundCube(const std::vector< Point3D > &pts)
void setLimits()
Set min-max bounds to fp min/max.
bool intersects(const Point3D &pt, float sqrRad) const
Checks if a point intersects a sphere of centre Pt, radius^2 sqrRad.
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 ...
float getMaxDistanceToBox(const Point3D &pt) const
Returns maximum distance to box corners (which is an upper bound on max box distance).
float getSize(unsigned int dim) const
Return the size of the side parallel to the given dimension.
float getVolume() const
Obtain the volume of the cube.
friend std::ostream & operator<<(std::ostream &stream, const BoundCube &b)
A 3D point data class storage.
unsigned int segmentTriple(unsigned int dim, float slice) const
Return a triplet to indicate a spatial partition value lies in.
BoundCube makeUnion(const BoundCube &b) const
Create the box containing a union of two bounding cubes.
float getLargestDim() const
Get the largest dimension of the bound cube.
void setBound(unsigned int bound, unsigned int minMax, float value)
Set an individual bound.
float getBound(unsigned int bound, unsigned int minMax) const
Return the bound on the given dimension.
BoundCube makeIntersection(const BoundCube &b) const
Create the box which is the intersection of two bounding cubes this is either null, or a box.
bool operator==(const BoundCube &other) const
Helper class to define a bounding cube.
bool containedInSphere(const Point3D &origin, float radius) const
Returns true if this box is contained by the sphere, represented by the origin+radius.
bool isFlat() const
Returns true if any bound is of null thickness.
Point3D getCentroid() const
Return the centroid.
BoundCube operator=(const BoundCube &)
bool contains(const BoundCube &b) const
Does this bounding box entirely contain another.
BoundCube(const std::vector< IonHit > &pts)
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.
void expand(const BoundCube &b)
Expand (as needed) volume such that the argument bounding cube is enclosed by this one...