![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A scalar field associated to display-related parameters. More...
#include <ecvScalarField.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. More... | |
| void | setMaxDisplayed (ScalarType val) |
| Sets the maximum displayed value. More... | |
| void | setSaturationStart (ScalarType val) |
| Sets the value at which to start color gradient. More... | |
| void | setSaturationStop (ScalarType val) |
| Sets the value at which to stop color gradient. More... | |
| const ecvColor::Rgb * | getColor (ScalarType value) const |
| const ecvColor::Rgb * | getValueColor (unsigned index) const |
| Shortcut to getColor. More... | |
| void | showNaNValuesInGrey (bool state) |
| bool | areNaNValuesShownInGrey () const |
| Returns whether NaN values are displayed in gray or hidden. More... | |
| void | alwaysShowZero (bool state) |
| Sets whether 0 should always appear in associated color ramp or not. More... | |
| bool | isZeroAlwaysShown () const |
| Returns whether 0 should always appear in associated color ramp or not. More... | |
| 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. More... | |
| bool | logScale () const |
| Returns whether scalar field is logarithmic or not. More... | |
| void | computeMinAndMax () override |
| Determines the min and max values. More... | |
| const ccColorScale::Shared & | getColorScale () const |
| Returns associated color scale. More... | |
| void | setColorScale (ccColorScale::Shared scale) |
| Sets associated color scale. More... | |
| unsigned | getColorRampSteps () const |
| Returns number of color ramp steps. More... | |
| void | setColorRampSteps (unsigned steps) |
| Sets number of color ramp steps used for display. More... | |
| const Histogram & | getHistogram () const |
| Returns associated histogram values (for display) More... | |
| bool | mayHaveHiddenValues () const |
| void | setModificationFlag (bool state) |
| Sets modification flag state. More... | |
| bool | getModificationFlag () const |
| Returns modification flag state. More... | |
| void | importParametersFrom (const ccScalarField *sf) |
| Imports the parameters from another scalar field. More... | |
| bool | isSerializable () const override |
| Returns whether object is serializable of not. More... | |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. 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) More... | |
| void | setGlobalShift (double shift) |
| Sets the global shift. More... | |
Public Member Functions inherited from cloudViewer::ScalarField | |
| ScalarField (const char *name=nullptr) | |
| Default constructor. More... | |
| ScalarField (const ScalarField &sf) | |
| Copy constructor. More... | |
| void | setName (const char *name) |
| Sets scalar field name. More... | |
| const char * | getName () const |
| Returns scalar field name. More... | |
| void | computeMeanAndVariance (ScalarType &mean, ScalarType *variance=nullptr) const |
| void | flagValueAsInvalid (std::size_t index) |
| Sets the value as 'invalid' (i.e. NAN_VALUE) More... | |
| std::size_t | countValidValues () const |
| Returns the number of valid values in this scalar field. More... | |
| ScalarType | getMin () const |
| Returns the minimum value. More... | |
| ScalarType | getMax () const |
| Returns the maximum value. More... | |
| void | fill (ScalarType fillValue=0) |
| Fills the array with a particular value. More... | |
| bool | reserveSafe (std::size_t count) |
| Reserves memory (no exception thrown) More... | |
| bool | resizeSafe (std::size_t count, bool initNewElements=false, ScalarType valueForNewElements=0) |
| Resizes memory (no exception thrown) More... | |
| ScalarType & | getValue (std::size_t index) |
| const ScalarType & | getValue (std::size_t index) const |
| void | setValue (std::size_t index, ScalarType value) |
| void | addElement (ScalarType value) |
| unsigned | currentSize () const |
| void | swap (std::size_t i1, std::size_t i2) |
| ~ScalarField () override=default | |
| Default destructor. More... | |
Public Member Functions inherited from CCShareable | |
| CCShareable () | |
| Default constructor. More... | |
| virtual void | link () |
| Increase counter. More... | |
| virtual void | release () |
| Decrease counter and deletes object when 0. More... | |
| virtual unsigned | getLinkCount () const |
| Returns the current link count. More... | |
Public Member Functions inherited from ccSerializableObject | |
| virtual | ~ccSerializableObject ()=default |
| Destructor. More... | |
Protected Member Functions | |
| ~ccScalarField () override=default | |
| Default destructor. More... | |
| void | updateSaturationBounds () |
| Updates saturation values. More... | |
| ScalarType | normalize (ScalarType val) const |
| Normalizes a scalar value between 0 and 1 (wrt to current parameters) More... | |
Protected Member Functions inherited from CCShareable | |
| virtual | ~CCShareable () |
| Destructor. More... | |
Protected Attributes | |
| Range | m_displayRange |
| Displayed values range. More... | |
| 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. More... | |
| bool | m_symmetricalScale |
| Whether color scale is symmetrical or not. More... | |
| bool | m_logScale |
| Whether scale is logarithmic or not. More... | |
| bool | m_alwaysShowZero |
| Whether 0 should always appear in associated color ramp. More... | |
| ccColorScale::Shared | m_colorScale |
| Active color ramp (for display) More... | |
| unsigned | m_colorRampSteps |
| Number of color ramps steps (for display) More... | |
| Histogram | m_histogram |
| Associated histogram values (for display) More... | |
| bool | m_modified |
| Modification flag. More... | |
| double | m_globalShift |
| Global shift. More... | |
Protected Attributes inherited from cloudViewer::ScalarField | |
| char | m_name [256] |
| Scalar field name. More... | |
| ScalarType | m_minVal |
| Minimum value. More... | |
| ScalarType | m_maxVal |
| Maximum value. More... | |
Protected Attributes inherited from CCShareable | |
| unsigned | m_linkCount |
| Links counter. More... | |
Additional Inherited Members | |
Public Types inherited from ccSerializableObject | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS , 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) More... | |
Static Public Member Functions inherited from cloudViewer::ScalarField | |
| static ScalarType | NaN () |
| Returns the specific NaN value. More... | |
| static bool | ValidValue (ScalarType value) |
| Returns whether a scalar value is valid or not. More... | |
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 cloudViewer::ScalarField object.
Definition at line 19 of file ecvScalarField.h.
|
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
| void ccScalarField::alwaysShowZero | ( | bool | state | ) |
Sets whether 0 should always appear in associated color ramp or not.
Referenced by sfEditDlg::alwaysShow0Changed(), define_ccScalarField(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Returns whether NaN values are displayed in gray or hidden.
Definition at line 156 of file ecvScalarField.h.
Referenced by define_ccScalarField(), ccSNECloud::drawMeOnly(), sfEditDlg::fillDialogWith(), sfEditDlg::nanInGrayChanged(), and cloudViewer::utility::pybind_scalarfield().
|
overridevirtual |
Determines the min and max values.
Reimplemented from cloudViewer::ScalarField.
Referenced by masc::Classifier::classify(), qM3C2Process::Compute(), qVoxFallProcess::Compute(), DistanceMapGenerationTool::ComputeRadialDist(), DistanceMapGenerationTool::ConvertMapToCloud(), ccMeasurementDevice::createScalarFieldForCloud(), qPCV::doAction(), qPoissonRecon::doAction(), ccDBRoot::editLabelScalarValue(), ccCompass::estimateStrain(), masc::Classifier::evaluate(), ccRasterizeTool::generateHillshade(), LoadCloud(), LoadScan(), CommandStatTest::process(), PCVCommand::Process(), ccEntityAction::statisticalTest(), and DistanceMapGenerationDlg::update().
|
inline |
Access to the range of displayed values.
Values outside of the [start;stop] intervale will either be grey or invisible (see showNaNValuesInGrey).
Definition at line 108 of file ecvScalarField.h.
Referenced by ccRasterizeTool::activeLayerChanged(), ccColorFromScalarDlg::ccColorFromScalarDlg(), define_ccScalarField(), ccSNECloud::drawMeOnly(), sfEditDlg::fillDialogWith(), ccHistogramWindow::fromSF(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::refresh(), and ecvFilterByLabelDlg::setInputEntity().
|
overridevirtual |
Loads data from binary stream.
| in | input file (already opened) |
| dataVersion | file version (for version-specific deserialization) |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
Note: When implementing, use dataVersion checks to handle differentversions:
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!
Definition at line 139 of file ecvScalarField.h.
References ecvColor::lightGrey(), and normalize().
Referenced by ccRasterizeTool::addNewContour(), define_ccScalarField(), ccSNECloud::drawMeOnly(), ccHistogramWindow::refresh(), and ccHistogramWindow::refreshBars().
|
inline |
Returns number of color ramp steps.
Definition at line 194 of file ecvScalarField.h.
Referenced by define_ccScalarField(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::refresh(), and ccPropertiesTreeDelegate::setEditorData().
|
inline |
Returns associated color scale.
Definition at line 186 of file ecvScalarField.h.
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), ccEntityAction::computeStatParams(), define_ccScalarField(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), sfEditDlg::fillDialogWith(), ccRasterizeTool::generateImage(), ccHistogramWindow::refresh(), ccHistogramWindow::refreshBars(), ccColorScaleEditorDialog::saveCurrentScale(), and ccPropertiesTreeDelegate::setEditorData().
|
inline |
Returns the global shift (if any)
Definition at line 234 of file ecvScalarField.h.
Referenced by define_ccScalarField(), ExtraLasField::ExtraLasField(), LasField::GetLASFields(), cloudViewer::utility::pybind_scalarfield(), and SimpleBinFilter::saveToFile().
|
inline |
Returns associated histogram values (for display)
Definition at line 206 of file ecvScalarField.h.
Referenced by ccHistogramWindow::computeBinArrayFromSF(), define_ccScalarField(), and sfEditDlg::fillDialogWith().
|
inline |
Returns modification flag state.
Definition at line 219 of file ecvScalarField.h.
Referenced by define_ccScalarField(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Shortcut to getColor.
Definition at line 147 of file ecvScalarField.h.
References cloudViewer::ScalarField::getValue().
Referenced by define_ccScalarField().
| void ccScalarField::importParametersFrom | ( | const ccScalarField * | sf | ) |
Imports the parameters from another scalar field.
Referenced by ccCropTool::Crop(), and define_ccScalarField().
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
Definition at line 225 of file ecvScalarField.h.
Referenced by cloudViewer::utility::pybind_scalarfield().
|
inline |
Returns whether 0 should always appear in associated color ramp or not.
Definition at line 164 of file ecvScalarField.h.
Referenced by sfEditDlg::alwaysShow0Changed(), define_ccScalarField(), sfEditDlg::fillDialogWith(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Access to the range of log scale saturation values.
Relative color scales will only be applied to values inside the [start;stop] intervale.
Definition at line 122 of file ecvScalarField.h.
Referenced by define_ccScalarField(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Returns whether scalar field is logarithmic or not.
Definition at line 180 of file ecvScalarField.h.
Referenced by define_ccScalarField(), sfEditDlg::fillDialogWith(), sfEditDlg::logScaleChanged(), and cloudViewer::utility::pybind_scalarfield().
| 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' intervale while those values are not displayed in grey (see ccScalarField::showNaNValuesInGrey).
Referenced by define_ccScalarField(), and cloudViewer::utility::pybind_scalarfield().
|
overridevirtual |
Returns the minimum file version required to save this instance.
To be overridden by subclasses to indicate their minimum required version. This enables the system to determine:
Implements ccSerializableObject.
|
protected |
Normalizes a scalar value between 0 and 1 (wrt to current parameters)
| val | scalar value |
|
inline |
Access to the range of saturation values.
Relative color scales will only be applied to values inside the [start;stop] intervale.
Definition at line 114 of file ecvScalarField.h.
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), define_ccScalarField(), sfEditDlg::fillDialogWith(), cloudViewer::utility::pybind_scalarfield(), and ccHistogramWindow::refresh().
| void ccScalarField::setColorRampSteps | ( | unsigned | steps | ) |
Sets number of color ramp steps used for display.
Referenced by DistanceMapGenerationDlg::colorScaleChanged(), define_ccScalarField(), cloudViewer::utility::pybind_scalarfield(), and DistanceMapGenerationDlg::update().
| void ccScalarField::setColorScale | ( | ccColorScale::Shared | scale | ) |
Sets associated color scale.
Referenced by ccColorFromScalarDlg::ccColorFromScalarDlg(), DistanceMapGenerationDlg::colorScaleChanged(), ccEntityAction::convertNormalsTo(), define_ccScalarField(), qPCV::doAction(), DistanceMapGenerationDlg::exportMapAsCloud(), ccRasterizeTool::generateHillshade(), LoadScan(), ccColorFromScalarDlg::maxChanged(), ccColorFromScalarDlg::minChanged(), ccColorScaleEditorDialog::onApply(), CommandSFColorScale::process(), PCVCommand::Process(), ccColorScaleEditorDialog::saveCurrentScale(), ccColorFromScalarDlg::setDefaultSatValuePerChannel(), DistanceMapGenerationDlg::update(), ccColorFromScalarDlg::updateHistogram(), and ccColorFromScalarDlg::~ccColorFromScalarDlg().
|
inline |
Sets the global shift.
Definition at line 236 of file ecvScalarField.h.
Referenced by define_ccScalarField(), SimpleBinFilter::loadFile(), and cloudViewer::utility::pybind_scalarfield().
| void ccScalarField::setLogScale | ( | bool | state | ) |
Sets whether scale is logarithmic or not.
Referenced by define_ccScalarField(), sfEditDlg::logScaleChanged(), and cloudViewer::utility::pybind_scalarfield().
| void ccScalarField::setMaxDisplayed | ( | ScalarType | val | ) |
Sets the maximum displayed value.
Referenced by define_ccScalarField(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::setMaxDispValue(), and ccColorFromScalarDlg::~ccColorFromScalarDlg().
| void ccScalarField::setMinDisplayed | ( | ScalarType | val | ) |
Sets the minimum displayed value.
Referenced by qM3C2Process::Compute(), define_ccScalarField(), CommandStatTest::process(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::setMinDispValue(), ccEntityAction::statisticalTest(), and ccColorFromScalarDlg::~ccColorFromScalarDlg().
|
inline |
Sets modification flag state.
Definition at line 217 of file ecvScalarField.h.
Referenced by define_ccScalarField(), and cloudViewer::utility::pybind_scalarfield().
| void ccScalarField::setSaturationStart | ( | ScalarType | val | ) |
Sets the value at which to start color gradient.
Referenced by define_ccScalarField(), E57Filter::loadFile(), CommandStatTest::process(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::setMinSatValue(), ccEntityAction::statisticalTest(), ccColorFromScalarDlg::updateHistogram(), and ccColorFromScalarDlg::~ccColorFromScalarDlg().
| void ccScalarField::setSaturationStop | ( | ScalarType | val | ) |
Sets the value at which to stop color gradient.
Referenced by define_ccScalarField(), E57Filter::loadFile(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::setMaxSatValue(), ccColorFromScalarDlg::updateHistogram(), and ccColorFromScalarDlg::~ccColorFromScalarDlg().
| void ccScalarField::setSymmetricalScale | ( | bool | state | ) |
Sets whether the color scale should be symmetrical or not.
For relative color scales only.
Referenced by qM3C2Process::Compute(), ccLibAlgorithms::ComputeGeomCharacteristic(), ccVolumeCalcTool::convertGridToCloud(), ccVolumeCalcTool::ConvertGridToCloud(), define_ccScalarField(), CommandStatTest::process(), cloudViewer::utility::pybind_scalarfield(), ccEntityAction::statisticalTest(), and sfEditDlg::symmetricalScaleChanged().
| void ccScalarField::showNaNValuesInGrey | ( | bool | state | ) |
Sets whether NaN/out of displayed range values should be displayed in gray or hidden
Referenced by define_ccScalarField(), qPoissonRecon::doAction(), sfEditDlg::nanInGrayChanged(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Returns whether the color scale s symmetrical or not.
For relative color scales only.
Definition at line 174 of file ecvScalarField.h.
Referenced by define_ccScalarField(), sfEditDlg::fillDialogWith(), cloudViewer::utility::pybind_scalarfield(), ccHistogramWindow::refresh(), and sfEditDlg::symmetricalScaleChanged().
|
overridevirtual |
Saves data to binary stream.
| out | output file (already opened) |
| dataVersion | target file version (for forward/backward compatibility) |
Reimplemented from ccSerializableObject.
|
protected |
Updates saturation values.
|
protected |
Whether 0 should always appear in associated color ramp.
Definition at line 280 of file ecvScalarField.h.
|
protected |
Number of color ramps steps (for display)
Definition at line 286 of file ecvScalarField.h.
|
protected |
Active color ramp (for display)
Definition at line 283 of file ecvScalarField.h.
|
protected |
Displayed values range.
Definition at line 256 of file ecvScalarField.h.
|
protected |
Global shift.
Definition at line 298 of file ecvScalarField.h.
|
protected |
Associated histogram values (for display)
Definition at line 289 of file ecvScalarField.h.
|
protected |
saturation values range (log scale mode)
For log scale color mapping with relative scales.
Definition at line 266 of file ecvScalarField.h.
|
protected |
Whether scale is logarithmic or not.
Definition at line 277 of file ecvScalarField.h.
|
protected |
Modification flag.
Any modification to the scalar field values or parameters will turn this flag on.
Definition at line 295 of file ecvScalarField.h.
|
protected |
Saturation values range.
For color mapping with relative scales.
Definition at line 261 of file ecvScalarField.h.
|
protected |
Whether NaN values are shown in grey or are hidden.
Definition at line 269 of file ecvScalarField.h.
|
protected |
Whether color scale is symmetrical or not.
For relative color scales only.
Definition at line 274 of file ecvScalarField.h.