VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkScalarsToColorsPainter Class Reference

painter that converts scalars to colors. It enable/disables coloring state depending on the ScalarMode. More...

#include <vtkScalarsToColorsPainter.h>

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

Public Types

typedef vtkPainter Superclass
 
- Public Types inherited from vtkPainter
enum  { VERTS = 0x1, LINES = 0x2, POLYS = 0x4, STRIPS = 0x8 }
 
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkScalarsToColorsPainterNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void CreateDefaultLookupTable ()
 
virtual int GetPremultiplyColorsWithAlpha (vtkActor *actor)
 
virtual vtkDataObjectGetOutput ()
 
virtual vtkIdType GetTextureSizeLimit ()
 
- Public Member Functions inherited from vtkPainter
vtkPainterNewInstance () const
 
virtual void ReleaseGraphicsResources (vtkWindow *)
 
virtual double GetTimeToDraw ()
 
virtual void UpdateBounds (double bounds[6])
 
virtual vtkInformationGetInformation ()
 
virtual void SetInformation (vtkInformation *)
 
virtual vtkPainterGetDelegatePainter ()
 
virtual void SetDelegatePainter (vtkPainter *)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
virtual void Render (vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
 
virtual void SetProgress (double)
 
virtual double GetProgress ()
 
void SetInput (vtkDataObject *)
 
virtual vtkDataObjectGetInput ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool 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)
 
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)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
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 vtkScalarsToColorsPainterNew ()
 
static int IsTypeOf (const char *type)
 
static vtkScalarsToColorsPainterSafeDownCast (vtkObjectBase *o)
 
static vtkInformationIntegerKeyUSE_LOOKUP_TABLE_SCALAR_RANGE ()
 
static vtkInformationDoubleVectorKeySCALAR_RANGE ()
 
static vtkInformationIntegerKeySCALAR_MODE ()
 
static vtkInformationIntegerKeyCOLOR_MODE ()
 
static vtkInformationIntegerKeyINTERPOLATE_SCALARS_BEFORE_MAPPING ()
 
static vtkInformationIntegerKeySCALAR_VISIBILITY ()
 
static vtkInformationIntegerKeySCALAR_MATERIAL_MODE ()
 
static vtkInformationIntegerKeyARRAY_ACCESS_MODE ()
 
static vtkInformationIntegerKeyARRAY_ID ()
 
static vtkInformationStringKeyARRAY_NAME ()
 
static vtkInformationIntegerKeyARRAY_COMPONENT ()
 
static vtkInformationIntegerKeyFIELD_DATA_TUPLE_ID ()
 
- Static Public Member Functions inherited from vtkPainter
static int IsTypeOf (const char *type)
 
static vtkPainterSafeDownCast (vtkObjectBase *o)
 
static vtkInformationIntegerKeySTATIC_DATA ()
 
static vtkInformationIntegerKeyCONSERVE_MEMORY ()
 
static vtkInformationIntegerKeyHIGH_QUALITY ()
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *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

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkScalarsToColorsPainter ()
 
virtual ~vtkScalarsToColorsPainter ()
 
virtual vtkDataObjectNewClone (vtkDataObject *data)
 
virtual void PrepareForRendering (vtkRenderer *renderer, vtkActor *actor)
 
virtual void ProcessInformation (vtkInformation *)
 
virtual void ReportReferences (vtkGarbageCollector *collector)
 
int CanUseTextureMapForColoring (vtkDataObject *input)
 
void UpdateColorTextureMap (double alpha, int multiply_with_alpha)
 
virtual void SetUseLookupTableScalarRange (int)
 
virtual void SetScalarRange (double, double)
 
void SetScalarRange (double[2])
 
virtual void SetScalarMode (int)
 
virtual void SetColorMode (int)
 
virtual void SetInterpolateScalarsBeforeMapping (int)
 
virtual void SetScalarVisibility (int)
 
virtual void SetScalarMaterialMode (int)
 
virtual void SetArrayAccessMode (int)
 
virtual void SetArrayComponent (int)
 
virtual void SetArrayId (int)
 
virtual void SetArrayName (const char *)
 
virtual void SetFieldDataTupleId (vtkIdType)
 
