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:
[legend]
Collaboration diagram for ccColorScaleEditorDialog:
[legend]

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

ccColorScalesManager * m_manager
 Color scale manager. More...
 
ccColorScale::Shared m_colorScale
 Current active color scale. More...
 
ccColorScaleEditorWidget * m_scaleWidget
 Color scale editor widget. More...
 
ccScalarField * m_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...
 
ecvMainAppInterface * m_mainApp
 Associated application (interface) More...
 
Ui::ColorScaleEditorDlg * m_ui
 

Detailed Description

Dialog to edit/create color scales.

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?

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.

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

◆ deleteCurrentScale

void ccColorScaleEditorDialog::deleteCurrentScale ( )
protectedslot

◆ exportCurrentScale

void ccColorScaleEditorDialog::exportCurrentScale ( )
protectedslot

◆ exportCustomLabelsList()

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

Exports the custom labels list.

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!

References m_ui.

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

◆ onApply

void ccColorScaleEditorDialog::onApply ( )
protectedslot

◆ onClose

void ccColorScaleEditorDialog::onClose ( )
protectedslot

◆ onCustomLabelsListChanged

void ccColorScaleEditorDialog::onCustomLabelsListChanged ( )
protectedslot

References setModified().

Referenced by ccColorScaleEditorDialog().

◆ onStepModified

◆ onStepSelected

void ccColorScaleEditorDialog::onStepSelected ( int  index)
protectedslot

◆ relativeModeChanged

void ccColorScaleEditorDialog::relativeModeChanged ( int  value)
protectedslot

◆ renameCurrentScale

void ccColorScaleEditorDialog::renameCurrentScale ( )
protectedslot

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!

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.

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.

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

◆ m_colorScale

◆ m_mainApp

ecvMainAppInterface* ccColorScaleEditorDialog::m_mainApp
protected

Associated application (interface)

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.

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

◆ m_minAbsoluteVal

double ccColorScaleEditorDialog::m_minAbsoluteVal
protected

Current min boundary for absolute scales.

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

◆ m_modified

bool ccColorScaleEditorDialog::m_modified
protected

Modification flag.

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

◆ m_scaleWidget

◆ m_ui


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