23#ifndef MAPPERFUNCTION_H
24#define MAPPERFUNCTION_H
80 void hsvValue(
float point,
float *h,
float *sat,
float *val)
const;
88 hsvValue(point, hsv, hsv + 1, hsv + 2);
98 hsvValue(point, hsv, hsv + 1, hsv + 2);
100 rgba[3] = getOpacityValueData(point);
168 void setOpacityScale(
double val) { SetValueDouble(_opacityScaleTag,
"Set Opacity Scale", val); }
206 int indx = mapPosition(point, getMinMapValue(), getMaxMapValue(), _numEntries - 1);
207 if (indx < 0) indx = 0;
208 if (indx > _numEntries - 1) indx = _numEntries - 1;
215 float mapIndexToFloat(
int indx)
const {
return (
float)(getMinMapValue() + ((float)indx) * (float)(getMaxMapValue() - getMinMapValue()) / (
float)(_numEntries - 1)); }
223 return TFInterpolator::diverging;
260 void SetAutoUpdateHisto(
bool val) { SetValueLong(_autoUpdateHistoTag,
"enable/disable auto update of histogram", val); }
276 void SetSecondaryVarMapper(
bool val) { SetValueLong(_secondaryVarMapperTag,
"Apply color through a secondary color", val); }
296 const int _numEntries;
307 static int mapPosition(
float x,
float minValue,
float maxValue,
int hSize);
310 string getNewOpacMapTag(
int *tagIndex);
313 string getOpacMapTag(
int index)
const;
316 int getOpacMapNum(
string tag);
318 string _make_omap_name(
int index)
const;
321#ifdef VAPOR3_0_0_ALPHA
366 void Erase(
string name);
370 vector<string> GetNames()
const;
void SetUseWhitespace(bool enabled)
TFInterpolator::type GetInterpType() const
void SetInterpType(TFInterpolator::type t)
bool GetUseWhitespace() const
Parent class for TransferFunction and IsoControl, supports positioning histogram over color/opacity m...
void SetCustomMappingSliderRange(const vector< double > &range)
Set the size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.
void setUseWhitespace(int state)
virtual ~MapperFunction()
int mapFloatToIndex(float point) const
MapperFunction & operator=(const MapperFunction &rhs)
void setOpacityComposition(CompositionType t)
void rgbaValue(float point, float rgba[4]) const
CompositionType getOpacityComposition() const
MapperFunction(ParamsBase::StateSave *ssave, XmlNode *node)
static vector< float > rgbToHsv(vector< float > rgb)
int SaveToFile(string path)
virtual OpacityMap * GetOpacityMap(int index) const
std::vector< float > makeLut() const
static const string _opacityScaleTag
void makeLut(float *clut) const
void setColorInterpType(TFInterpolator::type t)
static const string _opacityMapTag
void SetUsingCustomMappingSliderRange(bool b)
static const string CustomMappingSliderRangeTag
MapperFunction(ParamsBase::StateSave *ssave)
void setMinMapValue(float val)
static const string _autoUpdateHistoTag
virtual ColorMap * GetColorMap() const
bool IsUsingCustomMappingSliderRange() const
void rgbValue(float point, float rgb[3]) const
static string GetClassType()
CompositionType
Opacity composition types.
int getNumEntries() const
vector< double > getMinMaxMapValue() const
void setOpacityScale(double val)
float getOpacityValueData(float point) const
virtual OpacityMap * createOpacityMap(OpacityMap::Type type=OpacityMap::CONTROL_POINT)
static const string _opacityCompositionTag
int LoadColormapFromFile(string path)
void setMaxMapValue(float val)
MapperFunction(const MapperFunction &rhs)
static const string _secondaryVarMapperTag
bool GetAutoUpdateHisto()
bool GetSecondaryVarMapper()
int LoadFromFile(string path)
void SetSecondaryVarMapper(bool val)
TFInterpolator::type getColorInterpType()
float getMinMapValue() const
static void rgbToHsv(float *rgb, float *hsv)
float mapIndexToFloat(int indx) const
int getUseWhitespace() const
void DeleteOpacityMap(const OpacityMap *omap)
static const string IsUsingCustomMappingSliderRangeTag
void hsvValue(float point, float *h, float *sat, float *val) const
float getMaxMapValue() const
static const string _opacityMapsTag
vector< double > GetCustomMappingSliderRange() const
Returns size 2 vector of the users custom slider range. Used by TFMappingRangeSelector.
static void hsvToRgb(float *hsv, float *rgb)
void makeLut(std::vector< float > &clut) const
int getNumOpacityMaps() const
void setMinMaxMapValue(float val1, float val2)
static const string _dataBoundsTag
void setOpaque()
Make the opacity map completely opaque (opacity 1)
void SetAutoUpdateHisto(bool val)
double getOpacityScale() const
Nodes with state in Xml tree representation.
A Params subclass for managing parameters used by Renderers.