ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
distanceMapGenerationDlg.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
12 
13 // CV_DB_LIB
14 #include <ecvBBox.h>
15 
16 // Qt
17 #include <QColor>
18 #include <QSharedPointer>
19 
20 // cloudViewer
21 #include <CVTypes.h>
22 
23 // GUIs generated by Qt Designer
24 #include <ui_distanceMapGenerationDlg.h>
25 
27 class ccPointCloud;
28 class ccPolyline;
29 class ccScalarField;
31 class ccSymbolCloud;
32 class ccMapWindow;
33 
35 class DistanceMapGenerationDlg : public QDialog,
36  public Ui::DistanceMapGenerationDlg {
37  Q_OBJECT
38 
39 public:
42  ccScalarField* sf,
43  ccPolyline* polyline,
44  ecvMainAppInterface* app = 0);
45 
47  virtual ~DistanceMapGenerationDlg();
48 
51 
55  QString getAngularUnitString() const;
57  QString getCondensedAngularUnitString() const;
58 
60  QString getHeightUnitString() const;
61 
64 
67  const;
68 
73  };
74 
77 
79 
81  void getGridXValues(double& minX,
82  double& maxX,
83  double& step,
84  ANGULAR_UNIT unit = ANG_RAD) const;
85 
87 
90  void getGridYValues(double& minY,
91  double& maxY,
92  double& step,
93  ANGULAR_UNIT unit = ANG_RAD) const;
94 
96 
98  double getScaleYStep(ANGULAR_UNIT unit = ANG_RAD) const;
99 
100 protected slots:
101 
102  void projectionModeChanged(int);
103  void angularUnitChanged(int);
104  void updateGridSteps();
105  void updateProfileRevolDim(int);
106  void updateProfileOrigin();
107  void colorScaleChanged(int);
108  void spawnColorScaleEditor();
109  void updateHeightUnits();
110  void exportMapAsCloud();
111  void exportMapAsMesh();
112  void exportMapAsGrid();
113  void exportMapAsImage();
114  void exportProfilesAsDXF();
115  void loadOverlaySymbols();
116  void clearOverlaySymbols();
117  void overlaySymbolsSizeChanged(int);
120  void labelFontSizeChanged(int);
121  void labelPrecisionChanged(int);
122  void baseRadiusChanged(double);
123  void colorRampStepsChanged(int);
124  void toggleOverlayGrid(bool);
125  void changeGridColor();
126  void changeSymbolColor();
127  void toggleColorScaleDisplay(bool);
128  void updateVolumes();
129 
131  void updateOverlayGrid();
132 
134  void update();
135 
136 protected:
138  QSharedPointer<DistanceMapGenerationTool::Map> updateMap();
139 
141  void updateMapTexture();
142 
144  void updateZoom(ccBBox& box);
145 
147  void clearView();
148 
150 
152  double getBaseRadius() const;
153 
155  double getSpinboxAngularValue(
156  QDoubleSpinBox* spinBox,
158 
161 
164 
166  void updateMinAndMaxLimits();
167 
170 
173 
176 
179 
181  QSharedPointer<DistanceMapGenerationTool::Map> m_map;
182 
185 
188 
191 
196 
198  QColor m_gridColor;
199 
202 };
#define slots
Dialog for generating a distance map (surface of revolution)
void updateOverlayGrid()
Updates overlat grid (if any)
ccColorScaleSelector * m_colorScaleSelector
Color scale selector.
ccPointCloud * m_cloud
Associated cloud.
DistanceMapGenerationTool::EmptyCellFillOption getEmptyCellFillingOption() const
Returns the empty cells filling option.
ccSymbolCloud * m_xLabels
X labels.
double getBaseRadius() const
Returns currently applicable base radius.
DistanceMapGenerationDlg(ccPointCloud *cloud, ccScalarField *sf, ccPolyline *polyline, ecvMainAppInterface *app=0)
Default constructor.
void updateMinAndMaxLimits()
Updates the min and max limits (fields)
ANGULAR_UNIT getAngularUnit() const
Returns selected angular unit.
void getGridXValues(double &minX, double &maxX, double &step, ANGULAR_UNIT unit=ANG_RAD) const
Returns the current 'X' parameters.
double getSpinboxAngularValue(QDoubleSpinBox *spinBox, DistanceMapGenerationDlg::ANGULAR_UNIT unit) const
Returns the angle in a particular spinbox in the specified units.
void clearView()
Clears the 3D view.
QSharedPointer< DistanceMapGenerationTool::Map > m_map
Internal map structure.
ccPolyline * m_profile
Associated profile.
void update()
Updates map (and display)
QString getAngularUnitString() const
Returns selected angular unit as a string.
ccMapWindow * m_window
2D display
ccScalarField * m_sf
Associated scalar field.
DistanceMapGenerationTool::FillStrategyType getFillingStrategy() const
Returns the grid filling strategy.
QSharedPointer< DistanceMapGenerationTool::Map > updateMap()
Updates internal map.
QColor m_symbolColor
Symbols color.
ProjectionMode getProjectionMode() const
Returns current projection mode.
double getScaleYStep(ANGULAR_UNIT unit=ANG_RAD) const
Returns scale 'Y' step (current unit)
void getGridYValues(double &minY, double &maxY, double &step, ANGULAR_UNIT unit=ANG_RAD) const
Returns the current 'Y' parameters.
void saveToPersistentSettings()
Saves parameters to persistent settings.
void updateMapTexture()
Updates internal map texture (if any)
QString getHeightUnitString() const
Returns height unit.
QString getCondensedAngularUnitString() const
Returns selected angular unit as a condensed string.
void initFromPersistentSettings()
Loads parameters from persistent settings.
void updateZoom(ccBBox &box)
Updates 2D view zoom.
ANGULAR_UNIT m_angularUnits
Current angular units.
ecvMainAppInterface * m_app
Application interface.
ccSymbolCloud * m_yLabels
Y labels.
virtual ~DistanceMapGenerationDlg()
Default destructor.
EmptyCellFillOption
Option for handling empty cells.
FillStrategyType
Grid filling strategy.
Bounding box structure.
Definition: ecvBBox.h:25
Advanced editor for color scales.
2D map display window
Definition: ccMapWindow.h:15
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
A scalar field associated to display-related parameters.
Main application interface (for plugins)