Main class to assemble glTF components into a scene. More...
Public Member Functions | |
scene () | |
Default construct. More... | |
template<class Type > | |
label | addField (const Type &fld, const word &name, const label target=-1) |
Returns accessor index. More... | |
template<class Type > | |
label | addMesh (const Type &fld, const word &name) |
Returns index of last mesh. More... | |
template<class Type > | |
label | addFieldToMesh (const Type &fld, const word &name, const label meshId) |
Returns accessor index. More... | |
label | addColourToMesh (const vectorField &fld, const word &name, const label meshId, const scalarField &alpha=scalarField::null()) |
Add a colour field to the mesh, optionally with an alpha channel. More... | |
label | createAnimation (const word &name) |
Returns index of last animation. More... | |
void | addToAnimation (const label animationi, const label inputId, const label outputId, const label meshId, const string &interpolation="LINEAR") |
Add to existing animation. More... | |
void | write (const fileName &outputFile) |
Write to file pair (.gltf, .bin) More... | |
void | write (Ostream &os) |
Write JSON (.gltf) to stream with auxiliary binary data (.bin) More... | |
template<class Type > | |
Foam::label | addField (const Type &fld, const word &name, const label target) |
template<class Type > | |
Foam::label | addMesh (const Type &fld, const word &name) |
template<class Type > | |
Foam::label | addFieldToMesh (const Type &fld, const word &name, const label meshi) |
Main class to assemble glTF components into a scene.
Definition at line 64 of file foamGltfScene.H.
scene | ( | ) |
Default construct.
Definition at line 27 of file foamGltfScene.C.
label addField | ( | const Type & | fld, |
const word & | name, | ||
const label | target = -1 |
||
) |
label addMesh | ( | const Type & | fld, |
const word & | name | ||
) |
Returns index of last mesh.
label addFieldToMesh | ( | const Type & | fld, |
const word & | name, | ||
const label | meshId | ||
) |
Returns accessor index.
Foam::label addColourToMesh | ( | const vectorField & | fld, |
const word & | name, | ||
const label | meshId, | ||
const scalarField & | alpha = scalarField::null() |
||
) |
Add a colour field to the mesh, optionally with an alpha channel.
A constant alpha value can be specified as a field of size 1.
fld | RGB colour field |
alpha | Alpha channel |
Definition at line 61 of file foamGltfScene.C.
References Foam::constant::atomic::alpha, Foam::glTF::ARRAY_BUFFER, fld, Foam::glTF::key(), Foam::name(), and tmp< T >::New().
Foam::label createAnimation | ( | const word & | name | ) |
Returns index of last animation.
Definition at line 110 of file foamGltfScene.C.
References Foam::name().
void addToAnimation | ( | const label | animationi, |
const label | inputId, | ||
const label | outputId, | ||
const label | meshId, | ||
const string & | interpolation = "LINEAR" |
||
) |
Add to existing animation.
Definition at line 118 of file foamGltfScene.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
void write | ( | const fileName & | outputFile | ) |
Write to file pair (.gltf, .bin)
Definition at line 155 of file foamGltfScene.C.
References Foam::isDir(), Foam::mkDir(), os(), fileName::path(), fileName::replace_ext(), and Foam::vtk::write().
void write | ( | Ostream & | os | ) |
Write JSON (.gltf) to stream with auxiliary binary data (.bin)
Definition at line 172 of file foamGltfScene.C.
References IOstreamOption::BINARY, Foam::decrIndent(), Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), fileName::name(), Foam::nl, os(), fileName::replace_ext(), OFstream::stdStream(), and Ostream::write().
Foam::label addField | ( | const Type & | fld, |
const word & | name, | ||
const label | target | ||
) |
Definition at line 23 of file foamGltfSceneTemplates.C.
References fld, and Foam::name().
Foam::label addMesh | ( | const Type & | fld, |
const word & | name | ||
) |
Definition at line 52 of file foamGltfSceneTemplates.C.
References scene::addField(), Foam::glTF::ARRAY_BUFFER, fld, Foam::glTF::key(), and Foam::name().
Foam::label addFieldToMesh | ( | const Type & | fld, |
const word & | name, | ||
const label | meshi | ||
) |
Definition at line 66 of file foamGltfSceneTemplates.C.
References fld, and Foam::name().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.