 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
39 Range() : m_min(0), m_start(0), m_stop(0), m_max(0), m_range(1) {}
42 inline ScalarType
min()
const {
return m_min; }
43 inline ScalarType
start()
const {
return m_start; }
44 inline ScalarType
stop()
const {
return m_stop; }
45 inline ScalarType
max()
const {
return m_max; }
46 inline ScalarType
range()
const {
return m_range; }
47 inline ScalarType
maxRange()
const {
return m_max - m_min; }
52 bool resetStartStop =
true) {
53 assert(minVal <= maxVal);
60 m_start = inbound(m_start);
61 m_stop = inbound(m_stop);
67 m_start = inbound(value);
68 if (m_stop < m_start) m_stop = m_start;
72 m_stop = inbound(value);
73 if (m_stop < m_start) m_start = m_stop;
78 inline ScalarType
inbound(ScalarType val)
const {
79 return (val < m_min ? m_min : (val > m_max ? m_max : val));
83 return (val >= m_min && val <= m_max);
87 return (val >= m_start && val <= m_stop);
115 return m_logScale ? m_logSaturationRange : m_saturationRange;
123 return m_logSaturationRange;
127 void setMinDisplayed(ScalarType val);
129 void setMaxDisplayed(ScalarType val);
131 void setSaturationStart(ScalarType val);
133 void setSaturationStop(ScalarType val);
140 assert(m_colorScale);
141 return m_colorScale->getColorByRelativePos(
142 normalize(value), m_colorRampSteps,
148 return getColor(getValue(index));
153 void showNaNValuesInGrey(
bool state);
157 return m_showNaNValuesInGrey;
161 void alwaysShowZero(
bool state);
169 void setSymmetricalScale(
bool state);
177 void setLogScale(
bool state);
180 inline bool logScale()
const {
return m_logScale; }
183 void computeMinAndMax()
override;
197 void setColorRampSteps(
unsigned steps);
202 unsigned maxValue = 0;
214 bool mayHaveHiddenValues()
const;
226 bool toFile(QFile& out,
short dataVersion)
const override;
227 short minimumFileVersion()
const override;
228 bool fromFile(QFile& in,
231 LoadedIDMap& oldToNewIDMap)
override;
245 void updateSaturationBounds();
252 ScalarType normalize(ScalarType val)
const;
void setGlobalShift(double shift)
Sets the global shift.
Definition: ecvScalarField.h:236
bool m_logScale
Whether scale is logarithmic or not.
Definition: ecvScalarField.h:277
unsigned getColorRampSteps() const
Returns number of color ramp steps.
Definition: ecvScalarField.h:194
ScalarType stop() const
Definition: ecvScalarField.h:44
ScalarType m_max
Definition: ecvScalarField.h:99
bool m_showNaNValuesInGrey
Whether NaN values are shown in grey or are hidden.
Definition: ecvScalarField.h:269
ScalarType maxRange() const
Definition: ecvScalarField.h:47
QSharedPointer< ccColorScale > Shared
Shared pointer type.
Definition: ecvColorScale.h:74
bool isInbound(ScalarType val) const
Returns whether a value is inbound or not.
Definition: ecvScalarField.h:82
const ecvColor::Rgb * getColor(ScalarType value) const
Definition: ecvScalarField.h:139
ScalarType start() const
Definition: ecvScalarField.h:43
double m_globalShift
Global shift.
Definition: ecvScalarField.h:298
constexpr Rgb lightGrey(static_cast< ColorCompType >(MAX *0.8), static_cast< ColorCompType >(MAX *0.8), static_cast< ColorCompType >(MAX *0.8))
ScalarType m_range
Definition: ecvScalarField.h:101
bool isZeroAlwaysShown() const
Returns whether 0 should always appear in associated color ramp or not.
Definition: ecvScalarField.h:164
A simple scalar field (to be associated to a point cloud)
Definition: ScalarField.h:25
ScalarType m_min
Definition: ecvScalarField.h:96
ScalarType inbound(ScalarType val) const
Returns the nearest inbound value.
Definition: ecvScalarField.h:78
ScalarType m_start
Definition: ecvScalarField.h:97
const ecvColor::Rgb * getValueColor(unsigned index) const
Shortcut to getColor.
Definition: ecvScalarField.h:147
bool logScale() const
Returns whether scalar field is logarithmic or not.
Definition: ecvScalarField.h:180
constexpr ScalarType ZERO_TOLERANCE_SCALAR
Definition: CVConst.h:57
void setModificationFlag(bool state)
Sets modification flag state.
Definition: ecvScalarField.h:217
Range m_displayRange
Displayed values range.
Definition: ecvScalarField.h:256
Simple histogram structure.
Definition: ecvScalarField.h:200
void updateRange()
Updates actual range.
Definition: ecvScalarField.h:92
ccColorScale::Shared m_colorScale
Active color ramp (for display)
Definition: ecvScalarField.h:283
bool getModificationFlag() const
Returns modification flag state.
Definition: ecvScalarField.h:219
bool m_symmetricalScale
Whether color scale is symmetrical or not.
Definition: ecvScalarField.h:274
Range m_logSaturationRange
saturation values range (log scale mode)
Definition: ecvScalarField.h:266
Range m_saturationRange
Saturation values range.
Definition: ecvScalarField.h:261
double getGlobalShift() const
Returns the global shift (if any)
Definition: ecvScalarField.h:234
Range()
Default constructor.
Definition: ecvScalarField.h:39
void setBounds(ScalarType minVal, ScalarType maxVal, bool resetStartStop=true)
Definition: ecvScalarField.h:50
bool isInRange(ScalarType val) const
Returns whether a value is inside range or not.
Definition: ecvScalarField.h:86
ScalarType min() const
Definition: ecvScalarField.h:42
void setStart(ScalarType value)
Definition: ecvScalarField.h:66
bool m_alwaysShowZero
Whether 0 should always appear in associated color ramp.
Definition: ecvScalarField.h:280
Serializable object interface.
Definition: ecvSerializableObject.h:25
bool m_modified
Modification flag.
Definition: ecvScalarField.h:295
const Range & saturationRange() const
Access to the range of saturation values.
Definition: ecvScalarField.h:114
const Histogram & getHistogram() const
Returns associated histogram values (for display)
Definition: ecvScalarField.h:206
bool areNaNValuesShownInGrey() const
Returns whether NaN values are displayed in gray or hidden.
Definition: ecvScalarField.h:156
const ccColorScale::Shared & getColorScale() const
Returns associated color scale.
Definition: ecvScalarField.h:186
RGB color structure.
Definition: ecvColorTypes.h:49
bool symmetricalScale() const
Returns whether the color scale s symmetrical or not.
Definition: ecvScalarField.h:174
Histogram m_histogram
Associated histogram values (for display)
Definition: ecvScalarField.h:289
void setStop(ScalarType value)
Definition: ecvScalarField.h:71
ScalarType max() const
Definition: ecvScalarField.h:45
const Range & logSaturationRange() const
Access to the range of log scale saturation values.
Definition: ecvScalarField.h:122
#define CV_DB_LIB_API
Definition: CV_db.h:15
Scalar field range structure.
Definition: ecvScalarField.h:36
ScalarType range() const
Definition: ecvScalarField.h:46
ScalarType m_stop
Definition: ecvScalarField.h:98
bool isSerializable() const override
Returns whether object is serializable of not.
Definition: ecvScalarField.h:225
const Range & displayRange() const
Access to the range of displayed values.
Definition: ecvScalarField.h:108
unsigned m_colorRampSteps
Number of color ramps steps (for display)
Definition: ecvScalarField.h:286
A scalar field associated to display-related parameters.
Definition: ecvScalarField.h:19
std::string name
Definition: FileIOFactory.cpp:129