30 #include <Eigen/Geometry> 39 class AxisAlignedBoundingBox;
40 class OrientedBoundingBox;
59 bool IsEmpty()
const override = 0;
65 virtual Eigen::Vector3d
GetCenter()
const = 0;
79 bool relative =
true) = 0;
88 const Eigen::Vector3d& center) = 0;
97 const Eigen::Vector3d& center) = 0;
103 const Eigen::Vector3d& rotation);
106 const Eigen::Vector3d& rotation);
109 const Eigen::Vector3d& rotation);
112 const Eigen::Vector3d& rotation);
115 const Eigen::Vector3d& rotation);
118 const Eigen::Vector3d& rotation);
121 const Eigen::Vector3d& rotation);
124 const Eigen::Vector4d& rotation);
129 const std::vector<Eigen::Vector3d>&
points)
const;
132 const std::vector<Eigen::Vector3d>& points)
const;
135 const std::vector<Eigen::Vector3d>& points)
const;
144 const Eigen::Vector3d&
color)
const;
151 std::vector<Eigen::Vector3d>& points)
const;
158 std::vector<Eigen::Vector3d>& normals)
const;
165 std::vector<Eigen::Matrix3d>& covariances)
const;
175 std::vector<Eigen::Vector3d>& points,
176 bool relative)
const;
185 std::vector<Eigen::Vector3d>& points,
186 const Eigen::Vector3d& center)
const;
195 std::vector<Eigen::Vector3d>& points,
196 const Eigen::Vector3d& center)
const;
203 std::vector<Eigen::Vector3d>& normals)
const;
210 std::vector<Eigen::Matrix3d>& covariances)
const;
Eigen::Vector3d ComputeCenter(const std::vector< Eigen::Vector3d > &points) const
Computer center of a list of points.
Definition: Geometry3D.cpp:64
The base geometry class.
Definition: Geometry.h:37
bool IsEmpty() const override=0
Returns true iff the geometry is empty.
virtual Eigen::Vector3d GetMinBound() const =0
Returns min bounds for geometry coordinates.
virtual Geometry3D & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er)=0
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ...
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:150
virtual Geometry3D & Scale(const double scale, const Eigen::Vector3d ¢er)=0
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is tr...
virtual OrientedBoundingBox GetOrientedBoundingBox() const =0
Returns an oriented bounding box of the geometry.
Geometry3D(GeometryType type)
Parameterized Constructor.
Definition: Geometry3D.h:55
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 RotateNormals(const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) const
Rotate all normals with the rotation matrix R.
Definition: Geometry3D.cpp:150
void TransformCovariances(const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) const
Transforms all covariance matrices with the transformation.
Definition: Geometry3D.cpp:116
void TransformNormals(const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
Transforms the normals with the transformation matrix.
Definition: Geometry3D.cpp:106
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Geometry3D & Clear() override=0
Clear all elements in the geometry.
static Eigen::Matrix3d GetRotationMatrixFromYXZ(const Eigen::Vector3d &rotation)
Get Rotation Matrix from YXZ RotationType.
Definition: Geometry3D.cpp:203
math::float4 color
Definition: LineSetBuffers.cpp:64
The base geometry class for 3D geometries.
Definition: Geometry3D.h:47
static Eigen::Matrix3d GetRotationMatrixFromZYX(const Eigen::Vector3d &rotation)
Get Rotation Matrix from ZYX RotationType.
Definition: Geometry3D.cpp:196
void TranslatePoints(const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
Apply translation to the geometry coordinates.
Definition: Geometry3D.cpp:122
void ScalePoints(const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) const
Scale the coordinates of all points by the scaling factor scale.
Definition: Geometry3D.cpp:134
static Eigen::Matrix3d GetRotationMatrixFromYZX(const Eigen::Vector3d &rotation)
Get Rotation Matrix from YZX RotationType.
Definition: Geometry3D.cpp:175
static Eigen::Matrix3d GetRotationMatrixFromZXY(const Eigen::Vector3d &rotation)
Get Rotation Matrix from ZXY RotationType.
Definition: Geometry3D.cpp:182
void RotatePoints(const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) const
Rotate all points with the rotation matrix R.
Definition: Geometry3D.cpp:142
static Eigen::Matrix3d GetRotationMatrixFromXZY(const Eigen::Vector3d &rotation)
Get Rotation Matrix from XZY RotationType.
Definition: Geometry3D.cpp:189
~Geometry3D() override
Definition: Geometry3D.h:49
void TransformPoints(const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
Transforms all points with the transformation matrix.
Definition: Geometry3D.cpp:96
Definition: PinholeCameraIntrinsic.cpp:35
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
static Eigen::Matrix3d GetRotationMatrixFromXYZ(const Eigen::Vector3d &rotation)
Get Rotation Matrix from XYZ RotationType.
Definition: Geometry3D.cpp:168
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:216
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:75
Eigen::Vector3d ComputeMinBound(const std::vector< Eigen::Vector3d > &points) const
Compute min bound of a list points.
Definition: Geometry3D.cpp:41
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle(const Eigen::Vector3d &rotation)
Get Rotation Matrix from AxisAngle RotationType.
Definition: Geometry3D.cpp:210
void RotateCovariances(const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) const
Rotate all covariance matrices with the rotation matrix R.
Definition: Geometry3D.cpp:160
Eigen::Vector3d ComputeMaxBound(const std::vector< Eigen::Vector3d > &points) const
Compute max bound of a list points.
Definition: Geometry3D.cpp:53