41#ifndef foam_gltf_accessor_H
42#define foam_gltf_accessor_H
145 void set(const
Field<Type>&
fld,
bool calcMinMax = true);
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))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
string min_
Min value. Note: stored as a string for convenience.
string max_
Max value. Note: stored as a string for convenience.
label & componentType() noexcept
Return the component type.
label & count() noexcept
Return the data size.
label componentType_
Component type.
accessor()
Default construct.
label bufferViewId_
Buffer view index.
static string getValueType()
Return the glTF value type for the given OpenFOAM type.
~accessor()=default
Destructor.
string & type() noexcept
Return the type.
void write(Ostream &os) const
Write.
label & byteOffset() noexcept
Return the byte offset.
label & bufferViewId() noexcept
Return the buffer view index.
void set(const Field< Type > &fld, bool calcMinMax=true)
Set the accessor.
bool minMax_
Flag to indicate whether min and max values are available.
label byteOffset_
Byte offset.
static string toString(const Type &val)
Stringify the value.
const word & name() const noexcept
Return const access to the name.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling glTF creation. https://www.khronos.org/registry/glTF/.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).