Open CASCADE Technology 7.8.0
Public Member Functions | Protected Member Functions | Protected Attributes
RWGltf_GltfJsonParser Class Reference

INTERNAL tool for parsing glTF document (JSON structure). More...

#include <RWGltf_GltfJsonParser.hxx>

Public Member Functions

 RWGltf_GltfJsonParser (TopTools_SequenceOfShape &theRootShapes)
 Empty constructor.
 
void SetFilePath (const TCollection_AsciiString &theFilePath)
 Set file path.
 
void SetProbeHeader (bool theToProbe)
 Set flag for probing file without complete reading.
 
const TCollection_AsciiStringErrorPrefix () const
 Return prefix for reporting issues.
 
void SetErrorPrefix (const TCollection_AsciiString &theErrPrefix)
 Set prefix for reporting issues.
 
void SetAttributeMap (RWMesh_NodeAttributeMap &theAttribMap)
 Set map for storing node attributes.
 
void SetExternalFiles (NCollection_IndexedMap< TCollection_AsciiString > &theExternalFiles)
 Set list for storing external files.
 
void SetMetadata (TColStd_IndexedDataMapOfStringString &theMetadata)
 Set metadata map.
 
void SetReadAssetExtras (bool theToRead)
 Set flag to translate asset.extras into metadata.
 
const RWMesh_CoordinateSystemConverterCoordinateSystemConverter () const
 Return transformation from glTF to OCCT coordinate system.
 
void SetCoordinateSystemConverter (const RWMesh_CoordinateSystemConverter &theConverter)
 Set transformation from glTF to OCCT coordinate system.
 
void SetBinaryFormat (int64_t theBinBodyOffset, int64_t theBinBodyLen)
 Initialize binary format.
 
void SetSkipEmptyNodes (bool theToSkip)
 Set flag to ignore nodes without Geometry, TRUE by default.
 
void SetLoadAllScenes (bool theToLoadAll)
 Set flag to flag to load all scenes in the document, FALSE by default which means only main (default) scene will be loaded.
 
void SetMeshNameAsFallback (bool theToFallback)
 Set flag to use Mesh name in case if Node name is empty, TRUE by default.
 
bool Parse (const Message_ProgressRange &theProgress)
 Parse glTF document.
 
NCollection_Vector< TopoDS_Face > & FaceList ()
 Return face list for loading triangulation.
 

Protected Member Functions

void reportGltfSyntaxProblem (const TCollection_AsciiString &theMsg, Message_Gravity theGravity)
 Print message about invalid glTF syntax.
 

Protected Attributes

TopTools_SequenceOfShapemyRootShapes
 sequence of result root shapes
 
RWMesh_NodeAttributeMapmyAttribMap
 shape attributes
 
NCollection_IndexedMap< TCollection_AsciiString > * myExternalFiles
 list of external file references
 
RWMesh_CoordinateSystemConverter myCSTrsf
 transformation from glTF to OCCT coordinate system
 
TColStd_IndexedDataMapOfStringStringmyMetadata
 file metadata
 
NCollection_DataMap< TCollection_AsciiString, Handle< RWGltf_MaterialMetallicRoughness > > myMaterialsPbr
 
NCollection_DataMap< TCollection_AsciiString, Handle< RWGltf_MaterialCommon > > myMaterialsCommon
 
NCollection_DataMap< TCollection_AsciiString, Handle< XCAFDoc_VisMaterial > > myMaterials
 
NCollection_DataMap< TCollection_AsciiString, TopoDS_ShapemyShapeMap [3]
 
NCollection_DataMap< TCollection_AsciiString, boolmyProbedFiles
 
NCollection_DataMap< TCollection_AsciiString, Handle< NCollection_Buffer > > myDecodedBuffers
 
NCollection_Vector< TopoDS_FacemyFaceList
 face list for loading triangulation
 
TCollection_AsciiString myFilePath
 file path
 
TCollection_AsciiString myFolder
 folder
 
TCollection_AsciiString myErrorPrefix
 invalid syntax error prefix
 
int64_t myBinBodyOffset
 offset to binary body
 
