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]) |
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 vtkUnsignedCharArray * | MapScalars (vtkAbstractArray *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) |
double * | GetDataPointer () |
void | FillFromDataPointer (int n, double *ptr) |
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]) |
virtual void | SetBelowRangeColor (double, double, double) |
virtual void | SetBelowRangeColor (double[3]) |
virtual double * | GetBelowRangeColor () |
virtual void | GetBelowRangeColor (double &, double &, double &) |
virtual void | GetBelowRangeColor (double[3]) |
virtual void | SetUseBelowRangeColor (int) |
virtual int | GetUseBelowRangeColor () |
virtual void | UseBelowRangeColorOn () |
virtual void | UseBelowRangeColorOff () |
virtual void | SetAboveRangeColor (double, double, double) |
virtual void | SetAboveRangeColor (double[3]) |
virtual double * | GetAboveRangeColor () |
virtual void | GetAboveRangeColor (double &, double &, double &) |
virtual void | GetAboveRangeColor (double[3]) |
virtual void | SetUseAboveRangeColor (int) |
virtual int | GetUseAboveRangeColor () |
virtual void | UseAboveRangeColorOn () |
virtual void | UseAboveRangeColorOff () |
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) |
virtual vtkIdType | SetAnnotation (vtkStdString value, vtkStdString annotation) |
vtkIdType | GetNumberOfAnnotatedValues () |
vtkVariant | GetAnnotatedValue (vtkIdType idx) |
vtkStdString | GetAnnotation (vtkIdType idx) |
virtual void | GetAnnotationColor (const vtkVariant &val, double rgba[4]) |
vtkIdType | GetAnnotatedValueIndex (vtkVariant val) |
vtkIdType | GetAnnotatedValueIndexInternal (vtkVariant &val) |
virtual bool | RemoveAnnotation (vtkVariant value) |
virtual void | ResetAnnotations () |
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 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 () |
template<> | |
unsigned char | ColorToUChar (double t) |
template<> | |
unsigned char | ColorToUChar (float t) |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool 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 () |
template<typename T > | |
static unsigned char | ColorToUChar (T t) |
template<typename T > | |
static void | ColorToUChar (T t, unsigned char *dest) |
![]() | |
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) |
virtual void | UpdateAnnotatedValueMap () |
void | MapColorsToColors (void *input, unsigned char *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize, int outputFormat) |
vtkUnsignedCharArray * | ConvertToRGBA (vtkDataArray *colors, int numComp, int numTuples) |
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 values 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 at least 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 |
Returns the negation of EnableOpacityMapping.
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 the RGB values passed to this call.
Definition at line 71 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 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 be 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 be 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 be 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 be 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 |
Internal methods that map 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.
|
virtual |
Internal methods that map 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. vtkColorTransferFunction::GetDataPointer(). Retained for backwards compatibility.
|
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 172 of file vtkDiscretizableColorTransferFunction.h.
|
inlinevirtual |
This should return 1 if the subclass is using log scale for mapping scalars to colors.
Reimplemented from vtkScalarsToColors.
Definition at line 180 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 |
Flag indicating whether transfer function is discretized.
Definition at line 208 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Flag indicating whether log scaling is to be used.
Definition at line 211 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Number of values to use in discretized color map.
Definition at line 214 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Internal lookup table used for some aspects of the color mapping
Definition at line 217 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 219 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 221 of file vtkDiscretizableColorTransferFunction.h.
|
protected |
Definition at line 222 of file vtkDiscretizableColorTransferFunction.h.