void MapScalarsToTexture (vtkDataSet *output, vtkDataArray *scalars, vtkDataSet *input)
 
virtual void MapScalars (vtkDataSet *output, double alpha, int multiply_with_alpha, vtkDataSet *input)
 
- Protected Member Functions inherited from vtkPainter
 vtkPainter ()
 
 ~vtkPainter ()
 
void UpdateDelegatePainter ()
 
virtual void PassInformation (vtkPainter *toPainter)
 
virtual void UpdateDelegateProgress (vtkPainter *delegate, double amount)
 
virtual void ObserverPainterProgress (vtkPainter *toObserve)
 
void UpdateProgress (double amount)
 
virtual void RenderInternal (vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
 
vtkAbstractArrayGetInputArrayToProcess (int fieldAssociation, int fieldAttributeType, vtkDataSet *ds, bool *use_cell_data=0)
 
vtkAbstractArrayGetInputArrayToProcess (int fieldAssociation, const char *name, vtkDataSet *dsl, bool *use_cell_data=0)
 
- 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 &)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkDataObjectOutputData
 
int ArrayAccessMode
 
int ArrayComponent
 
int ArrayId
 
char * ArrayName
 
vtkIdType FieldDataTupleId
 
vtkScalarsToColorsLookupTable
 
vtkSmartPointer< vtkScalarsToColorsScalarsLookupTable
 
vtkSmartPointer< vtkImageDataColorTextureMap
 
int ColorMode
 
int InterpolateScalarsBeforeMapping
 
int ScalarMode
 
int ScalarMaterialMode
 
double LastUsedAlpha
 
int LastUsedMultiplyWithAlpha
 
double ScalarRange [2]
 
int ScalarVisibility
 
int UseLookupTableScalarRange
 
vtkTimeStamp OutputUpdateTime
 
int UsingScalarColoring
 
- Protected Attributes inherited from vtkPainter
vtkTimeStamp InformationProcessTime
 
vtkPainterObserverObserver
 
vtkInformationInformation
 
vtkPainterDelegatePainter
 
double Progress
 
double ProgressOffset
 
double ProgressScaleFactor
 
double TimeToDraw
 
vtkTimerLogTimer
 
vtkWeakPointer< vtkWindowLastWindow
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
static vtkInformationObjectBaseKeyLOOKUP_TABLE ()
 
void SetLookupTable (vtkScalarsToColors *lut)
 
vtkScalarsToColorsGetLookupTable ()
 

Detailed Description

painter that converts scalars to colors. It enable/disables coloring state depending on the ScalarMode.

This is a painter that converts scalars to colors. It enable/disables coloring state depending on the ScalarMode. This painter is composite dataset enabled.

Tests:
vtkScalarsToColorsPainter (Tests)

Definition at line 42 of file vtkScalarsToColorsPainter.h.

Member Typedef Documentation

Definition at line 46 of file vtkScalarsToColorsPainter.h.

Constructor & Destructor Documentation

vtkScalarsToColorsPainter::vtkScalarsToColorsPainter ( )
protected
virtual vtkScalarsToColorsPainter::~vtkScalarsToColorsPainter ( )
protectedvirtual

Member Function Documentation

static vtkScalarsToColorsPainter* vtkScalarsToColorsPainter::New ( )
static
static int vtkScalarsToColorsPainter::IsTypeOf ( const char *  type)
static
virtual int vtkScalarsToColorsPainter::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 vtkPainter.

Reimplemented in vtkOpenGLScalarsToColorsPainter.

static vtkScalarsToColorsPainter* vtkScalarsToColorsPainter::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkScalarsToColorsPainter::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkPainter.

Reimplemented in vtkOpenGLScalarsToColorsPainter.

vtkScalarsToColorsPainter* vtkScalarsToColorsPainter::NewInstance ( ) const
void vtkScalarsToColorsPainter::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 vtkPainter.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::USE_LOOKUP_TABLE_SCALAR_RANGE ( )
static

Control whether the mapper sets the lookuptable range based on its own ScalarRange, or whether it will use the LookupTable ScalarRange regardless of it's own setting. By default the Mapper is allowed to set the LookupTable range, but users who are sharing LookupTables between mappers/actors will probably wish to force the mapper to use the LookupTable unchanged.

