Open CASCADE Technology  7.4.1.dev
Public Member Functions | Protected Member Functions | Protected Attributes
RWGltf_CafWriter Class Reference

glTF writer context from XCAF document. More...

#include <RWGltf_CafWriter.hxx>

Inheritance diagram for RWGltf_CafWriter:
Inheritance graph
[legend]

Public Member Functions

 RWGltf_CafWriter (const TCollection_AsciiString &theFile, Standard_Boolean theIsBinary)
 Main constructor. More...
 
virtual ~RWGltf_CafWriter ()
 Destructor. More...
 
const RWMesh_CoordinateSystemConverterCoordinateSystemConverter () const
 Return transformation from OCCT to glTF coordinate system. More...
 
RWMesh_CoordinateSystemConverterChangeCoordinateSystemConverter ()
 Return transformation from OCCT to glTF coordinate system. More...
 
void SetCoordinateSystemConverter (const RWMesh_CoordinateSystemConverter &theConverter)
 Set transformation from OCCT to glTF coordinate system. More...
 
bool IsBinary () const
 Return flag to write into binary glTF format (.glb), specified within class constructor. More...
 
RWGltf_WriterTrsfFormat TransformationFormat () const
 Return preferred transformation format for writing into glTF file; RWGltf_WriterTrsfFormat_Compact by default. More...
 
void SetTransformationFormat (RWGltf_WriterTrsfFormat theFormat)
 Set preferred transformation format for writing into glTF file. More...
 
bool IsForcedUVExport () const
 Return TRUE to export UV coordinates even if there are no mapped texture; FALSE by default. More...
 
void SetForcedUVExport (bool theToForce)
 Set flag to export UV coordinates even if there are no mapped texture; FALSE by default. More...
 
const XCAFPrs_StyleDefaultStyle () const
 Return default material definition to be used for nodes with only color defined. More...
 
void SetDefaultStyle (const XCAFPrs_Style &theStyle)
 Set default material definition to be used for nodes with only color defined. More...
 
virtual bool Perform (const Handle< TDocStd_Document > &theDocument, const TDF_LabelSequence &theRootLabels, const TColStd_MapOfAsciiString *theLabelFilter, const TColStd_IndexedDataMapOfStringString &theFileInfo, const Handle< Message_ProgressIndicator > &theProgress)
 Write glTF file and associated binary file. Triangulation data should be precomputed within shapes! More...
 
virtual bool Perform (const Handle< TDocStd_Document > &theDocument, const TColStd_IndexedDataMapOfStringString &theFileInfo, const Handle< Message_ProgressIndicator > &theProgress)
 Write glTF file and associated binary file. Triangulation data should be precomputed within shapes! More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

virtual bool writeBinData (const Handle< TDocStd_Document > &theDocument, const TDF_LabelSequence &theRootLabels, const TColStd_MapOfAsciiString *theLabelFilter, const Handle< Message_ProgressIndicator > &theProgress)
 Write binary data file with triangulation data. Triangulation data should be precomputed within shapes! More...
 
virtual bool writeJson (const Handle< TDocStd_Document > &theDocument, const TDF_LabelSequence &theRootLabels, const TColStd_MapOfAsciiString *theLabelFilter, const TColStd_IndexedDataMapOfStringString &theFileInfo, const Handle< Message_ProgressIndicator > &theProgress)
 Write JSON file with glTF structure (should be called after writeBinData()). More...
 
virtual Standard_Boolean toSkipFaceMesh (const RWMesh_FaceIterator &theFaceIter)
 Return TRUE if face mesh should be skipped (e.g. because it is invalid or empty). More...
 
virtual void saveNodes (RWGltf_GltfFace &theGltfFace, std::ostream &theBinFile, const RWMesh_FaceIterator &theFaceIter, Standard_Integer &theAccessorNb) const
 Write mesh nodes into binary file. More...
 
virtual void saveNormals (RWGltf_GltfFace &theGltfFace, std::ostream &theBinFile, RWMesh_FaceIterator &theFaceIter, Standard_Integer &theAccessorNb) const
 Write mesh normals into binary file. More...
 
virtual void saveTextCoords (RWGltf_GltfFace &theGltfFace, std::ostream &theBinFile, const RWMesh_FaceIterator &theFaceIter, Standard_Integer &theAccessorNb) const
 Write mesh texture UV coordinates into binary file. More...
 