int64_t myBinBodyLen
 binary body length
 
bool myIsBinary
 binary document
 
bool myIsGltf1
 obsolete glTF 1.0 version format
 
bool myToSkipEmptyNodes
 ignore nodes without Geometry
 
bool myToLoadAllScenes
 flag to load all scenes in the document, FALSE by default
 
bool myUseMeshNameAsFallback
 flag to use Mesh name in case if Node name is empty, TRUE by default
 
bool myToProbeHeader
 flag to probe header without full reading, FALSE by default
 
bool myToReadAssetExtras
 flag to translate asset.extras into metadata, TRUE by default
 

Detailed Description

INTERNAL tool for parsing glTF document (JSON structure).

Constructor & Destructor Documentation

◆ RWGltf_GltfJsonParser()

RWGltf_GltfJsonParser::RWGltf_GltfJsonParser ( TopTools_SequenceOfShape theRootShapes)

Empty constructor.

Member Function Documentation

◆ CoordinateSystemConverter()

const RWMesh_CoordinateSystemConverter & RWGltf_GltfJsonParser::CoordinateSystemConverter ( ) const
inline

Return transformation from glTF to OCCT coordinate system.

◆ ErrorPrefix()

const TCollection_AsciiString & RWGltf_GltfJsonParser::ErrorPrefix ( ) const
inline

Return prefix for reporting issues.

◆ FaceList()

NCollection_Vector< TopoDS_Face > & RWGltf_GltfJsonParser::FaceList ( )
inline

Return face list for loading triangulation.

◆ Parse()

bool RWGltf_GltfJsonParser::Parse ( const Message_ProgressRange theProgress)

Parse glTF document.

◆ reportGltfSyntaxProblem()

void RWGltf_GltfJsonParser::reportGltfSyntaxProblem ( const TCollection_AsciiString theMsg,
Message_Gravity  theGravity 
)
protected

Print message about invalid glTF syntax.

◆ SetAttributeMap()

void RWGltf_GltfJsonParser::SetAttributeMap ( RWMesh_NodeAttributeMap theAttribMap)
inline

Set map for storing node attributes.

◆ SetBinaryFormat()

void RWGltf_GltfJsonParser::SetBinaryFormat ( int64_t  theBinBodyOffset,
int64_t  theBinBodyLen 
)
inline

Initialize binary format.

◆ SetCoordinateSystemConverter()

void RWGltf_GltfJsonParser::SetCoordinateSystemConverter ( const RWMesh_CoordinateSystemConverter theConverter)
inline

Set transformation from glTF to OCCT coordinate system.

◆ SetErrorPrefix()

void RWGltf_GltfJsonParser::SetErrorPrefix ( const TCollection_AsciiString theErrPrefix)
inline

Set prefix for reporting issues.

◆ SetExternalFiles()

void RWGltf_GltfJsonParser::SetExternalFiles ( NCollection_IndexedMap< TCollection_AsciiString > &  theExternalFiles)
inline

Set list for storing external files.

◆ SetFilePath()

void RWGltf_GltfJsonParser::SetFilePath ( const TCollection_AsciiString theFilePath)

Set file path.

◆ SetLoadAllScenes()

void RWGltf_GltfJsonParser::SetLoadAllScenes ( bool  theToLoadAll)
inline

Set flag to flag to load all scenes in the document, FALSE by default which means only main (default) scene will be loaded.

◆ SetMeshNameAsFallback()

void RWGltf_GltfJsonParser::SetMeshNameAsFallback ( bool  theToFallback)
inline

Set flag to use Mesh name in case if Node name is empty, TRUE by default.

◆ SetMetadata()

void RWGltf_GltfJsonParser::SetMetadata ( TColStd_IndexedDataMapOfStringString theMetadata)
inline

Set metadata map.

◆ SetProbeHeader()

void RWGltf_GltfJsonParser::SetProbeHeader ( bool  theToProbe)
inline

Set flag for probing file without complete reading.

◆ SetReadAssetExtras()

void RWGltf_GltfJsonParser::SetReadAssetExtras ( bool  theToRead)
inline

