Open CASCADE Technology  7.6.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. More...
 
void SetFilePath (const TCollection_AsciiString &theFilePath)
 Set file path. More...
 
void SetProbeHeader (bool theToProbe)
 Set flag for probing file without complete reading. More...
 
const TCollection_AsciiStringErrorPrefix () const
 Return prefix for reporting issues. More...
 
void SetErrorPrefix (const TCollection_AsciiString &theErrPrefix)
 Set prefix for reporting issues. More...
 
void SetAttributeMap (RWMesh_NodeAttributeMap &theAttribMap)
 Set map for storing node attributes. More...
 
void SetExternalFiles (NCollection_IndexedMap< TCollection_AsciiString > &theExternalFiles)
 Set list for storing external files. More...
 
void SetMetadata (TColStd_IndexedDataMapOfStringString &theMetadata)
 Set metadata map. More...
 
const RWMesh_CoordinateSystemConverterCoordinateSystemConverter () const
 Return transformation from glTF to OCCT coordinate system. More...
 
void SetCoordinateSystemConverter (const RWMesh_CoordinateSystemConverter &theConverter)
 Set transformation from glTF to OCCT coordinate system. More...
 
void SetBinaryFormat (int64_t theBinBodyOffset, int64_t theBinBodyLen)
 Initialize binary format. More...
 
void SetSkipEmptyNodes (bool theToSkip)
 Set flag to ignore nodes without Geometry, TRUE by default. More...
 
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. More...
 
void SetMeshNameAsFallback (bool theToFallback)
 Set flag to use Mesh name in case if Node name is empty, TRUE by default. More...
 
bool Parse (const Message_ProgressRange &theProgress)
 Parse glTF document. More...
 
NCollection_Vector< TopoDS_Face > & FaceList ()
 Return face list for loading triangulation. More...
 

Protected Member Functions

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

Protected Attributes

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

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.

◆ 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

◆ 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: