 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
14 #include <Eigen/Eigenvalues>
42 if (!bbox.
isValid())
return *
this;
114 for (
int i = 0; i < 8; ++i) {
115 add(mat * boxCorners[i]);
181 return std::min(V.
x, std::min(V.
y, V.
z));
188 return std::max(V.
x, std::max(V.
y, V.
z));
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++) {
252 const auto& point =
points[idx];
254 indices.push_back(idx);
260 inline void addEigen(
const Eigen::Vector3d& point) {
add(point); }
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
Type prod() const
x,y,z product
Definition: CVGeom.h:406
double volume() const
Definition: BoundingBox.h:262
void add(const Vector3Tpl< T > &P)
'Enlarges' the bounding box with a point
Definition: BoundingBox.h:131
normal_z x
Definition: my_point_types.h:165
T getMinBoxDim() const
Returns minimal box dimension.
Definition: BoundingBox.h:178
Vector3Tpl< T > getCenter() const
Returns center.
Definition: BoundingBox.h:164
Type x
Definition: CVGeom.h:137
Type norm() const
Returns vector norm.
Definition: CVGeom.h:424
T getDiagNorm() const
Returns diagonal length.
Definition: BoundingBox.h:172
Square matrix.
Definition: SquareMatrix.h:25
void setValidity(bool state)
Sets bonding box validity.
Definition: BoundingBox.h:200
void SetColor(const Eigen::Vector3d &color)
Sets the bounding box color.
Definition: BoundingBox.h:265
std::vector< std::size_t > GetPointIndicesWithinBoundingBox(const std::vector< Eigen::Vector3d > &points) const
Definition: BoundingBox.h:242
double getXPercentage(double x) const
Definition: BoundingBox.h:271
math::float4 color
Definition: LineSetBuffers.cpp:46
virtual const BoundingBoxTpl< T > & operator*=(T scaleFactor)
Scales the bounding box.
Definition: BoundingBox.h:89
double getDiagNormd() const
Returns diagonal length (double precision)
Definition: BoundingBox.h:175
bool m_valid
Validity.
Definition: BoundingBox.h:300
void getBounds(double bounds[6]) const
Definition: BoundingBox.h:283
Eigen::Vector3d GetColor() const
Gets the bounding box color.
Definition: BoundingBox.h:267
bool containsEigen(const Eigen::Vector3d &point) const
Definition: BoundingBox.h:236
T getMaxBoxDim() const
Returns maximal box dimension.
Definition: BoundingBox.h:185
normal_z y
Definition: my_point_types.h:168
BoundingBoxTpl(const Vector3Tpl< T > &minCorner, const Vector3Tpl< T > &maxCorner)
Constructor from two vectors (lower min. and upper max. corners)
Definition: BoundingBox.h:32
BoundingBoxTpl< T > operator+(const BoundingBoxTpl< T > &bbox) const
Returns the 'sum' of this bounding-box and another one.
Definition: BoundingBox.h:40
const BoundingBoxTpl< T > & operator+=(const BoundingBoxTpl< T > &bbox)
In place 'sum' of this bounding-box with another one.
Definition: BoundingBox.h:59
virtual const BoundingBoxTpl< T > & operator*=(const SquareMatrixTpl< T > &mat)
Rotates the bounding box.
Definition: BoundingBox.h:99
bool isValid() const
Returns whether bounding box is valid or not.
Definition: BoundingBox.h:203
double getZPercentage(double z) const
Definition: BoundingBox.h:279
T minDistTo(const BoundingBoxTpl< T > &bbox) const
Definition: BoundingBox.h:209
CCVector3d color_
The color of the bounding box in RGB.
Definition: BoundingBox.h:298
void addEigen(const Eigen::Vector3d &point)
Definition: BoundingBox.h:260
int points
Definition: FileIOFactory.cpp:144
Type z
Definition: CVGeom.h:137
Vector3Tpl< T > m_bbMin
Lower min. corner.
Definition: BoundingBox.h:294
BoundingBoxTpl()
Default constructor.
Definition: BoundingBox.h:28
static std::vector< Eigen::Matrix< double, 3, 1 > > fromArrayContainer(const std::vector< Vector3Tpl< PointCoordinateType >> &container)
Definition: CVGeom.h:301
Vector3Tpl< T > m_bbMax
Upper max. corner.
Definition: BoundingBox.h:296
bool contains(const Vector3Tpl< T > &P) const
Returns whether a points is inside the box or not.
Definition: BoundingBox.h:231
double getYPercentage(double y) const
Definition: BoundingBox.h:275
virtual const BoundingBoxTpl< T > & operator+=(const Vector3Tpl< T > &V)
Shifts the bounding box with a vector.
Definition: BoundingBox.h:69
Vector3Tpl< T > getDiagVec() const
Returns diagonal vector.
Definition: BoundingBox.h:169
std::vector< std::size_t > GetPointIndicesWithinBoundingBox(const std::vector< Vector3Tpl< T >> &points) const
Definition: BoundingBox.h:248
Type y
Definition: CVGeom.h:137
const Vector3Tpl< T > & maxCorner() const
Returns max corner (const)
Definition: BoundingBox.h:156
Bounding box structure.
Definition: BoundingBox.h:25
void clear()
Resets the bounding box.
Definition: BoundingBox.h:125
Vector3Tpl< T > & maxCorner()
Returns max corner.
Definition: BoundingBox.h:161
normal_z z
Definition: my_point_types.h:165
Vector3Tpl< T > & minCorner()
Returns min corner.
Definition: BoundingBox.h:159
Type u[3]
Definition: CVGeom.h:139
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
virtual const BoundingBoxTpl< T > & operator-=(const Vector3Tpl< T > &V)
Shifts the bounding box with a vector.
Definition: BoundingBox.h:79
double normd() const
Returns vector norm (forces double precision output)
Definition: CVGeom.h:426
const Vector3Tpl< T > & minCorner() const
Returns min corner (const)
Definition: BoundingBox.h:154
double computeVolume() const
Returns the bounding-box volume.
Definition: BoundingBox.h:192