VAPOR3 3.9.4
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
VAPoR::MapperFunction Class Reference

Parent class for TransferFunction and IsoControl, supports positioning histogram over color/opacity maps as well as a set of isovalues (as with Contours) More...

#include <MapperFunction.h>

Inheritance diagram for VAPoR::MapperFunction:
VAPoR::ParamsBase Wasp::MyBase

Public Types

enum  CompositionType { ADDITION = 0 , MULTIPLICATION = 1 }
 Opacity composition types. More...
 
- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 

Public Member Functions

 MapperFunction (ParamsBase::StateSave *ssave)
 
 MapperFunction (ParamsBase::StateSave *ssave, XmlNode *node)
 
 MapperFunction (const MapperFunction &rhs)
 
MapperFunctionoperator= (const MapperFunction &rhs)
 
virtual ~MapperFunction ()
 
int SaveToFile (string path)
 
int LoadFromFile (string path)
 
int LoadColormapFromFile (string path)
 
float getOpacityValueData (float point) const
 
void hsvValue (float point, float *h, float *sat, float *val) const
 
void rgbValue (float point, float rgb[3]) const
 
void rgbaValue (float point, float rgba[4]) const
 
void setOpaque ()
 Make the opacity map completely opaque (opacity 1)
 
bool isOpaque () const
 
void makeLut (float *clut) const
 
void makeLut (std::vector< float > &clut) const
 
std::vector< float > makeLut () const
 
float getMinMapValue () const
 
float getMaxMapValue () const
 
void setMinMaxMapValue (float val1, float val2)
 
void setMinMapValue (float val)
 
void setMaxMapValue (float val)
 
vector< double > getMinMaxMapValue () const
 
vector< double > GetCustomMappingSliderRange () const
 Returns size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.
 
bool IsUsingCustomMappingSliderRange () const
 
void SetCustomMappingSliderRange (const vector< double > &range)
 Set the size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.
 
void SetUsingCustomMappingSliderRange (bool b)
 
virtual OpacityMapcreateOpacityMap (OpacityMap::Type type=OpacityMap::CONTROL_POINT)
 
void DeleteOpacityMap (const OpacityMap *omap)
 
virtual OpacityMapGetOpacityMap (int index) const
 
int getNumOpacityMaps () const
 
void setOpacityScale (double val)
 
double getOpacityScale () const
 
void setOpacityComposition (CompositionType t)
 
CompositionType getOpacityComposition () const
 
int getNumEntries () const
 
int mapFloatToIndex (float point) const
 
float mapIndexToFloat (int indx) const
 
TFInterpolator::type getColorInterpType ()
 
void setColorInterpType (TFInterpolator::type t)
 
void setUseWhitespace (int state)
 
int getUseWhitespace () const
 
virtual ColorMapGetColorMap () const
 
bool GetAutoUpdateHisto ()
 
void SetAutoUpdateHisto (bool val)
 
bool GetSecondaryVarMapper ()
 
void SetSecondaryVarMapper (bool val)
 
- Public Member Functions inherited from VAPoR::ParamsBase
 ParamsBase (StateSave *ssave, const string &classname)
 
 ParamsBase (StateSave *ssave, XmlNode *node)
 
 ParamsBase (const ParamsBase &rhs)
 Copy constructor.
 
ParamsBaseoperator= (const ParamsBase &rhs)
 
 ParamsBase (ParamsBase &&)=delete
 
ParamsBaseoperator= (ParamsBase &)=delete
 
bool operator== (const ParamsBase &rhs) const
 Equivalence operator.
 
bool operator!= (const ParamsBase &rhs) const
 
virtual ~ParamsBase ()
 
void SetParent (ParamsBase *parent)
 
XmlNodeGetNode () const
 
void BeginGroup (const string &description)
 
void EndGroup ()
 
void IntermediateChange ()
 
virtual vector< long > GetValueLongVec (const string tag) const
 
