36 class AxisAlignedBoundingBox;
52 R_(
Eigen::Matrix3d::Identity()),
62 const Eigen::Matrix3d& R,
63 const Eigen::Vector3d& extent)
73 virtual Eigen::Vector3d
GetMinBound()
const override;
74 virtual Eigen::Vector3d
GetMaxBound()
const override;
75 virtual Eigen::Vector3d
GetCenter()
const override;
79 const Eigen::Matrix4d& transformation)
override;
81 bool relative =
true)
override;
91 const Eigen::Vector3d& center)
override;
100 const Eigen::Vector3d& center)
override;
128 const std::vector<Eigen::Vector3d>&
points)
const;
143 const std::vector<Eigen::Vector3d>& points);
179 const Eigen::Vector3d& max_bound)
181 min_bound_(min_bound),
182 max_bound_(max_bound),
189 virtual Eigen::Vector3d
GetMinBound()
const override;
190 virtual Eigen::Vector3d
GetMaxBound()
const override;
191 virtual Eigen::Vector3d
GetCenter()
const override;
195 const Eigen::Matrix4d& transformation)
override;
197 const Eigen::Vector3d& translation,
bool relative =
true)
override;
209 const double scale,
const Eigen::Vector3d& center)
override;
214 const Eigen::Matrix3d& R,
const Eigen::Vector3d& center)
override;
219 Eigen::Vector3d
GetExtent()
const {
return (max_bound_ - min_bound_); }
226 double GetMaxExtent()
const {
return (max_bound_ - min_bound_).maxCoeff(); }
229 return (x - min_bound_(0)) / (max_bound_(0) - min_bound_(0));
233 return (y - min_bound_(1)) / (max_bound_(1) - min_bound_(1));
237 return (z - min_bound_(2)) / (max_bound_(2) - min_bound_(2));
249 const std::vector<Eigen::Vector3d>&
points)
const;
252 std::string GetPrintInfo()
const;
258 const std::vector<Eigen::Vector3d>& points);
OrientedBoundingBox & Clear() override
Clear all elements in the geometry.
Definition: BoundingVolume.cpp:40
The base geometry class.
Definition: Geometry.h:37
Eigen::Matrix3d R_
Definition: BoundingVolume.h:150
Eigen::Vector3d max_bound_
The upper x, y, z bounds of the bounding box.
Definition: BoundingVolume.h:264
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:164
~AxisAlignedBoundingBox() override
Definition: BoundingVolume.h:184
double GetXPercentage(double x) const
Definition: BoundingVolume.h:228
Eigen::Vector3d extent_
The extent of the bounding box in its frame of reference.
Definition: BoundingVolume.h:152
double Volume() const
Returns the volume of the bounding box.
Definition: BoundingVolume.cpp:102
static OrientedBoundingBox CreateFromPoints(const std::vector< Eigen::Vector3d > &points)
Definition: BoundingVolume.cpp:148
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Eigen::Vector3d min_bound_
The lower x, y, z bounds of the bounding box.
Definition: BoundingVolume.h:262
Definition: EigenHelperForNonRigidOptimization.h:33
bool IsEmpty() const override
Returns true iff the geometry is empty.
Definition: BoundingVolume.cpp:48
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
Definition: BoundingVolume.cpp:60
double GetMaxExtent() const
Definition: BoundingVolume.h:226
virtual OrientedBoundingBox & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: BoundingVolume.cpp:70
double GetZPercentage(double z) const
Definition: BoundingVolume.h:236
virtual OrientedBoundingBox & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
Definition: BoundingVolume.cpp:78
std::vector< Eigen::Vector3d > GetBoxPoints() const
Definition: BoundingVolume.cpp:106
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
virtual AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
Definition: BoundingVolume.cpp:62
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
Definition: BoundingVolume.cpp:50
virtual OrientedBoundingBox & Scale(const double scale, const Eigen::Vector3d ¢er) override
Scales the oriented bounding boxs. The extent parameter is multiplied by the scale factor and the cen...
Definition: BoundingVolume.cpp:88
Eigen::Vector3d color_
The color of the bounding box in RGB.
Definition: BoundingVolume.h:266
OrientedBoundingBox()
Default constructor.
Definition: BoundingVolume.h:49
~OrientedBoundingBox() override
Definition: BoundingVolume.h:68
double GetYPercentage(double y) const
Definition: BoundingVolume.h:232
virtual OrientedBoundingBox GetOrientedBoundingBox() const override
Returns an oriented bounding box of the geometry.
Definition: BoundingVolume.cpp:66
AxisAlignedBoundingBox(const Eigen::Vector3d &min_bound, const Eigen::Vector3d &max_bound)
Parameterized constructor.
Definition: BoundingVolume.h:178
int points
Definition: FilePCD.cpp:71
OrientedBoundingBox(const Eigen::Vector3d ¢er, const Eigen::Matrix3d &R, const Eigen::Vector3d &extent)
Parameterized constructor.
Definition: BoundingVolume.h:61
Definition: Open3DViewer.h:29
std::vector< size_t > GetPointIndicesWithinBoundingBox(const std::vector< Eigen::Vector3d > &points) const
Return indices to points that are within the bounding box.
Definition: BoundingVolume.cpp:122
virtual OrientedBoundingBox & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) override
Rotates the oriented bounding boxs. Sets the rotation and center of the oriented bounding box to the ...
Definition: BoundingVolume.cpp:95
Eigen::Vector3d color_
The color of the bounding box in RGB.
Definition: BoundingVolume.h:154
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
Eigen::Vector3d GetExtent() const
Get the extent/length of the bounding box in x, y, and z dimension.
Definition: BoundingVolume.h:219
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
Definition: BoundingVolume.cpp:55
AxisAlignedBoundingBox()
Default constructor.
Definition: BoundingVolume.h:169
static OrientedBoundingBox CreateFromAxisAlignedBoundingBox(const AxisAlignedBoundingBox &aabox)
Definition: BoundingVolume.cpp:139
Eigen::Vector3d GetHalfExtent() const
Returns the half extent of the bounding box.
Definition: BoundingVolume.h:222
Eigen::Vector3d center_
The center point of the bounding box.
Definition: BoundingVolume.h:147