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

Color scale editor dialog. More...

#include <ecvColorScaleEditorWidget.h>

Inheritance diagram for ccColorScaleEditorWidget:
Collaboration diagram for ccColorScaleEditorWidget:

Signals

void stepSelected (int index)
 Signal emitted when a slider is selected. More...
 
void stepModified (int index)
 Signal emitted when a slider is modified. More...
 

Public Member Functions

 ccColorScaleEditorWidget (QWidget *parent=nullptr, Qt::Orientation orientation=Qt::Horizontal)
 Default constructor. More...
 
 ~ccColorScaleEditorWidget () override=default
 Destructor. More...
 
int getStepCount () const
 Returns the current number of color scale steps. More...
 
const ColorScaleElementSlidergetStep (int index)
 Returns a given slider (pointer on) More...
 
void setStepColor (int index, QColor color)
 Sets a given slider color. More...
 
void setStepRelativePosition (int index, double relativePos)
 Sets a given slider relative position. More...
 
int getSelectedStepIndex () const
 Returns currently selected step index. More...
 
void setSelectedStepIndex (int index, bool silent=false)
 Sets currently selected step index. More...
 
void deleteStep (int index)
 Deletes a given step. More...
 
void exportColorScale (ccColorScale::Shared &destScale) const
 Exports the current color scale. More...
 
void importColorScale (ccColorScale::Shared scale)
 Imports the current color scale. More...
 
void showLabels (bool state)
 Sets whether to show the color elements labels or not. More...
 
void setLabelColor (QColor color)
 Sets the labels color. More...
 
void setLabelPrecision (int precision)
 Sets the labels precision. More...
 
void setSliders (SharedColorScaleElementSliders sliders) override
 Sets associated sliders set. More...
 
- Public Member Functions inherited from ColorScaleEditorBaseWidget
 ColorScaleEditorBaseWidget (SharedColorScaleElementSliders sliders, Qt::Orientation orientation, int margin, QWidget *parent=nullptr)
 Defautl constructor. More...
 
int length () const
 Returns useful length. More...
 
Qt::Orientation getOrientation () const
 Returns orientation. More...
 
int getMargin () const
 Returns margin. More...
 

Protected Slots

void onPointClicked (double relativePos)
 Slot called when a 'point' is clicked on the color bar. More...
 
void onSliderModified (int sliderIndex)
 Slot called when a slider is moved or its color is changed. More...
 
void onSliderSelected (int sliderIndex)
 Slot called when a slider is selected. More...
 

Protected Attributes

ColorBarWidgetm_colorBarWidget
 Associated color bar. More...
 
SlidersWidgetm_slidersWidget
 Associated sliders widget. More...
 
SliderLabelWidgetm_labelsWidget
 Associated (sliders) labels widget. More...
 
- Protected Attributes inherited from ColorScaleEditorBaseWidget
SharedColorScaleElementSliders m_sliders
 Associated sliders. More...
 
Qt::Orientation m_orientation
 Orientation. More...
 
int m_margin
 Margin. More...
 

Detailed Description

Color scale editor dialog.

Definition at line 224 of file ecvColorScaleEditorWidget.h.

Constructor & Destructor Documentation

◆ ccColorScaleEditorWidget()

ccColorScaleEditorWidget::ccColorScaleEditorWidget ( QWidget *  parent = nullptr,
Qt::Orientation  orientation = Qt::Horizontal 
)

◆ ~ccColorScaleEditorWidget()

ccColorScaleEditorWidget::~ccColorScaleEditorWidget ( )
overridedefault

Destructor.

Member Function Documentation

◆ deleteStep()

void ccColorScaleEditorWidget::deleteStep ( int  index)

Deletes a given step.

Warning: first and last steps shouldn't be deleted!

Definition at line 693 of file ecvColorScaleEditorWidget.cpp.

References ColorScaleEditorBaseWidget::m_sliders, and onSliderSelected().

Referenced by ccColorScaleEditorDialog::deletecSelectedStep().

◆ exportColorScale()

void ccColorScaleEditorWidget::exportColorScale ( ccColorScale::Shared destScale) const

