VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkScalarsToColors Class Referenceabstract

Superclass for mapping scalar values into colors. More...

#include <vtkScalarsToColors.h>

Inheritance diagram for vtkScalarsToColors:
[legend]
Collaboration diagram for vtkScalarsToColors:
[legend]

Public Types

enum  VectorModes { MAGNITUDE =0, COMPONENT =1 }
 
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual int IsOpaque ()
 
virtual void Build ()
 
virtual unsigned char * MapValue (double v)=0
 
virtual void GetColor (double v, double rgb[3])=0
 
virtual vtkIdType GetNumberOfAvailableColors ()=0
 
virtual double * GetRange ()=0
 
virtual void SetRange (double min, double max)=0
 
void SetRange (double rng[2])
 
double * GetColor (double v)
 
virtual double GetOpacity (double vtkNotUsed(v))
 
double GetLuminance (double x)
 
virtual void SetAlpha (double alpha)
 
virtual double GetAlpha ()
 
virtual vtkUnsignedCharArrayMapScalars (vtkDataArray *scalars, int colorMode, int component)
 
virtual void SetVectorMode (int)
 
virtual int GetVectorMode ()
 
void SetVectorModeToMagnitude ()
 
void SetVectorModeToComponent ()
 
virtual void SetVectorComponent (int)
 
virtual int GetVectorComponent ()
 
void MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output, int outputFormat)
 
void MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output)
 
virtual void MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)=0
 
virtual vtkUnsignedCharArrayConvertUnsignedCharToRGBA (vtkUnsignedCharArray *colors, int numComp, int numTuples)
 
virtual int UsingLogScale ()
 
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
 
virtual void DebugOff ()
 
unsigned char GetDebug ()
 
void SetDebug (unsigned char debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (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)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
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 &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkScalarsToColorsSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObject *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkScalarsToColors ()
 
 ~vtkScalarsToColors ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &os)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

double Alpha
 
int VectorMode
 
int UseMagnitude
 
int VectorComponent
 
- Protected Attributes inherited from vtkObject
unsigned char Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Superclass for mapping scalar values into colors.

vtkScalarsToColors is a general purpose superclass for objects that convert scalars to colors. This include vtkLookupTable classes and color transfer functions.

The scalars 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.

See Also
vtkLookupTable vtkColorTransferFunction
Tests:
vtkScalarsToColors (Tests)

Definition at line 42 of file vtkScalarsToColors.h.

Member Typedef Documentation

Definition at line 45 of file vtkScalarsToColors.h.

Member Enumeration Documentation

Enumerator
MAGNITUDE 
COMPONENT 

Definition at line 126 of file vtkScalarsToColors.h.

Constructor & Destructor Documentation

vtkScalarsToColors::vtkScalarsToColors ( )
protected
vtkScalarsToColors::~vtkScalarsToColors ( )
inlineprotected

Definition at line 183 of file vtkScalarsToColors.h.

Member Function Documentation

virtual const char* vtkScalarsToColors::GetClassName ( )
virtual
static int vtkScalarsToColors::IsTypeOf ( const char *  type)
static
virtual int vtkScalarsToColors::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 vtkObject.

Reimplemented in vtkLookupTable, vtkLookupTableWithEnabling, vtkWindowLevelLookupTable, and vtkLogLookupTable.

static vtkScalarsToColors* vtkScalarsToColors::SafeDownCast ( vtkObject o)
static
void vtkScalarsToColors::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

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 vtkWindowLevelLookupTable.

virtual int vtkScalarsToColors::IsOpaque ( )
virtual

Return true if all of the values defining the mapping have an opacity equal to 1. Default implementation return true.

Reimplemented in vtkLookupTable.

virtual void vtkScalarsToColors::Build ( )
inlinevirtual

Perform any processing required (if any) before processing scalars.

Reimplemented in vtkLookupTable, and vtkWindowLevelLookupTable.

Definition at line 53 of file vtkScalarsToColors.h.

virtual double* vtkScalarsToColors::GetRange ( )
pure virtual

Sets/Gets the range of scalars which will be mapped.

Implemented in vtkLookupTable.

