ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvComparisonDlg.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 // CV_DB_LIB
11 #include <ecvOctree.h>
12 
13 // Qt
14 #include <ui_comparisonDlg.h>
15 
16 #include <QDialog>
17 #include <QString>
18 
19 class ccHObject;
20 class ccPointCloud;
21 class ccGenericMesh;
23 
25 class ccComparisonDlg : public QDialog, public Ui::ComparisonDialog {
26  Q_OBJECT
27 
28 public:
33  };
34 
36  ccComparisonDlg(ccHObject* compEntity,
37  ccHObject* refEntity,
38  CC_COMPARISON_TYPE cpType,
39  QWidget* parent = nullptr,
40  bool noDisplay = false);
41 
44 
46  inline bool initDialog() { return computeApproxDistances(); }
47 
49  ccHObject* getComparedEntity() const { return m_compEnt; }
52 
53 public slots:
54  bool computeDistances();
55  void applyAndExit();
56  void cancelAndExit();
57 
58 protected slots:
59  void showHisto();
60  void locaModelChanged(int);
61  void maxDistUpdated();
62 
63 protected:
64  bool isValid();
67  int getBestOctreeLevel();
68  int determineBestOctreeLevel(double);
69  void updateDisplay(bool showSF, bool hideRef);
70  void releaseOctrees();
71 
82 
95 
98 
100  QString m_sfName;
101 
103  QString m_oldSfName;
104 
107 
110 };
#define slots
Dialog for cloud/cloud or cloud/mesh comparison setting.
ccGenericPointCloud * m_refCloud
Reference entity equivalent cloud (if any)
void locaModelChanged(int)
QString m_sfName
last computed scalar field name
ccOctree::Shared m_refOctree
Reference entity's octree.
int determineBestOctreeLevel(double)
bool m_noDisplay
Whether a display is active (and should be refreshed) or not.
ccGenericMesh * m_refMesh
Reference entity equivalent mesh (if any)
CC_COMPARISON_TYPE
Comparison type.
ccHObject * m_refEnt
Reference entity.
bool m_refVisibility
Initial reference entity visibility.
ccOctree::Shared m_compOctree
Compared entity's octree.
ccComparisonDlg(ccHObject *compEntity, ccHObject *refEntity, CC_COMPARISON_TYPE cpType, QWidget *parent=nullptr, bool noDisplay=false)
Default constructor.
void updateDisplay(bool showSF, bool hideRef)
CC_COMPARISON_TYPE m_compType
Comparison type.
bool prepareEntitiesForComparison()
ccHObject * getComparedEntity() const
Returns compared entity.
bool m_refOctreeIsPartial
Whether the reference entity octree is partial or not.
ccPointCloud * m_compCloud
Compared entity equivalent cloud.
bool m_compSFVisibility
Initial compared entity visibility.
bool m_compOctreeIsPartial
Whether the compared entity octree is partial or not.
bool initDialog()
Should be called once after the dialog is created.
int m_bestOctreeLevel
Best octree level (or 0 if none has been guessed already)
~ccComparisonDlg()
Default destructor.
ccHObject * m_compEnt
Compared entity.
QString m_oldSfName
Initial SF name enabled on the compared entity.
ccHObject * getReferenceEntity()
Returns compared entity.
Generic mesh interface.
A 3D cloud interface with associated features (color, normals, octree, etc.)
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
QSharedPointer< ccOctree > Shared
Shared pointer.
Definition: ecvOctree.h:32
A 3D cloud and its associated features (color, normals, scalar fields, etc.)