ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvDisplayOptionsDlg.cpp
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 #include "ecvDisplayOptionsDlg.h"
9 
10 #include "ui_displayOptionsDlg.h"
11 
12 // local
13 #include "ecvApplicationBase.h"
14 #include "ecvPersistentSettings.h"
15 #include "ecvQtHelpers.h"
16 #include "ecvSettingManager.h"
17 
18 // CV_DB_LIB
19 #include <ecvColorTypes.h>
20 #include <ecvDisplayTools.h>
21 
22 #include "ecvHObject.h"
23 
24 // CV_CORE_LIB
25 #include <CVLog.h>
26 
27 // Qt
28 #include <QColor>
29 #include <QColorDialog>
30 #include <QMetaObject>
31 #include <QObject>
32 #include <QSettings>
33 #include <QStyleFactory>
34 
35 // Standard
36 #include <algorithm>
37 
38 // Default 'min cloud size' for LoD when VBOs are activated
39 static const double s_defaultMaxVBOCloudSizeM = 50.0;
40 
42  : QDialog(parent, Qt::Tool),
43  m_ui(new Ui::DisplayOptionsDlg()),
44  m_defaultAppStyleIndex(-1) {
45  m_ui->setupUi(this);
46 
47  connect(m_ui->ambientColorButton, &QAbstractButton::clicked, this,
49  connect(m_ui->diffuseColorButton, &QAbstractButton::clicked, this,
51  connect(m_ui->specularColorButton, &QAbstractButton::clicked, this,
53  connect(m_ui->meshBackColorButton, &QAbstractButton::clicked, this,
55  connect(m_ui->meshSpecularColorButton, &QAbstractButton::clicked, this,
57  connect(m_ui->meshFrontColorButton, &QAbstractButton::clicked, this,
59  connect(m_ui->bbColorButton, &QAbstractButton::clicked, this,
61  connect(m_ui->showBBOnSelectedCheckBox, &QCheckBox::toggled, this,
62  [&](bool state) { parameters.showBBOnSelected = state; });
63  connect(m_ui->bbOpacityDoubleSpinBox,
64  static_cast<void (QDoubleSpinBox::*)(double)>(
65  &QDoubleSpinBox::valueChanged),
67  connect(m_ui->bbLineWidthSpinBox,
68  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
70  connect(m_ui->bkgColorButton, &QAbstractButton::clicked, this,
72  connect(m_ui->labelBkgColorButton, &QAbstractButton::clicked, this,
74  connect(m_ui->labelMarkerColorButton, &QAbstractButton::clicked, this,
76  connect(m_ui->pointsColorButton, &QAbstractButton::clicked, this,
78  connect(m_ui->textColorButton, &QAbstractButton::clicked, this,
80 
81  connect(m_ui->doubleSidedCheckBox, &QCheckBox::toggled, this,
82  [&](bool state) { parameters.lightDoubleSided = state; });
83  connect(m_ui->enableGradientCheckBox, &QCheckBox::toggled, this,
84  [&](bool state) { parameters.drawBackgroundGradient = state; });
85  connect(m_ui->showCrossCheckBox, &QCheckBox::toggled, this,
86  [&](bool state) { parameters.displayCross = state; });
87  connect(m_ui->colorScaleShowHistogramCheckBox, &QCheckBox::toggled, this,
88  [&](bool state) { parameters.colorScaleShowHistogram = state; });
89  connect(m_ui->useColorScaleShaderCheckBox, &QCheckBox::toggled, this,
90  [&](bool state) { parameters.colorScaleUseShader = state; });
91  connect(m_ui->decimateMeshBox, &QCheckBox::toggled, this,
92  [&](bool state) { parameters.decimateMeshOnMove = state; });
93  connect(m_ui->decimateCloudBox, &QCheckBox::toggled, this,
94  [&](bool state) { parameters.decimateCloudOnMove = state; });
95  connect(m_ui->drawRoundedPointsCheckBox, &QCheckBox::toggled, this,
96  [&](bool state) { parameters.drawRoundedPoints = state; });
97  connect(m_ui->autoDisplayNormalsCheckBox, &QCheckBox::toggled, this,
98  [&](bool state) { options.normalsDisplayedByDefault = state; });
99  connect(m_ui->useNativeDialogsCheckBox, &QCheckBox::toggled, this,
100  [&](bool state) { options.useNativeDialogs = state; });
101  connect(m_ui->askForConfirmationBeforeQuittingCheckBox, &QCheckBox::toggled,
102  this, [&](bool state) {
103  options.askForConfirmationBeforeQuitting = state;
104  });
105  connect(m_ui->logVerbosityComboBox,
106  static_cast<void (QComboBox::*)(int)>(
107  &QComboBox::currentIndexChanged),
109 
110  connect(m_ui->useVBOCheckBox, &QAbstractButton::clicked, this,
112 
113  connect(m_ui->colorRampWidthSpinBox,
114  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
116 
117  connect(m_ui->defaultFontSizeSpinBox,
118  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
120  connect(m_ui->labelFontSizeSpinBox,
121  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
123  connect(m_ui->numberPrecisionSpinBox,
124  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
126  connect(m_ui->labelOpacitySpinBox,
127  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
129  connect(m_ui->labelMarkerSizeSpinBox,
130  static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
132 
133  connect(m_ui->zoomSpeedDoubleSpinBox,
134  static_cast<void (QDoubleSpinBox::*)(double)>(
135  &QDoubleSpinBox::valueChanged),
137  connect(m_ui->maxCloudSizeDoubleSpinBox,
138  static_cast<void (QDoubleSpinBox::*)(double)>(
139  &QDoubleSpinBox::valueChanged),
141  connect(m_ui->maxMeshSizeDoubleSpinBox,
142  static_cast<void (QDoubleSpinBox::*)(double)>(
143  &QDoubleSpinBox::valueChanged),
145 
146  connect(m_ui->autoComputeOctreeComboBox,
147  static_cast<void (QComboBox::*)(int)>(
148  &QComboBox::currentIndexChanged),
150 
151  connect(m_ui->appStyleComboBox,
152  static_cast<void (QComboBox::*)(int)>(
153  &QComboBox::currentIndexChanged),
155 
156  connect(m_ui->okButton, &QAbstractButton::clicked, this,
158  connect(m_ui->applyButton, &QAbstractButton::clicked, this,
160  connect(m_ui->resetButton, &QAbstractButton::clicked, this,
162  connect(m_ui->cancelButton, &QAbstractButton::clicked, this,
164 
165  // Populate application style combo box
166  populateAppStyleComboBox();
167 
170 
171  refresh();
172 
173  setUpdatesEnabled(true);
174 }
175 
177  delete m_ui;
178  m_ui = nullptr;
179 }
180 
183  lightAmbientColor.setRgbF(ac.r, ac.g, ac.b, ac.a);
184  ccQtHelpers::SetButtonColor(m_ui->ambientColorButton, lightAmbientColor);
185 
187  lightDiffuseColor.setRgbF(dc.r, dc.g, dc.b, dc.a);
188  ccQtHelpers::SetButtonColor(m_ui->diffuseColorButton, lightDiffuseColor);
189 
191  lightSpecularColor.setRgbF(sc.r, sc.g, sc.b, sc.a);
192  ccQtHelpers::SetButtonColor(m_ui->specularColorButton, lightSpecularColor);
193 
195  meshBackDiff.setRgbF(mbc.r, mbc.g, mbc.b, mbc.a);
196  ccQtHelpers::SetButtonColor(m_ui->meshBackColorButton, meshBackDiff);
197 
198  const ecvColor::Rgbaf& mspec = parameters.meshSpecular;
199  meshSpecularColor.setRgbF(mspec.r, mspec.g, mspec.b, mspec.a);
200  ccQtHelpers::SetButtonColor(m_ui->meshSpecularColorButton,
202 
204  meshFrontDiff.setRgbF(mfc.r, mfc.g, mfc.b, mfc.a);
205  ccQtHelpers::SetButtonColor(m_ui->meshFrontColorButton, meshFrontDiff);
206 
208  bbDefaultCol.setRgb(bbc.r, bbc.g, bbc.b);
209  ccQtHelpers::SetButtonColor(m_ui->bbColorButton, bbDefaultCol);
210  m_ui->showBBOnSelectedCheckBox->setChecked(parameters.showBBOnSelected);
211  m_ui->bbOpacityDoubleSpinBox->setValue(parameters.bbOpacity);
212  m_ui->bbLineWidthSpinBox->setValue(parameters.bbLineWidth);
213 
215  backgroundCol.setRgb(bgc.r, bgc.g, bgc.b);
216  ccQtHelpers::SetButtonColor(m_ui->bkgColorButton, backgroundCol);
217 
219  labelBackgroundCol.setRgb(lblbc.r, lblbc.g, lblbc.b);
220  ccQtHelpers::SetButtonColor(m_ui->labelBkgColorButton, labelBackgroundCol);
221 
223  labelMarkerCol.setRgb(lblmc.r, lblmc.g, lblmc.b);
224  ccQtHelpers::SetButtonColor(m_ui->labelMarkerColorButton, labelMarkerCol);
225 
227  pointsDefaultCol.setRgb(pdc.r, pdc.g, pdc.b);
228  ccQtHelpers::SetButtonColor(m_ui->pointsColorButton, pointsDefaultCol);
229 
231  textDefaultCol.setRgb(tdc.r, tdc.g, tdc.b);
232  ccQtHelpers::SetButtonColor(m_ui->textColorButton, textDefaultCol);
233 
234  m_ui->doubleSidedCheckBox->setChecked(parameters.lightDoubleSided);
235  m_ui->enableGradientCheckBox->setChecked(parameters.drawBackgroundGradient);
236  m_ui->decimateMeshBox->setChecked(parameters.decimateMeshOnMove);
237  m_ui->maxMeshSizeDoubleSpinBox->setValue(parameters.minLoDMeshSize /
238  1000000.0);
239  m_ui->decimateCloudBox->setChecked(parameters.decimateCloudOnMove);
240  m_ui->drawRoundedPointsCheckBox->setChecked(parameters.drawRoundedPoints);
241  m_ui->maxCloudSizeDoubleSpinBox->setValue(parameters.minLoDCloudSize /
242  1000000.0);
243  m_ui->useVBOCheckBox->setChecked(parameters.useVBOs);
244  m_ui->showCrossCheckBox->setChecked(parameters.displayCross);
245 
246  m_ui->colorScaleShowHistogramCheckBox->setChecked(
248  m_ui->useColorScaleShaderCheckBox->setChecked(
250  m_ui->useColorScaleShaderCheckBox->setEnabled(
252  m_ui->colorRampWidthSpinBox->setValue(parameters.colorScaleRampWidth);
253 
254  m_ui->defaultFontSizeSpinBox->setValue(parameters.defaultFontSize);
255  m_ui->labelFontSizeSpinBox->setValue(parameters.labelFontSize);
256  m_ui->numberPrecisionSpinBox->setValue(parameters.displayedNumPrecision);
257  m_ui->labelOpacitySpinBox->setValue(parameters.labelOpacity);
258  m_ui->labelMarkerSizeSpinBox->setValue(parameters.labelMarkerSize);
259 
260  m_ui->zoomSpeedDoubleSpinBox->setValue(parameters.zoomSpeed);
261 
262  m_ui->autoComputeOctreeComboBox->setCurrentIndex(
264 
265  m_ui->autoDisplayNormalsCheckBox->setChecked(
267  m_ui->useNativeDialogsCheckBox->setChecked(options.useNativeDialogs);
268  m_ui->askForConfirmationBeforeQuittingCheckBox->setChecked(
270  m_ui->logVerbosityComboBox->setCurrentIndex(
271  std::min(static_cast<int>(options.logVerbosityLevel),
272  static_cast<int>(CVLog::LOG_WARNING)));
273 
274  update();
275 }
276 
278  QColor newCol = QColorDialog::getColor(lightDiffuseColor, this);
279  if (!newCol.isValid()) return;
280 
281  lightDiffuseColor = newCol;
282  ccQtHelpers::SetButtonColor(m_ui->diffuseColorButton, lightDiffuseColor);
284 }
285 
287  QColor newCol = QColorDialog::getColor(lightAmbientColor, this);
288  if (!newCol.isValid()) return;
289 
290  lightAmbientColor = newCol;
291  ccQtHelpers::SetButtonColor(m_ui->ambientColorButton, lightAmbientColor);
293 
294  update();
295 }
296 
298  QColor newCol = QColorDialog::getColor(lightSpecularColor, this);
299  if (!newCol.isValid()) return;
300 
301  lightSpecularColor = newCol;
302  ccQtHelpers::SetButtonColor(m_ui->specularColorButton, lightSpecularColor);
304 
305  update();
306 }
307 
309  QColor newCol = QColorDialog::getColor(meshFrontDiff, this);
310  if (!newCol.isValid()) return;
311 
312  meshFrontDiff = newCol;
313  ccQtHelpers::SetButtonColor(m_ui->meshFrontColorButton, meshFrontDiff);
314 
316 
317  update();
318 }
319 
321  QColor newCol = QColorDialog::getColor(meshBackDiff, this);
322  if (!newCol.isValid()) return;
323 
324  meshBackDiff = newCol;
325  ccQtHelpers::SetButtonColor(m_ui->meshBackColorButton, meshBackDiff);
327 
328  update();
329 }
330 
332  QColor newCol = QColorDialog::getColor(meshSpecularColor, this);
333  if (!newCol.isValid()) return;
334 
335  meshSpecularColor = newCol;
336  ccQtHelpers::SetButtonColor(m_ui->meshSpecularColorButton,
339 
340  update();
341 }
342 
344  QColor newCol = QColorDialog::getColor(pointsDefaultCol, this);
345  if (!newCol.isValid()) return;
346 
347  pointsDefaultCol = newCol;
348  ccQtHelpers::SetButtonColor(m_ui->pointsColorButton, pointsDefaultCol);
350 
351  update();
352 }
353 
355  QColor newCol = QColorDialog::getColor(bbDefaultCol, this);
356  if (!newCol.isValid()) return;
357 
358  bbDefaultCol = newCol;
359  ccQtHelpers::SetButtonColor(m_ui->bbColorButton, bbDefaultCol);
361 
362  update();
363 }
364 
366  QColor newCol = QColorDialog::getColor(textDefaultCol, this);
367  if (!newCol.isValid()) return;
368 
369  textDefaultCol = newCol;
370  ccQtHelpers::SetButtonColor(m_ui->textColorButton, textDefaultCol);
372 
373  update();
374 }
375 
377  QColor newCol = QColorDialog::getColor(backgroundCol, this);
378  if (!newCol.isValid()) return;
379 
380  backgroundCol = newCol;
381  ccQtHelpers::SetButtonColor(m_ui->bkgColorButton, backgroundCol);
383 
384  update();
385 }
386 
388  QColor newCol = QColorDialog::getColor(labelBackgroundCol, this);
389  if (!newCol.isValid()) return;
390 
391  labelBackgroundCol = newCol;
392  ccQtHelpers::SetButtonColor(m_ui->labelBkgColorButton, labelBackgroundCol);
394 
395  update();
396 }
397 
399  QColor newCol = QColorDialog::getColor(labelMarkerCol, this);
400  if (!newCol.isValid()) return;
401 
402  labelMarkerCol = newCol;
403  ccQtHelpers::SetButtonColor(m_ui->labelMarkerColorButton, labelMarkerCol);
404 
406 
407  update();
408 }
409 
411  parameters.minLoDMeshSize = static_cast<unsigned>(val * 1000000);
412 }
413 
415  parameters.minLoDCloudSize = static_cast<unsigned>(val * 1000000);
416 }
417 
419  parameters.useVBOs = m_ui->useVBOCheckBox->isChecked();
420  if (parameters.useVBOs &&
421  m_ui->maxCloudSizeDoubleSpinBox->value() < s_defaultMaxVBOCloudSizeM) {
422  m_ui->maxCloudSizeDoubleSpinBox->setValue(s_defaultMaxVBOCloudSizeM);
423  }
424 }
425 
427  if (val < 2) return;
428  parameters.colorScaleRampWidth = static_cast<unsigned>(val);
429 }
430 
432  if (val < 0) return;
433  parameters.defaultFontSize = static_cast<unsigned>(val);
434 }
435 
437  if (val < 0) return;
438  parameters.labelFontSize = static_cast<unsigned>(val);
439 }
440 
442  if (val < 0) return;
443  parameters.displayedNumPrecision = static_cast<unsigned>(val);
444 }
445 
447  parameters.zoomSpeed = val;
448 }
449 
451  assert(index >= 0 && index < 3);
454 }
455 
457  if (val < 0 || val > 100) return;
458  parameters.labelOpacity = static_cast<unsigned>(val);
459 }
460 
462  if (val <= 0) return;
463 
464  parameters.labelMarkerSize = static_cast<unsigned>(val);
465 }
466 
468  if (val < 0.0 || val > 1.0) return;
469  parameters.bbOpacity = val;
470 }
471 
473  if (val < 1) return;
474  parameters.bbLineWidth = static_cast<unsigned>(val);
475 }
476 
478  // Restore old parameters and options
481 
482  // Restore old application style
483  if (m_defaultAppStyleIndex >= 0) {
484  QString oldStyle =
485  m_ui->appStyleComboBox->itemText(m_defaultAppStyleIndex);
486  if (ecvApp) {
487  ecvApp->setAppStyle(oldStyle);
488  }
489  }
490 
491  // Force redraw of selected objects to restore BoundingBox properties
493  if (sceneDB) {
494  // Find all selected entities and force them to redraw
495  ccHObject::Container allEntities;
496  sceneDB->filterChildren(allEntities, true, CV_TYPES::OBJECT);
497  for (ccHObject* entity : allEntities) {
498  if (entity && entity->isSelected()) {
499  entity->setForceRedrawRecursive(true);
500  }
501  }
502  }
503 
504  emit aspectHasChanged();
505 
506  reject();
507 }
508 
510  parameters.reset();
511  options.reset();
512 
513  // Reset app style to default
514  if (m_defaultAppStyleIndex >= 0) {
515  m_ui->appStyleComboBox->setCurrentIndex(m_defaultAppStyleIndex);
516  }
517 
518  refresh();
519 }
520 
524 
525  // Apply application style
526  {
527  QString style = m_ui->appStyleComboBox->currentText();
528  ecvApp->setAppStyle(style);
529  }
530 
531  // Apply log verbosity level (now directly uses CVLog::MessageLevelFlags)
532  {
535  CVLog::Print(QString("New log verbosity level: %1")
536  .arg(options.logVerbosityLevel));
537  }
538  }
539 
540  // Force redraw of selected objects to update BoundingBox properties
542  if (sceneDB) {
543  // Find all selected entities and force them to redraw
544  ccHObject::Container allEntities;
545  sceneDB->filterChildren(allEntities, true, CV_TYPES::OBJECT);
546  for (ccHObject* entity : allEntities) {
547  if (entity && entity->isSelected()) {
548  entity->setForceRedrawRecursive(true);
549  }
550  }
551  }
552 
553  emit aspectHasChanged();
554 }
555 
557  // Optional: could add live preview here
558  Q_UNUSED(index);
559 }
560 
562  if (index >= 0 && index < CVLog::LOG_ERROR) {
564  static_cast<CVLog::MessageLevelFlags>(index);
565  } else {
566  // unexpected value
567  assert(false);
568  }
569 }
570 
571 void ccDisplayOptionsDlg::populateAppStyleComboBox() {
572  // Get currently active style
573  // Get the current/default style from settings
574  // (matching CloudCompare's approach using QSettings)
575  QSettings settings;
576  settings.beginGroup(ecvPS::AppStyle());
577  QString defaultStyleName = settings.value("style").toString();
578  settings.endGroup();
579 
580  // Fill with all available Qt styles
581  QStringList appStyles = QStyleFactory::keys();
582  for (const QString& style : appStyles) {
583  m_ui->appStyleComboBox->addItem(style);
584  }
585 
586  // Add custom dark/light themes from QDarkStyleSheet
587  m_ui->appStyleComboBox->addItem(QStringLiteral("QDarkStyleSheet::Light"));
588  m_ui->appStyleComboBox->addItem(QStringLiteral("QDarkStyleSheet::Dark"));
589 
590  // Find and set the current style (matching CloudCompare's logic)
591  // Handle case-insensitive comparison and macOS style name aliases
592  for (int i = 0; i < m_ui->appStyleComboBox->count(); ++i) {
593  QString itemText = m_ui->appStyleComboBox->itemText(i);
594  if (itemText.compare(defaultStyleName, Qt::CaseInsensitive) == 0) {
596  break;
597  }
598  }
599 
600  // On macOS, handle style name aliases (macOS <-> macintosh)
601 #ifdef Q_OS_MAC
602  if (m_defaultAppStyleIndex < 0 && !defaultStyleName.isEmpty()) {
603  // Try to match macOS/macintosh style names (they are equivalent)
604  if (defaultStyleName.compare("macOS", Qt::CaseInsensitive) == 0 ||
605  defaultStyleName.compare("macintosh", Qt::CaseInsensitive) == 0) {
606  for (int i = 0; i < m_ui->appStyleComboBox->count(); ++i) {
607  QString itemText = m_ui->appStyleComboBox->itemText(i);
608  if (itemText.compare("macOS", Qt::CaseInsensitive) == 0 ||
609  itemText.compare("macintosh", Qt::CaseInsensitive) == 0) {
611  break;
612  }
613  }
614  }
615  }
616 #endif
617 
618  // Set default index (use 0 if no match found)
619  if (m_defaultAppStyleIndex < 0) {
621  }
622  m_ui->appStyleComboBox->setCurrentIndex(m_defaultAppStyleIndex);
623 }
624 
626  apply();
627 
630 
631  accept();
632 }
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
static void SetVerbosityLevel(int level)
Sets the verbosity level.
Definition: CVLog.cpp:59
MessageLevelFlags
Message level.
Definition: CVLog.h:42
@ LOG_WARNING
Definition: CVLog.h:46
@ LOG_ERROR
Definition: CVLog.h:47
static int VerbosityLevel()
Returns the current verbosity level.
Definition: CVLog.cpp:57
void refresh()
Refreshes dialog to reflect new parameters values.
ccDisplayOptionsDlg(QWidget *parent)
ecvOptions options
Current options.
ecvGui::ParamStruct oldParameters
Old parameters (for restore)
ecvGui::ParamStruct parameters
Current GUI parameters.
int m_defaultAppStyleIndex
Default application style index (for reset)
ecvOptions oldOptions
Old options (for restore)
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
unsigned filterChildren(Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const
Collects the children corresponding to a certain pattern.
Definition: ecvHObject.cpp:611
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
static void SetButtonColor(QAbstractButton *button, const QColor &col)
Sets a button background color.
Definition: ecvQtHelpers.h:17
RGB color structure.
Definition: ecvColorTypes.h:49
RGBA color structure.
static ccHObject * GetSceneDB()
static void Set(const ParamStruct &params)
Sets GUI parameters.
static const ParamStruct & Parameters()
Returns the stored values of each parameter.
bool useNativeDialogs
Use native load/save dialogs.
Definition: ecvOptions.h:25
static void Set(const ecvOptions &options)
Sets parameters.
Definition: ecvOptions.cpp:32
void reset()
Resets parameters to default values.
Definition: ecvOptions.cpp:36
bool normalsDisplayedByDefault
Whether to display the normals by default or not.
Definition: ecvOptions.h:22
bool askForConfirmationBeforeQuitting
Ask for confirmation before quitting.
Definition: ecvOptions.h:31
void toPersistentSettings() const
Saves to persistent DB.
Definition: ecvOptions.cpp:61
CVLog::MessageLevelFlags logVerbosityLevel
Log/console verbosity level (reuses CVLog::MessageLevelFlags)
Definition: ecvOptions.h:28
static const ecvOptions & Instance()
Returns the stored values of each parameter.
Definition: ecvOptions.h:48
static const QString AppStyle()
#define ecvApp
Mimic Qt's qApp for easy access to the application instance.
static const double s_defaultMaxVBOCloudSizeM
@ OBJECT
Definition: CVTypes.h:102
constexpr QRegularExpression::PatternOption CaseInsensitive
Definition: QtCompat.h:174
Definition: sfEditDlg.h:16
Rgb FromQColor(QColor qColor)
Conversion from QColor.
Rgbaf FromQColoraf(QColor qColor)
Conversion from QColor'a' (floating point)
void reset()
Resets parameters to default values.
ComputeOctreeForPicking
Octree computation (for picking) behaviors.
ecvColor::Rgbaf lightDiffuseColor
Light diffuse color (RGBA)
ecvColor::Rgbaf meshSpecular
Default mesh specular color.
unsigned labelMarkerSize
Label marker size.
ecvColor::Rgbub backgroundCol
Background color.
ecvColor::Rgbaf lightAmbientColor
Light ambient color (RGBA)
unsigned displayedNumPrecision
Displayed numbers precision.
double bbOpacity
Bounding-box opacity (0.0 to 1.0)
ComputeOctreeForPicking autoComputeOctree
Octree computation (for picking) behavior.
unsigned labelFontSize
Label font size.
bool lightDoubleSided
Double sided light.
ecvColor::Rgbub labelMarkerCol
Labels marker color.
ecvColor::Rgbub textDefaultCol
Default text color.
bool drawRoundedPoints
Whether to draw rounded points (slower) or not.
unsigned minLoDCloudSize
Min cloud size for decimation.
unsigned defaultFontSize
Default displayed font size.
ecvColor::Rgbub labelBackgroundCol
Labels background color.
ecvColor::Rgbaf lightSpecularColor
Light specular color (RGBA)
ecvColor::Rgbub bbDefaultCol
Bounding-boxes color.
unsigned colorScaleRampWidth
Color scale ramp width (for display)
bool displayCross
Display cross in the middle of the screen.
void toPersistentSettings() const
Saves to persistent DB.
bool colorScaleUseShader
Whether to use shader for color scale display (if available) or not.
bool colorScaleShaderSupported
Whether shader for color scale display is available or not.
unsigned bbLineWidth
Bounding-box line width.
unsigned minLoDMeshSize
Min mesh size for decimation.
bool showBBOnSelected
Show bounding-box on selected objects.
ecvColor::Rgbaf meshFrontDiff
Default mesh diffuse color (front)
bool decimateMeshOnMove
Decimate meshes when moved.
bool drawBackgroundGradient
Use background gradient.
bool useVBOs
Whether to use VBOs for faster display.
unsigned labelOpacity
Labels background opcaity.
ecvColor::Rgbaf meshBackDiff
Default mesh diffuse color (back)
double zoomSpeed
Zoom speed (1.0 by default)
bool decimateCloudOnMove
Decimate clouds when moved.
ecvColor::Rgbub pointsDefaultCol
Default 3D points color.
bool colorScaleShowHistogram
Color scale option: show histogram next to color ramp.