41 #ifndef Foam_gltf_scene_H 42 #define Foam_gltf_scene_H 96 mesh& getMesh(label meshi);
115 const label target = -1
149 const label animationi,
151 const label outputId,
A class for handling file names.
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
static const Field< scalar > & null() noexcept
Return a null Field (reference to a nullObject). Behaves like an empty Field.
void addToAnimation(const label animationi, const label inputId, const label outputId, const label meshId, const string &interpolation="LINEAR")
Add to existing animation.
label addFieldToMesh(const Type &fld, const word &name, const label meshId)
Returns accessor index.
label addMesh(const Type &fld, const word &name)
Returns index of last mesh.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
label createAnimation(const word &name)
Returns index of last animation.
scene()
Default construct.
A class for handling words, derived from Foam::string.
Main class to assemble glTF components into a scene.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
label addField(const Type &fld, const word &name, const label target=-1)
Returns accessor index.
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.
Abstract base class for volume field interpolation.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Container for glTF entities.
void write(const fileName &outputFile)
Write to file pair (.gltf, .bin)