14 #include <Eigen/Eigenvalues>
42 if (!bbox.
isValid())
return *
this;
114 for (
int i = 0; i < 8; ++i) {
115 add(mat * boxCorners[i]);
195 return static_cast<double>(V.
x) *
static_cast<double>(V.
y) *
196 static_cast<double>(V.
z);
213 for (uint8_t dim = 0; dim < 3; ++dim) {
224 return std::numeric_limits<T>::quiet_NaN();
243 const std::vector<Eigen::Vector3d>&
points)
const {
250 std::vector<size_t> indices;
251 for (std::size_t idx = 0; idx <
points.size(); idx++) {
254 indices.push_back(idx);
double normd() const
Returns vector norm (forces double precision output)
Type prod() const
x,y,z product
Type norm() const
Returns vector norm.
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
static std::vector< Eigen::Matrix< double, 3, 1 > > fromArrayContainer(const std::vector< Vector3Tpl< PointCoordinateType >> &container)
Vector3Tpl< T > getDiagVec() const
Returns diagonal vector.
BoundingBoxTpl(const Vector3Tpl< T > &minCorner, const Vector3Tpl< T > &maxCorner)
Constructor from two vectors (lower min. and upper max. corners)
BoundingBoxTpl()
Default constructor.
double getDiagNormd() const
Returns diagonal length (double precision)
Vector3Tpl< T > & minCorner()
Returns min corner.
CCVector3d color_
The color of the bounding box in RGB.
Vector3Tpl< T > m_bbMin
Lower min. corner.
BoundingBoxTpl< T > operator+(const BoundingBoxTpl< T > &bbox) const
Returns the 'sum' of this bounding-box and another one.
Vector3Tpl< T > getCenter() const
Returns center.
std::vector< std::size_t > GetPointIndicesWithinBoundingBox(const std::vector< Vector3Tpl< T >> &points) const
double getZPercentage(double z) const
Eigen::Vector3d GetColor() const
Gets the bounding box color.
std::vector< std::size_t > GetPointIndicesWithinBoundingBox(const std::vector< Eigen::Vector3d > &points) const
bool contains(const Vector3Tpl< T > &P) const
Returns whether a points is inside the box or not.
T minDistTo(const BoundingBoxTpl< T > &bbox) const
const Vector3Tpl< T > & maxCorner() const
Returns max corner (const)
T getDiagNorm() const
Returns diagonal length.
T getMinBoxDim() const
Returns minimal box dimension.
void setValidity(bool state)
Sets bonding box validity.
double computeVolume() const
Returns the bounding-box volume.
virtual const BoundingBoxTpl< T > & operator*=(T scaleFactor)
Scales the bounding box.
void getBounds(double bounds[6]) const
T getMaxBoxDim() const
Returns maximal box dimension.
void clear()
Resets the bounding box.
bool containsEigen(const Eigen::Vector3d &point) const
const Vector3Tpl< T > & minCorner() const
Returns min corner (const)
virtual const BoundingBoxTpl< T > & operator*=(const SquareMatrixTpl< T > &mat)
Rotates the bounding box.
Vector3Tpl< T > m_bbMax
Upper max. corner.
const BoundingBoxTpl< T > & operator+=(const BoundingBoxTpl< T > &bbox)
In place 'sum' of this bounding-box with another one.
double getXPercentage(double x) const
virtual const BoundingBoxTpl< T > & operator+=(const Vector3Tpl< T > &V)
Shifts the bounding box with a vector.
virtual const BoundingBoxTpl< T > & operator-=(const Vector3Tpl< T > &V)
Shifts the bounding box with a vector.
void addEigen(const Eigen::Vector3d &point)
void SetColor(const Eigen::Vector3d &color)
Sets the bounding box color.
Vector3Tpl< T > & maxCorner()
Returns max corner.
bool isValid() const
Returns whether bounding box is valid or not.
double getYPercentage(double y) const
void add(const Vector3Tpl< T > &P)
'Enlarges' the bounding box with a point
Generic file read and write utility for python interface.