Loading...
Searching...
No Matches
accessor Class Reference

glTF accessor More...

#include <foamGltfAccessor.H>

Inheritance diagram for accessor:
Collaboration diagram for accessor:

Public Member Functions

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

Protected Attributes

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

Detailed Description

glTF accessor

Note
Implements the glTF v2 specification
Source files

Definition at line 62 of file foamGltfAccessor.H.

Constructor & Destructor Documentation

◆ accessor() [1/2]

accessor ( )

Default construct.

Definition at line 25 of file foamGltfAccessor.C.

References base::base(), bufferViewId_, byteOffset_, componentType_, count_, max_, min_, minMax_, and type_.

Here is the call graph for this function:

◆ accessor() [2/2]

accessor ( const word & name)
explicit

Construct from name.

Definition at line 39 of file foamGltfAccessor.C.

References base::base(), bufferViewId_, byteOffset_, componentType_, count_, max_, min_, minMax_, base::name(), and type_.

Here is the call graph for this function:

◆ ~accessor()

~accessor ( )
default

Destructor.

References byteOffset(), componentType(), count(), fld(), Foam::noexcept, os(), set(), type(), and write().

Here is the call graph for this function:

Member Function Documentation

◆ getValueType() [1/2]

template<class Type>
string getValueType ( )
staticprotected

Return the glTF value type for the given OpenFOAM type.

Referenced by set().

Here is the caller graph for this function:

◆ toString() [1/2]

template<class Type>
string toString ( const Type & val)
staticprotected

Stringify the value.

References base::name().

Referenced by set().

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

◆ bufferViewId()

Foam::label & bufferViewId ( )
noexcept

Return the buffer view index.

Definition at line 55 of file foamGltfAccessor.C.

References bufferViewId_, and Foam::noexcept.

◆ byteOffset()

Foam::label & byteOffset ( )
noexcept

Return the byte offset.

Definition at line 61 of file foamGltfAccessor.C.

References byteOffset_, and Foam::noexcept.

Referenced by ~accessor().

Here is the caller graph for this function:

◆ componentType()

Foam::label & componentType ( )
noexcept

Return the component type.

Definition at line 67 of file foamGltfAccessor.C.

References componentType_, and Foam::noexcept.

Referenced by ~accessor().

Here is the caller graph for this function:

◆ count()

Foam::label & count ( )
noexcept

Return the data size.

Definition at line 73 of file foamGltfAccessor.C.

References count_, and Foam::noexcept.

Referenced by ~accessor().

Here is the caller graph for this function:

◆ type()

Foam::string & type ( )
noexcept

Return the type.

Definition at line 79 of file foamGltfAccessor.C.

References Foam::noexcept, and type_.

Referenced by ~accessor().

Here is the caller graph for this function:

◆ set()

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

Set the accessor.

Definition at line 79 of file foamGltfAccessorTemplates.C.

References componentType_, count_, fld(), Foam::glTF::FLOAT, getValueType(), Foam::glTF::key(), Foam::max(), max_, maxValue, Foam::min(), min_, minMax_, minValue, toString(), and type_.

Referenced by ~accessor().

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

◆ write()

void write ( Ostream & os) const

Write.

Definition at line 85 of file foamGltfAccessor.C.

References bufferViewId_, byteOffset_, componentType_, count_, Foam::indent(), max_, min_, minMax_, Foam::nl, os(), type_, and base::write().

Referenced by Foam::operator<<(), and ~accessor().

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

◆ getValueType() [2/2]

template<class Type>
Foam::string getValueType ( )

Definition at line 27 of file foamGltfAccessorTemplates.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and exprTypeTraits< Type >::value.

Here is the call graph for this function:

◆ toString() [2/2]

template<class Type>
Foam::string toString ( const Type & val)

Definition at line 61 of file foamGltfAccessorTemplates.C.

References Foam::component(), and OStringStream::str().

Here is the call graph for this function:

Member Data Documentation

◆ bufferViewId_

label bufferViewId_
protected

Buffer view index.

Definition at line 73 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), bufferViewId(), and write().

◆ byteOffset_

label byteOffset_
protected

Byte offset.

Definition at line 78 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), byteOffset(), and write().

◆ componentType_

label componentType_
protected

Component type.

Definition at line 83 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), componentType(), set(), and write().

◆ count_

label count_
protected

Data size.

Definition at line 88 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), count(), set(), and write().

◆ type_

string type_
protected

Data type.

Definition at line 93 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), set(), type(), and write().

◆ max_

string max_
protected

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

Definition at line 98 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), set(), and write().

◆ min_

string min_
protected

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

Definition at line 103 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), set(), and write().

◆ minMax_

bool minMax_
protected

Flag to indicate whether min and max values are available.

Definition at line 108 of file foamGltfAccessor.H.

Referenced by accessor(), accessor(), set(), and write().


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