virtual vector< long > GetValueLongVec (const string tag, const vector< long > &defaultVal) const
 
virtual long GetValueLong (const string tag, long defaultVal) const
 
virtual vector< double > GetValueDoubleVec (const string tag) const
 
virtual vector< double > GetValueDoubleVec (const string tag, const vector< double > &defaultVal) const
 
virtual double GetValueDouble (const string tag, double defaultVal) const
 
virtual vector< string > GetValueStringVec (const string tag) const
 
virtual vector< string > GetValueStringVec (const string tag, const vector< string > &defaultVal) const
 
virtual string GetValueString (const string tag, string defaultVal) const
 
virtual void SetValueLongVec (const string &tag, string description, const vector< long > &values)
 
virtual void SetValueLong (const string &tag, string description, long value)
 
virtual void SetValueDoubleVec (const string &tag, string description, const vector< double > &values)
 
virtual void SetValueDouble (const string &tag, string description, double value)
 
virtual void SetValueStringVec (const string &tag, string description, const vector< string > &values)
 
virtual void SetValueString (const string &tag, string description, const string &value)
 
string GetName () const
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Static Public Member Functions

static string GetClassType ()
 
static void hsvToRgb (float *hsv, float *rgb)
 
static void rgbToHsv (float *rgb, float *hsv)
 
static vector< float > rgbToHsv (vector< float > rgb)
 
- Static Public Member Functions inherited from Wasp::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message.
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 
static bool GetEnableErrMsg ()
 

Static Public Attributes

static const string _dataBoundsTag
 
static const string _opacityCompositionTag
 
static const string _opacityScaleTag
 
static const string _opacityMapsTag
 
static const string _opacityMapTag
 
static const string _autoUpdateHistoTag
 
static const string _secondaryVarMapperTag
 
static const string CustomMappingSliderRangeTag
 
static const string IsUsingCustomMappingSliderRangeTag
 
- Static Public Attributes inherited from Wasp::MyBase
static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 

Additional Inherited Members

- Protected Member Functions inherited from VAPoR::ParamsBase
 ParamsBase (StateSave *ssave)
 
void Remove (const string &name)
 
const map< string, string > & GetAttributes ()
 
void Clear ()
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 
- Protected Attributes inherited from VAPoR::ParamsBase
StateSave_ssave
 
XmlNode_node
 

Detailed Description

Parent class for TransferFunction and IsoControl, supports positioning histogram over color/opacity maps as well as a set of isovalues (as with Contours)

Author
Alan Norton
Version
3.0
Date
January 2016

Definition at line 43 of file MapperFunction.h.

Member Enumeration Documentation

◆ CompositionType

Opacity composition types.

Enumerator
ADDITION 
MULTIPLICATION 

Definition at line 175 of file MapperFunction.h.

Constructor & Destructor Documentation

◆ MapperFunction() [1/3]

VAPoR::MapperFunction::MapperFunction ( ParamsBase::StateSave ssave)

◆ MapperFunction() [2/3]

VAPoR::MapperFunction::MapperFunction ( ParamsBase::StateSave ssave,
XmlNode node 
)

◆ MapperFunction() [3/3]

VAPoR::MapperFunction::MapperFunction ( const MapperFunction rhs)

◆ ~MapperFunction()

virtual VAPoR::MapperFunction::~MapperFunction ( )
virtual

Member Function Documentation

◆ createOpacityMap()

virtual OpacityMap * VAPoR::MapperFunction::createOpacityMap ( OpacityMap::Type  type = OpacityMap::CONTROL_POINT)
virtual

Create an opacity map for this transfer function

Parameters
[in]typeof opacity map

◆ DeleteOpacityMap()

void VAPoR::MapperFunction::DeleteOpacityMap ( const OpacityMap omap)

Delete an opacity map from this transfer function

Parameters
[in]omapPointer to map to delete

◆ GetAutoUpdateHisto()

