Open3D (C++ API)  0.18.0+252c867
Public Member Functions | Static Public Member Functions | Data Fields
open3d::geometry::LineSet Class Reference

LineSet define a sets of lines in 3D. A typical application is to display the point cloud correspondence pairs. More...

#include <LineSet.h>

Inheritance diagram for open3d::geometry::LineSet:
open3d::geometry::Geometry3D open3d::geometry::Geometry

Public Member Functions

 LineSet ()
 Default Constructor. More...
 
 LineSet (const std::vector< Eigen::Vector3d > &points, const std::vector< Eigen::Vector2i > &lines)
 Parameterized Constructor. More...
 
 ~LineSet () override
 
LineSetClear () override
 Clear all elements in the geometry. More...
 
bool IsEmpty () const override
 Returns true iff the geometry is empty. More...
 
Eigen::Vector3d GetMinBound () const override
 Returns min bounds for geometry coordinates. More...
 
Eigen::Vector3d GetMaxBound () const override
 Returns max bounds for geometry coordinates. More...
 
Eigen::Vector3d GetCenter () const override
 Returns the center of the geometry coordinates. More...
 
AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const override
 
OrientedBoundingBox GetOrientedBoundingBox (bool robust=false) const override
 
OrientedBoundingBox GetMinimalOrientedBoundingBox (bool robust=false) const override
 
LineSetTransform (const Eigen::Matrix4d &transformation) override
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
LineSetTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 Apply translation to the geometry coordinates. More...
 
LineSetScale (const double scale, const Eigen::Vector3d &center) override
 Apply scaling to the geometry coordinates. Given a scaling factor \(s\), and center \(c\), a given point \(p\) is transformed according to \(s (p - c) + c\). More...
 
LineSetRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix \(R\), and center \(c\), a given point \(p\) is transformed according to \(R (p - c) + c\). More...
 
LineSetoperator+= (const LineSet &lineset)
 
LineSet operator+ (const LineSet &lineset) const
 
bool HasPoints () const
 Returns true if the object contains points. More...
 
bool HasLines () const
 Returns true if the object contains lines. More...
 
bool HasColors () const
 Returns true if the objects lines contains colors. More...
 
std::pair< Eigen::Vector3d, Eigen::Vector3d > GetLineCoordinate (size_t line_index) const
 Returns the coordinates of the line at the given index. More...
 
LineSetPaintUniformColor (const Eigen::Vector3d &color)
 Assigns each line in the LineSet the same color. More...
 
- Public Member Functions inherited from open3d::geometry::Geometry3D
 ~Geometry3D () override
 
virtual Geometry3DRotate (const Eigen::Matrix3d &R)
 
- Public Member Functions inherited from open3d::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 Returns one of registered geometry types. More...
 
int Dimension () const
 Returns whether the geometry is 2D or 3D. More...
 
std::string GetName () const
 
void SetName (const std::string &name)
 

Static Public Member Functions

static std::shared_ptr< LineSetCreateFromPointCloudCorrespondences (const PointCloud &cloud0, const PointCloud &cloud1, const std::vector< std::pair< int, int >> &correspondences)
 Factory function to create a LineSet from two PointClouds (cloud0, cloud1) and a correspondence set. More...
 
static std::shared_ptr< LineSetCreateFromOrientedBoundingBox (const OrientedBoundingBox &box)
 Factory function to create a LineSet from an OrientedBoundingBox. More...
 
static std::shared_ptr< LineSetCreateFromAxisAlignedBoundingBox (const AxisAlignedBoundingBox &box)
 Factory function to create a LineSet from an AxisAlignedBoundingBox. More...
 
static std::shared_ptr< LineSetCreateFromTriangleMesh (const TriangleMesh &mesh)
 
static std::shared_ptr< LineSetCreateFromTetraMesh (const TetraMesh &mesh)
 
static std::shared_ptr< LineSetCreateCameraVisualization (int view_width_px, int view_height_px, const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, double scale=1.0)
 
- Static Public Member Functions inherited from open3d::geometry::Geometry3D
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 

Data Fields

std::vector< Eigen::Vector3d > points_
 Points coordinates. More...
 
std::vector< Eigen::Vector2i > lines_
 Lines denoted by the index of points forming the line. More...
 
