VTK
|
a combination of vtkColorTransferFunction and vtkLookupTable. More...
#include <vtkDiscretizableColorTransferFunction.h>
Public Types | |
typedef vtkColorTransferFunction | Superclass |
![]() | |
typedef vtkScalarsToColors | Superclass |
![]() | |
enum | VectorModes { MAGNITUDE =0, COMPONENT =1, RGBCOLORS =2 } |
typedef vtkObject | Superclass |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkDiscretizableColorTransferFunction * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
int | IsOpaque () |
virtual void | GetIndexedColor (vtkIdType i, double rgba[4]) |
Get the "indexed color" assigned to an index. More... | |
virtual void | Build () |
virtual unsigned char * | MapValue (double v) |
virtual void | GetColor (double v, double rgb[3]) |
virtual double | GetOpacity (double v) |
double * | GetRGBPoints () |
virtual void | SetAlpha (double alpha) |
virtual vtkIdType | GetNumberOfAvailableColors () |
virtual unsigned long | GetMTime () |
void | SetIndexedColor (unsigned int index, const double rgb[3]) |
void | SetIndexedColor (unsigned int index, double r, double g, double b) |
void | SetNumberOfIndexedColors (unsigned int count) |
unsigned int | GetNumberOfIndexedColors () |
virtual void | SetDiscretize (int) |
virtual int | GetDiscretize () |
virtual void | DiscretizeOn () |
virtual void | DiscretizeOff () |
virtual void | SetUseLogScale (int useLogScale) |
virtual int | GetUseLogScale () |
virtual void | SetNumberOfValues (vtkIdType) |
virtual vtkIdType | GetNumberOfValues () |
virtual vtkUnsignedCharArray * | MapScalars (vtkDataArray *scalars, int colorMode, int component) |
virtual void | SetNanColor (double r, double g, double b) |
virtual void | SetNanColor (double rgb[3]) |
virtual int | UsingLogScale () |
virtual void | SetScalarOpacityFunction (vtkPiecewiseFunction *function) |
virtual vtkPiecewiseFunction * | GetScalarOpacityFunction () const |
virtual void | SetEnableOpacityMapping (bool) |
virtual bool | GetEnableOpacityMapping () |
virtual void | EnableOpacityMappingOn () |
virtual void | EnableOpacityMappingOff () |
![]() | |
vtkColorTransferFunction * | NewInstance () const |
void | DeepCopy (vtkScalarsToColors *f) |
void | ShallowCopy (vtkColorTransferFunction *f) |
int | GetSize () |
void | RemoveAllPoints () |
int | AdjustRange (double range[2]) |
void | BuildFunctionFromTable (double x1, double x2, int size, double *table) |
int | AddRGBPoint (double x, double r, double g, double b) |
int | AddRGBPoint (double x, double r, double g, double b, double midpoint, double sharpness) |
int | AddHSVPoint (double x, double h, double s, double v) |
int | AddHSVPoint (double x, double h, double s, double v, double midpoint, double sharpness) |
int | RemovePoint (double x) |
void | AddRGBSegment (double x1, double r1, double g1, double b1, double x2, double r2, double g2, double b2) |
void | AddHSVSegment (double x1, double h1, double s1, double v1, double x2, double h2, double s2, double v2) |
double * | GetColor (double x) |
double | GetRedValue (double x) |
double | GetGreenValue (double x) |
double | GetBlueValue (double x) |
int | GetNodeValue (int index, double val[6]) |
int | SetNodeValue (int index, double val[6]) |
virtual double * | GetRange () |
virtual void | GetRange (double &, double &) |
virtual void | GetRange (double[2]) |
void | GetTable (double x1, double x2, int n, double *table) |
void | GetTable (double x1, double x2, int n, float *table) |
const unsigned char * | GetTable (double x1, double x2, int n) |
virtual void | SetClamping (int) |
virtual int | GetClamping () |
virtual void | ClampingOn () |
virtual void | ClampingOff () |
virtual void | SetColorSpace (int) |
void | SetColorSpaceToRGB () |
void | SetColorSpaceToHSV () |
void | SetColorSpaceToLab () |
void | SetColorSpaceToDiverging () |
virtual int | GetColorSpace () |
virtual void | SetHSVWrap (int) |
virtual int | GetHSVWrap () |
virtual void | HSVWrapOn () |
virtual void | HSVWrapOff () |
virtual void | SetScale (int) |
void | SetScaleToLinear () |
void | SetScaleToLog10 () |
virtual int | GetScale () |
virtual double * | GetNanColor () |
virtual void | GetNanColor (double &, double &, double &) |
virtual void | GetNanColor (double[3]) |
double * | GetDataPointer () |
void | FillFromDataPointer (int, double *) |
virtual void | MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement) |
virtual void | SetAllowDuplicateScalars (int) |
virtual int | GetAllowDuplicateScalars () |
virtual void | AllowDuplicateScalarsOn () |
virtual void | AllowDuplicateScalarsOff () |
![]() | |
vtkScalarsToColors * | NewInstance () const |
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 (vtkVariant &val) |
Look up an index into the array of annotations given a value. Does no pointer checks. Returns -1 when val not present. 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... | |
void | SetRange (double rng[2]) |
double * | GetColor (double v) |
double | GetLuminance (double x) |
virtual double | GetAlpha () |
virtual void | SetVectorMode (int) |
virtual int | GetVectorMode () |
void | SetVectorModeToMagnitude () |
void | SetVectorModeToComponent () |
void | SetVectorModeToRGBColors () |
virtual void | SetVectorComponent (int) |
virtual int | GetVectorComponent () |
virtual void | SetVectorSize (int) |
virtual int | GetVectorSize () |
void | MapVectorsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat, int vectorComponent, int vectorSize) |
void | MapVectorsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output, int outputFormat) |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output) |
void | MapScalarsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) |
virtual vtkUnsignedCharArray * | ConvertUnsignedCharToRGBA (vtkUnsignedCharArray *colors, int numComp, int numTuples) |
virtual void | SetAnnotations (vtkAbstractArray *values, vtkStringArray *annotations) |
virtual vtkAbstractArray * | GetAnnotatedValues () |
virtual vtkStringArray * | GetAnnotations () |
virtual void | SetIndexedLookup (int) |
virtual int | GetIndexedLookup () |
virtual void | IndexedLookupOn () |
virtual void | IndexedLookupOff () |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkDiscretizableColorTransferFunction * | New () |
static int | IsTypeOf (const char *type) |
static vtkDiscretizableColorTransferFunction * | SafeDownCast (vtkObjectBase *o) |
![]() | |
static vtkColorTransferFunction * | New () |
static int | IsTypeOf (const char *type) |
static vtkColorTransferFunction * | SafeDownCast (vtkObjectBase *o) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkScalarsToColors * | SafeDownCast (vtkObjectBase *o) |
static vtkScalarsToColors * | New () |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkDiscretizableColorTransferFunction () | |
~vtkDiscretizableColorTransferFunction () | |
void | MapDataArrayToOpacity (vtkDataArray *scalars, int component, vtkUnsignedCharArray *colors) |
![]() | |
vtkColorTransferFunction () | |
~vtkColorTransferFunction () | |
void | SortAndUpdateRange () |
bool | UpdateRange () |
void | MovePoint (double oldX, double newX) |
virtual void | SetRange (double, double) |
void | SetRange (double rng[2]) |
![]() | |
vtkScalarsToColors () | |
~vtkScalarsToColors () | |
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... | |
void | MapColorsToColors (void *input, unsigned char *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize, int outputFormat) |
void | MapVectorsToMagnitude (void *input, double *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize) |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
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.
Definition at line 59 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
|
protected |
|
static |
|
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 vtkColorTransferFunction.
|
static |
|
protectedvirtual |
Reimplemented from vtkColorTransferFunction.
vtkDiscretizableColorTransferFunction* vtkDiscretizableColorTransferFunction::NewInstance | ( | ) | const |
|
virtual |
Print method for vtkColorTransferFunction
Reimplemented from vtkColorTransferFunction.
|
virtual |
Return true if all of the values defining the mapping have an opacity equal to 1. Default implementation return true.
Reimplemented from vtkScalarsToColors.
|
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 |
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.
unsigned int vtkDiscretizableColorTransferFunction::GetNumberOfIndexedColors | ( | ) |
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 |
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 |
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 |
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 |
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 |
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 |
Get/Set if log scale must be used while mapping scalars to colors. The default is 0.
|
virtual |
Get/Set if log scale must be used while mapping scalars to colors. The default is 0.
|
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 |
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 |
Map one value through the lookup table and return a color defined as a RGBA unsigned char tuple (4 bytes).
Reimplemented from vtkColorTransferFunction.
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
Reimplemented from vtkColorTransferFunction.
Return the opacity of a given scalar.
Reimplemented from vtkScalarsToColors.
|
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.
double* vtkDiscretizableColorTransferFunction::GetRGBPoints | ( | ) |
Returns the (x, r, g, b) values as an array.
|
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 |
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.
|
inlinevirtual |
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.
|
inlinevirtual |
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 |
Get the number of available colors for mapping to.
Reimplemented from vtkColorTransferFunction.
|
virtual |
Set/get the opacity function to use.
|
virtual |
Set/get the opacity function to use.
|
virtual |
Enable/disable the usage of the scalar opacity function.
|
virtual |
Enable/disable the usage of the scalar opacity function.
|
virtual |
Enable/disable the usage of the scalar opacity function.
|
virtual |
Enable/disable the usage of the scalar opacity function.
|
virtual |
Overridden to include the ScalarOpacityFunction's MTime.
Reimplemented from vtkObject.
|
protected |
|
protected |
Definition at line 205 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 206 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 208 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 209 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 211 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 213 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 214 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 215 of file vtkDiscretizableColorTransferFunction.h.