colourTable Class Reference

Base class for generating a colour table from node points. More...

Collaboration diagram for colourTable:
[legend]

Public Types

enum  interpolationType { RGB, HSV, DIVERGING }
 Internal interpolation type. More...
 
enum  predefinedType {
  COOL_WARM, COLD_HOT, FIRE, RAINBOW,
  GREYSCALE, XRAY
}
 Enumeration of commonly used colour tables. More...
 
typedef Tuple2< scalar, vectorpair_type
 The data lookup type. More...
 

Public Member Functions

 colourTable (const List< Tuple2< scalar, vector >> &values, const interpolationType interp=interpolationType::RGB)
 Copy construct from table values. More...
 
 colourTable (List< Tuple2< scalar, vector >> &&values, const interpolationType interp=interpolationType::RGB)
 Copy construct from table values. More...
 
 colourTable (const dictionary &dict, const interpolationType interp=interpolationType::RGB)
 Read construct from dictionary. More...
 
virtual ~colourTable ()=default
 Destructor. More...
 
vector value (const scalar x) const
 Return the colour at x (within 0-1 range) More...
 
List< Tuple2< scalar, vector > > table (const label nColours) const
 Return a discrete lookup table of colours. More...
 
OstreamwriteDict (Ostream &os) const
 Write as dictionary format. More...
 

Static Public Member Functions

static const colourTableptr (const word &tableName)
 Look up pointer to colourTable by name, or nullptr on failure. More...
 
static const colourTableptr (const predefinedType tbl)
 Look up pointer to colourTable by type, or nullptr on failure. More...
 
static const colourTableref (const word &tableName)
 Look up pointer to colourTable by name. Fatal on failure. More...
 
static const colourTableref (const predefinedType tbl)
 Look up pointer to colourTable by type. Fatal on failure. More...
 
static autoPtr< colourTableNew (Istream &is)
 Read as dictionary content. More...
 
static const HashPtrTable< colourTable > & tables ()
 Predefined tables. More...
 

Static Public Attributes

static const Enum< interpolationTypeinterpolationTypeNames
 Enumeration names for interpolationType. More...
 
static const Enum< predefinedTypepredefinedNames
 Enumeration names for predefinedType. More...
 

Detailed Description

Base class for generating a colour table from node points.

Dictionary definition

Property Description Required Default
interpolate rgb/hsv/diverging no rgb
table Node points for the colour table yes

Predefined colour tables (in "etc/colourTables") include "coolToWarm", "coldAndHot", "fire", "rainbow", "greyscale", "xray".

Source files

Definition at line 79 of file colourTable.H.

Member Typedef Documentation

◆ pair_type

typedef Tuple2<scalar, vector> pair_type

The data lookup type.

Definition at line 111 of file colourTable.H.

Member Enumeration Documentation

◆ interpolationType

Internal interpolation type.

Enumerator
RGB 
HSV 
DIVERGING 

Definition at line 84 of file colourTable.H.

◆ predefinedType

Enumeration of commonly used colour tables.

The indices must match those in "etc/colourTables"

Enumerator
COOL_WARM 

"coolToWarm"

COLD_HOT 

"coldAndHot"

FIRE 

"fire" - ParaView "Black-Body Radiation"

RAINBOW 

"rainbow"

GREYSCALE 

greyscale - ParaView "Grayscale"

XRAY 

"xray" - ParaView "X Ray"

Definition at line 93 of file colourTable.H.

Constructor & Destructor Documentation

◆ colourTable() [1/3]

colourTable ( const List< Tuple2< scalar, vector >> &  values,
const interpolationType  interp = interpolationType::RGB 
)
explicit

Copy construct from table values.

Definition at line 49 of file colourTable.C.

◆ colourTable() [2/3]

colourTable ( List< Tuple2< scalar, vector >> &&  values,
const interpolationType  interp = interpolationType::RGB 
)
explicit

Copy construct from table values.

Definition at line 60 of file colourTable.C.

◆ colourTable() [3/3]

colourTable ( const dictionary dict,
const interpolationType  interp = interpolationType::RGB 
)
explicit

Read construct from dictionary.

Definition at line 71 of file colourTable.C.

References dict.

◆ ~colourTable()

virtual ~colourTable ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ptr() [1/2]

const Foam::colourTable * ptr ( const word tableName)
static

Look up pointer to colourTable by name, or nullptr on failure.

Definition at line 88 of file colourTables.C.

References p.

Referenced by x3dWriter::x3dWriter().

Here is the caller graph for this function:

◆ ptr() [2/2]

const Foam::colourTable * ptr ( const predefinedType  tbl)
static

Look up pointer to colourTable by type, or nullptr on failure.

Definition at line 107 of file colourTables.C.

◆ ref() [1/2]

const Foam::colourTable & ref ( const word tableName)
static

Look up pointer to colourTable by name. Fatal on failure.

Definition at line 113 of file colourTables.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and p.

Here is the call graph for this function:

◆ ref() [2/2]

const Foam::colourTable & ref ( const predefinedType  tbl)
static

Look up pointer to colourTable by type. Fatal on failure.

Definition at line 128 of file colourTables.C.

References ref().

Here is the call graph for this function:

◆ New()

Foam::autoPtr< Foam::colourTable > New ( Istream is)
static

Read as dictionary content.

Definition at line 86 of file colourTable.C.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ tables()

const Foam::HashPtrTable< Foam::colourTable > & tables ( )
static

Predefined tables.

Definition at line 77 of file colourTables.C.

◆ value()

Foam::vector value ( const scalar  x) const

Return the colour at x (within 0-1 range)

Definition at line 94 of file colourTable.C.

References Foam::findLower(), Tuple2< T1, T2 >::first(), Foam::colourTools::interpolateDiverging(), Foam::colourTools::interpolateHSV(), Foam::colourTools::interpolateRGB(), s, and x.

Here is the call graph for this function:

◆ table()

Foam::List< Foam::Tuple2< Foam::scalar, Foam::vector > > table ( const label  nColours) const

Return a discrete lookup table of colours.

Definition at line 150 of file colourTable.C.

References x.

◆ writeDict()

Foam::Ostream & writeDict ( Ostream os) const

Write as dictionary format.

Definition at line 165 of file colourTable.C.

References Ostream::beginBlock(), Ostream::endBlock(), os(), and Ostream::writeEntry().

Referenced by Foam::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ interpolationTypeNames

const Foam::Enum< Foam::colourTable::interpolationType > interpolationTypeNames
static

Enumeration names for interpolationType.

Definition at line 105 of file colourTable.H.

◆ predefinedNames

const Foam::Enum< Foam::colourTable::predefinedType > predefinedNames
static

Enumeration names for predefinedType.

Definition at line 108 of file colourTable.H.

Referenced by x3dWriter::x3dWriter().


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