Writes point data in glTF v2 format. More...
Public Types | |
enum | fieldOption { UNIFORM, FIELD } |
Field option used for colours. More... | |
Public Member Functions | |
TypeName ("gltf") | |
Runtime type information. More... | |
gltfSetWriter () | |
Default construct. More... | |
gltfSetWriter (const dictionary &dict) | |
Construct from dictionary. More... | |
virtual | ~gltfSetWriter ()=default |
Destructor. More... | |
virtual fileName | getFileName (const coordSet &, const wordList &) const |
Return the file name. More... | |
virtual void | write (const coordSet &, const wordList &, const List< const Field< Type > * > &, Ostream &) const |
Write. More... | |
virtual void | write (const bool writeTracks, const List< scalarField > ×, const PtrList< coordSet > &, const wordList &valueSetNames, const List< List< Field< Type >>> &, Ostream &) const |
Write tracks (main entry point) More... | |
virtual void | writeAnimateTracks (const bool writeTracks, const List< scalarField > ×, const PtrList< coordSet > &tracks, const wordList &valueSetNames, const List< List< Field< Type >>> &valueSets, Ostream &) const |
Write animated tracks. More... | |
virtual void | writeStaticTracks (const bool writeTracks, const List< scalarField > ×, const PtrList< coordSet > &tracks, const wordList &valueSetNames, const List< List< Field< Type >>> &valueSets, Ostream &) const |
Write static tracks. More... | |
![]() | |
TypeName ("writer") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, writer, word,(),()) | |
declareRunTimeSelectionTable (autoPtr, writer, dict,(const dictionary &formatOptions),(formatOptions)) | |
writer () | |
Default construct. More... | |
writer (const dictionary &dict) | |
Construct with dictionary. More... | |
virtual | ~writer ()=default |
Destructor. More... | |
virtual void | write (const coordSet &, const wordList &, const List< Field< Type >> &, Ostream &) const |
General entry point for writing. More... | |
virtual Ostream & | write (const scalar, Ostream &) const |
Write scalar as ascii. More... | |
template<class VSType > | |
Ostream & | writeVS (const VSType &, Ostream &) const |
virtual Ostream & | write (const vector &, Ostream &) const |
Write vector. Tab separated ascii. More... | |
virtual Ostream & | write (const sphericalTensor &, Ostream &) const |
Write sphericalTensor. Tab separated ascii. More... | |
virtual Ostream & | write (const symmTensor &, Ostream &) const |
Write symmTensor. Tab separated ascii. More... | |
virtual Ostream & | write (const tensor &, Ostream &) const |
Write tensor. Tab separated ascii. More... | |
template<class VSType > | |
Foam::Ostream & | writeVS (const VSType &value, Ostream &os) const |
Static Public Attributes | |
static const Enum< fieldOption > | fieldOptionNames_ |
Strings corresponding to the field options. More... | |
Additional Inherited Members | |
![]() | |
static autoPtr< writer > | New (const word &writeFormat) |
Return a reference to the selected writer. More... | |
static autoPtr< writer > | New (const word &writeFormat, const dictionary &formatOptions) |
Return a reference to the selected writer. More... | |
![]() | |
fileName | getBaseName (const coordSet &, const wordList &) const |
Generates filename from coordSet and sampled fields. More... | |
void | writeCoord (const coordSet &, const label sampleI, Ostream &) const |
void | writeTable (const coordSet &, const List< Type > &, Ostream &) const |
Writes single-column ascii write. Column 1 is coordSet coordinate,. More... | |
void | writeTable (const coordSet &, const List< const List< Type > * > &, Ostream &os) const |
Writes multi-column ascii write. Column 1 is coordSet coordinate,. More... | |
virtual void | writeSeparator (Ostream &os) const |
Writes a separator. Used by write functions. More... | |
Writes point data in glTF v2 format.
The output can contain both geometry and fields, with additional support for colours using a user-supplied colour map, and animation of particle tracks.
Controls are provided via the optional formatOptions dictionary.
For non-particle track data:
formatOptions { // Apply colours flag (yes | no ) [optional] colours yes; // List of options per field fieldInfo { p { // Colour map [optional] colourMap <colourMap>; // Colour map minimum and maximum limits [optional] // Uses field min and max if not specified min 0; max 1; // Alpha channel [optional] (uniform | field) alpha uniform; alphaValue 0.5; //alpha field; //alphaField T; //normalise yes; } } } \verbatim For particle tracks: \verbatim formatOptions { // Apply colours flag (yes | no) [optional] colours yes; // Animate tracks (yes | no) [optional] animate yes; // Animation properties [optional] animationInfo { // Colour map [optional] colourMap <colourMap>; // Colour [optional] (uniform | field) colour uniform; colourValue (1 0 0); // RGB in range [0-1] //colour field; //colourField d; // Colour map minimum and maximum limits [optional] // Note: for colour = field option // Uses field min and max if not specified min 0; max 1; // Alpha channel [optional] (uniform | field) alpha uniform; alphaValue 0.5; //alpha field; //alphaField T; //normalise yes; } }
For more information on the specification see https://www.khronos.org/registry/glTF/
Definition at line 144 of file gltfSetWriter.H.
|
strong |
Field option used for colours.
Enumerator | |
---|---|
UNIFORM | Uniform value. |
FIELD | field value |
Definition at line 153 of file gltfSetWriter.H.
gltfSetWriter | ( | ) |
Default construct.
Definition at line 290 of file gltfSetWriter.C.
|
explicit |
Construct from dictionary.
Definition at line 301 of file gltfSetWriter.C.
|
virtualdefault |
Destructor.
TypeName | ( | "gltf" | ) |
Runtime type information.
|
virtual |
Return the file name.
Implements writer< Type >.
Definition at line 327 of file gltfSetWriter.C.
References points.
|
virtual |
Write.
Implements writer< Type >.
Definition at line 338 of file gltfSetWriter.C.
References scene::addColourToMesh(), scene::addFieldToMesh(), scene::addMesh(), Foam::constant::atomic::alpha, Foam::component(), dict, Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, field(), forAll, Foam::max(), maxValue, Foam::min(), minValue, Foam::name(), os(), points, dictionary::subOrEmptyDict(), and scene::write().
|
virtual |
Write tracks (main entry point)
Implements writer< Type >.
Definition at line 412 of file gltfSetWriter.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and os().
|
virtual |
Write animated tracks.
Definition at line 540 of file gltfSetWriter.C.
References scene::addColourToMesh(), scene::addField(), scene::addFieldToMesh(), scene::addMesh(), scene::addToAnimation(), Foam::constant::atomic::alpha, scene::createAnimation(), field(), forAll, Foam::name(), os(), and scene::write().
|
virtual |
Write static tracks.
Definition at line 458 of file gltfSetWriter.C.
References scene::addColourToMesh(), scene::addFieldToMesh(), scene::addMesh(), Foam::constant::atomic::alpha, Foam::component(), dict, f(), field(), forAll, Foam::max(), maxValue, Foam::min(), minValue, Foam::name(), os(), dictionary::subOrEmptyDict(), scene::write(), and Foam::Zero.
|
static |
Strings corresponding to the field options.
Definition at line 161 of file gltfSetWriter.H.