ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvFilterByLabelDlg.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 // Local
11 #include <ecvOverlayDialog.h>
12 #include <ui_filterByLabelDlg.h>
13 
14 // CV_CORE_LIB
15 #include <CVConst.h>
16 
17 class ccHObject;
18 class ccPointCloud;
19 
23  public Ui::FilterByLabelDialog {
24  Q_OBJECT
25 
26 public:
28  ecvFilterByLabelDlg(QWidget* parent = nullptr);
29  virtual ~ecvFilterByLabelDlg();
30 
31  // inherited from ccOverlayDialog
32  virtual bool start() override;
33  virtual void stop(bool state) override;
34  virtual bool linkWith(QWidget* win) override;
35 
38 
40  Mode mode() const { return m_mode; }
41 
43 
47  bool setInputEntity(ccHObject* entity);
48  void clear();
49 
50 protected:
51  void apply();
52  void clearLayoutWidgets(QLayout* layout);
54  void getSelectedFilterClasses(std::vector<ScalarType>& filteredClasses);
55 
56 protected slots:
57  void cancel();
58  void selectAllClasses();
60  void onSplit() {
61  m_mode = SPLIT;
62  apply();
63  }
66  apply();
67  }
70  apply();
71  }
72 
73 protected:
75  typedef std::pair<ccHObject*, ccPointCloud*> EntityAndVerticesType;
77 
78  double m_minVald;
79  double m_maxVald;
80 
81  std::vector<size_t> m_labels;
82 };
#define slots
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Generic overlay dialog interface.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
bool setInputEntity(ccHObject *entity)
Adds an entity to the 'selected' entities set.
virtual bool start() override
Starts process.
Mode mode() const
Returns the selected mode.
EntityAndVerticesType m_toFilter
void clearLayoutWidgets(QLayout *layout)
std::pair< ccHObject *, ccPointCloud * > EntityAndVerticesType
ecvFilterByLabelDlg(QWidget *parent=nullptr)
Default constructor.
virtual void stop(bool state) override
Stops process/dialog.
virtual bool linkWith(QWidget *win) override
Links the overlay dialog with a MDI window.
void getSelectedFilterClasses(std::vector< ScalarType > &filteredClasses)
std::vector< size_t > m_labels