ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccColorScaleEditorDialog Class Reference

Dialog to edit/create color scales. More...

#include <ecvColorScaleEditorDlg.h>

Inheritance diagram for ccColorScaleEditorDialog:
Collaboration diagram for ccColorScaleEditorDialog:

Public Member Functions

 ccColorScaleEditorDialog (ccColorScalesManager *manager, ecvMainAppInterface *mainApp, ccColorScale::Shared currentScale=ccColorScale::Shared(nullptr), QWidget *parent=nullptr)
 Default constructor. More...
 
 ~ccColorScaleEditorDialog () override=default
 Destructor. More...
 
void setAssociatedScalarField (ccScalarField *sf)
 Sets associated scalar field (optional) More...
 
void setActiveScale (ccColorScale::Shared currentScale)
 Sets active scale. More...
 
ccColorScale::Shared getActiveScale ()
 Returns active scale. More...
 

Protected Slots

void colorScaleChanged (int)
 
void relativeModeChanged (int)
 
void onStepSelected (int)
 
void onStepModified (int)
 
void deletecSelectedStep ()
 
void changeSelectedStepColor ()
 
void changeSelectedStepValue (double)
 
void onCustomLabelsListChanged ()
 
void toggleCustomLabelsList (bool)
 
void copyCurrentScale ()
 
bool saveCurrentScale ()
 
void deleteCurrentScale ()
 
void renameCurrentScale ()
 
void exportCurrentScale ()
 
void importScale ()
 
void createNewScale ()
 
void onApply ()
 
void onClose ()
 

Protected Member Functions

void updateMainComboBox ()
 Updates main combox box with color scales manager. More...
 
void setModified (bool state)
 Sets modification flag state. More...
 
bool canChangeCurrentScale ()
 If the current scale has been modified, ask the user what to do. More...
 
bool isRelativeMode () const
 
void setScaleModeToRelative (bool isRelative)
 
bool checkCustomLabelsList (bool showWarnings)
 Checks the custom labels list. More...
 
bool exportCustomLabelsList (ccColorScale::LabelSet &labels)
 Exports the custom labels list. More...
 

Protected Attributes

ccColorScalesManagerm_manager
 Color scale manager. More...
 
ccColorScale::Shared m_colorScale
 Current active color scale. More...
 
ccColorScaleEditorWidgetm_scaleWidget
 Color scale editor widget. More...
 
ccScalarFieldm_associatedSF
 Associated scalar field. More...
 
bool m_modified
 Modification flag. More...
 
double m_minAbsoluteVal
 Current min boundary for absolute scales. More...
 
double m_maxAbsoluteVal
 Current max boundary for absolute scales. More...
 
ecvMainAppInterfacem_mainApp
 Associated application (interface) More...
 
Ui::ColorScaleEditorDlg * m_ui
 

Detailed Description

Dialog to edit/create color scales.

Definition at line 27 of file ecvColorScaleEditorDlg.h.

Constructor & Destructor Documentation

◆ ccColorScaleEditorDialog()

◆ ~ccColorScaleEditorDialog()

ccColorScaleEditorDialog::~ccColorScaleEditorDialog ( )
overridedefault

Destructor.

Member Function Documentation

◆ canChangeCurrentScale()

bool ccColorScaleEditorDialog::canChangeCurrentScale ( )
protected

If the current scale has been modified, ask the user what to do.

Returns
whether user allows the change or not

ask the user if we should save the current scale?

Definition at line 185 of file ecvColorScaleEditorDlg.cpp.

References m_colorScale, m_modified, and saveCurrentScale().

Referenced by onApply(), onClose(), and setActiveScale().

◆ changeSelectedStepColor

◆ changeSelectedStepValue

◆ checkCustomLabelsList()

bool ccColorScaleEditorDialog::checkCustomLabelsList ( bool  showWarnings)
protected

Checks the custom labels list.

Definition at line 527 of file ecvColorScaleEditorDlg.cpp.

References CVLog::Error(), m_ui, qtCompatSplitRegex(), and QtCompat::SkipEmptyParts.

Referenced by saveCurrentScale(), and toggleCustomLabelsList().

◆ colorScaleChanged

void ccColorScaleEditorDialog::colorScaleChanged ( int  pos)
protectedslot

◆ copyCurrentScale

◆ createNewScale

void ccColorScaleEditorDialog::createNewScale ( )
protectedslot

◆ deletecSelectedStep

void ccColorScaleEditorDialog::deletecSelectedStep ( )
protectedslot

◆ deleteCurrentScale

void ccColorScaleEditorDialog::deleteCurrentScale ( )
protectedslot

◆ exportCurrentScale

void ccColorScaleEditorDialog::exportCurrentScale ( )
protectedslot

◆ exportCustomLabelsList()

bool ccColorScaleEditorDialog::exportCustomLabelsList ( ccColorScale::LabelSet labels)
protected

Exports the custom labels list.

Definition at line 496 of file ecvColorScaleEditorDlg.cpp.

References CVLog::Error(), m_ui, qtCompatSplitRegex(), and QtCompat::SkipEmptyParts.

