Go to the documentation of this file.
40 { interpolationType::RGB,
"rgb" },
41 { interpolationType::HSV,
"hsv" },
42 { interpolationType::DIVERGING,
"diverging" },
50 const List<Tuple2<scalar, vector>>&
values,
51 const interpolationType interp
62 const interpolationType interp
73 const interpolationType interp
79 dict.readEntry(
"table", table_);
98 return table_.first().second();
103 return table_.last().second();
110 [](
const pair_type& pr,
const scalar& val)
113 return (pr.first() <= val);
120 return table_.first().second();
122 else if (idx == table_.size()-1)
125 return table_.last().second();
128 const scalar t0 = table_[idx].first();
129 const scalar t1 = table_[idx+1].first();
131 const scalar
s = (
x - t0)/(t1 - t0);
133 const vector& rgb0 = table_[idx].second();
134 const vector& rgb1 = table_[idx+1].second();
136 if (interp_ == DIVERGING)
140 else if (interp_ == HSV)
152 List<Tuple2<scalar, vector>> lut(nColours);
154 for (label i=0; i < nColours; ++i)
156 const scalar
x = scalar(i)/scalar(nColours-1);
168 os.
writeEntry(
"interpolate", interpolationTypeNames[interp_]);
static autoPtr< T > New(Args &&... args)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
colourTable(const List< Tuple2< scalar, vector >> &values, const interpolationType interp=interpolationType::RGB)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
static autoPtr< colourTable > New(Istream &is)
static const Enum< interpolationType > interpolationTypeNames
virtual Ostream & beginBlock(const keyType &kw)
vector value(const scalar x) const
Ostream & operator<<(Ostream &, const boundaryPatch &p)
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
List< Tuple2< scalar, vector > > table(const label nColours) const
virtual Ostream & endBlock()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Vector< scalar > vector
A scalar version of the templated Vector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Ostream & writeDict(Ostream &os) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Base class for generating a colour table from node points.
Ostream & writeEntry(const keyType &key, const T &value)
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept