Base class for generating a colour table from node points. More...
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. 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. The input is clipped to 0-1 range. More... | |
List< Tuple2< scalar, vector > > | table (const label nColours) const |
Return a discrete lookup table of colours. More... | |
Ostream & | writeDict (Ostream &os) const |
Write as dictionary format. More... | |
Static Public Member Functions | |
static const colourTable * | ptr (const word &tableName) |
Look up pointer to colourTable by name, or nullptr on failure. More... | |
static const colourTable * | ptr (const predefinedType tbl) |
Look up pointer to colourTable by type, or nullptr on failure. More... | |
static const colourTable & | ref (const word &tableName) |
Look up pointer to colourTable by name. Fatal on failure. More... | |
static const colourTable & | ref (const predefinedType tbl) |
Look up pointer to colourTable by type. Fatal on failure. More... | |
static autoPtr< colourTable > | New (Istream &is) |
Read as dictionary content. More... | |
static const HashPtrTable< colourTable > & | tables () |
Predefined tables. More... | |
Static Public Attributes | |
static const Enum< interpolationType > | interpolationTypeNames |
Enumeration names for interpolationType. More... | |
static const Enum< predefinedType > | predefinedNames |
Enumeration names for predefinedType. More... | |
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 42 of file colourTable.C.
|
explicit |
Copy construct from table values.
Definition at line 53 of file colourTable.C.
|
explicit |
|
virtualdefault |
Destructor.
|
static |
Look up pointer to colourTable by name, or nullptr on failure.
Definition at line 81 of file colourTables.C.
References p.
Referenced by x3dWriter::x3dWriter().
|
static |
Look up pointer to colourTable by type, or nullptr on failure.
Definition at line 100 of file colourTables.C.
|
static |
Look up pointer to colourTable by name. Fatal on failure.
Definition at line 106 of file colourTables.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and p.
|
static |
Look up pointer to colourTable by type. Fatal on failure.
Definition at line 121 of file colourTables.C.
References ref().
|
static |
Read as dictionary content.
Definition at line 79 of file colourTable.C.
References 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 Foam::findLower(), Tuple2< T1, T2 >::first(), Foam::colourTools::interpolateDiverging(), Foam::colourTools::interpolateHSV(), Foam::colourTools::interpolateRGB(), s, and x.
Referenced by Foam::getAnimationColour(), and Foam::getBoundedColours().
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.
References x.
Foam::Ostream & writeDict | ( | Ostream & | os | ) | const |
Write as dictionary format.
Definition at line 158 of file colourTable.C.
References Ostream::beginBlock(), Ostream::endBlock(), os(), and Ostream::writeEntry().
Referenced by Foam::operator<<().
|
static |
Enumeration names for interpolationType.
Definition at line 108 of file colourTable.H.
|
static |
Enumeration names for predefinedType.
Definition at line 113 of file colourTable.H.
Referenced by x3dWriter::x3dWriter().