Open3D (C++ API)  0.19.0
Loading...
Searching...
No Matches
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
16namespace open3d {
17namespace t {
18namespace geometry {
19
23class Geometry : public core::IsDevice {
24public:
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,
57 };
58
59public:
60 virtual ~Geometry() {}
61
62protected:
67 Geometry(GeometryType type, int dimension)
68 : geometry_type_(type), dimension_(dimension) {}
69
70public:
72 virtual Geometry& Clear() = 0;
73
75 virtual bool IsEmpty() const = 0;
76
78 virtual core::Device GetDevice() const = 0;
79
81 GeometryType GetGeometryType() const { return geometry_type_; }
82
84 int Dimension() const { return dimension_; }
85
86 std::string GetName() const { return name_; }
87 void SetName(const std::string& name) { name_ = name; }
88
89private:
92
94 int dimension_;
95 std::string name_;
96};
98enum class Metric {
101 FScore
102};
103
108 std::vector<float> fscore_radius = {0.01};
112 size_t n_sampled_points = 1000;
113 std::string ToString() const {
114 return fmt::format(
115 "MetricParameters: fscore_radius={}, n_sampled_points={}",
117 }
118};
119
120enum class MethodOBBCreate {
121 PCA,
124};
125
126} // namespace geometry
127} // namespace t
128} // namespace open3d
double t
Definition SurfaceReconstructionPoisson.cpp:172
Definition Device.h:18
Definition Device.h:90
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for eac...
Definition HalfEdgeTriangleMesh.h:24
MeshBash Class.
Definition MeshBase.h:33
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
virtual Geometry & Clear()=0
Clear all elements in the geometry.
void SetName(const std::string &name)
Definition Geometry.h:87
GeometryType GetGeometryType() const
Returns one of registered geometry types.
Definition Geometry.h:81
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:84
std::string GetName() const
Definition Geometry.h:86
Geometry(GeometryType type, int dimension)
Parameterized Constructor.
Definition Geometry.h:67
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
virtual ~Geometry()
Definition Geometry.h:60
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 bounding ellipsoid oriented along an arbitrary frame of reference.
Definition BoundingVolume.h:512
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:97
std::string name
Definition FilePCD.cpp:40
char type
Definition FilePCD.cpp:42
MethodOBBCreate
Definition Geometry.h:120
@ MINIMAL_APPROX
Minimal OBB approximation.
@ PCA
Principal Component Analysis.
@ MINIMAL_JYLANKI
Minimal OBB by Jylanki.
Metric
Metrics for comparing point clouds and triangle meshes.
Definition Geometry.h:98
@ ChamferDistance
Chamfer Distance.
@ HausdorffDistance
Hausdorff Distance.
Definition PinholeCameraIntrinsic.cpp:16
Holder for various parameters required by metrics.
Definition Geometry.h:105
size_t n_sampled_points
Definition Geometry.h:112
std::vector< float > fscore_radius
Definition Geometry.h:108
std::string ToString() const
Definition Geometry.h:113