Base class for generating a colour table from node points. More...
#include <colourTable.H>

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, vector > | pair_type |
| The data lookup type. | |
Public Member Functions | |
| colourTable (const List< Tuple2< scalar, vector > > &values, const interpolationType interp=interpolationType::RGB) | |
| Copy construct from table values. | |
| colourTable (List< Tuple2< scalar, vector > > &&values, const interpolationType interp=interpolationType::RGB) | |
| Copy construct from table values. | |
| colourTable (const dictionary &dict, const interpolationType interp=interpolationType::RGB) | |
| Read construct from dictionary. | |
| virtual | ~colourTable ()=default |
| Destructor. | |
| vector | value (const scalar x) const |
| Return the colour at x. The input is clipped to 0-1 range. | |
| List< Tuple2< scalar, vector > > | table (const label nColours) const |
| Return a discrete lookup table of colours. | |
| Ostream & | writeDict (Ostream &os) const |
| Write as dictionary format. | |
Static Public Member Functions | |
| static const colourTable * | ptr (const word &tableName) |
| Look up pointer to colourTable by name, or nullptr on failure. | |
| static const colourTable * | ptr (const predefinedType tbl) |
| Look up pointer to colourTable by type, or nullptr on failure. | |
| static const colourTable & | ref (const word &tableName) |
| Look up pointer to colourTable by name. Fatal on failure. | |
| static const colourTable & | ref (const predefinedType tbl) |
| Look up pointer to colourTable by type. Fatal on failure. | |
| static autoPtr< colourTable > | New (Istream &is) |
| Read as dictionary content. | |
| static const HashPtrTable< colourTable > & | tables () |
| Predefined tables. | |
Static Public Attributes | |
| static const Enum< interpolationType > | interpolationTypeNames |
| Enumeration names for interpolationType. | |
| static const Enum< predefinedType > | predefinedNames |
| Enumeration names for predefinedType. | |
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".
Definition at line 75 of file colourTable.H.
The data lookup type.
Definition at line 118 of file colourTable.H.
| enum interpolationType |
Internal interpolation type.
| Enumerator | |
|---|---|
| RGB | |
| HSV | |
| DIVERGING | |
Definition at line 82 of file colourTable.H.
| enum 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 94 of file colourTable.H.
|
explicit |
Copy construct from table values.
Definition at line 41 of file colourTable.C.
Referenced by ptr(), and ref().

|
explicit |
Copy construct from table values.
Definition at line 52 of file colourTable.C.
|
explicit |
Read construct from dictionary.
Definition at line 63 of file colourTable.C.
References dict, and interpolationTypeNames.
|
virtualdefault |
|
static |
Look up pointer to colourTable by name, or nullptr on failure.
Definition at line 81 of file colourTables.C.
References colourTable(), and p.
Referenced by ptr(), and ref().


|
static |
Look up pointer to colourTable by type, or nullptr on failure.
Definition at line 100 of file colourTables.C.
References predefinedNames, and ptr().

|
static |
Look up pointer to colourTable by name. Fatal on failure.
Definition at line 106 of file colourTables.C.
References colourTable(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, p, and ptr().

|
static |
Look up pointer to colourTable by type. Fatal on failure.
Definition at line 121 of file colourTables.C.
References predefinedNames, and ref().

|
static |
Read as dictionary content.
Definition at line 79 of file colourTable.C.
References dictionary, and autoPtr< T >::New().

|
static |
Predefined tables.
Definition at line 70 of file colourTables.C.
| Foam::vector value | ( | const scalar | x | ) | const |
Return the colour at x. The input is clipped to 0-1 range.
Definition at line 87 of file colourTable.C.
References DIVERGING, Foam::findLower(), Tuple2< T1, T2 >::first(), HSV, Foam::colourTools::interpolateDiverging(), Foam::colourTools::interpolateHSV(), Foam::colourTools::interpolateRGB(), s(), and x.
Referenced by Foam::getAnimationColour(), Foam::getBoundedColours(), and table().


| Foam::List< Foam::Tuple2< Foam::scalar, Foam::vector > > table | ( | const label | nColours | ) | const |
Return a discrete lookup table of colours.
Definition at line 143 of file colourTable.C.

| Foam::Ostream & writeDict | ( | Ostream & | os | ) | const |
Write as dictionary format.
Definition at line 158 of file colourTable.C.
References interpolationTypeNames, and os().
Referenced by Foam::operator<<().


|
static |
Enumeration names for interpolationType.
Definition at line 108 of file colourTable.H.
Referenced by colourTable(), and writeDict().
|
static |
Enumeration names for predefinedType.
Definition at line 113 of file colourTable.H.