scene Class Reference

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 meshi)
 Returns accessor index. More...
 
label addColourToMesh (const vectorField &fld, const word &name, const label meshi, const scalarField &alpha=scalarField())
 Returns accessor index. 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 (Ostream &os)
 Write to stream (JSON and binary data) 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)
 

Detailed Description

Main class to assemble glTF components into a scene.

Note
Implements the glTF v2 specification
Source files

Definition at line 64 of file foamGltfScene.H.

Constructor & Destructor Documentation

◆ scene()

scene ( )

Default construct.

Definition at line 33 of file foamGltfScene.C.

Member Function Documentation

◆ addField() [1/2]

label addField ( const Type &  fld,
const word name,
const label  target = -1 
)

Returns accessor index.

Referenced by scene::addMesh(), and gltfSetWriter< Type >::writeAnimateTracks().

Here is the caller graph for this function:

◆ addMesh() [1/2]

label addMesh ( const Type &  fld,
const word name 
)

Returns index of last mesh.

Referenced by gltfSetWriter< Type >::write(), gltfSetWriter< Type >::writeAnimateTracks(), and gltfSetWriter< Type >::writeStaticTracks().

Here is the caller graph for this function:

◆ addFieldToMesh() [1/2]

label addFieldToMesh ( const Type &  fld,
const word name,
const label  meshi 
)

Returns accessor index.

Referenced by gltfSetWriter< Type >::write(), gltfSetWriter< Type >::writeAnimateTracks(), and gltfSetWriter< Type >::writeStaticTracks().

Here is the caller graph for this function:

◆ addColourToMesh()

Foam::label addColourToMesh ( const vectorField fld,
const word name,
const label  meshi,
const scalarField alpha = scalarField() 
)

Returns accessor index.

Definition at line 47 of file foamGltfScene.C.

References Foam::abort(), Foam::constant::atomic::alpha, Foam::glTF::ARRAY_BUFFER, Foam::FatalError, FatalErrorInFunction, fld, Foam::glTF::key(), and Foam::name().

Referenced by gltfSetWriter< Type >::write(), gltfSetWriter< Type >::writeAnimateTracks(), and gltfSetWriter< Type >::writeStaticTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAnimation()

Foam::label createAnimation ( const word name)

Returns index of last animation.

Definition at line 94 of file foamGltfScene.C.

References Foam::name().

Referenced by gltfSetWriter< Type >::writeAnimateTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addToAnimation()

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 102 of file foamGltfScene.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Referenced by gltfSetWriter< Type >::writeAnimateTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void write ( Ostream os)

Write to stream (JSON and binary data)

Definition at line 139 of file foamGltfScene.C.

References IOstreamOption::BINARY, fileName::concat(), Foam::decrIndent(), Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), fileName::name(), Foam::nl, os(), OFstream::stdStream(), and Ostream::write().

Referenced by gltfSetWriter< Type >::write(), gltfSetWriter< Type >::writeAnimateTracks(), and gltfSetWriter< Type >::writeStaticTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addField() [2/2]

Foam::label addField ( const Type &  fld,
const word name,
const label  target 
)

Definition at line 30 of file foamGltfSceneTemplates.C.

References fld, and Foam::name().

Here is the call graph for this function:

◆ addMesh() [2/2]

Foam::label addMesh ( const Type &  fld,
const word name 
)

Definition at line 59 of file foamGltfSceneTemplates.C.

References mesh::accessorId(), scene::addField(), Foam::glTF::ARRAY_BUFFER, fld, Foam::glTF::key(), and Foam::name().

Here is the call graph for this function:

◆ addFieldToMesh() [2/2]

Foam::label addFieldToMesh ( const Type &  fld,
const word name,
const label  meshi 
)

Definition at line 73 of file foamGltfSceneTemplates.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, fld, and Foam::name().

Here is the call graph for this function:

The documentation for this class was generated from the following files: