ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qCanupo2DViewDialog.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 <ui_qCanupo2DViewDialog.h>
11 
12 // Local
13 #include "classifier.h"
14 
15 // cloudViewer
16 #include <CVGeom.h>
17 
19 class ccHObject;
20 class ccPointCloud;
21 class ccPolyline;
22 
24 class qCanupo2DViewDialog : public QDialog, public Ui::Canupo2DViewDialog {
25  Q_OBJECT
26 
27 public:
29  qCanupo2DViewDialog(const CorePointDescSet* descriptors1,
30  const CorePointDescSet* descriptors2,
31  QString cloud1Name,
32  QString cloud2Name,
33  int class1 = 1,
34  int class2 = 2,
35  const CorePointDescSet* evaluationDescriptors = 0,
36  ecvMainAppInterface* app = 0);
37 
39  virtual ~qCanupo2DViewDialog();
40 
42  void setPickingRadius(int radius);
43 
45  const Classifier& getClassifier() { return m_classifier; }
46 
47 public slots:
48 
50  bool trainClassifier();
51 
52 protected slots:
53 
55  void resetBoundary();
56 
58  void computeStatistics();
59 
60  void saveClassifier();
61  void checkBeforeAccept();
62  void setPointSize(int);
64 
65  void addOrSelectPoint(int, int);
66  void removePoint(int, int);
67  void moveSelectedPoint(int, int, Qt::MouseButtons);
68  void deselectPoint();
69 
70 protected:
72  void reset();
73 
75  void updateScalesList(bool firstTime);
76 
78  void getActiveScales(std::vector<float>& scales) const;
79 
81  void addObject(ccHObject* obj);
82 
84  void updateZoom();
85 
87  void updateClassifierPath(Classifier& classifier) const;
88 
90  CCVector3 getClickPos(int x, int y) const;
92  int getClosestVertex(int x, int y, CCVector3& P) const;
93 
96 
101 
102  // descritpors
106 
107  // classes
108  int m_class1;
109  QString m_cloud1Name;
110  int m_class2;
111  QString m_cloud2Name;
112 
119 
124 };
#define slots
Classifier.
Definition: classifier.h:23
Set of (core) point descriptors.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
Main application interface (for plugins)
CANUPO plugin's 2D view dialog.
Classifier m_classifier
Associated classifier.
bool m_classifierSaved
Whether the classifier has been saved (at least once)
virtual ~qCanupo2DViewDialog()
Destructor.
ccPointCloud * m_cloud
Associated cloud.
void reset()
Resets display.
const CorePointDescSet * m_evaluationDescriptors
bool trainClassifier()
Trains the classifier (with the current number of scales!)
const Classifier & getClassifier()
Returns classifier.
void setPickingRadius(int radius)
Sets picking radius (for polyline vertices)
const CorePointDescSet * m_descriptors1
CCVector3 getClickPos(int x, int y) const
Returns the click position in 3D.
void updateScalesList(bool firstTime)
Updates the list of active scales.
void updateClassifierPath(Classifier &classifier) const
Updates classifier path with the currently displayed polyline.
void addOrSelectPoint(int, int)
const CorePointDescSet * m_descriptors2
qCanupo2DViewDialog(const CorePointDescSet *descriptors1, const CorePointDescSet *descriptors2, QString cloud1Name, QString cloud2Name, int class1=1, int class2=2, const CorePointDescSet *evaluationDescriptors=0, ecvMainAppInterface *app=0)
Default constructor.
void computeStatistics()
Computes statistics with the current classifier.
int m_pickingRadius
Picking radius.
void moveSelectedPoint(int, int, Qt::MouseButtons)
void resetBoundary()
Updates the boundary representation.
void getActiveScales(std::vector< float > &scales) const
Returns the list of active scales.
int m_selectedPointIndex
Currently selected polyline point.
void addObject(ccHObject *obj)
Adds a custom object to the 2D view.
ecvMainAppInterface * m_app
Gives access to the application (data-base, UI, etc.)
void updateZoom()
Updates zoom.
ccPointCloud * m_polyVertices
Associated polyline vertices.
ccPolyline * m_poly
Associated polyline.
int getClosestVertex(int x, int y, CCVector3 &P) const
Returns closest vertex.