qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
A scalar field associated to display-related parameters. More...
#include <ccScalarField.h>
Classes | |
struct | Histogram |
Simple histogram structure. More... | |
class | Range |
Scalar field range structure. More... | |
Public Member Functions | |
ccScalarField (const char *name=nullptr) | |
Default constructor. More... | |
ccScalarField (const ccScalarField &sf) | |
Copy constructor. More... | |
const Range & | displayRange () const |
Access to the range of displayed values. More... | |
const Range & | saturationRange () const |
Access to the range of saturation values. More... | |
const Range & | logSaturationRange () const |
Access to the range of log scale saturation values. More... | |
void | setMinDisplayed (ScalarType val) |
Sets the minimum displayed value. | |
void | setMaxDisplayed (ScalarType val) |
Sets the maximum displayed value. | |
void | setSaturationStart (ScalarType val) |
Sets the value at which to start color gradient. | |
void | setSaturationStop (ScalarType val) |
Sets the value at which to stop color gradient. | |
const ccColor::Rgb * | getColor (ScalarType value) const |
Returns the color corresponding to a given value (wrt to the current display parameters) More... | |
const ccColor::Rgb * | getValueColor (unsigned index) const |
Shortcut to getColor. | |
void | showNaNValuesInGrey (bool state) |
Sets whether NaN/out of displayed range values should be displayed in grey or hidden. | |
bool | areNaNValuesShownInGrey () const |
Returns whether NaN values are displayed in grey or hidden. | |
void | alwaysShowZero (bool state) |
Sets whether 0 should always appear in associated color ramp or not. | |
bool | isZeroAlwaysShown () const |
Returns whether 0 should always appear in associated color ramp or not. | |
void | setSymmetricalScale (bool state) |
Sets whether the color scale should be symmetrical or not. More... | |
bool | symmetricalScale () const |
Returns whether the color scale s symmetrical or not. More... | |
void | setLogScale (bool state) |
Sets whether scale is logarithmic or not. | |
bool | logScale () const |
Returns whether scalar field is logarithmic or not. | |
void | computeMinAndMax () override |
const ccColorScale::Shared & | getColorScale () const |
Returns associated color scale. | |
void | setColorScale (ccColorScale::Shared scale) |
Sets associated color scale. | |
unsigned | getColorRampSteps () const |
Returns number of color ramp steps. | |
void | setColorRampSteps (unsigned steps) |
Sets number of color ramp steps used for display. | |
const Histogram & | getHistogram () const |
Returns associated histogram values (for display) | |
bool | mayHaveHiddenValues () const |
Returns whether the scalar field in its current configuration MAY have 'hidden' values or not. More... | |
void | setModificationFlag (bool state) |
Sets modification flag state. | |
bool | getModificationFlag () const |
Returns modification flag state. | |
void | importParametersFrom (const ccScalarField *sf) |
Imports the parameters from another scalar field. | |
bool | isSerializable () const override |
Returns whether object is serializable of not. More... | |
bool | toFile (QFile &out) const override |
Saves data to binary stream. More... | |
bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
Loads data from binary stream. More... | |
double | getGlobalShift () const |
Returns the global shift (if any) | |
void | setGlobalShift (double shift) |
Sets the global shift. | |
Public Member Functions inherited from ccSerializableObject | |
virtual | ~ccSerializableObject ()=default |
Destructor. | |
virtual bool | isSerializable () const |
Returns whether object is serializable of not. More... | |
virtual bool | toFile (QFile &out) const |
Saves data to binary stream. More... | |
virtual bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
Loads data from binary stream. More... | |
Protected Member Functions | |
~ccScalarField () override=default | |
Default destructor. More... | |
void | updateSaturationBounds () |
Updates saturation values. | |
ScalarType | normalize (ScalarType val) const |
Normalizes a scalar value between 0 and 1 (wrt to current parameters) More... | |
Protected Attributes | |
Range | m_displayRange |
Displayed values range. | |
Range | m_saturationRange |
Saturation values range. More... | |
Range | m_logSaturationRange |
saturation values range (log scale mode) More... | |
bool | m_showNaNValuesInGrey |
Whether NaN values are shown in grey or are hidden. | |
bool | m_symmetricalScale |
Whether color scale is symmetrical or not. More... | |
bool | m_logScale |
Whether scale is logarithmic or not. | |
bool | m_alwaysShowZero |
Whether 0 should always appear in associated color ramp. | |
ccColorScale::Shared | m_colorScale |
Active color ramp (for display) | |
unsigned | m_colorRampSteps |
Number of color ramps steps (for display) | |
Histogram | m_histogram |
Associated histogram values (for display) | |
bool | m_modified |
Modification flag. More... | |
double | m_globalShift |
Global shift. | |
Additional Inherited Members | |
Public Types inherited from ccSerializableObject | |
enum | DeserializationFlags { DF_POINT_COORDS_64_BITS = 1 , DF_SCALAR_VAL_32_BITS = 2 } |
Deserialization flags (bit-field) More... | |
typedef QMultiMap< unsigned, unsigned > | LoadedIDMap |
Map of loaded unique IDs (old ID --> new ID) | |
Static Public Member Functions inherited from ccSerializableObject | |
static bool | WriteError () |
Sends a custom error message (write error) and returns 'false'. More... | |
static bool | ReadError () |
Sends a custom error message (read error) and returns 'false'. More... | |
static bool | MemoryError () |
Sends a custom error message (not enough memory) and returns 'false'. More... | |
static bool | CorruptError () |
Sends a custom error message (corrupted file) and returns 'false'. More... | |
A scalar field associated to display-related parameters.
Extends the CCCoreLib::ScalarField object.
|
explicit |
Default constructor.
name | scalar field name |
ccScalarField::ccScalarField | ( | const ccScalarField & | sf | ) |
Copy constructor.
sf | scalar field to copy |
|
overrideprotecteddefault |
Default destructor.
Call release instead
|
inline |
Access to the range of displayed values.
Values outside of the [start;stop] interval will either be grey or invisible (see showNaNValuesInGrey).
|
overridevirtual |
Loads data from binary stream.
in | input file (already opened) |
dataVersion | file version |
flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
oldToNewIDMap | map to link old IDs with new IDs |
Reimplemented from ccSerializableObject.
|
inline |
Returns the color corresponding to a given value (wrt to the current display parameters)
Warning: must no be called if the SF is not associated to a color scale!
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
|
inline |
Access to the range of log scale saturation values.
Relative color scales will only be applied to values inside the [start;stop] interval.
bool ccScalarField::mayHaveHiddenValues | ( | ) | const |
Returns whether the scalar field in its current configuration MAY have 'hidden' values or not.
'Hidden' values are typically NaN values or values outside of the 'displayed' interval while those values are not displayed in grey (see ccScalarField::showNaNValuesInGrey).
|
protected |
Normalizes a scalar value between 0 and 1 (wrt to current parameters)
val | scalar value |
ValidValue(d) ||
|
inline |
Access to the range of saturation values.
Relative color scales will only be applied to values inside the [start;stop] interval.
void ccScalarField::setSymmetricalScale | ( | bool | state | ) |
Sets whether the color scale should be symmetrical or not.
For relative color scales only.
|
inline |
Returns whether the color scale s symmetrical or not.
For relative color scales only.
|
overridevirtual |
Saves data to binary stream.
out | output file (already opened) |
Reimplemented from ccSerializableObject.
|
protected |
saturation values range (log scale mode)
For log scale color mapping with relative scales.
|
protected |
Modification flag.
Any modification to the scalar field values or parameters will turn this flag on.
|
protected |
Saturation values range.
For color mapping with relative scales.
|
protected |
Whether color scale is symmetrical or not.
For relative color scales only.