Go to the documentation of this file.
52 #ifndef vtkScalarsToColors_h
53 #define vtkScalarsToColors_h
55 #include "vtkCommonCoreModule.h"
92 {this->SetRange(rng[0],rng[1]);}
112 {this->GetColor(v,this->RGB);
return this->RGB;}
127 {
double rgb[3]; this->GetColor(x,rgb);
128 return static_cast<double>(rgb[0]*0.30 + rgb[1]*0.59 + rgb[2]*0.11);}
138 vtkGetMacro(Alpha,
double);
172 vtkGetMacro(VectorMode,
int);
190 vtkGetMacro(VectorComponent,
int);
202 vtkGetMacro(VectorSize,
int);
213 int inputDataType,
int numberOfValues,
214 int inputIncrement,
int outputFormat,
215 int vectorComponent,
int vectorSize);
217 int inputDataType,
int numberOfValues,
218 int inputIncrement,
int outputFormat)
219 { this->MapVectorsThroughTable(input, output, inputDataType, numberOfValues,
220 inputIncrement, outputFormat, -1, -1); }
231 unsigned char *output,
234 unsigned char *output)
235 {this->MapScalarsThroughTable(scalars,output,
VTK_RGBA);}
237 int inputDataType,
int numberOfValues,
240 {this->MapScalarsThroughTable2(input, output, inputDataType,
241 numberOfValues, inputIncrement, outputFormat);}
249 int inputDataType,
int numberOfValues,
370 vtkGetMacro(IndexedLookup,
int);
381 template<
typename T>
static
386 template<
typename T>
static
389 *dest = ColorToUChar(t);
410 void MapColorsToColors(
void *input,
unsigned char *output,
411 int inputDataType,
int numberOfValues,
412 int numberOfComponents,
int vectorSize,
428 void MapVectorsToMagnitude(
void *input,
double *output,
429 int inputDataType,
int numberOfValues,
430 int numberOfComponents,
int vectorSize);
442 virtual
void UpdateAnnotatedValueMap();
448 class vtkInternalAnnotatedValueMap;
449 vtkInternalAnnotatedValueMap* AnnotatedValueMap;
463 unsigned char RGBABytes[4];
467 double InputRange[2];
482 return static_cast<unsigned char>(t*255 + 0.5);
487 return static_cast<unsigned char>(t*255 + 0.5);
vtkVariant GetAnnotatedValue(vtkIdType idx)
Return the annotated value at a particular index in the list of annotations.
virtual vtkIdType SetAnnotation(vtkVariant value, vtkStdString annotation)
Add a new entry (or change an existing entry) to the list of annotated values.
static void ColorToUChar(T t, unsigned char *dest)
virtual vtkUnsignedCharArray * MapScalars(vtkDataArray *scalars, int colorMode, int component)
Internal methods that map a data array into a 4-component, unsigned char RGBA array.
virtual unsigned char * MapValue(double v)
Map one value through the lookup table and return a color defined as a RGBA unsigned char tuple (4 by...
dynamic, self-adjusting array of unsigned char
abstract base class for most VTK objects
virtual bool RemoveAnnotation(vtkVariant value)
Remove an existing entry from the list of annotated values.
virtual void Build()
Perform any processing required (if any) before processing scalars.
abstract superclass for arrays of numeric data
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void GetIndexedColor(vtkIdType i, double rgba[4])
Get the "indexed color" assigned to an index.
virtual void SetAlpha(double alpha)
Specify an additional opacity (alpha) value to blend with.
virtual void SetAnnotations(vtkAbstractArray *values, vtkStringArray *annotations)
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or ...
void SetVectorModeToMagnitude()
void MapVectorsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
virtual double GetOpacity(double v)
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0...
~vtkScalarsToColors() override
vtkIdType GetNumberOfAnnotatedValues()
Return the annotated value at a particular index in the list of annotations.
static unsigned char ColorToUChar(T t)
Converts a color from numeric type T to uchar.
void MapScalarsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
virtual void DeepCopy(vtkScalarsToColors *o)
Copy the contents from another object.
void SetVectorModeToComponent()
double * GetColor(double v)
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and ...
a simple class to control print indentation
virtual vtkIdType SetAnnotation(vtkStdString value, vtkStdString annotation)
This variant of SetAnnotation accepts the value as a string so ParaView can treat annotations as stri...
void MapScalarsThroughTable(vtkDataArray *scalars, unsigned char *output, int outputFormat)
Map a set of scalars through the lookup table in a single operation.
virtual void GetAnnotationColor(const vtkVariant &val, double rgba[4])
Obtain the color associated with a particular annotated value (or NanColor if unmatched).
A atomic type representing the union of many types.
virtual void ResetAnnotations()
Remove all existing values and their annotations.
virtual int UsingLogScale()
This should return 1 is the subclass is using log scale for mapping scalars to colors.
Superclass for mapping scalar values to colors.
virtual void SetRange(double min, double max)
virtual void GetColor(double v, double rgb[3])
Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1...
Abstract superclass for all arrays.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
virtual vtkIdType GetNumberOfAvailableColors()
Get the number of available colors for mapping to.
vtkStdString GetAnnotation(vtkIdType idx)
Return the annotation at a particular index in the list of annotations.
void SetRange(double rng[2])
virtual double * GetRange()
Sets/Gets the range of scalars that will be mapped.
double GetLuminance(double x)
Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0....
void MapVectorsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat, int vectorComponent, int vectorSize)
Map vectors through the lookup table.
vtkIdType GetAnnotatedValueIndexInternal(vtkVariant &val)
Look up an index into the array of annotations given a value.
a vtkAbstractArray subclass for strings
virtual void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
An internal method typically not used in applications.
Wrapper around std::string to keep symbols short.
static vtkScalarsToColors * New()
virtual vtkUnsignedCharArray * MapScalars(vtkAbstractArray *scalars, int colorMode, int component)
vtkIdType GetAnnotatedValueIndex(vtkVariant val)
Return the index of the given value in the list of annotated values (or -1 if not present).
void MapScalarsThroughTable(vtkDataArray *scalars, unsigned char *output)
void SetVectorModeToRGBColors()
virtual int IsOpaque()
Return true if all of the values defining the mapping have an opacity equal to 1.