static vtkInformationDoubleVectorKey* vtkScalarsToColorsPainter::SCALAR_RANGE ( )
static

Specify range in terms of scalar minimum and maximum (smin,smax). These values are used to map scalars into lookup table. Has no effect when UseLookupTableScalarRange is true.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::SCALAR_MODE ( )
static

Control how the painter works with scalar point data and cell attribute data. See vtkMapper::ScalarMode for more details.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::COLOR_MODE ( )
static

Control how the scalar data is mapped to colors. By default (ColorModeToDefault), unsigned char scalars are treated as colors, and NOT mapped through the lookup table, while everything else is. Setting ColorModeToMapScalars means that all scalar data will be mapped through the lookup table.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::INTERPOLATE_SCALARS_BEFORE_MAPPING ( )
static

By default, vertex color is used to map colors to a surface. Colors are interpolated after being mapped. This option avoids color interpolation by using a one dimensional texture map for the colors.

static vtkInformationObjectBaseKey* vtkScalarsToColorsPainter::LOOKUP_TABLE ( )
static

Specify a lookup table for the mapper to use.

void vtkScalarsToColorsPainter::SetLookupTable ( vtkScalarsToColors lut)

Specify a lookup table for the mapper to use.

vtkScalarsToColors* vtkScalarsToColorsPainter::GetLookupTable ( )

Specify a lookup table for the mapper to use.

virtual void vtkScalarsToColorsPainter::CreateDefaultLookupTable ( )
virtual

Create default lookup table. Generally used to create one when none is available with the scalar data.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::SCALAR_VISIBILITY ( )
static

Turn on/off flag to control whether scalar data is used to color objects.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::ARRAY_ACCESS_MODE ( )
static

Controls what data array is used to generate colors.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::ARRAY_ID ( )
static

Controls what data array is used to generate colors.

static vtkInformationStringKey* vtkScalarsToColorsPainter::ARRAY_NAME ( )
static

Controls what data array is used to generate colors.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::ARRAY_COMPONENT ( )
static

Controls what data array is used to generate colors.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::FIELD_DATA_TUPLE_ID ( )
static

Controls what data array is used to generate colors.

static vtkInformationIntegerKey* vtkScalarsToColorsPainter::SCALAR_MATERIAL_MODE ( )
static

Set the light-model color mode.

virtual int vtkScalarsToColorsPainter::GetPremultiplyColorsWithAlpha ( vtkActor actor)
virtual

For alpha blending, we sometime premultiply the colors with alpha and change the alpha blending function. This call returns whether we are premultiplying or using the default blending function. Currently this checks if the actor has a texture, if not it returns true. TODO: It is possible to make this decision dependent on key passed down from a painter upstream that makes a more informed decision for alpha blending depending on extensions available, for example.

Reimplemented in vtkOpenGLScalarsToColorsPainter.

virtual vtkDataObject* vtkScalarsToColorsPainter::GetOutput ( )
virtual

Subclasses need to override this to return the output of the pipeline.

Reimplemented from vtkPainter.

virtual vtkIdType vtkScalarsToColorsPainter::GetTextureSizeLimit ( )
virtual

Return the texture size limit. Subclasses need to override this to return the actual correct texture size limit. Here it is hardcoded to 1024.

Reimplemented in vtkOpenGLScalarsToColorsPainter.

virtual vtkDataObject* vtkScalarsToColorsPainter::NewClone ( vtkDataObject data)
protectedvirtual

Create a new shallow-copied clone for data with no scalars.

void vtkScalarsToColorsPainter::MapScalarsToTexture ( vtkDataSet output,
vtkDataArray scalars,
vtkDataSet input 
)
protected

Create texture coordinates for the output assuming a texture for the lookuptable has already been created correctly. this->LookupTable is the lookuptable used.

virtual void vtkScalarsToColorsPainter::PrepareForRendering ( vtkRenderer renderer,
vtkActor actor 
)
protectedvirtual

Called just before RenderInternal(). We build the Color array here.

Reimplemented from vtkPainter.

