Open3D (C++ API)  0.17.0
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 #include "open3d/core/Device.h"
13 
14 namespace open3d {
15 namespace t {
16 namespace geometry {
17 
21 class Geometry : public core::IsDevice {
22 public:
26  enum class GeometryType {
28  Unspecified = 0,
30  PointCloud = 1,
32  VoxelGrid = 2,
34  Octree = 3,
36  LineSet = 4,
38  MeshBase = 5,
40  TriangleMesh = 6,
44  Image = 8,
46  RGBDImage = 9,
48  TetraMesh = 10,
53  };
54 
55 public:
56  virtual ~Geometry() {}
57 
58 protected:
63  Geometry(GeometryType type, int dimension)
64  : geometry_type_(type), dimension_(dimension) {}
65 
66 public:
68  virtual Geometry& Clear() = 0;
69 
71  virtual bool IsEmpty() const = 0;
72 
74  virtual core::Device GetDevice() const = 0;
75 
77  GeometryType GetGeometryType() const { return geometry_type_; }
78 
80  int Dimension() const { return dimension_; }
81 
82  std::string GetName() const { return name_; }
83  void SetName(const std::string& name) { name_ = name; }
84 
85 private:
87  GeometryType geometry_type_ = GeometryType::Unspecified;
88 
90  int dimension_;
91  std::string name_;
92 };
93 
94 } // namespace geometry
95 } // namespace t
96 } // namespace open3d
Definition: Device.h:18
Definition: Device.h:88
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for eac...
Definition: HalfEdgeTriangleMesh.h:24
MeshBash Class.
Definition: MeshBase.h:32
Octree datastructure.
Definition: Octree.h:244
Tetra mesh contains vertices and tetrahedra represented by the indices to the vertices.
Definition: TetraMesh.h:29
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:61
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound.
Definition: BoundingVolume.h:46
The base geometry class.
Definition: Geometry.h:21
void SetName(const std::string &name)
Definition: Geometry.h:83
GeometryType GetGeometryType() const
Returns one of registered geometry types.
Definition: Geometry.h:77
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:26
@ Unspecified
Unspecified geometry type.
virtual core::Device GetDevice() const =0
Returns the device of the geometry.
int Dimension() const
Returns whether the geometry is 2D or 3D.
Definition: Geometry.h:80
std::string GetName() const
Definition: Geometry.h:82
Geometry(GeometryType type, int dimension)
Parameterized Constructor.
Definition: Geometry.h:63
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
virtual ~Geometry()
Definition: Geometry.h:56
virtual Geometry & Clear()=0
Clear all elements in the geometry.
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
A LineSet contains points and lines joining them and optionally attributes on the points and lines.
Definition: LineSet.h:84
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:245
A point cloud contains a list of 3D points.
Definition: PointCloud.h:80
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:21
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:92
std::string name
Definition: FilePCD.cpp:39
char type
Definition: FilePCD.cpp:41
Definition: PinholeCameraIntrinsic.cpp:16