bool VAPoR::MapperFunction::GetAutoUpdateHisto ( )
inline

Method to get the state of the automatic histogram update setting.

Returns
The state of the autoUpdateHisto checkbox

Definition at line 254 of file MapperFunction.h.

◆ GetClassType()

static string VAPoR::MapperFunction::GetClassType ( )
inlinestatic

Definition at line 69 of file MapperFunction.h.

◆ getColorInterpType()

TFInterpolator::type VAPoR::MapperFunction::getColorInterpType ( )
inline

Obtain the color interpolation type

Returns
TFInterpolator::type color interpolation type

Definition at line 219 of file MapperFunction.h.

References VAPoR::ColorMap::GetInterpType().

◆ GetColorMap()

virtual ColorMap * VAPoR::MapperFunction::GetColorMap ( ) const
inlinevirtual

Method to get the Color Map from the Mapper Function

Returns
ColorMap pointer to the Color Map

Definition at line 248 of file MapperFunction.h.

◆ GetCustomMappingSliderRange()

vector< double > VAPoR::MapperFunction::GetCustomMappingSliderRange ( ) const

Returns size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.

◆ getMaxMapValue()

float VAPoR::MapperFunction::getMaxMapValue ( ) const
inline

Obtain maximum mapping (histo) value

Returns
Maximum mapping value

Definition at line 125 of file MapperFunction.h.

◆ getMinMapValue()

float VAPoR::MapperFunction::getMinMapValue ( ) const
inline

Obtain minimum mapping (histo) value

Returns
Minimum mapping value

Definition at line 121 of file MapperFunction.h.

◆ getMinMaxMapValue()

vector< double > VAPoR::MapperFunction::getMinMaxMapValue ( ) const

Obtain min and max mapping (histo) values

Returns
minimum and maximum as a 2-vector of doubles

◆ getNumEntries()

int VAPoR::MapperFunction::getNumEntries ( ) const
inline

Obtain the number of entries in the color/opacity map

Returns
number of entries

Definition at line 198 of file MapperFunction.h.

◆ getNumOpacityMaps()

int VAPoR::MapperFunction::getNumOpacityMaps ( ) const
inline

Determine how many opacity maps are available

Returns
number of opacity maps

Definition at line 164 of file MapperFunction.h.

◆ getOpacityComposition()

CompositionType VAPoR::MapperFunction::getOpacityComposition ( ) const
inline

Obtain the type of opacity composition (ADDITION or MULTIPLICATION)

Returns
CompositionType

Definition at line 183 of file MapperFunction.h.

◆ GetOpacityMap()

virtual OpacityMap * VAPoR::MapperFunction::GetOpacityMap ( int  index) const
virtual

Obtain the opacity map associated with an index. specified index identifies which of the opacity maps is requested.

Parameters
[in]indexOpacity map index of desired map.

◆ getOpacityScale()

double VAPoR::MapperFunction::getOpacityScale ( ) const
inline

Identify the current opacity scale factor

Returns
current opacity scale factor

Definition at line 172 of file MapperFunction.h.

◆ getOpacityValueData()

float VAPoR::MapperFunction::getOpacityValueData ( float  point) const

Determine the opacity value at a particular data value

Parameters
[in]pointfloat data value

◆ GetSecondaryVarMapper()

bool VAPoR::MapperFunction::GetSecondaryVarMapper ( )
inline

Method to get the state of whether the current mapper function applies color through a primary variable or secondary variable. For example, Barbs may have a "Color Mapped Variable" that colors the barbs according to a "Secondary variable", independent of the vector variables that define the Barbs. Isosurfaces can have Secondary Variable colorings too.

Definition at line 269 of file MapperFunction.h.

◆ getUseWhitespace()

int VAPoR::MapperFunction::getUseWhitespace ( ) const
inline

Definition at line 240 of file MapperFunction.h.

References VAPoR::ColorMap::GetUseWhitespace().

◆ hsvToRgb()