Referenced by saveCurrentScale().

◆ getActiveScale()

ccColorScale::Shared ccColorScaleEditorDialog::getActiveScale ( )
inline

◆ importScale

◆ isRelativeMode()

bool ccColorScaleEditorDialog::isRelativeMode ( ) const
protected

Returns whether current edited scale is 'relative' (true) or 'absolute' (false) Warning: may not be the same state as the current scale (m_colorScale) If current modifications have not been saved yet!

Definition at line 209 of file ecvColorScaleEditorDlg.cpp.

References m_ui.

Referenced by changeSelectedStepValue(), onStepModified(), and saveCurrentScale().

◆ onApply

void ccColorScaleEditorDialog::onApply ( )
protectedslot

◆ onClose

void ccColorScaleEditorDialog::onClose ( )
protectedslot

Definition at line 741 of file ecvColorScaleEditorDlg.cpp.

References canChangeCurrentScale().

Referenced by ccColorScaleEditorDialog().

◆ onCustomLabelsListChanged

void ccColorScaleEditorDialog::onCustomLabelsListChanged ( )
protectedslot

Definition at line 551 of file ecvColorScaleEditorDlg.cpp.

References setModified().

Referenced by ccColorScaleEditorDialog().

◆ onStepModified

◆ onStepSelected

void ccColorScaleEditorDialog::onStepSelected ( int  index)
protectedslot

◆ relativeModeChanged

void ccColorScaleEditorDialog::relativeModeChanged ( int  value)
protectedslot

Definition at line 174 of file ecvColorScaleEditorDlg.cpp.

References setModified(), and setScaleModeToRelative().

Referenced by ccColorScaleEditorDialog().

◆ renameCurrentScale

void ccColorScaleEditorDialog::renameCurrentScale ( )
protectedslot

Definition at line 664 of file ecvColorScaleEditorDlg.cpp.

References m_colorScale, and m_ui.

Referenced by ccColorScaleEditorDialog().

◆ saveCurrentScale

◆ setActiveScale()

◆ setAssociatedScalarField()

void ccColorScaleEditorDialog::setAssociatedScalarField ( ccScalarField sf)

◆ setModified()

void ccColorScaleEditorDialog::setModified ( bool  state)
protected

◆ setScaleModeToRelative()

void ccColorScaleEditorDialog::setScaleModeToRelative ( bool  isRelative)
protected

Sets current mode for active scale between 'relative' (true) or 'absolute' (false) Warning: may not be the same state as the current scale (m_colorScale) If current modifications have not been saved yet!

Definition at line 309 of file ecvColorScaleEditorDlg.cpp.

References ccColorScaleEditorWidget::getSelectedStepIndex(), m_scaleWidget, m_ui, and onStepModified().

Referenced by relativeModeChanged(), and setActiveScale().

◆ toggleCustomLabelsList

void ccColorScaleEditorDialog::toggleCustomLabelsList ( bool  state)
protectedslot

◆ updateMainComboBox()

void ccColorScaleEditorDialog::updateMainComboBox ( )
protected

Updates main combox box with color scales manager.

Definition at line 138 of file ecvColorScaleEditorDlg.cpp.

References m_colorScale, m_manager, m_ui, and ccColorScalesManager::map().

Referenced by ccColorScaleEditorDialog(), copyCurrentScale(), createNewScale(), deleteCurrentScale(), and importScale().

Member Data Documentation

◆ m_associatedSF

ccScalarField* ccColorScaleEditorDialog::m_associatedSF
protected

Associated scalar field.

Definition at line 123 of file ecvColorScaleEditorDlg.h.

Referenced by onApply(), onStepModified(), and setAssociatedScalarField().

◆ m_colorScale

◆ m_mainApp

ecvMainAppInterface* ccColorScaleEditorDialog::m_mainApp
protected

Associated application (interface)

Definition at line 134 of file ecvColorScaleEditorDlg.h.

Referenced by onApply(), and saveCurrentScale().

◆ m_manager

ccColorScalesManager* ccColorScaleEditorDialog::m_manager
protected

◆ m_maxAbsoluteVal

double ccColorScaleEditorDialog::m_maxAbsoluteVal
protected

Current max boundary for absolute scales.

Definition at line 131 of file ecvColorScaleEditorDlg.h.

Referenced by changeSelectedStepValue(), onStepModified(), saveCurrentScale(), setActiveScale(), and setAssociatedScalarField().

◆ m_minAbsoluteVal

double ccColorScaleEditorDialog::m_minAbsoluteVal
protected

Current min boundary for absolute scales.

Definition at line 129 of file ecvColorScaleEditorDlg.h.

Referenced by changeSelectedStepValue(), onStepModified(), saveCurrentScale(), setActiveScale(), and setAssociatedScalarField().

◆ m_modified

bool ccColorScaleEditorDialog::m_modified
protected

Modification flag.

Definition at line 126 of file ecvColorScaleEditorDlg.h.

Referenced by canChangeCurrentScale(), onStepSelected(), and setModified().

◆ m_scaleWidget

◆ m_ui


The documentation for this class was generated from the following files: