SingleThreadedFragmentsModel
The main class for managing a 3D model loaded from a fragments file in a single thread. It's designed for easy data querying in the backend, so all the 3D visualization logic is not present.
Constructors
new SingleThreadedFragmentsModel()
new SingleThreadedFragmentsModel(
modelId,modelData,raw):SingleThreadedFragmentsModel
The constructor of the fragments model.
Parameters
| Parameter | Type | Default value |
|---|---|---|
modelId | string | undefined |
modelData | Uint8Array | undefined |
raw | boolean | false |
Returns
Accessors
modelId
getmodelId():string
The ID of the model.
Returns
string
Methods
dispose()
dispose():
void
Dispose the model. Use this when you're done with the model. If you use the FragmentsModels.dispose method, this will be called automatically for all models.
Returns
void
edit()
edit(
requests):object
Apply a batch of edit requests. Accumulates onto this model's pending-edit history; call save to flatten them into a new committed buffer or reset to discard.
Parameters
| Parameter | Type |
|---|---|
requests | EditRequest[] |
Returns
object
The delta flatbuffer bytes and the local IDs assigned to any newly-created items.
deltaModelBuffer
deltaModelBuffer:
Uint8Array=model
ids
ids:
number[]
getBuffer()
getBuffer(
raw):ArrayBufferLike
Get the buffer of the model.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
raw | boolean | false | Whether to get the raw buffer. If false, it will be compressed. |
Returns
ArrayBufferLike
getCRS()
getCRS():
any
Get the Coordinate Reference System (CRS) data of the model, if available.
Returns
any
getCategories()
getCategories():
string[]
Get all the categories of the model.
Returns
string[]
getCoordinates()
getCoordinates():
number[]
Gets coordinates of the model.
Returns
number[]
getGlobalTranformsIdsOfItems()
getGlobalTranformsIdsOfItems(
ids):Promise<number[]>
Gets the global transforms IDs of the items of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
ids | number[] | The local IDs of the items to get the global transforms IDs of. |
Returns
Promise<number[]>
getGlobalTransforms()
getGlobalTransforms(
localIds?):Promise<Map<number,RawGlobalTransformData>>
Gets the global transforms of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the global transforms to get. If undefined, it will return all global transforms. |
Returns
Promise<Map<number, RawGlobalTransformData>>
getGlobalTransformsIds()
getGlobalTransformsIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the global transforms IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getGuidsByLocalIds()
getGuidsByLocalIds(
localIds): (null|string)[]
Get the GUIDs corresponding to the specified local IDs.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds | number[] | Array of local IDs to look up. |
Returns
(null | string)[]
getItems()
getItems(
localIds?):Promise<Map<number,RawItemData>>
Gets the items of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the items to get. If undefined, it will return all items. |
Returns
Promise<Map<number, RawItemData>>
getItemsByQuery()
getItemsByQuery(
params,config?):number[]
Query items based on specified parameters.