Open3D (C++ API)  0.18.0+5c982c7
Geometry.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <string>
11 
12 namespace open3d {
13 namespace geometry {
14 
18 class Geometry {
19 public:
23  enum class GeometryType {
25  Unspecified = 0,
27  PointCloud = 1,
29  VoxelGrid = 2,
31  Octree = 3,
33  LineSet = 4,
35  MeshBase = 5,
37  TriangleMesh = 6,
41  Image = 8,
43  RGBDImage = 9,
45  TetraMesh = 10,
50  };
51 
52 public:
53  virtual ~Geometry() {}
54 
55 protected:
60  Geometry(GeometryType type, int dimension)
61  : geometry_type_(type), dimension_(dimension) {}
62 
63 public:
65  virtual Geometry& Clear() = 0;
67  virtual bool IsEmpty() const = 0;
69  GeometryType GetGeometryType() const { return geometry_type_; }
71  int Dimension() const { return dimension_; }
72 
73  std::string GetName() const { return name_; }
74  void SetName(const std::string& name) { name_ = name; }
75 
76 private:
78  GeometryType geometry_type_ = GeometryType::Unspecified;
80  int dimension_ = 3;
81  std::string name_;
82 };
83 
84 } // namespace geometry
85 } // namespace open3d
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound.
Definition: BoundingVolume.h:160
The base geometry class.
Definition: Geometry.h:18
GeometryType GetGeometryType() const
Returns one of registered geometry types.
Definition: Geometry.h:69
virtual ~Geometry()
Definition: Geometry.h:53
void SetName(const std::string &name)
Definition: Geometry.h:74
virtual Geometry & Clear()=0
Clear all elements in the geometry.
int Dimension() const
Returns whether the geometry is 2D or 3D.
Definition: Geometry.h:71
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:23
@ Unspecified
Unspecified geometry type.
std::string GetName() const
Definition: Geometry.h:73
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
Geometry(GeometryType type, int dimension)
Parameterized Constructor.
Definition: Geometry.h:60
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for eac...
Definition: HalfEdgeTriangleMesh.h:24
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:34
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
Definition: LineSet.h:29
MeshBash Class.
Definition: MeshBase.h:32
Octree datastructure.
Definition: Octree.h:244
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:25
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition: PointCloud.h:36
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:27
Tetra mesh contains vertices and tetrahedra represented by the indices to the vertices.
Definition: TetraMesh.h:29
Triangle mesh contains vertices and triangles represented by the indices to the vertices.
Definition: TriangleMesh.h:35
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:61
std::string name
Definition: FilePCD.cpp:39
char type
Definition: FilePCD.cpp:41
Definition: PinholeCameraIntrinsic.cpp:16