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

Color scale element: one value + one color. More...

#include <ecvColorScale.h>

Inheritance diagram for ccColorScaleElement:

Public Member Functions

 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 ccColorScaleElement &e1, const ccColorScaleElement &e2)
 Comparison operator between two color scale elements. More...
 

Protected Attributes

double m_relativePos
 Step (relative) position. More...
 
QColor m_color
 Color. More...
 

Detailed Description

Color scale element: one value + one color.

Definition at line 22 of file ecvColorScale.h.

Constructor & Destructor Documentation

◆ ccColorScaleElement() [1/2]

ccColorScaleElement::ccColorScaleElement ( )
inline

Default constructor.

Definition at line 25 of file ecvColorScale.h.

◆ ccColorScaleElement() [2/2]

ccColorScaleElement::ccColorScaleElement ( double  relativePos,
QColor  color 
)
inline

Constructor from a (relative) position and a color.

Definition at line 28 of file ecvColorScale.h.

Member Function Documentation

◆ getColor()

◆ getRelativePos()

double ccColorScaleElement::getRelativePos ( ) const
inline

Returns step position (relative to scale boundaries)

Returns
relative position (always between 0.0 and 1.0!)

Definition at line 38 of file ecvColorScale.h.

References m_relativePos.

Referenced by ccColorScaleEditorDialog::changeSelectedStepValue(), define_ccColorScale(), IsSmaller(), ColorScaleElementSlider::IsSmaller(), ccColorScaleEditorDialog::onStepModified(), SlidersWidget::updateAllSlidersPos(), and SlidersWidget::updateSliderPos().

◆ IsSmaller()

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

Comparison operator between two color scale elements.

Definition at line 46 of file ecvColorScale.h.

References getRelativePos().

Referenced by define_ccColorScale().

◆ setColor()

void ccColorScaleElement::setColor ( QColor  color)
inline

Sets color.

Definition at line 41 of file ecvColorScale.h.

References color, and m_color.

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

◆ setRelativePos()

void ccColorScaleElement::setRelativePos ( double  pos)
inline

Sets associated value (relative to scale boundaries)

Parameters
posrelative position (always between 0.0 and 1.0!)

Definition at line 34 of file ecvColorScale.h.

References m_relativePos.

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

Member Data Documentation

◆ m_color

QColor ccColorScaleElement::m_color
protected

Color.

Definition at line 57 of file ecvColorScale.h.

Referenced by getColor(), ColorScaleElementSlider::paintEvent(), and setColor().

◆ m_relativePos

double ccColorScaleElement::m_relativePos
protected

Step (relative) position.

Must always be between 0.0 and 1.0!

Definition at line 55 of file ecvColorScale.h.

Referenced by getRelativePos(), and setRelativePos().


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