ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PointCloudPicker.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 <ecvHObject.h>
11 
12 #include <Eigen/Core>
13 #include <memory>
14 #include <vector>
15 
16 class ccBBox;
17 class ecvOrientedBBox;
18 
19 namespace cloudViewer {
20 namespace visualization {
21 
23 class PointCloudPicker : public ccHObject {
24 public:
25  PointCloudPicker(const char* name = "PointCloudPicker") : ccHObject(name) {}
26  ~PointCloudPicker() override {}
27 
28  // inherited methods (ccHObject)
29  virtual bool isSerializable() const override { return true; }
30 
32  virtual CV_CLASS_ENUM getClassID() const override {
34  }
35 
36 public:
38  bool isEmpty() const;
39  virtual Eigen::Vector3d GetMinBound() const override;
40  virtual Eigen::Vector3d GetMaxBound() const override;
41  virtual Eigen::Vector3d GetCenter() const override;
42  virtual ccBBox GetAxisAlignedBoundingBox() const override;
43  virtual ecvOrientedBBox GetOrientedBoundingBox() const override;
44  virtual PointCloudPicker& Transform(
45  const Eigen::Matrix4d& transformation) override;
46  virtual PointCloudPicker& Translate(const Eigen::Vector3d& translation,
47  bool relative = true) override;
48  virtual PointCloudPicker& Scale(const double s,
49  const Eigen::Vector3d& center) override;
50  virtual PointCloudPicker& Rotate(const Eigen::Matrix3d& R,
51  const Eigen::Vector3d& center) override;
52  bool SetPointCloud(std::shared_ptr<const ccHObject> ptr);
53 
54 public:
55  std::shared_ptr<const ccHObject> pointcloud_ptr_;
56  std::vector<size_t> picked_indices_;
57 };
58 
59 } // namespace visualization
60 } // namespace cloudViewer
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
std::string name
Bounding box structure.
Definition: ecvBBox.h:25
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
A utility class to store picked points of a pointcloud.
virtual PointCloudPicker & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
virtual PointCloudPicker & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ,...
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
virtual ecvOrientedBBox GetOrientedBoundingBox() const override
bool SetPointCloud(std::shared_ptr< const ccHObject > ptr)
virtual ccBBox GetAxisAlignedBoundingBox() const override
Returns an axis-aligned bounding box of the geometry.
std::shared_ptr< const ccHObject > pointcloud_ptr_
PointCloudPicker(const char *name="PointCloudPicker")
virtual CV_CLASS_ENUM getClassID() const override
Returns unique class ID.
virtual PointCloudPicker & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
virtual PointCloudPicker & Scale(const double s, const Eigen::Vector3d &center) override
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is tr...
virtual bool isSerializable() const override
Returns whether object is serializable of not.
virtual Eigen::Vector3d GetCenter() const override
Returns the center of the geometry coordinates.
@ CUSTOM_H_OBJECT
Definition: CVTypes.h:179
Generic file read and write utility for python interface.