virtual void saveIndices (RWGltf_GltfFace &theGltfFace, std::ostream &theBinFile, const RWMesh_FaceIterator &theFaceIter, Standard_Integer &theAccessorNb)
 Write mesh indexes into binary file. More...
 
virtual void writePositions (const RWGltf_GltfFace &theGltfFace)
 Write bufferView for vertex positions within RWGltf_GltfRootElement_Accessors section. More...
 
virtual void writeNormals (const RWGltf_GltfFace &theGltfFace)
 Write bufferView for vertex normals within RWGltf_GltfRootElement_Accessors section. More...
 
virtual void writeTextCoords (const RWGltf_GltfFace &theGltfFace)
 Write bufferView for vertex texture coordinates within RWGltf_GltfRootElement_Accessors section. More...
 
virtual void writeIndices (const RWGltf_GltfFace &theGltfFace)
 Write bufferView for triangle indexes within RWGltf_GltfRootElement_Accessors section. More...
 
virtual void writeAccessors (const RWGltf_GltfSceneNodeMap &theSceneNodeMap)
 Write RWGltf_GltfRootElement_Accessors section. More...
 
virtual void writeAnimations ()
 Write RWGltf_GltfRootElement_Animations section (reserved). More...
 
virtual void writeAsset (const TColStd_IndexedDataMapOfStringString &theFileInfo)
 Write RWGltf_GltfRootElement_Asset section. More...
 
virtual void writeBufferViews (const Standard_Integer theBinDataBufferId)
 Write RWGltf_GltfRootElement_BufferViews section. More...
 
virtual void writeBuffers ()
 Write RWGltf_GltfRootElement_Buffers section. More...
 
virtual void writeExtensions ()
 Write RWGltf_GltfRootElement_ExtensionsUsed/RWGltf_GltfRootElement_ExtensionsRequired sections (reserved). More...
 
virtual void writeImages (const RWGltf_GltfSceneNodeMap &theSceneNodeMap, RWGltf_GltfMaterialMap &theMaterialMap)
 Write RWGltf_GltfRootElement_Images section. More...
 
virtual void writeMaterials (const RWGltf_GltfSceneNodeMap &theSceneNodeMap, RWGltf_GltfMaterialMap &theMaterialMap)
 Write RWGltf_GltfRootElement_Materials section. More...
 
virtual void writeMeshes (const RWGltf_GltfSceneNodeMap &theSceneNodeMap, const RWGltf_GltfMaterialMap &theMaterialMap)
 Write RWGltf_GltfRootElement_Meshes section. More...
 
virtual void writeNodes (const Handle< TDocStd_Document > &theDocument, const TDF_LabelSequence &theRootLabels, const TColStd_MapOfAsciiString *theLabelFilter, const RWGltf_GltfSceneNodeMap &theSceneNodeMap, NCollection_Sequence< Standard_Integer > &theSceneRootNodeInds)
 Write RWGltf_GltfRootElement_Nodes section. More...
 
virtual void writeSamplers (const RWGltf_GltfMaterialMap &theMaterialMap)
 Write RWGltf_GltfRootElement_Samplers section. More...
 
virtual void writeScene (const Standard_Integer theDefSceneId)
 Write RWGltf_GltfRootElement_Scene section. More...
 
virtual void writeScenes (const NCollection_Sequence< Standard_Integer > &theSceneRootNodeInds)
 Write RWGltf_GltfRootElement_Scenes section. More...
 
virtual void writeSkins ()
 Write RWGltf_GltfRootElement_Skins section (reserved). More...
 
virtual void writeTextures (const RWGltf_GltfSceneNodeMap &theSceneNodeMap, RWGltf_GltfMaterialMap &theMaterialMap)
 Write RWGltf_GltfRootElement_Textures section. More...
 

Protected Attributes

TCollection_AsciiString myFile
 output glTF file More...
 
TCollection_AsciiString myBinFileNameFull
 output file with binary data (full path) More...
 
TCollection_AsciiString myBinFileNameShort
 output file with binary data (short path) More...
 
RWGltf_WriterTrsfFormat myTrsfFormat
 transformation format to write into glTF file More...
 
Standard_Boolean myIsBinary
 flag to write into binary glTF format (.glb) More...
 
Standard_Boolean myIsForcedUVExport
 export UV coordinates even if there are no mapped texture More...
 
