VTK
9.1.0
|
Superclass for mapping scalar values to colors. More...
#include <vtkScalarsToColors.h>
Public Types | |
enum | VectorModes { MAGNITUDE = 0 , COMPONENT = 1 , RGBCOLORS = 2 } |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. More... | |
vtkScalarsToColors * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | Build () |
Perform any processing required (if any) before processing scalars. More... | |
virtual const unsigned char * | MapValue (double v) |
Map one value through the lookup table and return a color defined as an RGBA unsigned char tuple (4 bytes). More... | |
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 in the rgb argument. More... | |
double * | GetColor (double v) |
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1. More... | |
virtual double | GetOpacity (double v) |
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1. More... | |
double | GetLuminance (double x) |
Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0.11*blue as a double between 0 and 1. More... | |
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. More... | |
void | MapVectorsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output, int outputFormat) |
Map a set of scalars through the lookup table in a single operation. More... | |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output) |
void | MapScalarsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) |
virtual void | MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) |
An internal method typically not used in applications. More... | |
virtual void | DeepCopy (vtkScalarsToColors *o) |
Copy the contents from another object. More... | |
virtual int | UsingLogScale () |
This should return 1 is the subclass is using log scale for mapping scalars to colors. More... | |
virtual vtkIdType | GetNumberOfAvailableColors () |
Get the number of available colors for mapping to. More... | |
virtual vtkIdType | SetAnnotation (vtkVariant value, vtkStdString annotation) |
Add a new entry (or change an existing entry) to the list of annotated values. More... | |
virtual vtkIdType | SetAnnotation (vtkStdString value, vtkStdString annotation) |
This variant of SetAnnotation accepts the value as a string so ParaView can treat annotations as string vector arrays. More... | |
vtkIdType | GetNumberOfAnnotatedValues () |
Return the annotated value at a particular index in the list of annotations. More... | |
vtkVariant | GetAnnotatedValue (vtkIdType idx) |
Return the annotated value at a particular index in the list of annotations. More... | |
vtkStdString | GetAnnotation (vtkIdType idx) |
Return the annotation at a particular index in the list of annotations. More... | |
virtual void | GetAnnotationColor (const vtkVariant &val, double rgba[4]) |
Obtain the color associated with a particular annotated value (or NanColor if unmatched). More... | |
vtkIdType | GetAnnotatedValueIndex (vtkVariant val) |
Return the index of the given value in the list of annotated values (or -1 if not present). More... | |
vtkIdType | GetAnnotatedValueIndexInternal (const vtkVariant &val) |
Look up an index into the array of annotations given a value. More... | |
virtual void | GetIndexedColor (vtkIdType i, double rgba[4]) |
Get the "indexed color" assigned to an index. More... | |
virtual bool | RemoveAnnotation (vtkVariant value) |
Remove an existing entry from the list of annotated values. More... | |
virtual void | ResetAnnotations () |
Remove all existing values and their annotations. More... | |
virtual int | IsOpaque () |
Return true if all of the values defining the mapping have an opacity equal to 1. More... | |
virtual int | IsOpaque (vtkAbstractArray *scalars, int colorMode, int component) |
Return true if all of the values defining the mapping have an opacity equal to 1. More... | |
virtual double * | GetRange () |
Sets/Gets the range of scalars that will be mapped. More... | |
virtual void | SetRange (double min, double max) |
Sets/Gets the range of scalars that will be mapped. More... | |
virtual void | SetRange (const double rng[2]) |
Sets/Gets the range of scalars that will be mapped. More... | |
virtual void | SetAlpha (double alpha) |
Specify an additional opacity (alpha) value to blend with. More... | |
virtual double | GetAlpha () |
Specify an additional opacity (alpha) value to blend with. More... | |
virtual vtkUnsignedCharArray * | MapScalars (vtkDataArray *scalars, int colorMode, int component, int outputFormat=VTK_RGBA) |
Internal methods that map a data array into an unsigned char array. More... | |
virtual vtkUnsignedCharArray * | MapScalars (vtkAbstractArray *scalars, int colorMode, int component, int outputFormat=VTK_RGBA) |
Internal methods that map a data array into an unsigned char array. More... | |
virtual void | SetVectorMode (int) |
Change mode that maps vectors by magnitude vs. More... | |
virtual int | GetVectorMode () |
Change mode that maps vectors by magnitude vs. More... | |
void | SetVectorModeToMagnitude () |
Change mode that maps vectors by magnitude vs. More... | |
void | SetVectorModeToComponent () |
Change mode that maps vectors by magnitude vs. More... | |
void | SetVectorModeToRGBColors () |
Change mode that maps vectors by magnitude vs. More... | |
virtual void | SetVectorComponent (int) |
If the mapper does not select which component of a vector to map to colors, you can specify it here. More... | |
virtual int | GetVectorComponent () |
If the mapper does not select which component of a vector to map to colors, you can specify it here. More... | |
virtual void | SetVectorSize (int) |
When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components. More... | |
virtual int | GetVectorSize () |
When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components. More... | |
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 as a set of annotations to add to a scalar array (when IndexedLookup is false). More... | |
virtual vtkAbstractArray * | GetAnnotatedValues () |
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false). More... | |
virtual vtkStringArray * | GetAnnotations () |
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false). More... | |
virtual void | SetIndexedLookup (vtkTypeBool) |
Set/get whether the lookup table is for categorical or ordinal data. More... | |
virtual vtkTypeBool | GetIndexedLookup () |
Set/get whether the lookup table is for categorical or ordinal data. More... | |
virtual void | IndexedLookupOn () |
Set/get whether the lookup table is for categorical or ordinal data. More... | |
virtual void | IndexedLookupOff () |
Set/get whether the lookup table is for categorical or ordinal data. More... | |
template<> | |
unsigned char | ColorToUChar (double t) |
Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255. More... | |
template<> | |
unsigned char | ColorToUChar (float t) |
Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. More... | |
virtual void | DebugOff () |
Turn debugging output off. More... | |
bool | GetDebug () |
Get the value of the debug flag. More... | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. More... | |
virtual void | Modified () |
Update the modification time for this object. More... | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. More... | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. More... | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. More... | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More... | |
virtual void | Delete () |
Delete a VTK object. More... | |
virtual void | FastDelete () |
Delete a reference to this object. More... | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. More... | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). More... | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). More... | |
int | GetReferenceCount () |
Return the current reference count of this object. More... | |
void | SetReferenceCount (int) |
Sets the reference count. More... | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. More... | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
Static Public Member Functions | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkScalarsToColors * | SafeDownCast (vtkObjectBase *o) |
static vtkScalarsToColors * | New () |
template<typename T > | |
static unsigned char | ColorToUChar (T t) |
Converts a color from numeric type T to uchar. More... | |
template<typename T > | |
static void | ColorToUChar (T t, unsigned char *dest) |
Converts a color from numeric type T to uchar. More... | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. More... | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. More... | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More... | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More... | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More... | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkScalarsToColors () | |
~vtkScalarsToColors () override | |
void | MapColorsToColors (void *input, unsigned char *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize, int outputFormat) |
An internal method that assumes that the input already has the right colors, and only remaps the range to [0,255] and pads to the desired output format. More... | |
vtkUnsignedCharArray * | ConvertToRGBA (vtkDataArray *colors, int numComp, int numTuples) |
An internal method used to convert a color array to RGBA. More... | |
void | MapVectorsToMagnitude (void *input, double *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize) |
An internal method for converting vectors to magnitudes, used as a preliminary step before doing magnitude mapping. More... | |
virtual vtkIdType | CheckForAnnotatedValue (vtkVariant value) |
Allocate annotation arrays if needed, then return the index of the given value or -1 if not present. More... | |
virtual void | UpdateAnnotatedValueMap () |
Update the map from annotated values to indices in the array of annotations. More... | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. More... | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. More... | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkAbstractArray * | AnnotatedValues |
vtkStringArray * | Annotations |
vtkInternalAnnotatedValueList * | AnnotatedValueList |
vtkTypeBool | IndexedLookup |
double | Alpha |
int | VectorMode |
int | VectorComponent |
int | VectorSize |
int | UseMagnitude |
unsigned char | RGBABytes [4] |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Additional Inherited Members | |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
Superclass for mapping scalar values to colors.
vtkScalarsToColors is a general-purpose base class for objects that convert scalars to colors. This include vtkLookupTable classes and color transfer functions. By itself, this class will simply rescale the scalars.
The scalar-to-color mapping can be augmented with an additional uniform alpha blend. This is used, for example, to blend a vtkActor's opacity with the lookup table values.
Specific scalar values may be annotated with text strings that will be included in color legends using SetAnnotations, SetAnnotation, GetNumberOfAnnotatedValues, GetAnnotatedValue, GetAnnotation, RemoveAnnotation, and ResetAnnotations.
This class also has a method for indicating that the set of annotated values form a categorical color map; by setting IndexedLookup to true, you indicate that the annotated values are the only valid values for which entries in the color table should be returned. In this mode, subclasses should then assign colors to annotated values by taking the modulus of an annotated value's index in the list of annotations with the number of colors in the table.
Definition at line 108 of file vtkScalarsToColors.h.
Definition at line 111 of file vtkScalarsToColors.h.
Enumerator | |
---|---|
MAGNITUDE | |
COMPONENT | |
RGBCOLORS |
Definition at line 231 of file vtkScalarsToColors.h.
|
protected |
|
overrideprotected |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class.
Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObjectBase.
Reimplemented in vtkLookupTable, vtkColorTransferFunction, vtkDiscretizableColorTransferFunction, vtkLogLookupTable, vtkLookupTableWithEnabling, and vtkWindowLevelLookupTable.
|
static |
|
protectedvirtual |
vtkScalarsToColors * vtkScalarsToColors::NewInstance | ( | ) | const |
|
overridevirtual |
Methods invoked by print to print information about the object including superclasses.
Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject.
Reimplemented in vtkColorTransferFunction, vtkDiscretizableColorTransferFunction, vtkLogLookupTable, vtkLookupTableWithEnabling, and vtkWindowLevelLookupTable.
|
static |
|
virtual |
Return true if all of the values defining the mapping have an opacity equal to 1.
Default implementation returns true. The more complex signature will yield more accurate results.
Reimplemented in vtkLookupTable, and vtkDiscretizableColorTransferFunction.
|
virtual |
Return true if all of the values defining the mapping have an opacity equal to 1.
Default implementation returns true. The more complex signature will yield more accurate results.
Reimplemented in vtkLookupTable, and vtkDiscretizableColorTransferFunction.
|
inlinevirtual |
Perform any processing required (if any) before processing scalars.
Default implementation does nothing.
Reimplemented in vtkLookupTable, and vtkDiscretizableColorTransferFunction.
Definition at line 129 of file vtkScalarsToColors.h.
|
virtual |
Sets/Gets the range of scalars that will be mapped.
Reimplemented in vtkLookupTable, and vtkColorTransferFunction.
|
virtual |
Sets/Gets the range of scalars that will be mapped.
Reimplemented in vtkLookupTable, and vtkColorTransferFunction.
|
inlinevirtual |
Sets/Gets the range of scalars that will be mapped.
Reimplemented in vtkLookupTable, and vtkColorTransferFunction.
Definition at line 137 of file vtkScalarsToColors.h.
|
virtual |
Map one value through the lookup table and return a color defined as an RGBA unsigned char tuple (4 bytes).
Reimplemented in vtkLookupTable, vtkColorTransferFunction, and vtkDiscretizableColorTransferFunction.
|
virtual |
Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1 in the rgb argument.
Reimplemented in vtkLookupTable, vtkDiscretizableColorTransferFunction, and vtkColorTransferFunction.
|
inline |
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
Definition at line 156 of file vtkScalarsToColors.h.
|
virtual |
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.
This implementation always returns 1.
Reimplemented in vtkLookupTable, and vtkDiscretizableColorTransferFunction.
|
inline |
Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0.11*blue as a double between 0 and 1.
Returns the luminance value for the specified scalar value.
Definition at line 174 of file vtkScalarsToColors.h.
|
virtual |
Specify an additional opacity (alpha) value to blend with.
Values != 1 modify the resulting color consistent with the requested form of the output. This is typically used by an actor in order to blend its opacity. Value is clamped between 0 and 1.
Reimplemented in vtkDiscretizableColorTransferFunction.
|
virtual |
Specify an additional opacity (alpha) value to blend with.
Values != 1 modify the resulting color consistent with the requested form of the output. This is typically used by an actor in order to blend its opacity. Value is clamped between 0 and 1.
|
virtual |
Internal methods that map a data array into an unsigned char array.
The output format can be set to VTK_RGBA (4 components), VTK_RGB (3 components), VTK_LUMINANCE (1 component, greyscale), or VTK_LUMINANCE_ALPHA (2 components). If not supplied, the output format defaults to RGBA. The color mode determines the behavior of mapping. If VTK_COLOR_MODE_DEFAULT is set, then unsigned char data arrays are treated as colors (and converted to RGBA if necessary); If VTK_COLOR_MODE_DIRECT_SCALARS is set, then all arrays are treated as colors (integer types are clamped in the range 0-255, floating point arrays are clamped in the range 0.0-1.0. Note 'char' does not have enough values to represent a color so mapping this type is considered an error); otherwise, the data is mapped through this instance of ScalarsToColors. The component argument is used for data arrays with more than one component; it indicates which component to use to do the blending. When the component argument is -1, then the this object uses its own selected technique to change a vector into a scalar to map.
|
virtual |
Internal methods that map a data array into an unsigned char array.
The output format can be set to VTK_RGBA (4 components), VTK_RGB (3 components), VTK_LUMINANCE (1 component, greyscale), or VTK_LUMINANCE_ALPHA (2 components). If not supplied, the output format defaults to RGBA. The color mode determines the behavior of mapping. If VTK_COLOR_MODE_DEFAULT is set, then unsigned char data arrays are treated as colors (and converted to RGBA if necessary); If VTK_COLOR_MODE_DIRECT_SCALARS is set, then all arrays are treated as colors (integer types are clamped in the range 0-255, floating point arrays are clamped in the range 0.0-1.0. Note 'char' does not have enough values to represent a color so mapping this type is considered an error); otherwise, the data is mapped through this instance of ScalarsToColors. The component argument is used for data arrays with more than one component; it indicates which component to use to do the blending. When the component argument is -1, then the this object uses its own selected technique to change a vector into a scalar to map.
|
virtual |
Change mode that maps vectors by magnitude vs.
component. If the mode is "RGBColors", then the vectors components are scaled to the range and passed directly as the colors.
|
virtual |
Change mode that maps vectors by magnitude vs.
component. If the mode is "RGBColors", then the vectors components are scaled to the range and passed directly as the colors.
void vtkScalarsToColors::SetVectorModeToMagnitude | ( | ) |
Change mode that maps vectors by magnitude vs.
component. If the mode is "RGBColors", then the vectors components are scaled to the range and passed directly as the colors.
void vtkScalarsToColors::SetVectorModeToComponent | ( | ) |
Change mode that maps vectors by magnitude vs.
component. If the mode is "RGBColors", then the vectors components are scaled to the range and passed directly as the colors.
void vtkScalarsToColors::SetVectorModeToRGBColors | ( | ) |
Change mode that maps vectors by magnitude vs.
component. If the mode is "RGBColors", then the vectors components are scaled to the range and passed directly as the colors.
|
virtual |
If the mapper does not select which component of a vector to map to colors, you can specify it here.
|
virtual |
If the mapper does not select which component of a vector to map to colors, you can specify it here.
|
virtual |
When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components.
Set to -1 to map all components. If this is not set to -1, then you can use SetVectorComponent to set which scalar component will be the first component in the vector to be mapped.
|
virtual |
When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components.
Set to -1 to map all components. If this is not set to -1, then you can use SetVectorComponent to set which scalar component will be the first component in the vector to be mapped.
void vtkScalarsToColors::MapVectorsThroughTable | ( | void * | input, |
unsigned char * | output, | ||
int | inputDataType, | ||
int | numberOfValues, | ||
int | inputIncrement, | ||
int | outputFormat, | ||
int | vectorComponent, | ||
int | vectorSize | ||
) |
Map vectors through the lookup table.
Unlike MapScalarsThroughTable, this method will use the VectorMode to decide how to map vectors. The output format can be set to VTK_RGBA (4 components), VTK_RGB (3 components), VTK_LUMINANCE (1 component, greyscale), or VTK_LUMINANCE_ALPHA (2 components)
|
inline |
Definition at line 268 of file vtkScalarsToColors.h.
void vtkScalarsToColors::MapScalarsThroughTable | ( | vtkDataArray * | scalars, |
unsigned char * | output, | ||
int | outputFormat | ||
) |
Map a set of scalars through the lookup table in a single operation.
This method ignores the VectorMode and the VectorComponent. The output format can be set to VTK_RGBA (4 components), VTK_RGB (3 components), VTK_LUMINANCE (1 component, greyscale), or VTK_LUMINANCE_ALPHA (2 components) If not supplied, the output format defaults to RGBA.
|
inline |
Definition at line 284 of file vtkScalarsToColors.h.
|
inline |
Definition at line 288 of file vtkScalarsToColors.h.
|
virtual |
An internal method typically not used in applications.
This should be a protected function, but it must be kept public for backwards compatibility. Never call this method directly.
Reimplemented in vtkLookupTable, vtkDiscretizableColorTransferFunction, vtkLookupTableWithEnabling, and vtkColorTransferFunction.
|
virtual |
Copy the contents from another object.
Reimplemented in vtkColorTransferFunction, and vtkLookupTable.
|
inlinevirtual |
This should return 1 is the subclass is using log scale for mapping scalars to colors.
Default implementation always returns 0.
Reimplemented in vtkLookupTable, and vtkDiscretizableColorTransferFunction.
Definition at line 312 of file vtkScalarsToColors.h.
|
virtual |
Get the number of available colors for mapping to.
Reimplemented in vtkLookupTable, vtkColorTransferFunction, and vtkDiscretizableColorTransferFunction.
|
virtual |
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
The two arrays must both either be nullptr or of the same length or the call will be ignored.
Note that these arrays are deep copied rather than being used directly in order to support the use case where edits are made. If the values and annotations arrays were held by this class then each call to map scalar values to colors would require us to check the MTime of the arrays.
|
virtual |
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
The two arrays must both either be nullptr or of the same length or the call will be ignored.
Note that these arrays are deep copied rather than being used directly in order to support the use case where edits are made. If the values and annotations arrays were held by this class then each call to map scalar values to colors would require us to check the MTime of the arrays.
|
virtual |
Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
The two arrays must both either be nullptr or of the same length or the call will be ignored.
Note that these arrays are deep copied rather than being used directly in order to support the use case where edits are made. If the values and annotations arrays were held by this class then each call to map scalar values to colors would require us to check the MTime of the arrays.
|
virtual |
Add a new entry (or change an existing entry) to the list of annotated values.
Returns the index of value in the list of annotations.
|
virtual |
This variant of SetAnnotation accepts the value as a string so ParaView can treat annotations as string vector arrays.
vtkIdType vtkScalarsToColors::GetNumberOfAnnotatedValues | ( | ) |
Return the annotated value at a particular index in the list of annotations.
vtkVariant vtkScalarsToColors::GetAnnotatedValue | ( | vtkIdType | idx | ) |
Return the annotated value at a particular index in the list of annotations.
vtkStdString vtkScalarsToColors::GetAnnotation | ( | vtkIdType | idx | ) |
Return the annotation at a particular index in the list of annotations.
|
virtual |
Obtain the color associated with a particular annotated value (or NanColor if unmatched).
vtkIdType vtkScalarsToColors::GetAnnotatedValueIndex | ( | vtkVariant | val | ) |
Return the index of the given value in the list of annotated values (or -1 if not present).
vtkIdType vtkScalarsToColors::GetAnnotatedValueIndexInternal | ( | const vtkVariant & | val | ) |
Look up an index into the array of annotations given a value.
Does no pointer checks. Returns -1 when val
not present.
|
virtual |
Get the "indexed color" assigned to an index.
The index is used in IndexedLookup mode to assign colors to annotations (in the order the annotations were set). Subclasses must implement this and interpret how to treat the index. vtkLookupTable simply returns GetTableValue(index % this->GetNumberOfTableValues()). vtkColorTransferFunction returns the color associated with node index % this->GetSize().
Note that implementations must set the opacity (alpha) component of the color, even if they do not provide opacity values in their colormaps. In that case, alpha = 1 should be used.
Reimplemented in vtkDiscretizableColorTransferFunction, vtkLookupTable, and vtkColorTransferFunction.
|
virtual |
Remove an existing entry from the list of annotated values.
Returns true when the entry was actually removed (i.e., it existed before the call). Otherwise, returns false.
|
virtual |
Remove all existing values and their annotations.
|
virtual |
Set/get whether the lookup table is for categorical or ordinal data.
The default is ordinal data; values not present in the lookup table will be assigned an interpolated color.
When categorical data is present, only values in the lookup table will be considered valid; all other values will be assigned NanColor.
|
virtual |
Set/get whether the lookup table is for categorical or ordinal data.
The default is ordinal data; values not present in the lookup table will be assigned an interpolated color.
When categorical data is present, only values in the lookup table will be considered valid; all other values will be assigned NanColor.
|
virtual |
Set/get whether the lookup table is for categorical or ordinal data.
The default is ordinal data; values not present in the lookup table will be assigned an interpolated color.
When categorical data is present, only values in the lookup table will be considered valid; all other values will be assigned NanColor.
|
virtual |
Set/get whether the lookup table is for categorical or ordinal data.
The default is ordinal data; values not present in the lookup table will be assigned an interpolated color.
When categorical data is present, only values in the lookup table will be considered valid; all other values will be assigned NanColor.
|
inlinestatic |
Converts a color from numeric type T to uchar.
We assume the integral type is already in the range 0-255. If it is not, behavior is undefined. Floating point types are assumed to be in interval 0.0-1.0
Definition at line 430 of file vtkScalarsToColors.h.
|
inlinestatic |
Converts a color from numeric type T to uchar.
We assume the integral type is already in the range 0-255. If it is not, behavior is undefined. Floating point types are assumed to be in interval 0.0-1.0
Definition at line 435 of file vtkScalarsToColors.h.
|
protected |
An internal method that assumes that the input already has the right colors, and only remaps the range to [0,255] and pads to the desired output format.
If the input has 1 or 2 components, the first component will be duplicated if the output format is RGB or RGBA. If the input has 2 or 4 components, the last component will be used for the alpha if the output format is RGBA or LuminanceAlpha. If the input has 3 or 4 components but the output is Luminance or LuminanceAlpha, then the components will be combined to compute the luminance. Any components past the fourth component will be ignored.
|
protected |
An internal method used to convert a color array to RGBA.
The method instantiates a vtkUnsignedCharArray and returns it. The user is responsible for managing the memory.
|
protected |
An internal method for converting vectors to magnitudes, used as a preliminary step before doing magnitude mapping.
|
protectedvirtual |
Allocate annotation arrays if needed, then return the index of the given value or -1 if not present.
|
protectedvirtual |
Update the map from annotated values to indices in the array of annotations.
|
inline |
Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255.
Definition at line 521 of file vtkScalarsToColors.h.
|
inline |
Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255.
Definition at line 526 of file vtkScalarsToColors.h.
|
protected |
Definition at line 486 of file vtkScalarsToColors.h.
|
protected |
Definition at line 487 of file vtkScalarsToColors.h.
|
protected |
Definition at line 490 of file vtkScalarsToColors.h.
|
protected |
Definition at line 492 of file vtkScalarsToColors.h.
|
protected |
Definition at line 494 of file vtkScalarsToColors.h.
|
protected |
Definition at line 497 of file vtkScalarsToColors.h.
|
protected |
Definition at line 498 of file vtkScalarsToColors.h.
|
protected |
Definition at line 499 of file vtkScalarsToColors.h.
|
protected |
Definition at line 502 of file vtkScalarsToColors.h.
|
protected |
Definition at line 504 of file vtkScalarsToColors.h.