◆ getSelectedStepIndex()

int ccColorScaleEditorWidget::getSelectedStepIndex ( ) const
inline

◆ getStep()

const ColorScaleElementSlider* ccColorScaleEditorWidget::getStep ( int  index)
inline

◆ getStepCount()

int ccColorScaleEditorWidget::getStepCount ( ) const
inline

◆ importColorScale()

void ccColorScaleEditorWidget::importColorScale ( ccColorScale::Shared  scale)

◆ onPointClicked

void ccColorScaleEditorWidget::onPointClicked ( double  relativePos)
protectedslot

◆ onSliderModified

void ccColorScaleEditorWidget::onSliderModified ( int  sliderIndex)
protectedslot

Slot called when a slider is moved or its color is changed.

Definition at line 611 of file ecvColorScaleEditorWidget.cpp.

References m_colorBarWidget, m_labelsWidget, m_slidersWidget, and stepModified().

Referenced by ccColorScaleEditorWidget(), onPointClicked(), setStepColor(), and setStepRelativePosition().

◆ onSliderSelected

void ccColorScaleEditorWidget::onSliderSelected ( int  sliderIndex)
protectedslot

Slot called when a slider is selected.

Definition at line 639 of file ecvColorScaleEditorWidget.cpp.

References m_slidersWidget, and stepSelected().

Referenced by ccColorScaleEditorWidget(), and deleteStep().

◆ setLabelColor()

void ccColorScaleEditorWidget::setLabelColor ( QColor  color)

Sets the labels color.

Definition at line 679 of file ecvColorScaleEditorWidget.cpp.

References color, m_labelsWidget, and SliderLabelWidget::setTextColor().

◆ setLabelPrecision()

void ccColorScaleEditorWidget::setLabelPrecision ( int  precision)

Sets the labels precision.

Definition at line 686 of file ecvColorScaleEditorWidget.cpp.

References m_labelsWidget, and SliderLabelWidget::setPrecision().

◆ setSelectedStepIndex()

void ccColorScaleEditorWidget::setSelectedStepIndex ( int  index,
bool  silent = false 
)

Sets currently selected step index.

Definition at line 704 of file ecvColorScaleEditorWidget.cpp.

References m_slidersWidget, and SlidersWidget::select().

Referenced by ccColorScaleEditorDialog::changeSelectedStepValue().

◆ setSliders()

void ccColorScaleEditorWidget::setSliders ( SharedColorScaleElementSliders  sliders)
overridevirtual

◆ setStepColor()

void ccColorScaleEditorWidget::setStepColor ( int  index,
QColor  color 
)

◆ setStepRelativePosition()

void ccColorScaleEditorWidget::setStepRelativePosition ( int  index,
double  relativePos 
)

◆ showLabels()

void ccColorScaleEditorWidget::showLabels ( bool  state)

Sets whether to show the color elements labels or not.

Definition at line 672 of file ecvColorScaleEditorWidget.cpp.

References m_labelsWidget.

◆ stepModified

void ccColorScaleEditorWidget::stepModified ( int  index)
signal

Signal emitted when a slider is modified.

Referenced by onSliderModified().

◆ stepSelected

void ccColorScaleEditorWidget::stepSelected ( int  index)
signal

Signal emitted when a slider is selected.

Referenced by onSliderSelected().

Member Data Documentation

◆ m_colorBarWidget

ColorBarWidget* ccColorScaleEditorWidget::m_colorBarWidget
protected

Associated color bar.

Definition at line 304 of file ecvColorScaleEditorWidget.h.

Referenced by ccColorScaleEditorWidget(), onPointClicked(), and onSliderModified().

◆ m_labelsWidget

SliderLabelWidget* ccColorScaleEditorWidget::m_labelsWidget
protected

Associated (sliders) labels widget.

Definition at line 310 of file ecvColorScaleEditorWidget.h.

Referenced by ccColorScaleEditorWidget(), onSliderModified(), setLabelColor(), setLabelPrecision(), and showLabels().

◆ m_slidersWidget

SlidersWidget* ccColorScaleEditorWidget::m_slidersWidget
protected

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