RWMesh_CoordinateSystemConverter myCSTrsf
 transformation from OCCT to glTF coordinate system More...
 
XCAFPrs_Style myDefaultStyle
 default material definition to be used for nodes with only color defined More...
 
opencascade::std::shared_ptr< RWGltf_GltfOStreamWritermyWriter
 JSON writer. More...
 
RWGltf_GltfBufferView myBuffViewPos
 current buffer view with nodes positions More...
 
RWGltf_GltfBufferView myBuffViewNorm
 current buffer view with nodes normals More...
 
RWGltf_GltfBufferView myBuffViewTextCoord
 current buffer view with nodes UV coordinates More...
 
RWGltf_GltfBufferView myBuffViewInd
 current buffer view with triangulation indexes More...
 
NCollection_DataMap< TopoDS_Shape, RWGltf_GltfFace, TopTools_ShapeMapHashermyBinDataMap
 map for TopoDS_Face to glTF face (merging duplicates) More...
 
int64_t myBinDataLen64
 length of binary file More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

glTF writer context from XCAF document.

Constructor & Destructor Documentation

◆ RWGltf_CafWriter()

RWGltf_CafWriter::RWGltf_CafWriter ( const TCollection_AsciiString theFile,
Standard_Boolean  theIsBinary 
)

Main constructor.

Parameters
theFile[in] path to output glTF file
theIsBinary[in] flag to write into binary glTF format (.glb)

◆ ~RWGltf_CafWriter()

virtual RWGltf_CafWriter::~RWGltf_CafWriter ( )
virtual

Destructor.

Member Function Documentation

◆ ChangeCoordinateSystemConverter()

RWMesh_CoordinateSystemConverter& RWGltf_CafWriter::ChangeCoordinateSystemConverter ( )
inline

Return transformation from OCCT to glTF coordinate system.

◆ CoordinateSystemConverter()

const RWMesh_CoordinateSystemConverter& RWGltf_CafWriter::CoordinateSystemConverter ( ) const
inline

Return transformation from OCCT to glTF coordinate system.

◆ DefaultStyle()

const XCAFPrs_Style& RWGltf_CafWriter::DefaultStyle ( ) const
inline

Return default material definition to be used for nodes with only color defined.

◆ IsBinary()

bool RWGltf_CafWriter::IsBinary ( ) const
inline

Return flag to write into binary glTF format (.glb), specified within class constructor.

◆ IsForcedUVExport()

bool RWGltf_CafWriter::IsForcedUVExport ( ) const
inline

Return TRUE to export UV coordinates even if there are no mapped texture; FALSE by default.

◆ Perform() [1/2]

virtual bool RWGltf_CafWriter::Perform ( const Handle< TDocStd_Document > &  theDocument,
const TDF_LabelSequence theRootLabels,
const TColStd_MapOfAsciiString theLabelFilter,
const TColStd_IndexedDataMapOfStringString theFileInfo,
const Handle< Message_ProgressIndicator > &  theProgress 
)
virtual

Write glTF file and associated binary file. Triangulation data should be precomputed within shapes!

Parameters
theDocument[in] input document
theRootLabels[in] list of root shapes to export
theLabelFilter[in] optional filter with document nodes to export, with keys defined by XCAFPrs_DocumentExplorer::DefineChildId() and filled recursively (leaves and parent assembly nodes at all levels); when not NULL, all nodes not included into the map will be ignored
theFileInfo[in] map with file metadata to put into glTF header section
theProgress[in] optional progress indicator
Returns
FALSE on file writing failure

◆ Perform() [2/2]

virtual bool RWGltf_CafWriter::Perform ( const Handle< TDocStd_Document > &  theDocument,
const TColStd_IndexedDataMapOfStringString theFileInfo,
const Handle< Message_ProgressIndicator > &  theProgress 
)
virtual

Write glTF file and associated binary file. Triangulation data should be precomputed within shapes!

Parameters
theDocument[in] input document
theFileInfo[in] map with file metadata to put into glTF header section
theProgress[in] optional progress indicator
Returns
FALSE on file writing failure

◆ saveIndices()

virtual void RWGltf_CafWriter::saveIndices ( RWGltf_GltfFace theGltfFace,
std::ostream &  theBinFile,
const RWMesh_FaceIterator theFaceIter,
Standard_Integer theAccessorNb 
)
protectedvirtual