std::vector< Eigen::Vector3d > colors_
 RGB colors of lines. More...
 

Additional Inherited Members

- Public Types inherited from open3d::geometry::Geometry
enum class  GeometryType {
  Unspecified = 0 , PointCloud = 1 , VoxelGrid = 2 , Octree = 3 ,
  LineSet = 4 , MeshBase = 5 , TriangleMesh = 6 , HalfEdgeTriangleMesh = 7 ,
  Image = 8 , RGBDImage = 9 , TetraMesh = 10 , OrientedBoundingBox = 11 ,
  AxisAlignedBoundingBox = 12
}
 Specifies possible geometry types. More...
 
- Protected Member Functions inherited from open3d::geometry::Geometry3D
 Geometry3D (GeometryType type)
 Parameterized Constructor. More...
 
Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points) const
 Compute min bound of a list points. More...
 
Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) const
 Compute max bound of a list points. More...
 
Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points) const
 Computer center of a list of points. More...
 
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. More...
 
void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
 Transforms all points with the transformation matrix. More...
 
void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
 Transforms the normals with the transformation matrix. More...
 
void TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) const
 Transforms all covariance matrices with the transformation. More...
 
void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
 Apply translation to the geometry coordinates. More...
 
void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Scale the coordinates of all points by the scaling factor scale. More...
 
void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Rotate all points with the rotation matrix R. More...
 
void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) const
 Rotate all normals with the rotation matrix R. More...
 
void RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) const
 Rotate all covariance matrices with the rotation matrix R. More...
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 Parameterized Constructor. More...
 

Detailed Description

LineSet define a sets of lines in 3D. A typical application is to display the point cloud correspondence pairs.

Constructor & Destructor Documentation

◆ LineSet() [1/2]

open3d::geometry::LineSet::LineSet ( )
inline

Default Constructor.

◆ LineSet() [2/2]

open3d::geometry::LineSet::LineSet ( const std::vector< Eigen::Vector3d > &  points,
const std::vector< Eigen::Vector2i > &  lines 
)
inline

Parameterized Constructor.

Create a LineSet from given points and line indices

Parameters
pointsPoint coordinates.
linesLines denoted by the index of points forming the line.

◆ ~LineSet()

open3d::geometry::LineSet::~LineSet ( )
inlineoverride

Member Function Documentation

◆ Clear()

LineSet & open3d::geometry::LineSet::Clear ( )
overridevirtual

Clear all elements in the geometry.

Implements open3d::geometry::Geometry3D.

◆ CreateCameraVisualization()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateCameraVisualization ( int  view_width_px,
int  view_height_px,
const Eigen::Matrix3d &  intrinsic,
const Eigen::Matrix4d &  extrinsic,
double  scale = 1.0 
)
static

Factory function to create a LineSet from intrinsic and extrinsic matrices.

Parameters
view_width_pxThe width of the view, in pixels
view_height_pxThe height of the view, in pixels
intrinsicThe intrinsic matrix
extrinsicThe extrinsic matrix

◆ CreateFromAxisAlignedBoundingBox()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateFromAxisAlignedBoundingBox ( const AxisAlignedBoundingBox box)
static

Factory function to create a LineSet from an AxisAlignedBoundingBox.

Parameters
boxThe input bounding box.

◆ CreateFromOrientedBoundingBox()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateFromOrientedBoundingBox ( const OrientedBoundingBox box)
static

Factory function to create a LineSet from an OrientedBoundingBox.

Parameters
boxThe input bounding box.

◆ CreateFromPointCloudCorrespondences()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateFromPointCloudCorrespondences ( const PointCloud cloud0,
const PointCloud cloud1,
const std::vector< std::pair< int, int >> &  correspondences 
)
static

Factory function to create a LineSet from two PointClouds (cloud0, cloud1) and a correspondence set.

Parameters
cloud0First point cloud.
cloud1Second point cloud.
correspondencesSet of correspondences.

◆ CreateFromTetraMesh()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateFromTetraMesh ( const TetraMesh mesh)
static

Factory function to create a LineSet from edges of a tetra mesh.

Parameters
meshThe input tetra mesh.

◆ CreateFromTriangleMesh()

std::shared_ptr< LineSet > open3d::geometry::LineSet::CreateFromTriangleMesh ( const TriangleMesh mesh)
static