static void VAPoR::MapperFunction::hsvToRgb ( float *  hsv,
float *  rgb 
)
static

Utility method converts HSV to RGB

Parameters
[in]hsv(HSV as float[3] array)
[out]rgb(RGB as float[3] array)

◆ hsvValue()

void VAPoR::MapperFunction::hsvValue ( float  point,
float *  h,
float *  sat,
float *  val 
) const

Determine the color value (in HSV) at a data point

Parameters
[in]pointData value
[out]hHue
[out]satSaturation
[out]valValue

◆ isOpaque()

bool VAPoR::MapperFunction::isOpaque ( ) const

Determine if the map is totally opaque (opacity 1)

Returns
true if opaque.

◆ IsUsingCustomMappingSliderRange()

bool VAPoR::MapperFunction::IsUsingCustomMappingSliderRange ( ) const

◆ LoadColormapFromFile()

int VAPoR::MapperFunction::LoadColormapFromFile ( string  path)

◆ LoadFromFile()

int VAPoR::MapperFunction::LoadFromFile ( string  path)

Load a transfer function from a file,

Parameters
[in]pathPath of input file

◆ makeLut() [1/3]

std::vector< float > VAPoR::MapperFunction::makeLut ( ) const

◆ makeLut() [2/3]

void VAPoR::MapperFunction::makeLut ( float *  clut) const

Build a color/opacity lookup table. Caller must supply an array to be filled in. Each entry isa 4-tuple: r,g,b,opacity.

Parameters
[out]clutlookup table of size _numEntries*4

◆ makeLut() [3/3]

void VAPoR::MapperFunction::makeLut ( std::vector< float > &  clut) const

◆ mapFloatToIndex()

int VAPoR::MapperFunction::mapFloatToIndex ( float  point) const
inline

Map and quantize a real value to the corresponding table index i.e., quantize to current Mapper function domain

Parameters
[in]pointvalue to be quantized
Returns
quantized value in [0,_numEntries-1]

Definition at line 204 of file MapperFunction.h.

◆ mapIndexToFloat()

float VAPoR::MapperFunction::mapIndexToFloat ( int  indx) const
inline

Determine float value associated with index

Parameters
[in]indxindex (between 0 and _numEntries)
Returns
corresponding float value

Definition at line 215 of file MapperFunction.h.

◆ operator=()

MapperFunction & VAPoR::MapperFunction::operator= ( const MapperFunction rhs)

◆ rgbaValue()

void VAPoR::MapperFunction::rgbaValue ( float  point,
float  rgba[4] 
) const
inline

Determine the color (in RGB) and opacity at a data point

Parameters
[in]pointData value
[out]rgbr,g,b, afloats

Definition at line 95 of file MapperFunction.h.

◆ rgbToHsv() [1/2]

static void VAPoR::MapperFunction::rgbToHsv ( float *  rgb,
float *  hsv 
)
static

Utility method converts RGB to HSV

Parameters
[in]rgb(RGB as float[3] array)
[out]hsv(HSV as float[3] array)

◆ rgbToHsv() [2/2]

static vector< float > VAPoR::MapperFunction::rgbToHsv ( vector< float >  rgb)
static

◆ rgbValue()

void VAPoR::MapperFunction::rgbValue ( float  point,
float  rgb[3] 
) const
inline

Determine the color value (in RGB) at a data point

Parameters
[in]pointData value
[out]rgbr,g,b floats

Definition at line 85 of file MapperFunction.h.

◆ SaveToFile()

int VAPoR::MapperFunction::SaveToFile ( string  path)

Save this transfer function to a file

Parameters
[in]pathPath of output file

◆ SetAutoUpdateHisto()

void VAPoR::MapperFunction::SetAutoUpdateHisto ( bool  val)
inline

Method to set the state of the automatic histogram update setting.

Parameters
[in]Stateof the autoUpdateHisto setting

Definition at line 260 of file MapperFunction.h.

