Open3D (C++ API)  0.18.0+252c867
SelectionPolygonVolume.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 <Eigen/Core>
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
16 
17 namespace open3d {
18 
19 namespace geometry {
20 class Geometry;
21 class PointCloud;
22 class TriangleMesh;
23 } // namespace geometry
24 
25 namespace visualization {
26 
31 public:
33 
34 public:
35  bool ConvertToJsonValue(Json::Value &value) const override;
36  bool ConvertFromJsonValue(const Json::Value &value) override;
40  std::shared_ptr<geometry::PointCloud> CropPointCloud(
41  const geometry::PointCloud &input) const;
45  std::shared_ptr<geometry::TriangleMesh> CropTriangleMesh(
46  const geometry::TriangleMesh &input) const;
50  std::vector<size_t> CropInPolygon(const geometry::PointCloud &input) const;
51 
52 private:
53  std::shared_ptr<geometry::PointCloud> CropPointCloudInPolygon(
54  const geometry::PointCloud &input) const;
55  std::shared_ptr<geometry::TriangleMesh> CropTriangleMeshInPolygon(
56  const geometry::TriangleMesh &input) const;
57  std::vector<size_t> CropInPolygon(
58  const std::vector<Eigen::Vector3d> &input) const;
59 
60 public:
62  std::string orthogonal_axis_ = "";
64  std::vector<Eigen::Vector3d> bounding_polygon_;
66  double axis_min_ = 0.0;
68  double axis_max_ = 0.0;
69 };
70 
71 } // namespace visualization
72 } // namespace open3d
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition: PointCloud.h:36
Triangle mesh contains vertices and triangles represented by the indices to the vertices.
Definition: TriangleMesh.h:35
Definition: IJsonConvertible.h:40
Select a polygon volume for cropping.
Definition: SelectionPolygonVolume.h:30
std::vector< size_t > CropInPolygon(const geometry::PointCloud &input) const
Definition: SelectionPolygonVolume.cpp:107
double axis_min_
Minimum axis value.
Definition: SelectionPolygonVolume.h:66
double axis_max_
Maximum axis value.
Definition: SelectionPolygonVolume.h:68
bool ConvertToJsonValue(Json::Value &value) const override
Definition: SelectionPolygonVolume.cpp:20
~SelectionPolygonVolume() override
Definition: SelectionPolygonVolume.h:32
std::shared_ptr< geometry::PointCloud > CropPointCloud(const geometry::PointCloud &input) const
Definition: SelectionPolygonVolume.cpp:73
std::string orthogonal_axis_
One of {x, y, z}.
Definition: SelectionPolygonVolume.h:62
std::vector< Eigen::Vector3d > bounding_polygon_
Bounding polygon boundary.
Definition: SelectionPolygonVolume.h:64
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: SelectionPolygonVolume.cpp:39
std::shared_ptr< geometry::TriangleMesh > CropTriangleMesh(const geometry::TriangleMesh &input) const
Definition: SelectionPolygonVolume.cpp:87
Definition: PinholeCameraIntrinsic.cpp:16