Factory function to create a LineSet from edges of a triangle mesh.

Parameters
meshThe input triangle mesh.

◆ GetAxisAlignedBoundingBox()

AxisAlignedBoundingBox open3d::geometry::LineSet::GetAxisAlignedBoundingBox ( ) const
overridevirtual

Creates the axis-aligned bounding box around the points of the object. Further details in AxisAlignedBoundingBox::CreateFromPoints()

Implements open3d::geometry::Geometry3D.

◆ GetCenter()

Eigen::Vector3d open3d::geometry::LineSet::GetCenter ( ) const
overridevirtual

Returns the center of the geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetLineCoordinate()

std::pair<Eigen::Vector3d, Eigen::Vector3d> open3d::geometry::LineSet::GetLineCoordinate ( size_t  line_index) const
inline

Returns the coordinates of the line at the given index.

Parameters
line_indexIndex of the line.

◆ GetMaxBound()

Eigen::Vector3d open3d::geometry::LineSet::GetMaxBound ( ) const
overridevirtual

Returns max bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMinBound()

Eigen::Vector3d open3d::geometry::LineSet::GetMinBound ( ) const
overridevirtual

Returns min bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMinimalOrientedBoundingBox()

OrientedBoundingBox open3d::geometry::LineSet::GetMinimalOrientedBoundingBox ( bool  robust = false) const
overridevirtual

Creates the minimal oriented bounding box around the points of the object. Further details in OrientedBoundingBox::CreateFromPointsMinimal()

Parameters
robustIf set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetOrientedBoundingBox()

OrientedBoundingBox open3d::geometry::LineSet::GetOrientedBoundingBox ( bool  robust = false) const
overridevirtual

Creates an oriented bounding box around the points of the object. Further details in OrientedBoundingBox::CreateFromPoints()

Parameters
robustIf set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.

Implements open3d::geometry::Geometry3D.

◆ HasColors()

bool open3d::geometry::LineSet::HasColors ( ) const
inline

Returns true if the objects lines contains colors.

◆ HasLines()

bool open3d::geometry::LineSet::HasLines ( ) const
inline

Returns true if the object contains lines.

◆ HasPoints()

bool open3d::geometry::LineSet::HasPoints ( ) const
inline

Returns true if the object contains points.

◆ IsEmpty()

bool open3d::geometry::LineSet::IsEmpty ( ) const
overridevirtual

Returns true iff the geometry is empty.

Implements open3d::geometry::Geometry3D.

◆ operator+()

LineSet open3d::geometry::LineSet::operator+ ( const LineSet lineset) const

◆ operator+=()

LineSet & open3d::geometry::LineSet::operator+= ( const LineSet lineset)

◆ PaintUniformColor()

LineSet& open3d::geometry::LineSet::PaintUniformColor ( const Eigen::Vector3d &  color)
inline

Assigns each line in the LineSet the same color.

Parameters
colorSpecifies the color to be applied.

◆ Rotate()

LineSet & open3d::geometry::LineSet::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix \(R\), and center \(c\), a given point \(p\) is transformed according to \(R (p - c) + c\).

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Implements open3d::geometry::Geometry3D.

◆ Scale()

LineSet & open3d::geometry::LineSet::Scale ( const double  scale,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply scaling to the geometry coordinates. Given a scaling factor \(s\), and center \(c\), a given point \(p\) is transformed according to \(s (p - c) + c\).

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Implements open3d::geometry::Geometry3D.

◆ Transform()

LineSet & open3d::geometry::LineSet::Transform ( const Eigen::Matrix4d &  transformation)
overridevirtual

Apply transformation (4x4 matrix) to the geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ Translate()

LineSet & open3d::geometry::LineSet::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
overridevirtual

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Implements open3d::geometry::Geometry3D.

Field Documentation

◆ colors_

std::vector<Eigen::Vector3d> open3d::geometry::LineSet::colors_

RGB colors of lines.

◆ lines_

std::vector<Eigen::Vector2i> open3d::geometry::LineSet::lines_

Lines denoted by the index of points forming the line.

◆ points_

std::vector<Eigen::Vector3d> open3d::geometry::LineSet::points_

Points coordinates.


The documentation for this class was generated from the following files: