23 #ifndef LSST_SPHGEOM_BOX3D_H_ 24 #define LSST_SPHGEOM_BOX3D_H_ 103 _enforceInvariants();
108 return _intervals[0] == b._intervals[0] &&
109 _intervals[1] == b._intervals[1] &&
110 _intervals[2] == b._intervals[2];
217 _enforceInvariants();
225 _enforceInvariants();
233 return Box3d(*this).clipTo(b);
237 return Box3d(*this).clipTo(b);
262 return Box3d(*this).expandTo(b);
266 return Box3d(*this).expandTo(b);
290 _enforceInvariants();
294 return Box3d(*this).dilateBy(w, h, d);
314 return ((xr & yr & zr) & (CONTAINS | WITHIN)) |
315 ((xr | yr | zr) & DISJOINT);
320 void _enforceInvariants() {
337 #endif // LSST_SPHGEOM_BOX3D_H_ bool operator!=(Box3d const &b) const
bool isEmpty() const
isEmpty returns true if this box does not contain any points.
Box3d erodedBy(double r) const
Box3d & dilateBy(double w, double h, double d)
dilateBy morphologically dilates or erodes the x, y, and z intervals of this box by w...
bool isWithin(Box3d const &b) const
Vector3d getCenter() const
getCenter returns the center of this box.
Box3d dilatedBy(double w, double h, double d) const
static Box3d aroundUnitSphere()
aroundUnitSphere returns a minimal Box3d containing the unit sphere.
Interval1d const & y() const
Interval & clipTo(Scalar x)
Interval1d const & z() const
Relationship relate(Box3d const &b) const
Interval1d represents closed intervals of ℝ.
This file defines a class for representing intervals of ℝ.
std::ostream & operator<<(std::ostream &, Angle const &)
bool isWithin(Scalar x) const
double getHeight() const
getHeight returns the height (y-axis extent) of this box.
Vector3d is a vector in ℝ³ with components stored in double precision.
double getWidth() const
getWidth returns the width (x-axis extent) of this box.
Box3d(Vector3d const &v1, Vector3d const &v2)
This constructor creates a box spanning the intervals [v1.x(), v2.x()], [v1.y(), v2.y()], and [v1.z(), v2.z()].
Box3d(Interval1d const &x, Interval1d const &y, Interval1d const &z)
This constructor creates a box spanning the given x, y, and z intervals.
Scalar getSize() const
getSize returns the size (length, width) of this interval.
This file declares a class for representing vectors in ℝ³.
Relationship relate(Vector3d const &v) const
Relationship relate(Scalar x) const
A base class for image defects.
Box3d clippedTo(Box3d const &b) const
Box3d & expandTo(Vector3d const &b)
Box3d dilatedBy(double r) const
Box3d & erodeBy(double r)
Box3d & dilateBy(double r)
dilateBy minimally expands or shrinks this Box to include or remove all points within distance |r| of...
Box3d expandedTo(Box3d const &b) const
Interval & expandTo(Scalar x)
bool contains(Box3d const &b) const
bool isDisjointFrom(Vector3d const &b) const
bool operator==(Box3d const &b) const
Two 3D boxes are equal if they contain the same points.
bool isEmpty() const
isEmpty returns true if this interval does not contain any points.
Box3d erodedBy(double w, double h, double d) const
Box3d clippedTo(Vector3d const &b) const
Box3d & expandTo(Box3d const &b)
bool operator==(Vector3d const &v) const
A box is equal to a point if it contains only that point.
bool contains(Vector3d const &b) const
This file provides a type alias for describing set relationships.
bool intersects(Vector3d const &b) const
Box3d & erodeBy(double w, double h, double d)
Interval1d operator()(int i) const
The function call operator returns the i-th interval of this box.
bool operator!=(Vector3d const &v) const
Box3d & clipTo(Box3d const &b)
Box3d & clipTo(Vector3d const &b)
Box3d represents a box in ℝ³.
Box3d expandedTo(Vector3d const &b) const
double getDepth() const
getDepth returns the depth (z-axis extent) of this box.
bool contains(Scalar x) const
bool isFull() const
isFull returns true if this box contains all points in ℝ³.
bool isFull() const
isFull returns true if this interval = ℝ.
Box3d(Vector3d const &v, double w, double h, double d)
This constructor creates a box with center v, half-width w, half-height h, and half-depth d...
Interval1d const & x() const
Box3d()
This constructor creates an empty 3D box.
bool isDisjointFrom(Box3d const &b) const
Interval & dilateBy(Scalar x)
For positive x, dilateBy morphologically dilates this interval by [-x,x], which is equivalent to the ...
Box3d(Vector3d const &v)
This constructor creates a box containing a single point.
bool isWithin(Vector3d const &b) const
bool intersects(Scalar x) const
bool intersects(Box3d const &b) const