ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccCompassDlg.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 // Qt
11 #include <ecvOverlayDialog.h>
12 
13 #include <QAction>
14 #include <QDialog>
15 #include <QList>
16 
17 // Local
18 #include <ui_compassDlg.h>
19 
20 #include "ccTrace.h"
21 
22 class ccCompassDlg : public ccOverlayDialog, public Ui::compassDlg {
23  Q_OBJECT
24 
25 public:
27  explicit ccCompassDlg(QWidget *parent = 0);
28 
29  /*
30  Returns a flag describing the currently selected ccTrace::COST_MODE (used to
31  build the cost function for optimisation)
32  */
33  int getCostMode();
34 
35  /*
36  Returns true if the m_plane_fit action is checked -> used to check if the
37  user expects us to fit a plane to finished traces.
38  */
39  bool planeFitMode();
40 
41  // menus
46 
47  // settings menu actions
48  QAction *m_plane_fit;
49  QAction *m_showStippled;
50  QAction *m_showNormals;
51  QAction *m_showNames;
52  QAction *m_recalculate;
53 
54  // pair picking menu actions
55  QAction *m_pinchTool;
56  QAction *m_measure_thickness; // activates thickness tool
57  QAction *m_measure_thickness_twoPoint; // activates thickness tool
58  //--
59  QAction *m_youngerThan; // activates topology tool - crosscutting relations
60  QAction *m_follows; // activates topology tool - stratigraphic younging
61  // relations
62  QAction *m_equivalent; // activates topology tool - coeval/equivalent
63  // relations
64  //--
65  QAction *m_fitPlaneToGeoObject; // fits a plane to the upper/lower surfaces
66  // of all points in a GeoObject
68  QAction *m_estimateNormals; // estimate structure normals
69  QAction *m_estimateP21; // estimate the intensity of structures (doesn't
70  // need to know orientation)
71  QAction *m_estimateStrain; // estimate strain from Mode-I dykes and veins
72  QAction *m_mergeSelected; // merges the selected geoObjects
73  QAction *m_toPointCloud; // converts geoObject data to point cloud
74  QAction *m_distributeSelection; // tool for distributing imported data
75  // (meshes etc.) into GeoObjects based on
76  // shared names.
77 
78  //--
79  QAction *m_noteTool; // activates note tool
80  QAction *m_loadFoliations; // load field data from a file
81  QAction *m_loadLineations; // load field data from a file
82  QAction *m_toSVG; // export to svg
83 
84 protected slots:
86  void onShortcutTriggered(int);
87 
88  // callbacks to update cost
89  void setDarkCost() {
90  clearCost();
91  m_dark->setChecked(true);
92  }
93  void setLightCost() {
94  clearCost();
95  m_light->setChecked(true);
96  }
97  void setRGBCost() {
98  clearCost();
99  m_rgb->setChecked(true);
100  }
101  void setGradCost() {
102  clearCost();
103  m_grad->setChecked(true);
104  }
105  void setCurveCost() {
106  clearCost();
107  m_curve->setChecked(true);
108  }
109  void setDistCost() {
110  clearCost();
111  m_dist->setChecked(true);
112  }
113  void setScalarCost() {
114  clearCost();
115  m_scalar->setChecked(true);
116  }
118  clearCost();
119  m_scalar_inv->setChecked(true);
120  }
121 
122 private:
123  // algorithm menu
124  QAction *m_dark;
125  QAction *m_light;
126  QAction *m_rgb;
127  QAction *m_grad;
128  QAction *m_curve;
129  QAction *m_dist;
130  QAction *m_scalar;
131  QAction *m_scalar_inv;
132 
133  // disactivates all cost function checkboxes
134  void clearCost() {
135  m_dark->setChecked(false);
136  m_light->setChecked(false);
137  m_rgb->setChecked(false);
138  m_grad->setChecked(false);
139  m_curve->setChecked(false);
140  m_dist->setChecked(false);
141  m_scalar->setChecked(false);
142  m_scalar_inv->setChecked(false);
143  }
144 };
#define slots
void setDarkCost()
Definition: ccCompassDlg.h:89
QAction * m_equivalent
Definition: ccCompassDlg.h:62
void setInvScalarCost()
Definition: ccCompassDlg.h:117
QAction * m_showStippled
Definition: ccCompassDlg.h:49
ccCompassDlg(QWidget *parent=0)
Default constructor.
QAction * m_fitPlaneToGeoObject
Definition: ccCompassDlg.h:65
QAction * m_measure_thickness_twoPoint
Definition: ccCompassDlg.h:57
void setRGBCost()
Definition: ccCompassDlg.h:97
QAction * m_toPointCloud
Definition: ccCompassDlg.h:73
QAction * m_distributeSelection
Definition: ccCompassDlg.h:74
void setDistCost()
Definition: ccCompassDlg.h:109
QAction * m_measure_thickness
Definition: ccCompassDlg.h:56
QAction * m_estimateNormals
Definition: ccCompassDlg.h:68
QMenu * m_pairpicking_menu
Definition: ccCompassDlg.h:44
QMenu * m_cost_algorithm_menu
Definition: ccCompassDlg.h:42
QAction * m_showNormals
Definition: ccCompassDlg.h:50
QAction * m_estimateP21
Definition: ccCompassDlg.h:69
QAction * m_mergeSelected
Definition: ccCompassDlg.h:72
QAction * m_estimateStrain
Definition: ccCompassDlg.h:71
void setCurveCost()
Definition: ccCompassDlg.h:105
void setLightCost()
Definition: ccCompassDlg.h:93
QAction * m_toSVG
Definition: ccCompassDlg.h:82
QAction * m_follows
Definition: ccCompassDlg.h:60
QAction * m_plane_fit
Definition: ccCompassDlg.h:48
QAction * m_noteTool
Definition: ccCompassDlg.h:79
QAction * m_loadLineations
Definition: ccCompassDlg.h:81
QAction * m_youngerThan
Definition: ccCompassDlg.h:59
QAction * m_pinchTool
Definition: ccCompassDlg.h:55
QAction * m_showNames
Definition: ccCompassDlg.h:51
void setScalarCost()
Definition: ccCompassDlg.h:113
bool planeFitMode()
QAction * m_loadFoliations
Definition: ccCompassDlg.h:80
QAction * m_recalculateFitPlanes
Definition: ccCompassDlg.h:67
QMenu * m_research_menu
Definition: ccCompassDlg.h:45
QAction * m_recalculate
Definition: ccCompassDlg.h:52
void setGradCost()
Definition: ccCompassDlg.h:101
void onShortcutTriggered(int)
To capture overridden shortcuts (pause button, etc.)
QMenu * m_settings_menu
Definition: ccCompassDlg.h:43
Generic overlay dialog interface.