◆ setColorInterpType()

void VAPoR::MapperFunction::setColorInterpType ( TFInterpolator::type  t)
inline

Specify the color interpolation type

Parameters
[in]tcolor interpolation type

Definition at line 228 of file MapperFunction.h.

References VAPoR::ColorMap::SetInterpType().

◆ SetCustomMappingSliderRange()

void VAPoR::MapperFunction::SetCustomMappingSliderRange ( const vector< double > &  range)

Set the size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.

◆ setMaxMapValue()

void VAPoR::MapperFunction::setMaxMapValue ( float  val)
inline

Definition at line 134 of file MapperFunction.h.

◆ setMinMapValue()

void VAPoR::MapperFunction::setMinMapValue ( float  val)
inline

Definition at line 132 of file MapperFunction.h.

◆ setMinMaxMapValue()

void VAPoR::MapperFunction::setMinMaxMapValue ( float  val1,
float  val2 
)

Set both minimum and maximum mapping (histo) values

Parameters
[in]val1minimum value
[in]val2maximum value

◆ setOpacityComposition()

void VAPoR::MapperFunction::setOpacityComposition ( CompositionType  t)
inline

Specify the type of opacity composition (ADDITION or MULTIPLICATION)

Parameters
[in]tCompositionType

Definition at line 179 of file MapperFunction.h.

◆ setOpacityScale()

void VAPoR::MapperFunction::setOpacityScale ( double  val)
inline

Specify an opacity scale factor applied to all opacity maps

Parameters
[in]valopacity scale factor

Definition at line 168 of file MapperFunction.h.

◆ setOpaque()

void VAPoR::MapperFunction::setOpaque ( )

Make the opacity map completely opaque (opacity 1)

◆ SetSecondaryVarMapper()

void VAPoR::MapperFunction::SetSecondaryVarMapper ( bool  val)
inline

Method to set the state of whether the current mapper function applies color through a ColorMappedVariable, or a renderer's primary variable.

Parameters
[in]Stateof the Secondary Variable color setting

Definition at line 276 of file MapperFunction.h.

◆ setUseWhitespace()

void VAPoR::MapperFunction::setUseWhitespace ( int  state)
inline

Definition at line 234 of file MapperFunction.h.

References VAPoR::ColorMap::SetUseWhitespace().

◆ SetUsingCustomMappingSliderRange()

void VAPoR::MapperFunction::SetUsingCustomMappingSliderRange ( bool  b)

Member Data Documentation

◆ _autoUpdateHistoTag

const string VAPoR::MapperFunction::_autoUpdateHistoTag
static

Definition at line 287 of file MapperFunction.h.

◆ _dataBoundsTag

const string VAPoR::MapperFunction::_dataBoundsTag
static

Definition at line 282 of file MapperFunction.h.

◆ _opacityCompositionTag

const string VAPoR::MapperFunction::_opacityCompositionTag
static

Definition at line 283 of file MapperFunction.h.

◆ _opacityMapsTag

const string VAPoR::MapperFunction::_opacityMapsTag
static

Definition at line 285 of file MapperFunction.h.

◆ _opacityMapTag

const string VAPoR::MapperFunction::_opacityMapTag
static

Definition at line 286 of file MapperFunction.h.

◆ _opacityScaleTag

const string VAPoR::MapperFunction::_opacityScaleTag
static

Definition at line 284 of file MapperFunction.h.

◆ _secondaryVarMapperTag

const string VAPoR::MapperFunction::_secondaryVarMapperTag
static

Definition at line 288 of file MapperFunction.h.

◆ CustomMappingSliderRangeTag

const string VAPoR::MapperFunction::CustomMappingSliderRangeTag
static

Definition at line 289 of file MapperFunction.h.

◆ IsUsingCustomMappingSliderRangeTag

const string VAPoR::MapperFunction::IsUsingCustomMappingSliderRangeTag
static

Definition at line 290 of file MapperFunction.h.


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