Set flag to translate asset.extras into metadata.

◆ SetSkipEmptyNodes()

void RWGltf_GltfJsonParser::SetSkipEmptyNodes ( bool  theToSkip)
inline

Set flag to ignore nodes without Geometry, TRUE by default.

Field Documentation

◆ myAttribMap

RWMesh_NodeAttributeMap* RWGltf_GltfJsonParser::myAttribMap
protected

shape attributes

◆ myBinBodyLen

int64_t RWGltf_GltfJsonParser::myBinBodyLen
protected

binary body length

◆ myBinBodyOffset

int64_t RWGltf_GltfJsonParser::myBinBodyOffset
protected

offset to binary body

◆ myCSTrsf

RWMesh_CoordinateSystemConverter RWGltf_GltfJsonParser::myCSTrsf
protected

transformation from glTF to OCCT coordinate system

◆ myDecodedBuffers

NCollection_DataMap<TCollection_AsciiString, Handle< NCollection_Buffer > > RWGltf_GltfJsonParser::myDecodedBuffers
protected

◆ myErrorPrefix

TCollection_AsciiString RWGltf_GltfJsonParser::myErrorPrefix
protected

invalid syntax error prefix

◆ myExternalFiles

NCollection_IndexedMap<TCollection_AsciiString>* RWGltf_GltfJsonParser::myExternalFiles
protected

list of external file references

◆ myFaceList

NCollection_Vector<TopoDS_Face> RWGltf_GltfJsonParser::myFaceList
protected

face list for loading triangulation

◆ myFilePath

TCollection_AsciiString RWGltf_GltfJsonParser::myFilePath
protected

file path

◆ myFolder

TCollection_AsciiString RWGltf_GltfJsonParser::myFolder
protected

folder

◆ myIsBinary

bool RWGltf_GltfJsonParser::myIsBinary
protected

binary document

◆ myIsGltf1

bool RWGltf_GltfJsonParser::myIsGltf1
protected

obsolete glTF 1.0 version format

◆ myMaterials

NCollection_DataMap<TCollection_AsciiString, Handle< XCAFDoc_VisMaterial > > RWGltf_GltfJsonParser::myMaterials
protected

◆ myMaterialsCommon

NCollection_DataMap<TCollection_AsciiString, Handle< RWGltf_MaterialCommon > > RWGltf_GltfJsonParser::myMaterialsCommon
protected

◆ myMaterialsPbr

NCollection_DataMap<TCollection_AsciiString, Handle< RWGltf_MaterialMetallicRoughness > > RWGltf_GltfJsonParser::myMaterialsPbr
protected

◆ myMetadata

TColStd_IndexedDataMapOfStringString* RWGltf_GltfJsonParser::myMetadata
protected

file metadata

◆ myProbedFiles

NCollection_DataMap<TCollection_AsciiString, bool> RWGltf_GltfJsonParser::myProbedFiles
protected

◆ myRootShapes

TopTools_SequenceOfShape* RWGltf_GltfJsonParser::myRootShapes
protected

sequence of result root shapes

◆ myShapeMap

NCollection_DataMap<TCollection_AsciiString, TopoDS_Shape> RWGltf_GltfJsonParser::myShapeMap[3]
protected

◆ myToLoadAllScenes

bool RWGltf_GltfJsonParser::myToLoadAllScenes
protected

flag to load all scenes in the document, FALSE by default

◆ myToProbeHeader

bool RWGltf_GltfJsonParser::myToProbeHeader
protected

flag to probe header without full reading, FALSE by default

◆ myToReadAssetExtras

bool RWGltf_GltfJsonParser::myToReadAssetExtras
protected

flag to translate asset.extras into metadata, TRUE by default

◆ myToSkipEmptyNodes

bool RWGltf_GltfJsonParser::myToSkipEmptyNodes
protected

ignore nodes without Geometry

◆ myUseMeshNameAsFallback

bool RWGltf_GltfJsonParser::myUseMeshNameAsFallback
protected

flag to use Mesh name in case if Node name is empty, TRUE by default


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