ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SelectionPolygonVolume.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <CVGeom.h>
11 #include <IJsonConvertible.h>
12 
13 #include <Eigen/Core>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 class ccMesh;
19 class ccPointCloud;
20 
21 namespace cloudViewer {
22 
23 namespace visualization {
24 
29 public:
31 
32 public:
33  bool ConvertToJsonValue(Json::Value &value) const override;
34  bool ConvertFromJsonValue(const Json::Value &value) override;
38  std::shared_ptr<ccPointCloud> CropPointCloud(
39  const ccPointCloud &input) const;
43  std::shared_ptr<ccMesh> CropTriangleMesh(const ccMesh &input) const;
47  std::vector<size_t> CropInPolygon(const ccPointCloud &input) const;
48 
49 private:
50  std::shared_ptr<ccPointCloud> CropPointCloudInPolygon(
51  const ccPointCloud &input) const;
52  std::shared_ptr<ccMesh> CropTriangleMeshInPolygon(
53  const ccMesh &input) const;
54  std::vector<size_t> CropInPolygon(
55  const std::vector<Eigen::Vector3d> &input) const;
56  std::vector<size_t> CropInPolygon(
57  const std::vector<CCVector3> &input) const;
58 
59 public:
61  std::string orthogonal_axis_ = "";
63  std::vector<Eigen::Vector3d> bounding_polygon_;
65  double axis_min_ = 0.0;
67  double axis_max_ = 0.0;
68 };
69 
70 } // namespace visualization
71 } // namespace cloudViewer
Triangular mesh.
Definition: ecvMesh.h:35
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
std::vector< Eigen::Vector3d > bounding_polygon_
Bounding polygon boundary.
bool ConvertToJsonValue(Json::Value &value) const override
std::vector< size_t > CropInPolygon(const ccPointCloud &input) const
bool ConvertFromJsonValue(const Json::Value &value) override
std::shared_ptr< ccPointCloud > CropPointCloud(const ccPointCloud &input) const
std::shared_ptr< ccMesh > CropTriangleMesh(const ccMesh &input) const
Generic file read and write utility for python interface.