ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
stereogramDlg.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_stereogramDlg.h"
11 #include "ui_stereogramParamsDlg.h"
12 
13 // CV_DB_LIB
14 #include <ecvColorScale.h>
15 #include <ecvPlane.h>
16 
17 // Qt
18 #include <QDialog>
19 
20 // system
21 #include <utility>
22 
23 class ccHObject;
24 class FacetDensityGrid;
27 
29 class StereogramParamsDlg : public QDialog, public Ui::StereogramParamsDlg {
30 public:
32  StereogramParamsDlg(QWidget* parent = 0)
33  : QDialog(parent, Qt::Tool), Ui::StereogramParamsDlg() {
34  setupUi(this);
35  }
36 };
37 
39 class StereogramWidget : public QLabel {
40  Q_OBJECT
41 
42 public:
44  StereogramWidget(QWidget* parent = 0);
45 
47  virtual ~StereogramWidget();
48 
50  bool init(double angularStep_deg,
51  ccHObject* facetGroup,
52  double resolution_deg = 2.0);
53 
55  void getMeanDir(double& meanDip_deg, double& meanDipDir_deg) {
56  meanDip_deg = m_meanDip_deg;
57  meanDipDir_deg = m_meanDipDir_deg;
58  }
59 
60  // inherited from QWidget (to get a square widget!)
61  virtual int heightForWidth(int w) const { return w; }
62 
65  m_densityColorScale = colorScale;
66  }
69  return m_densityColorScale;
70  }
72  void setDensityColorScaleSteps(unsigned steps) {
74  }
76  unsigned getDensityColorScaleSteps() const {
78  }
79 
81  void setTicksFreq(int freq) { m_ticksFreq = freq; }
82 
84  void showHSVRing(bool state) { m_showHSVRing = state; }
85 
87  void enableMouseTracking(bool state,
88  double dipSpan_deg = 30,
89  double dipDirSpan_deg = 30);
90 
92  void setTrackedCenter(double dip_deg, double dipDir_deg);
93 
94 signals:
95 
97 
100  void pointClicked(double dip_deg, double dipDir_deg);
101 
102 protected:
103  // inherited from QWidget
104  virtual void paintEvent(QPaintEvent* e);
105  virtual void mousePressEvent(QMouseEvent* e);
106 
109 
112 
117 
122 
125 
128 
139 
141  QPoint m_center;
143  int m_radius;
144 };
145 
147 class StereogramDialog : public QDialog, public Ui::StereogramDialog {
148  Q_OBJECT
149 
150 public:
153 
155 
158  bool init(double angularStep_deg,
159  ccHObject* facetGroup,
160  double resolution_deg = 2.0);
161 
164 
165 protected slots:
166 
167  void colorScaleChanged(int);
168  void spawnColorScaleEditor();
169  void onTicksFreqChanged(int);
170  void onHSVColorsToggled(bool);
171  void onDensityColorStepsChanged(int);
172  void onFilterEnabled(bool);
173  void onPointClicked(double, double);
174  void onFilterSizeChanged(double);
175  void onFilterCenterChanged(double);
176  void exportCurrentSelection();
177 
178 protected:
179  // inherited from QDialog
180  void closeEvent(QCloseEvent* e);
181 
184  void updateFacetsFilter(bool enable);
185 
188 
191 
194 
197 };
#define slots
#define signals
Density grid.
Dialog for displaying the angular repartition of facets (qFacets plugin)
void onTicksFreqChanged(int)
ecvMainAppInterface * m_app
Main application interface.
void updateFacetsFilter(bool enable)
ccColorScaleSelector * m_colorScaleSelector
Color scale selector/editor.
void closeEvent(QCloseEvent *e)
void onFilterCenterChanged(double)
StereogramDialog(ecvMainAppInterface *app)
Default constructor.
void onDensityColorStepsChanged(int)
void colorScaleChanged(int)
void onFilterEnabled(bool)
void onPointClicked(double, double)
StereogramWidget * stereogram()
Returns associated widget.
int m_facetGroupUniqueID
Associated set of facets (unique ID)
void spawnColorScaleEditor()
void exportCurrentSelection()
bool init(double angularStep_deg, ccHObject *facetGroup, double resolution_deg=2.0)
Inits dialog.
void onFilterSizeChanged(double)
void onHSVColorsToggled(bool)
StereogramWidget * m_classifWidget
Associated widget.
Dialog for stereogram parameters (qFacets plugin)
Definition: stereogramDlg.h:29
StereogramParamsDlg(QWidget *parent=0)
Default constructor.
Definition: stereogramDlg.h:32
Orientation-based classification widget.
Definition: stereogramDlg.h:39
virtual int heightForWidth(int w) const
Definition: stereogramDlg.h:61
int m_radius
Stereogram radius (pixels)
double m_clickDipDir_deg
Last mouse click equivalent dip direction (in degrees)
void setDensityColorScaleSteps(unsigned steps)
Sets density color scale steps.
Definition: stereogramDlg.h:72
double m_clickDipSpan_deg
Click area span along dip (in degrees)
double m_meanDip_deg
Mean dip (in degrees)
void showHSVRing(bool state)
Whether to show the 'HSV' ring or not.
Definition: stereogramDlg.h:84
bool init(double angularStep_deg, ccHObject *facetGroup, double resolution_deg=2.0)
Sets current parameters.
double m_meanDipDir_deg
Mean dip direction (in degrees)
void setTrackedCenter(double dip_deg, double dipDir_deg)
Sets tracked center position.
int m_ticksFreq
Ticks frequency.
virtual ~StereogramWidget()
Destructor.
StereogramWidget(QWidget *parent=0)
Default constructor.
unsigned getDensityColorScaleSteps() const
Returns density color scale steps.
Definition: stereogramDlg.h:76
bool m_trackMouseClick
Mouse tracking.
FacetDensityGrid * m_densityGrid
Density grid.
double m_angularStep_deg
Angular step (in degrees)
void setDensityColorScale(ccColorScale::Shared colorScale)
Sets density color scale.
Definition: stereogramDlg.h:64
ccColorScale::Shared getDensityColorScale() const
Returns density color scale.
Definition: stereogramDlg.h:68
double m_clickDipDirSpan_deg
Click area span along dip direction (in degrees)
virtual void paintEvent(QPaintEvent *e)
void pointClicked(double dip_deg, double dipDir_deg)
Signal emitted when the mouse (left) button is clicked.
void enableMouseTracking(bool state, double dipSpan_deg=30, double dipDirSpan_deg=30)
Enables or not the mouse tracking mode.
void getMeanDir(double &meanDip_deg, double &meanDipDir_deg)
Returns the mean dip direction and dip.
Definition: stereogramDlg.h:55
QPoint m_center
Stereogram center (pixels)
double m_clickDip_deg
Last mouse click equivalent dip (in degrees)
bool m_showHSVRing
Whether to show the 'HSV' ring or not.
unsigned m_densityColorScaleSteps
Density color scale steps.
void setTicksFreq(int freq)
Sets the ticks frequency (0 = no ticks)
Definition: stereogramDlg.h:81
virtual void mousePressEvent(QMouseEvent *e)
ccColorScale::Shared m_densityColorScale
Density color scale.
Advanced editor for color scales.
QSharedPointer< ccColorScale > Shared
Shared pointer type.
Definition: ecvColorScale.h:74
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Main application interface (for plugins)