Write mesh indexes into binary file.

Parameters
theGltfFace[out] glTF face definition
theBinFile[out] output file to write into
theFaceIter[in] current face to write
theAccessorNb[in] [out] last accessor index

◆ saveNodes()

virtual void RWGltf_CafWriter::saveNodes ( RWGltf_GltfFace theGltfFace,
std::ostream &  theBinFile,
const RWMesh_FaceIterator theFaceIter,
Standard_Integer theAccessorNb 
) const
protectedvirtual

Write mesh nodes into binary file.

Parameters
theGltfFace[out] glTF face definition
theBinFile[out] output file to write into
theFaceIter[in] current face to write
theAccessorNb[in] [out] last accessor index

◆ saveNormals()

virtual void RWGltf_CafWriter::saveNormals ( RWGltf_GltfFace theGltfFace,
std::ostream &  theBinFile,
RWMesh_FaceIterator theFaceIter,
Standard_Integer theAccessorNb 
) const
protectedvirtual

Write mesh normals into binary file.

Parameters
theGltfFace[out] glTF face definition
theBinFile[out] output file to write into
theFaceIter[in] current face to write
theAccessorNb[in] [out] last accessor index

◆ saveTextCoords()

virtual void RWGltf_CafWriter::saveTextCoords ( RWGltf_GltfFace theGltfFace,
std::ostream &  theBinFile,
const RWMesh_FaceIterator theFaceIter,
Standard_Integer theAccessorNb 
) const
protectedvirtual

Write mesh texture UV coordinates into binary file.

Parameters
theGltfFace[out] glTF face definition
theBinFile[out] output file to write into
theFaceIter[in] current face to write
theAccessorNb[in] [out] last accessor index

◆ SetCoordinateSystemConverter()

void RWGltf_CafWriter::SetCoordinateSystemConverter ( const RWMesh_CoordinateSystemConverter theConverter)
inline

Set transformation from OCCT to glTF coordinate system.

◆ SetDefaultStyle()

void RWGltf_CafWriter::SetDefaultStyle ( const XCAFPrs_Style theStyle)
inline

Set default material definition to be used for nodes with only color defined.

◆ SetForcedUVExport()

void RWGltf_CafWriter::SetForcedUVExport ( bool  theToForce)
inline

Set flag to export UV coordinates even if there are no mapped texture; FALSE by default.

◆ SetTransformationFormat()

void RWGltf_CafWriter::SetTransformationFormat ( RWGltf_WriterTrsfFormat  theFormat)
inline

Set preferred transformation format for writing into glTF file.

◆ toSkipFaceMesh()

virtual Standard_Boolean RWGltf_CafWriter::toSkipFaceMesh ( const RWMesh_FaceIterator theFaceIter)
protectedvirtual

Return TRUE if face mesh should be skipped (e.g. because it is invalid or empty).

◆ TransformationFormat()

RWGltf_WriterTrsfFormat RWGltf_CafWriter::TransformationFormat ( ) const
inline

Return preferred transformation format for writing into glTF file; RWGltf_WriterTrsfFormat_Compact by default.

◆ writeAccessors()

virtual void RWGltf_CafWriter::writeAccessors ( const RWGltf_GltfSceneNodeMap theSceneNodeMap)
protectedvirtual

Write RWGltf_GltfRootElement_Accessors section.

Parameters
theSceneNodeMap[in] ordered map of scene nodes

◆ writeAnimations()

virtual void RWGltf_CafWriter::writeAnimations ( )
protectedvirtual

Write RWGltf_GltfRootElement_Animations section (reserved).

◆ writeAsset()

virtual void RWGltf_CafWriter::writeAsset ( const TColStd_IndexedDataMapOfStringString theFileInfo)
protectedvirtual

Write RWGltf_GltfRootElement_Asset section.

Parameters
theFileInfo[in] optional metadata to write into file header

◆ writeBinData()

virtual bool RWGltf_CafWriter::writeBinData ( const Handle< TDocStd_Document > &  theDocument,
const TDF_LabelSequence theRootLabels,
const TColStd_MapOfAsciiString theLabelFilter,
const Handle< Message_ProgressIndicator > &  theProgress 
)
protectedvirtual

Write binary data file with triangulation data. Triangulation data should be precomputed within shapes!

