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:
[legend]

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.

Constructor & Destructor Documentation

◆ ccColorScaleElement() [1/2]

ccColorScaleElement::ccColorScaleElement ( )
inline

Default constructor.

◆ ccColorScaleElement() [2/2]

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

Constructor from a (relative) position and a color.

Member Function Documentation

◆ getColor()

◆ getRelativePos()

double ccColorScaleElement::getRelativePos ( ) const
inline

◆ IsSmaller()

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

Comparison operator between two color scale elements.

References e2, and getRelativePos().

Referenced by define_ccColorScale(), and ccColorScale::sort().

◆ setColor()

void ccColorScaleElement::setColor ( QColor  color)
inline

Sets color.

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!)

References m_relativePos.

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

Member Data Documentation

◆ m_color

QColor ccColorScaleElement::m_color
protected

◆ m_relativePos

double ccColorScaleElement::m_relativePos
protected

Step (relative) position.

Must always be between 0.0 and 1.0!

Referenced by getRelativePos(), and setRelativePos().


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