OpenCascade.js
API ReferenceDataExchangeTKDEGLTF

RWGltf

OCCT package RWGltf: RWGltf_CafReader, RWGltf_CafWriter, RWGltf_DracoParameters, RWGltf_GltfAccessor, and 19 more bound classes.

RWGltf_CafReader

The glTF (GL Transmission Format) mesh reader into XDE document.

Constructors(1)

Static methods(2)

Instance methods(19)

  • ToParallel(): boolean

    Return TRUE if multithreaded optimizations are allowed; FALSE by default.

  • SetParallel(theToParallel: boolean): void

    Setup multithreaded execution.

    Parameters (1)
    • theToParallel
  • ToSkipEmptyNodes(): boolean

    Return TRUE if Nodes without Geometry should be ignored, TRUE by default.

  • SetSkipEmptyNodes(theToSkip: boolean): void

    Set flag to ignore nodes without Geometry.

    Parameters (1)
    • theToSkip
  • ToLoadAllScenes(): boolean

    Return TRUE if all scenes in the document should be loaded, FALSE by default which means only main (default) scene will be loaded.

  • ToApplyScale(): boolean

    Return TRUE if non-uniform scaling should be applied directly to the triangulation. FALSE if the average scale should be applied to the transformation matrix.

  • SetLoadAllScenes(theToLoadAll: boolean): void

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

    Parameters (1)
    • theToLoadAll
  • Set flag to use Mesh name in case if Node name is empty, TRUE by default.

  • SetMeshNameAsFallback(theToFallback: boolean): void

    Set flag to use Mesh name in case if Node name is empty.

    Parameters (1)
    • theToFallback
  • Return flag to fill in triangulation using double or single precision; FALSE by default.

  • SetDoublePrecision(theIsDouble: boolean): void

    Set flag to fill in triangulation using double or single precision.

    Parameters (1)
    • theIsDouble
  • Returns TRUE if data loading should be skipped and can be performed later; FALSE by default.

  • SetToSkipLateDataLoading(theToSkip: boolean): void

    Sets flag to skip data loading.

    Parameters (1)
    • theToSkip
  • SetToApplyScale(theToApplyScale: boolean): void

    Set flag to apply non-uniform scaling directly to the triangulation (modify nodes). TRUE by default. In case of FALSE the average scale is applied to the transformation matrix.

    Parameters (1)
    • theToApplyScale
  • ToKeepLateData(): boolean

    Returns TRUE if data should be loaded into itself without its transferring to new structure. It allows to keep information about deferred storage to load/unload this data later. TRUE by default.

  • SetToKeepLateData(theToKeep: boolean): void

    Sets flag to keep information about deferred storage to load/unload data later.

    Parameters (1)
    • theToKeep
  • Returns TRUE if additional debug information should be print; FALSE by default.

  • SetToPrintDebugMessages(theToPrint: boolean): void

    Sets flag to print debug information.

    Parameters (1)
    • theToPrint

RWGltf_CafWriter

glTF writer context from XCAF document.

Constructors(1)

Static methods(2)

Instance methods(27)

  • Return transformation from OCCT to glTF coordinate system.

  • Return transformation from OCCT to glTF coordinate system.

  • Set transformation from OCCT to glTF coordinate system.

    Parameters (1)
    • theConverter
  • IsBinary(): boolean

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

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

  • Set preferred transformation format for writing into glTF file.

    Parameters (1)
    • theFormat
  • Return name format for exporting Nodes; RWMesh_NameFormat_InstanceOrProduct by default.

  • Set name format for exporting Nodes.

    Parameters (1)
    • theFormat
  • Return name format for exporting Meshes; RWMesh_NameFormat_Product by default.

  • Set name format for exporting Meshes.

    Parameters (1)
    • theFormat
  • IsForcedUVExport(): boolean

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

  • SetForcedUVExport(theToForce: boolean): void

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

    Parameters (1)
    • theToForce
  • Return default material definition to be used for nodes with only color defined.

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

    Parameters (1)
    • theStyle
  • Return flag to write image textures into GLB file (binary gltf export); TRUE by default. When set to FALSE, texture images will be written as separate files. Has no effect on writing into non-binary format.

  • SetToEmbedTexturesInGlb(theToEmbedTexturesInGlb: boolean): void

    Set flag to write image textures into GLB file (binary gltf export).

    Parameters (1)
    • theToEmbedTexturesInGlb
  • ToMergeFaces(): boolean

    Return flag to merge faces within a single part; FALSE by default.

  • SetMergeFaces(theToMerge: boolean): void

    Set flag to merge faces within a single part. May reduce JSON size thanks to smaller number of primitive arrays.

    Parameters (1)
    • theToMerge
  • ToSplitIndices16(): boolean

    Return flag to prefer keeping 16-bit indexes while merging face; FALSE by default.

  • SetSplitIndices16(theToSplit: boolean): void

    Set flag to prefer keeping 16-bit indexes while merging face. Has effect only with ToMergeFaces() option turned ON. May reduce binary data size thanks to smaller triangle indexes.

    Parameters (1)
    • theToSplit
  • ToParallel(): boolean

    Return TRUE if multithreaded optimizations are allowed; FALSE by default.

  • SetParallel(theToParallel: boolean): void

    Setup multithreaded execution.

    Parameters (1)
    • theToParallel
  • Return Draco parameters.

  • Set Draco parameters.

    Parameters (1)
    • theDracoParameters
  • Perform(theDocument: TDocStd_Document, theRootLabels: NCollection_Sequence_TDF_Label, theLabelFilter: NCollection_Map_TCollection_AsciiString, theFileInfo: any, theProgress: Message_ProgressRange): boolean

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

    Parameters (5)
    • theDocument
      input document
    • theRootLabels
      list of root shapes to export
    • theLabelFilter
      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
      map with file metadata to put into glTF header section
    • theProgress
      optional progress indicator
    Returns

    FALSE on file writing failure

  • Perform(theDocument: TDocStd_Document, theFileInfo: any, theProgress: Message_ProgressRange): boolean

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

    Parameters (3)
    • theDocument
      input document
    • theFileInfo
      map with file metadata to put into glTF header section
    • theProgress
      optional progress indicator
    Returns

    FALSE on file writing failure

RWGltf_GltfAccessorCompType

Properties(7)

RWGltf_GltfAccessorLayout

Properties(8)

RWGltf_GltfArrayType

Properties(9)

RWGltf_GltfJsonParser

INTERNAL tool for parsing glTF document (JSON structure).

Constructors(1)

Instance methods(18)

RWGltf_GltfLatePrimitiveArray

Mesh data wrapper for delayed primitive array loading from glTF file.

Constructors(1)

Static methods(2)

Instance methods(16)

RWGltf_GltfMaterialMap

Material manager for exporting into glTF format.

Constructors(1)

Static methods(1)

Instance methods(9)

RWGltf_GltfPrimitiveMode

Properties(8)

RWGltf_GltfRootElement

Properties(21)

RWGltf_MaterialMetallicRoughness

glTF 2.0 format PBR material definition.

Constructors(1)

Properties(14)

RWGltf_TriangulationReader

Constructors(1)

Static methods(1)

Instance methods(2)