virtual void vtkScalarsToColorsPainter::MapScalars ( vtkDataSet output,
double  alpha,
int  multiply_with_alpha,
vtkDataSet input 
)
protectedvirtual

Generates the colors, if needed. If multiply_with_alpha is set, the colors are multiplied with alpha.

virtual void vtkScalarsToColorsPainter::ProcessInformation ( vtkInformation )
protectedvirtual

Called before RenderInternal() if the Information has been changed since the last time this method was called.

Reimplemented from vtkPainter.

virtual void vtkScalarsToColorsPainter::ReportReferences ( vtkGarbageCollector collector)
protectedvirtual

Take part in garbage collection.

Reimplemented from vtkPainter.

int vtkScalarsToColorsPainter::CanUseTextureMapForColoring ( vtkDataObject input)
protected

Returns if we can use texture maps for scalar coloring. Note this doesn't say we "will" use scalar coloring. It says, if we do use scalar coloring, we will use a 1D texture. When rendering multiblock datasets, if any 2 blocks provide different lookup tables for the scalars, then also we cannot use textures. This case can be handled if required.

void vtkScalarsToColorsPainter::UpdateColorTextureMap ( double  alpha,
int  multiply_with_alpha 
)
protected

Should not be called if CanUseTextureMapForColoring() returns 0.

virtual void vtkScalarsToColorsPainter::SetUseLookupTableScalarRange ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetScalarRange ( double  ,
double   
)
protectedvirtual
void vtkScalarsToColorsPainter::SetScalarRange ( double  [2])
protected
virtual void vtkScalarsToColorsPainter::SetScalarMode ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetColorMode ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetInterpolateScalarsBeforeMapping ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetScalarVisibility ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetScalarMaterialMode ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetArrayAccessMode ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetArrayComponent ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetArrayId ( int  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetArrayName ( const char *  )
protectedvirtual
virtual void vtkScalarsToColorsPainter::SetFieldDataTupleId ( vtkIdType  )
protectedvirtual

Member Data Documentation

vtkDataObject* vtkScalarsToColorsPainter::OutputData
protected

Definition at line 183 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ArrayAccessMode
protected

Definition at line 187 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ArrayComponent
protected

Definition at line 188 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ArrayId
protected

Definition at line 189 of file vtkScalarsToColorsPainter.h.

char* vtkScalarsToColorsPainter::ArrayName
protected

Definition at line 190 of file vtkScalarsToColorsPainter.h.

vtkIdType vtkScalarsToColorsPainter::FieldDataTupleId
protected

Definition at line 191 of file vtkScalarsToColorsPainter.h.

vtkScalarsToColors* vtkScalarsToColorsPainter::LookupTable
protected

Definition at line 193 of file vtkScalarsToColorsPainter.h.

vtkSmartPointer<vtkScalarsToColors> vtkScalarsToColorsPainter::ScalarsLookupTable
protected

Definition at line 196 of file vtkScalarsToColorsPainter.h.

vtkSmartPointer<vtkImageData> vtkScalarsToColorsPainter::ColorTextureMap
protected

Definition at line 197 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ColorMode
protected

Definition at line 198 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::InterpolateScalarsBeforeMapping
protected

Definition at line 199 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ScalarMode
protected

Definition at line 200 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ScalarMaterialMode
protected

Definition at line 201 of file vtkScalarsToColorsPainter.h.

double vtkScalarsToColorsPainter::LastUsedAlpha
protected

Definition at line 202 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::LastUsedMultiplyWithAlpha
protected

Definition at line 204 of file vtkScalarsToColorsPainter.h.

double vtkScalarsToColorsPainter::ScalarRange[2]
protected

Definition at line 205 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::ScalarVisibility
protected

Definition at line 206 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::UseLookupTableScalarRange
protected

Definition at line 207 of file vtkScalarsToColorsPainter.h.

vtkTimeStamp vtkScalarsToColorsPainter::OutputUpdateTime
protected

Definition at line 209 of file vtkScalarsToColorsPainter.h.

int vtkScalarsToColorsPainter::UsingScalarColoring
protected

Definition at line 213 of file vtkScalarsToColorsPainter.h.


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