Hide menu
Loading...
Searching...
No Matches
ModelData_Model

Table of Contents

Provides CAD Exchanger data model.

The model encapsulates a scene graph (hierarchy of assemblies and parts) and is thus an entry point to entire 3D model data.

The model object can be and restored from a file in native CAD Exchanger format. Future versions may introduce model saving to CAD Exchanger native format.


Constructor

new ModelData_Model([theName])

Creates an instance of ModelData_Model.

Param Type Description
theNameoptional string The model name.

Members

name: string | null

The model name. null if the model has no name (by default).


numberOfRoots: number readonly

Number of root elements in the graph.

Methods

accept(theVisitor) ⇒ Promise<void>

Accepts an element visitor.

Parameters:

Param Type Description
theVisitor ModelData_SceneGraphElementVisitor

addRoot(theRoot)

Adds new root element into the scene graph.

Parameters:

Param Type Description
theRoot ModelData_SceneGraphElement The root element.

loadFile(theFileId, dataProvider, [theAppend], [theProgressScope])Promise<ModelData_ModelLoadResult>

Loads model from model URL. All necessary data will be requested using dataProvider.

Parameters:

Param Type Default Description
theFileId string The file identificator.
dataProvider ModelData_CDXFBBufferProvider The external model data provider.
theAppendoptional boolean true Indicates append roots or not.
theProgressScopeoptional Base_ProgressScope

loadSceneGraph(theFileId, theScenegraphData, dataProvider, [theAppend])ModelData_ModelLoadResult

Loads model from CDXFB scenegraph file. The external referenced data will be requested using dataProvider.

Parameters:

Param Type Default Description
theFileId string The file identificator
theScenegraphData ModelData_CDXFBBufferType The array buffer contains CDXFB scenegraph persistance.
dataProvider ModelData_CDXFBBufferProvider The external model data provider.
theAppendoptional boolean true Indicates append roots or not

root(theIndex)ModelData_SceneGraphElement

Returns root element in the graph by index.

Parameters:

Param Type Description
theIndex number The root index.