accessor Class Reference

glTF accessor More...

Inheritance diagram for accessor:
[legend]
Collaboration diagram for accessor:
[legend]

Public Member Functions

 accessor ()
 Default construct. More...
 
 accessor (const word &name)
 Construct from name. More...
 
 ~accessor ()=default
 Destructor. More...
 
label & bufferViewId () noexcept
 Return the buffer view index. More...
 
label & byteOffset () noexcept
 Return the byte offset. More...
 
label & componentType () noexcept
 Return the component type. More...
 
label & count () noexcept
 Return the data size. More...
 
stringtype () noexcept
 Return the type. More...
 
template<class Type >
void set (const Field< Type > &fld, bool calcMinMax=true)
 Set the accessor. More...
 
void write (Ostream &os) const
 Write. More...
 
template<class Type >
Foam::string getValueType ()
 
template<class Type >
Foam::string toString (const Type &val)
 
- Public Member Functions inherited from base
 base ()
 Default construct. More...
 
 base (const word &name)
 Construct with name. More...
 
 ~base ()=default
 Destructor. More...
 
label & id () noexcept
 Return access to the ID. More...
 
const wordname () const noexcept
 Return const access to the name. More...
 
void write (Ostream &os) const
 Write. More...
 
void operator= (const base &gltf)
 

Static Protected Member Functions

template<class Type >
static string getValueType ()
 Return the glTF value type for the given OpenFOAM type. More...
 
template<class Type >
static string toString (const Type &val)
 Stringify the value. More...
 

Protected Attributes

label bufferViewId_
 Buffer view index. More...
 
label byteOffset_
 Byte offset. More...
 
label componentType_
 Component type. More...
 
label count_
 Data size. More...
 
string type_
 Data type. More...
 
string max_
 Max value. Note: stored as a string for convenience. More...
 
string min_
 Min value. Note: stored as a string for convenience. More...
 
bool minMax_
 Flag to indicate whether min and max values are available. More...
 
- Protected Attributes inherited from base
word name_
 Name. More...
 
label id_
 ID. More...
 

Detailed Description

glTF accessor

Note
Implements the glTF v2 specification
Source files

Definition at line 66 of file foamGltfAccessor.H.

Constructor & Destructor Documentation

◆ accessor() [1/2]

accessor ( )

Default construct.

Definition at line 32 of file foamGltfAccessor.C.

◆ accessor() [2/2]

accessor ( const word name)
explicit

Construct from name.

Definition at line 46 of file foamGltfAccessor.C.

◆ ~accessor()

~accessor ( )
default

Destructor.

Member Function Documentation

◆ getValueType() [1/2]

static string getValueType ( )
staticprotected

Return the glTF value type for the given OpenFOAM type.

◆ toString() [1/2]

static string toString ( const Type &  val)
staticprotected

Stringify the value.

◆ bufferViewId()

Foam::label & bufferViewId ( )
noexcept

Return the buffer view index.

Definition at line 62 of file foamGltfAccessor.C.

◆ byteOffset()

Foam::label & byteOffset ( )
noexcept

Return the byte offset.

Definition at line 68 of file foamGltfAccessor.C.

◆ componentType()

Foam::label & componentType ( )
noexcept

Return the component type.

Definition at line 74 of file foamGltfAccessor.C.

◆ count()

Foam::label & count ( )
noexcept

Return the data size.

Definition at line 80 of file foamGltfAccessor.C.

◆ type()

Foam::string & type ( )
noexcept

Return the type.

Definition at line 86 of file foamGltfAccessor.C.

◆ set()

void set ( const Field< Type > &  fld,
bool  calcMinMax = true 
)

Set the accessor.

Definition at line 86 of file foamGltfAccessorTemplates.C.

References fld(), Foam::glTF::FLOAT, Foam::glTF::key(), Foam::max(), maxValue, Foam::min(), minValue, and ITstream::toString().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const

Write.

Definition at line 92 of file foamGltfAccessor.C.

References Foam::indent(), Foam::nl, os(), and ObukhovLength::write().

Referenced by Foam::operator<<().

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

◆ getValueType() [2/2]

Foam::string getValueType ( )

Definition at line 34 of file foamGltfAccessorTemplates.C.

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

Here is the call graph for this function:

◆ toString() [2/2]

Foam::string toString ( const Type &  val)

Definition at line 68 of file foamGltfAccessorTemplates.C.

References Foam::component(), and StringStreamAllocator< StreamType >::str().

Here is the call graph for this function:

Member Data Documentation

◆ bufferViewId_

label bufferViewId_
protected

Buffer view index.

Definition at line 75 of file foamGltfAccessor.H.

◆ byteOffset_

label byteOffset_
protected

Byte offset.

Definition at line 78 of file foamGltfAccessor.H.

◆ componentType_

label componentType_
protected

Component type.

Definition at line 81 of file foamGltfAccessor.H.

◆ count_

label count_
protected

Data size.

Definition at line 84 of file foamGltfAccessor.H.

◆ type_

string type_
protected

Data type.

Definition at line 87 of file foamGltfAccessor.H.

◆ max_

string max_
protected

Max value. Note: stored as a string for convenience.

Definition at line 90 of file foamGltfAccessor.H.

◆ min_

string min_
protected

Min value. Note: stored as a string for convenience.

Definition at line 93 of file foamGltfAccessor.H.

◆ minMax_

bool minMax_
protected

Flag to indicate whether min and max values are available.

Definition at line 96 of file foamGltfAccessor.H.


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