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 <string>
11
12namespace open3d {
13namespace geometry {
14
18class Geometry {
19public:
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,
52 };
53
54public:
55 virtual ~Geometry() {}
56
57protected:
62 Geometry(GeometryType type, int dimension)
63 : geometry_type_(type), dimension_(dimension) {}
64
65public:
67 virtual Geometry& Clear() = 0;
69 virtual bool IsEmpty() const = 0;
71 GeometryType GetGeometryType() const { return geometry_type_; }
73 int Dimension() const { return dimension_; }
74
75 std::string GetName() const { return name_; }
76 void SetName(const std::string& name) { name_ = name; }
77
78private:
82 int dimension_ = 3;
83 std::string name_;
84};
85
86} // namespace geometry
87} // namespace open3d
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound.
Definition BoundingVolume.h:285
The base geometry class.
Definition Geometry.h:18
GeometryType GetGeometryType() const
Returns one of registered geometry types.
Definition Geometry.h:71
virtual ~Geometry()
Definition Geometry.h:55
void SetName(const std::string &name)
Definition Geometry.h:76
int Dimension() const
Returns whether the geometry is 2D or 3D.
Definition Geometry.h:73
GeometryType
Specifies possible geometry types.
Definition Geometry.h:23
@ Unspecified
Unspecified geometry type.
std::string GetName() const
Definition Geometry.h:75
virtual bool IsEmpty() const =0
Returns true iff the geometry is empty.
virtual Geometry & Clear()=0
Clear all elements in the geometry.
Geometry(GeometryType type, int dimension)
Parameterized Constructor.
Definition Geometry.h:62
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:30
MeshBash Class.
Definition MeshBase.h:33
Octree datastructure.
Definition Octree.h:244
A bounding box oriented along an arbitrary frame of reference.
Definition BoundingVolume.h:138
Definition BoundingVolume.h:20
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:40
char type
Definition FilePCD.cpp:42
Definition PinholeCameraIntrinsic.cpp:16