qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ccScalarField Class Reference

A scalar field associated to display-related parameters. More...

#include <ccScalarField.h>

Inheritance diagram for ccScalarField:
Inheritance graph
[legend]
Collaboration diagram for ccScalarField:
Collaboration graph
[legend]

Classes

struct  Histogram
 Simple histogram structure. More...
 
struct  Range
 Range structure. More...
 

Public Member Functions

 ccScalarField (const char *name=0)
 Default constructor. More...
 
const RangedisplayRange () const
 Access to the range of displayed values. More...
 
const RangesaturationRange () const
 Access to the range of saturation values. More...
 
const RangelogSaturationRange () 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 colorType * getColor (ScalarType value) const
 Returns the color corresponding to a given value (wrt to the current display parameters) More...
 
const colorType * 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.
 
virtual void computeMinAndMax ()
 
const ccColorScale::SharedgetColorScale () 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 HistogramgetHistogram () const
 Returns associated histogram values (for display)
 
virtual bool isSerializable () const
 Returns whether object is serializable of not.
 
virtual bool toFile (QFile &out) const
 Saves data to binay stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags)
 Loads data from binay stream. More...
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()
 Desctructor.
 

Protected Member Functions

virtual ~ccScalarField ()
 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
 
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)
 

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...
 
- 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...
 

Detailed Description

A scalar field associated to display-related parameters.

Extends the CCLib::ScalarField object.

Constructor & Destructor Documentation

ccScalarField::ccScalarField ( const char *  name = 0)

Default constructor.

Parameters
namescalar field name
virtual ccScalarField::~ccScalarField ( )
inlineprotectedvirtual

Default destructor.

[SHAREABLE] Call 'release' to destroy this object properly.

Member Function Documentation

const Range& ccScalarField::displayRange ( ) const
inline

Access to the range of displayed values.

Values outside of the [start;stop] intervale will either be grey or invisible (see showNaNValuesInGrey).

bool ccScalarField::fromFile ( QFile &  in,
short  dataVersion,
int  flags 
)
virtual

Loads data from binay stream.

Parameters
ininput file (already opened)
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
Returns
success

Reimplemented from ccSerializableObject.

const colorType* ccScalarField::getColor ( ScalarType  value) const
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!

const Range& ccScalarField::logSaturationRange ( ) const
inline

Access to the range of log scale saturation values.

Relative color scales will only be applied to values inside the [start;stop] intervale.

ScalarType ccScalarField::normalize ( ScalarType  val) const
protected

Normalizes a scalar value between 0 and 1 (wrt to current parameters)

Parameters
valscalar value
Returns
a number between 0 and 1 if inside displayed range or -1 otherwise

ValidValue(d) ||

const Range& ccScalarField::saturationRange ( ) const
inline

Access to the range of saturation values.

Relative color scales will only be applied to values inside the [start;stop] intervale.

void ccScalarField::setSymmetricalScale ( bool  state)

Sets whether the color scale should be symmetrical or not.

For relative color scales only.

bool ccScalarField::symmetricalScale ( ) const
inline

Returns whether the color scale s symmetrical or not.

For relative color scales only.

bool ccScalarField::toFile ( QFile &  out) const
virtual

Saves data to binay stream.

Parameters
outoutput file (already opened)
Returns
success

Reimplemented from ccSerializableObject.

Member Data Documentation

Range ccScalarField::m_logSaturationRange
protected

saturation values range (log scale mode)

For log scale color mapping with relative scales.

Range ccScalarField::m_saturationRange
protected

Saturation values range.

For color mapping with relative scales.

bool ccScalarField::m_symmetricalScale
protected

Whether color scale is symmetrical or not.

For relative color scales only.


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