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

Color scale element as a widget. More...

#include <ecvColorScaleEditorWidget.h>

Inheritance diagram for ColorScaleElementSlider:
Collaboration diagram for ColorScaleElementSlider:

Public Member Functions

 ColorScaleElementSlider (double relativePos=0.0, QColor color=Qt::black, QWidget *parent=nullptr, Qt::Orientation orientation=Qt::Horizontal)
 Default constructor. More...
 
void setSelected (bool state)
 Sets selection state. More...
 
bool isSelected () const
 Returns selection state. More...
 
- Public Member Functions inherited from ccColorScaleElement
 ccColorScaleElement ()
 Default constructor. More...
 
 ccColorScaleElement (double relativePos, QColor color)
 Constructor from a (relative) position and a color. More...
 
void setRelativePos (double pos)
 Sets associated value (relative to scale boundaries) More...
 
double getRelativePos () const
 Returns step position (relative to scale boundaries) More...
 
void setColor (QColor color)
 Sets color. More...
 
const QColor & getColor () const
 Returns color. More...
 

Static Public Member Functions

static bool IsSmaller (const ColorScaleElementSlider *e1, const ColorScaleElementSlider *e2)
 Comparison operator between two (pointers on) color scale elements. More...
 
- Static Public Member Functions inherited from ccColorScaleElement
static bool IsSmaller (const ccColorScaleElement &e1, const ccColorScaleElement &e2)
 Comparison operator between two color scale elements. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *e) override
 

Protected Attributes

bool m_selected
 Selection state. More...
 
Qt::Orientation m_orientation
 Widget orientation. More...
 
- Protected Attributes inherited from ccColorScaleElement
double m_relativePos
 Step (relative) position. More...
 
QColor m_color
 Color. More...
 

Detailed Description

Color scale element as a widget.

Definition at line 23 of file ecvColorScaleEditorWidget.h.

Constructor & Destructor Documentation

◆ ColorScaleElementSlider()

ColorScaleElementSlider::ColorScaleElementSlider ( double  relativePos = 0.0,
QColor  color = Qt::black,
QWidget *  parent = nullptr,
Qt::Orientation  orientation = Qt::Horizontal 
)

Default constructor.

Definition at line 29 of file ecvColorScaleEditorWidget.cpp.

References DEFAULT_SLIDER_SYMBOL_SIZE, and m_orientation.

Member Function Documentation

◆ isSelected()

bool ColorScaleElementSlider::isSelected ( ) const
inline

Returns selection state.

Definition at line 38 of file ecvColorScaleEditorWidget.h.

Referenced by SlidersWidget::mouseDoubleClickEvent(), and SlidersWidget::mouseMoveEvent().

◆ IsSmaller()

static bool ColorScaleElementSlider::IsSmaller ( const ColorScaleElementSlider e1,
const ColorScaleElementSlider e2 
)
inlinestatic

Comparison operator between two (pointers on) color scale elements.

Definition at line 41 of file ecvColorScaleEditorWidget.h.

References ccColorScaleElement::getRelativePos().

Referenced by ColorScaleElementSliders::sort().

◆ paintEvent()

void ColorScaleElementSlider::paintEvent ( QPaintEvent *  e)
overrideprotected

◆ setSelected()

void ColorScaleElementSlider::setSelected ( bool  state)
inline

Sets selection state.

Definition at line 35 of file ecvColorScaleEditorWidget.h.

Member Data Documentation

◆ m_orientation

Qt::Orientation ColorScaleElementSlider::m_orientation
protected

Widget orientation.

Definition at line 54 of file ecvColorScaleEditorWidget.h.

Referenced by ColorScaleElementSlider(), and paintEvent().

◆ m_selected

bool ColorScaleElementSlider::m_selected
protected

Selection state.

Definition at line 51 of file ecvColorScaleEditorWidget.h.

Referenced by paintEvent().


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