Parameters
theDocument[in] input document
theRootLabels[in] list of root shapes to export
theLabelFilter[in] optional filter with document nodes to export
theProgress[in] optional progress indicator
Returns
FALSE on file writing failure

◆ writeBuffers()

virtual void RWGltf_CafWriter::writeBuffers ( )
protectedvirtual

Write RWGltf_GltfRootElement_Buffers section.

◆ writeBufferViews()

virtual void RWGltf_CafWriter::writeBufferViews ( const Standard_Integer  theBinDataBufferId)
protectedvirtual

Write RWGltf_GltfRootElement_BufferViews section.

Parameters
theBinDataBufferId[in] index of binary buffer with vertex data

◆ writeExtensions()

virtual void RWGltf_CafWriter::writeExtensions ( )
protectedvirtual

Write RWGltf_GltfRootElement_ExtensionsUsed/RWGltf_GltfRootElement_ExtensionsRequired sections (reserved).

◆ writeImages()

virtual void RWGltf_CafWriter::writeImages ( const RWGltf_GltfSceneNodeMap theSceneNodeMap,
RWGltf_GltfMaterialMap theMaterialMap 
)
protectedvirtual

Write RWGltf_GltfRootElement_Images section.

Parameters
theSceneNodeMap[in] ordered map of scene nodes
theMaterialMap[out] map of materials, filled with image files used by textures

◆ writeIndices()

virtual void RWGltf_CafWriter::writeIndices ( const RWGltf_GltfFace theGltfFace)
protectedvirtual

Write bufferView for triangle indexes within RWGltf_GltfRootElement_Accessors section.

Parameters
theGltfFace[in] face definition to write

◆ writeJson()

virtual bool RWGltf_CafWriter::writeJson ( const Handle< TDocStd_Document > &  theDocument,
const TDF_LabelSequence theRootLabels,
const TColStd_MapOfAsciiString theLabelFilter,
const TColStd_IndexedDataMapOfStringString theFileInfo,
const Handle< Message_ProgressIndicator > &  theProgress 
)
protectedvirtual

Write JSON file with glTF structure (should be called after writeBinData()).

Parameters
theDocument[in] input document
theRootLabels[in] list of root shapes to export
theLabelFilter[in] optional filter with document nodes to export
theFileInfo[in] map with file metadata to put into glTF header section
theProgress[in] optional progress indicator
Returns
FALSE on file writing failure

◆ writeMaterials()

virtual void RWGltf_CafWriter::writeMaterials ( const RWGltf_GltfSceneNodeMap theSceneNodeMap,
RWGltf_GltfMaterialMap theMaterialMap 
)
protectedvirtual

Write RWGltf_GltfRootElement_Materials section.

Parameters
theSceneNodeMap[in] ordered map of scene nodes
theMaterialMap[out] map of materials, filled with materials

◆ writeMeshes()

virtual void RWGltf_CafWriter::writeMeshes ( const RWGltf_GltfSceneNodeMap theSceneNodeMap,
const RWGltf_GltfMaterialMap theMaterialMap 
)
protectedvirtual

Write RWGltf_GltfRootElement_Meshes section.

Parameters
theSceneNodeMap[in] ordered map of scene nodes
theMaterialMap[in] map of materials

◆ writeNodes()

virtual void RWGltf_CafWriter::writeNodes ( const Handle< TDocStd_Document > &  theDocument,
const TDF_LabelSequence theRootLabels,
const TColStd_MapOfAsciiString theLabelFilter,
const RWGltf_GltfSceneNodeMap theSceneNodeMap,
NCollection_Sequence< Standard_Integer > &  theSceneRootNodeInds 
)
protectedvirtual

Write RWGltf_GltfRootElement_Nodes section.

Parameters
theDocument[in] input document
theRootLabels[in] list of root shapes to export
theLabelFilter[in] optional filter with document nodes to export
theSceneNodeMap[in] ordered map of scene nodes
theSceneRootNodeInds[out] sequence of scene nodes pointing to root shapes (to be used for writeScenes())

◆ writeNormals()

virtual void RWGltf_CafWriter::writeNormals ( const RWGltf_GltfFace theGltfFace)
protectedvirtual

Write bufferView for vertex normals within RWGltf_GltfRootElement_Accessors section.

Parameters
theGltfFace[in] face definition to write

◆ writePositions()

virtual void RWGltf_CafWriter::writePositions ( const RWGltf_GltfFace theGltfFace)
protectedvirtual