virtual void vtkScalarsToColors::SetRange ( double  min,
double  max 
)
pure virtual

Sets/Gets the range of scalars which will be mapped.

Implemented in vtkLookupTable.

void vtkScalarsToColors::SetRange ( double  rng[2])
inline

Sets/Gets the range of scalars which will be mapped.

Definition at line 59 of file vtkScalarsToColors.h.

virtual unsigned char* vtkScalarsToColors::MapValue ( double  v)
pure virtual

Map one value through the lookup table and return a color defined as a RGBA unsigned char tuple (4 bytes).

Implemented in vtkLookupTable.

virtual void vtkScalarsToColors::GetColor ( double  v,
double  rgb[3] 
)
pure virtual

Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.

Implemented in vtkLookupTable.

double* vtkScalarsToColors::GetColor ( double  v)
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 74 of file vtkScalarsToColors.h.

virtual double vtkScalarsToColors::GetOpacity ( double   vtkNotUsedv)
inlinevirtual

Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.

Definition at line 81 of file vtkScalarsToColors.h.

double vtkScalarsToColors::GetLuminance ( double  x)
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 89 of file vtkScalarsToColors.h.

virtual void vtkScalarsToColors::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.

virtual double vtkScalarsToColors::GetAlpha ( )
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.

virtual vtkUnsignedCharArray* vtkScalarsToColors::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.

virtual void vtkScalarsToColors::SetVectorMode ( int  )
virtual

Change mode that maps vectors by magnitude vs. component.

virtual int vtkScalarsToColors::GetVectorMode ( )
virtual

Change mode that maps vectors by magnitude vs. component.

void vtkScalarsToColors::SetVectorModeToMagnitude ( )

Change mode that maps vectors by magnitude vs. component.

void vtkScalarsToColors::SetVectorModeToComponent ( )

Change mode that maps vectors by magnitude vs. component.

virtual void vtkScalarsToColors::SetVectorComponent ( int  )
virtual

If the mapper does not select which component of a vector to map to colors, you can specify it here.

virtual int vtkScalarsToColors::GetVectorComponent ( )
virtual

If the mapper does not select which component of a vector to map to colors, you can specify it here.

void vtkScalarsToColors::MapScalarsThroughTable ( vtkDataArray scalars,
unsigned char *  output,
int  outputFormat 
)

Map a set of scalars through the lookup table in a single operation. 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.

void vtkScalarsToColors::MapScalarsThroughTable ( vtkDataArray scalars,
unsigned char *  output 
)
inline

Map a set of scalars through the lookup table in a single operation. 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.

Definition at line 149 of file vtkScalarsToColors.h.

virtual void vtkScalarsToColors::MapScalarsThroughTable2 ( void *  input,
unsigned char *  output,
int  inputDataType,
int  numberOfValues,
int  inputIncrement,
int  outputFormat 
)
pure virtual

An internal method typically not used in applications.

Implemented in vtkLookupTable, and vtkLookupTableWithEnabling.

virtual vtkUnsignedCharArray* vtkScalarsToColors::ConvertUnsignedCharToRGBA ( vtkUnsignedCharArray colors,
int  numComp,
int  numTuples 
)
virtual

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.

virtual int vtkScalarsToColors::UsingLogScale ( )
inlinevirtual

This should return 1 is the subclass is using log scale for mapping scalars to colors. Default implementation returns 0.

Reimplemented in vtkLookupTable.

Definition at line 174 of file vtkScalarsToColors.h.

virtual vtkIdType vtkScalarsToColors::GetNumberOfAvailableColors ( )
pure virtual

Get the number of available colors for mapping to.

Implemented in vtkLookupTable.

Member Data Documentation

double vtkScalarsToColors::Alpha
protected

Definition at line 185 of file vtkScalarsToColors.h.

int vtkScalarsToColors::VectorMode
protected

Definition at line 188 of file vtkScalarsToColors.h.

int vtkScalarsToColors::UseMagnitude
protected

Definition at line 192 of file vtkScalarsToColors.h.

int vtkScalarsToColors::VectorComponent
protected

Definition at line 193 of file vtkScalarsToColors.h.


The documentation for this class was generated from the following file: