VTK
|
a combination of vtkColorTransferFunction and vtkLookupTable. More...
#include <vtkDiscretizableColorTransferFunction.h>
a combination of vtkColorTransferFunction and vtkLookupTable.
This is a cross between a vtkColorTransferFunction and a vtkLookupTable selectively combining the functionality of both. This class is a vtkColorTransferFunction allowing users to specify the RGB control points that control the color transfer function. At the same time, by setting Discretize to 1 (true), one can force the transfer function to only have NumberOfValues discrete colors.
When IndexedLookup is true, this class behaves differently. The annotated valyes are considered to the be only valid values for which entries in the color table should be returned. The colors for annotated values are those specified using AddIndexedColors. Typically, there must be atleast as many indexed colors specified as the annotations. For backwards compatibility, if no indexed-colors are specified, the colors in the lookup Table are assigned to annotated values by taking the modulus of their index in the list of annotations. If a scalar value is not present in AnnotatedValues, then NanColor will be used.
NOTE: One must call Build() after making any changes to the points in the ColorTransferFunction to ensure that the discrete and non-discrete versions match up.
Definition at line 55 of file vtkDiscretizableColorTransferFunction.h.
Reimplemented from vtkColorTransferFunction.
Definition at line 59 of file vtkDiscretizableColorTransferFunction.h.
static vtkDiscretizableColorTransferFunction* vtkDiscretizableColorTransferFunction::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkColorTransferFunction.
static int vtkDiscretizableColorTransferFunction::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type 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 vtkColorTransferFunction.
virtual int vtkDiscretizableColorTransferFunction::IsA | ( | const char * | name | ) | [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 vtkColorTransferFunction.
static vtkDiscretizableColorTransferFunction* vtkDiscretizableColorTransferFunction::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkColorTransferFunction.
virtual vtkObjectBase* vtkDiscretizableColorTransferFunction::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkColorTransferFunction.
Reimplemented from vtkColorTransferFunction.
void vtkDiscretizableColorTransferFunction::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Print method for vtkColorTransferFunction
Reimplemented from vtkColorTransferFunction.
int vtkDiscretizableColorTransferFunction::IsOpaque | ( | ) | [virtual] |
Return true if all of the values defining the mapping have an opacity equal to 1. Default implementation return true.
Reimplemented from vtkScalarsToColors.
void vtkDiscretizableColorTransferFunction::SetIndexedColor | ( | unsigned int | index, |
const double | rgb[3] | ||
) | [inline] |
Add colors to use when IndexedLookup is true. SetIndexedColor() will automatically call SetNumberOfIndexedColors(index+1) if the current number of indexed colors is not sufficient for the specified index and all will be initialized to with the rgb values passed to this call.
Definition at line 70 of file vtkDiscretizableColorTransferFunction.h.
void vtkDiscretizableColorTransferFunction::SetIndexedColor | ( | unsigned int | index, |
double | r, | ||
double | g, | ||
double | b | ||
) |
Add colors to use when IndexedLookup is true. SetIndexedColor() will automatically call SetNumberOfIndexedColors(index+1) if the current number of indexed colors is not sufficient for the specified index and all will be initialized to with the rgb values passed to this call.
virtual void vtkDiscretizableColorTransferFunction::GetIndexedColor | ( | vtkIdType | i, |
double | rgba[4] | ||
) | [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 assocated 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 from vtkColorTransferFunction.
void vtkDiscretizableColorTransferFunction::SetNumberOfIndexedColors | ( | unsigned int | count | ) |
Set the number of indexed colors. These are used when IndexedLookup is true. If no indexed colors are specified, for backwards compatibility, this class reverts to using the RGBPoints for colors.
Set the number of indexed colors. These are used when IndexedLookup is true. If no indexed colors are specified, for backwards compatibility, this class reverts to using the RGBPoints for colors.
virtual void vtkDiscretizableColorTransferFunction::Build | ( | ) | [virtual] |
Generate discretized lookup table, if applicable. This method must be called after changes to the ColorTransferFunction otherwise the discretized version will be inconsistent with the non-discretized one.
Reimplemented from vtkScalarsToColors.
virtual void vtkDiscretizableColorTransferFunction::SetDiscretize | ( | int | ) | [virtual] |
Set if the values are to mapped after discretization. The number of discrete values is set by using SetNumberOfValues(). Not set by default, i.e. color value is determined by interpolating at the scalar value.
virtual int vtkDiscretizableColorTransferFunction::GetDiscretize | ( | ) | [virtual] |
Set if the values are to mapped after discretization. The number of discrete values is set by using SetNumberOfValues(). Not set by default, i.e. color value is determined by interpolating at the scalar value.
virtual void vtkDiscretizableColorTransferFunction::DiscretizeOn | ( | ) | [virtual] |
Set if the values are to mapped after discretization. The number of discrete values is set by using SetNumberOfValues(). Not set by default, i.e. color value is determined by interpolating at the scalar value.
virtual void vtkDiscretizableColorTransferFunction::DiscretizeOff | ( | ) | [virtual] |
Set if the values are to mapped after discretization. The number of discrete values is set by using SetNumberOfValues(). Not set by default, i.e. color value is determined by interpolating at the scalar value.
virtual void vtkDiscretizableColorTransferFunction::SetUseLogScale | ( | int | useLogScale | ) | [virtual] |
Get/Set if log scale must be used while mapping scalars to colors. The default is 0.
virtual int vtkDiscretizableColorTransferFunction::GetUseLogScale | ( | ) | [virtual] |
Get/Set if log scale must be used while mapping scalars to colors. The default is 0.
virtual void vtkDiscretizableColorTransferFunction::SetNumberOfValues | ( | vtkIdType | ) | [virtual] |
Set the number of values i.e. colors to be generated in the discrete lookup table. This has no effect if Discretize is off. The default is
virtual vtkIdType vtkDiscretizableColorTransferFunction::GetNumberOfValues | ( | ) | [virtual] |
Set the number of values i.e. colors to be generated in the discrete lookup table. This has no effect if Discretize is off. The default is
virtual unsigned char* vtkDiscretizableColorTransferFunction::MapValue | ( | double | v | ) | [virtual] |
Map one value through the lookup table and return a color defined as a RGBA unsigned char tuple (4 bytes).
Reimplemented from vtkColorTransferFunction.
virtual void vtkDiscretizableColorTransferFunction::GetColor | ( | double | v, |
double | rgb[3] | ||
) | [virtual] |
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
Reimplemented from vtkColorTransferFunction.
virtual double vtkDiscretizableColorTransferFunction::GetOpacity | ( | double | v | ) | [virtual] |
Return the opacity of a given scalar.
Reimplemented from vtkScalarsToColors.
virtual vtkUnsignedCharArray* vtkDiscretizableColorTransferFunction::MapScalars | ( | vtkDataArray * | scalars, |
int | colorMode, | ||
int | component | ||
) | [virtual] |
An internal method maps a data array into a 4-component, unsigned char RGBA array. 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); otherwise, the data is mapped through this instance of ScalarsToColors. The offset 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. When IndexedLookup (inherited from vtkScalarsToColors) is true, the scalar opacity function is not used regardless of EnableOpacityMapping.
Reimplemented from vtkScalarsToColors.
Returns the (x, r, g, b) values as an array.
virtual void vtkDiscretizableColorTransferFunction::SetAlpha | ( | double | alpha | ) | [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. Overridden to pass the alpha to the internal vtkLookupTable.
Reimplemented from vtkScalarsToColors.
virtual void vtkDiscretizableColorTransferFunction::SetNanColor | ( | double | r, |
double | g, | ||
double | b | ||
) | [virtual] |
Set the color to use when a NaN (not a number) is encountered. This is an RGB 3-tuple color of doubles in the range [0,1]. Overridden to pass the NanColor to the internal vtkLookupTable.
Reimplemented from vtkColorTransferFunction.
virtual void vtkDiscretizableColorTransferFunction::SetNanColor | ( | double | rgb[3] | ) | [inline, virtual] |
Set the color to use when a NaN (not a number) is encountered. This is an RGB 3-tuple color of doubles in the range [0,1]. Overridden to pass the NanColor to the internal vtkLookupTable.
Reimplemented from vtkColorTransferFunction.
Definition at line 169 of file vtkDiscretizableColorTransferFunction.h.
virtual int vtkDiscretizableColorTransferFunction::UsingLogScale | ( | ) | [inline, virtual] |
This should return 1 is the subclass is using log scale for mapping scalars to colors.
Reimplemented from vtkScalarsToColors.
Definition at line 178 of file vtkDiscretizableColorTransferFunction.h.
virtual vtkIdType vtkDiscretizableColorTransferFunction::GetNumberOfAvailableColors | ( | ) | [virtual] |
Get the number of available colors for mapping to.
Reimplemented from vtkColorTransferFunction.
virtual void vtkDiscretizableColorTransferFunction::SetScalarOpacityFunction | ( | vtkPiecewiseFunction * | function | ) | [virtual] |
Set/get the opacity function to use.
virtual vtkPiecewiseFunction* vtkDiscretizableColorTransferFunction::GetScalarOpacityFunction | ( | ) | const [virtual] |
Set/get the opacity function to use.
virtual void vtkDiscretizableColorTransferFunction::SetEnableOpacityMapping | ( | bool | ) | [virtual] |
Enable/disable the usage of the scalar opacity function.
virtual bool vtkDiscretizableColorTransferFunction::GetEnableOpacityMapping | ( | ) | [virtual] |
Enable/disable the usage of the scalar opacity function.
virtual void vtkDiscretizableColorTransferFunction::EnableOpacityMappingOn | ( | ) | [virtual] |
Enable/disable the usage of the scalar opacity function.
virtual void vtkDiscretizableColorTransferFunction::EnableOpacityMappingOff | ( | ) | [virtual] |
Enable/disable the usage of the scalar opacity function.
virtual unsigned long vtkDiscretizableColorTransferFunction::GetMTime | ( | ) | [virtual] |
Overridden to include the ScalarOpacityFunction's MTime.
Reimplemented from vtkObject.
void vtkDiscretizableColorTransferFunction::MapDataArrayToOpacity | ( | vtkDataArray * | scalars, |
int | component, | ||
vtkUnsignedCharArray * | colors | ||
) | [protected] |
int vtkDiscretizableColorTransferFunction::Discretize [protected] |
Definition at line 205 of file vtkDiscretizableColorTransferFunction.h.
Definition at line 206 of file vtkDiscretizableColorTransferFunction.h.
Definition at line 208 of file vtkDiscretizableColorTransferFunction.h.
Definition at line 209 of file vtkDiscretizableColorTransferFunction.h.
Reimplemented from vtkColorTransferFunction.
Definition at line 211 of file vtkDiscretizableColorTransferFunction.h.
bool vtkDiscretizableColorTransferFunction::EnableOpacityMapping [protected] |
Definition at line 213 of file vtkDiscretizableColorTransferFunction.h.
vtkSmartPointer<vtkPiecewiseFunction> vtkDiscretizableColorTransferFunction::ScalarOpacityFunction [protected] |
Definition at line 214 of file vtkDiscretizableColorTransferFunction.h.
unsigned long vtkDiscretizableColorTransferFunction::ScalarOpacityFunctionObserverId [protected] |
Definition at line 215 of file vtkDiscretizableColorTransferFunction.h.