Write bufferView for vertex positions within RWGltf_GltfRootElement_Accessors section.

Parameters
theGltfFace[in] face definition to write

◆ writeSamplers()

virtual void RWGltf_CafWriter::writeSamplers ( const RWGltf_GltfMaterialMap theMaterialMap)
protectedvirtual

Write RWGltf_GltfRootElement_Samplers section.

◆ writeScene()

virtual void RWGltf_CafWriter::writeScene ( const Standard_Integer  theDefSceneId)
protectedvirtual

Write RWGltf_GltfRootElement_Scene section.

Parameters
theDefSceneId[in] index of default scene (0)

◆ writeScenes()

virtual void RWGltf_CafWriter::writeScenes ( const NCollection_Sequence< Standard_Integer > &  theSceneRootNodeInds)
protectedvirtual

Write RWGltf_GltfRootElement_Scenes section.

Parameters
theSceneRootNodeInds[in] sequence of scene nodes pointing to root shapes

◆ writeSkins()

virtual void RWGltf_CafWriter::writeSkins ( )
protectedvirtual

Write RWGltf_GltfRootElement_Skins section (reserved).

◆ writeTextCoords()

virtual void RWGltf_CafWriter::writeTextCoords ( const RWGltf_GltfFace theGltfFace)
protectedvirtual

Write bufferView for vertex texture coordinates within RWGltf_GltfRootElement_Accessors section.

Parameters
theGltfFace[in] face definition to write

◆ writeTextures()

virtual void RWGltf_CafWriter::writeTextures ( const RWGltf_GltfSceneNodeMap theSceneNodeMap,
RWGltf_GltfMaterialMap theMaterialMap 
)
protectedvirtual

Write RWGltf_GltfRootElement_Textures section.

Parameters
theSceneNodeMap[in] ordered map of scene nodes
theMaterialMap[out] map of materials, filled with textures

Field Documentation

◆ myBinDataLen64

int64_t RWGltf_CafWriter::myBinDataLen64
protected

length of binary file

◆ myBinDataMap

NCollection_DataMap<TopoDS_Shape, RWGltf_GltfFace, TopTools_ShapeMapHasher> RWGltf_CafWriter::myBinDataMap
protected

map for TopoDS_Face to glTF face (merging duplicates)

◆ myBinFileNameFull

TCollection_AsciiString RWGltf_CafWriter::myBinFileNameFull
protected

output file with binary data (full path)

◆ myBinFileNameShort

TCollection_AsciiString RWGltf_CafWriter::myBinFileNameShort
protected

output file with binary data (short path)

◆ myBuffViewInd

RWGltf_GltfBufferView RWGltf_CafWriter::myBuffViewInd
protected

current buffer view with triangulation indexes

◆ myBuffViewNorm

RWGltf_GltfBufferView RWGltf_CafWriter::myBuffViewNorm
protected

current buffer view with nodes normals

◆ myBuffViewPos

RWGltf_GltfBufferView RWGltf_CafWriter::myBuffViewPos
protected

current buffer view with nodes positions

◆ myBuffViewTextCoord

RWGltf_GltfBufferView RWGltf_CafWriter::myBuffViewTextCoord
protected

current buffer view with nodes UV coordinates

◆ myCSTrsf

RWMesh_CoordinateSystemConverter RWGltf_CafWriter::myCSTrsf
protected

transformation from OCCT to glTF coordinate system

◆ myDefaultStyle

XCAFPrs_Style RWGltf_CafWriter::myDefaultStyle
protected

default material definition to be used for nodes with only color defined

◆ myFile

TCollection_AsciiString RWGltf_CafWriter::myFile
protected

output glTF file

◆ myIsBinary

Standard_Boolean RWGltf_CafWriter::myIsBinary
protected

flag to write into binary glTF format (.glb)

◆ myIsForcedUVExport

Standard_Boolean RWGltf_CafWriter::myIsForcedUVExport
protected

export UV coordinates even if there are no mapped texture

◆ myTrsfFormat

RWGltf_WriterTrsfFormat RWGltf_CafWriter::myTrsfFormat
protected

transformation format to write into glTF file

◆ myWriter

opencascade::std::shared_ptr<RWGltf_GltfOStreamWriter> RWGltf_CafWriter::myWriter
protected

JSON writer.


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