30 #include <Eigen/Geometry> 38 class AxisAlignedBoundingBox;
39 class OrientedBoundingBox;
58 bool IsEmpty()
const override = 0;
64 virtual Eigen::Vector3d
GetCenter()
const = 0;
77 bool relative =
true) = 0;
95 bool center =
true) = 0;
99 const Eigen::Vector3d& rotation);
102 const Eigen::Vector3d& rotation);
105 const Eigen::Vector3d& rotation);
108 const Eigen::Vector3d& rotation);
111 const Eigen::Vector3d& rotation);
114 const Eigen::Vector3d& rotation);
117 const Eigen::Vector3d& rotation);
120 const Eigen::Vector4d& rotation);
125 const std::vector<Eigen::Vector3d>&
points)
const;
128 const std::vector<Eigen::Vector3d>& points)
const;
131 const std::vector<Eigen::Vector3d>& points)
const;
142 const Eigen::Vector3d& color)
const;
149 std::vector<Eigen::Vector3d>& points)
const;
155 std::vector<Eigen::Vector3d>& normals)
const;
164 std::vector<Eigen::Vector3d>& points,
165 bool relative)
const;
175 std::vector<Eigen::Vector3d>& points,
187 std::vector<Eigen::Vector3d>& points,
199 std::vector<Eigen::Vector3d>& normals,
void RotatePoints(const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, bool center) const
Rotate all points with the rotation matrix R.
Definition: Geometry3D.cpp:136
Eigen::Vector3d ComputeCenter(const std::vector< Eigen::Vector3d > &points) const
Computer center of a list of points.
Definition: Geometry3D.cpp:60
virtual Geometry3D & Scale(const double scale, bool center=true)=0
Apply scaling to the geometry coordinates.
The base geometry class.
Definition: Geometry.h:35
bool IsEmpty() const override=0
Returns true iff the geometry is empty.
virtual Eigen::Vector3d GetMinBound() const =0
Returns min bounds for geometry coordinates.
void ScalePoints(const double scale, std::vector< Eigen::Vector3d > &points, bool center) const
Scale the coordinates of all points by the scaling factor scale.
Definition: Geometry3D.cpp:124
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:130
virtual OrientedBoundingBox GetOrientedBoundingBox() const =0
Returns an oriented bounding box of the geometry.
Geometry3D(GeometryType type)
Parameterized Constructor.
Definition: Geometry3D.h:54
virtual Eigen::Vector3d GetCenter() const =0
Returns the center of the geometry coordinates.
virtual Geometry3D & Transform(const Eigen::Matrix4d &transformation)=0
Apply transformation (4x4 matrix) to the geometry coordinates.
virtual AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const =0
Returns an axis-aligned bounding box of the geometry.
virtual Eigen::Vector3d GetMaxBound() const =0
Returns max bounds for geometry coordinates.
void TransformNormals(const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
Transforms the normals with the transformation matrix.
Definition: Geometry3D.cpp:102
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Geometry3D & Clear() override=0
Clear all elements in the geometry.
int size
Definition: FilePCD.cpp:56
static Eigen::Matrix3d GetRotationMatrixFromYXZ(const Eigen::Vector3d &rotation)
Get Rotation Matrix from YXZ RotationType.
Definition: Geometry3D.cpp:191
void RotateNormals(const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals, bool center) const
Rotate all normals with the rotation matrix R.
Definition: Geometry3D.cpp:148
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
static Eigen::Matrix3d GetRotationMatrixFromZYX(const Eigen::Vector3d &rotation)
Get Rotation Matrix from ZYX RotationType.
Definition: Geometry3D.cpp:184
void TranslatePoints(const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
Apply translation to the geometry coordinates.
Definition: Geometry3D.cpp:112
static Eigen::Matrix3d GetRotationMatrixFromYZX(const Eigen::Vector3d &rotation)
Get Rotation Matrix from YZX RotationType.
Definition: Geometry3D.cpp:163
static Eigen::Matrix3d GetRotationMatrixFromZXY(const Eigen::Vector3d &rotation)
Get Rotation Matrix from ZXY RotationType.
Definition: Geometry3D.cpp:170
char type
Definition: FilePCD.cpp:57
static Eigen::Matrix3d GetRotationMatrixFromXZY(const Eigen::Vector3d &rotation)
Get Rotation Matrix from XZY RotationType.
Definition: Geometry3D.cpp:177
~Geometry3D() override
Definition: Geometry3D.h:48
int points
Definition: FilePCD.cpp:70
void TransformPoints(const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
Transforms all points with the transformation matrix.
Definition: Geometry3D.cpp:92
Definition: PinholeCameraIntrinsic.cpp:34
virtual Geometry3D & Rotate(const Eigen::Matrix3d &R, bool center=true)=0
Apply rotation to the geometry coordinates and normals.
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:40
static Eigen::Matrix3d GetRotationMatrixFromXYZ(const Eigen::Vector3d &rotation)
Get Rotation Matrix from XYZ RotationType.
Definition: Geometry3D.cpp:156
virtual Geometry3D & Translate(const Eigen::Vector3d &translation, bool relative=true)=0
Apply translation to the geometry coordinates.
static Eigen::Matrix3d GetRotationMatrixFromQuaternion(const Eigen::Vector4d &rotation)
Get Rotation Matrix from Quaternion.
Definition: Geometry3D.cpp:204
Eigen::Vector3d ComputeMinBound(const std::vector< Eigen::Vector3d > &points) const
Compute min bound of a list points.
Definition: Geometry3D.cpp:37
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle(const Eigen::Vector3d &rotation)
Get Rotation Matrix from AxisAngle RotationType.
Definition: Geometry3D.cpp:198
Eigen::Vector3d ComputeMaxBound(const std::vector< Eigen::Vector3d > &points) const
Compute max bound of a list points.
Definition: Geometry3D.cpp:49
void ResizeAndPaintUniformColor(std::vector< Eigen::Vector3d > &colors, const size_t size, const Eigen::Vector3d &color) const
Resizes the colors vector and paints a uniform color.
Definition: Geometry3D.cpp:71