Open3D (C++ API)  0.19.0
Geometry.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <fmt/format.h>
11 
12 #include <string>
13 
14 #include "open3d/core/Device.h"
15 
16 namespace open3d {
17 namespace t {
18 namespace geometry {
19 
23 class Geometry : public core::IsDevice {
24 public:
28  enum class GeometryType {
30  Unspecified = 0,
32  PointCloud = 1,
34  VoxelGrid = 2,
36  Octree = 3,
38  LineSet = 4,
40  MeshBase = 5,
42  TriangleMesh = 6,
46  Image = 8,
48  RGBDImage = 9,
50  TetraMesh = 10,
55  };
56 
57 public:
58  virtual ~Geometry() {}
59 
60 protected:
65  Geometry(GeometryType type, int dimension)
66  : geometry_type_(type), dimension_(dimension) {}
67 
68 public:
70  virtual Geometry& Clear() = 0;
71 
73  virtual bool IsEmpty() const = 0;
74 
76  virtual core::Device GetDevice() const = 0;
77 
79  GeometryType GetGeometryType() const { return geometry_type_; }
80 
82  int Dimension() const { return dimension_; }
83 
84  std::string GetName() const { return name_; }
85  void SetName(const std::string& name) { name_ = name; }
86 
87 private:
89  GeometryType geometry_type_ = GeometryType::Unspecified;
90 
92  int dimension_;
93  std::string name_;
94 };
96 enum class Metric {
99  FScore
100 };
101 
106  std::vector<float> fscore_radius = {0.01};
110  size_t n_sampled_points = 1000;
111  std::string ToString() const {
112  return fmt::format(
113  "MetricParameters: fscore_radius={}, n_sampled_points={}",
115  }
116 };
117 
118 } // namespace geometry
119 } // namespace t
120 } // namespace open3d
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:195
double t
Definition: SurfaceReconstructionPoisson.cpp:172
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:23
void SetName(const std::string &name)
Definition: Geometry.h:85
GeometryType GetGeometryType() const
Returns one of registered geometry types.
Definition: Geometry.h:79
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:28
@ 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:82
std::string GetName() const
Definition: Geometry.h:84
Geometry(GeometryType type, int dimension)
Parameterized Constructor.
Definition: Geometry.h:65
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
virtual ~Geometry()
Definition: Geometry.h:58
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:257
A point cloud contains a list of 3D points.
Definition: PointCloud.h:81
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:21
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:96
std::string name
Definition: FilePCD.cpp:39
char type
Definition: FilePCD.cpp:41
Metric
Metrics for comparing point clouds and triangle meshes.
Definition: Geometry.h:96
@ ChamferDistance
Chamfer Distance.
@ HausdorffDistance
Hausdorff Distance.
Definition: PinholeCameraIntrinsic.cpp:16
Holder for various parameters required by metrics.
Definition: Geometry.h:103
size_t n_sampled_points
Definition: Geometry.h:110
std::vector< float > fscore_radius
Definition: Geometry.h:106
std::string ToString() const
Definition: Geometry.h:111