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
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
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.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | ItemsQueryParams | The query parameters. |
config? | ItemsQueryConfig | Optional query configuration. |
Returns
number[]
getItemsChildren()
getItemsChildren(
ids):void
Get the spatial structure children of the specified items.
Parameters
| Parameter | Type | Description |
|---|---|---|
ids | Identifier[] | The IDs of the items to look up. |
Returns
void
getItemsData()
getItemsData(
ids,config?):ItemData[]
Get all the data of the specified items.
Parameters
| Parameter | Type | Description |
|---|---|---|
ids | number[] | The IDs of the items to look up. |
config? | Partial <ItemsDataConfig> | The configuration of the items data. |
Returns
ItemData[]
getItemsGeometry()
getItemsGeometry(
localIds,lod?):MeshData[][]
Get geometry data for the specified items.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds | number[] | The local IDs of the items to get geometry for. |
lod? | CurrentLod | The level of detail for the geometry (optional). |
Returns
MeshData[][]
getItemsIds()
getItemsIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the items IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getItemsOfCategories()
getItemsOfCategories(
categories):object
Get all the items of the model that belong to the specified category.
Parameters
| Parameter | Type |
|---|---|
categories | RegExp[] |
Returns
object
getItemsWithGeometry()
getItemsWithGeometry():
number[]
Get all the items of the model that have geometry.
Returns
number[]
getLocalIds()
getLocalIds():
Promise<number[]>
Get all the local IDs of the model.
Returns
Promise<number[]>
getLocalIdsByGuids()
getLocalIdsByGuids(
guids): (null|number)[]
Get the local IDs corresponding to the specified GUIDs.
Parameters
| Parameter | Type | Description |
|---|---|---|
guids | string[] | Array of GUIDs to look up. |
Returns
(null | number)[]
getLocalTransforms()
getLocalTransforms(
localIds?):Promise<Map<number,RawTransformData>>
Gets the local transforms of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the local transforms to get. If undefined, it will return all local transforms. |
Returns
Promise<Map<number, RawTransformData>>
getLocalTransformsIds()
getLocalTransformsIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the local transforms IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getMaterials()
getMaterials(
localIds?):Promise<Map<number,RawMaterial>>
Gets the materials of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the materials to get. If undefined, it will return all materials. |
Returns
Promise<Map<number, RawMaterial>>
getMaterialsIds()
getMaterialsIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the materials IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getMaxLocalId()
getMaxLocalId():
number
Get the maximum local ID of the model.
Returns
number
getMetadata()
getMetadata<
T>():T
Get the metadata of the model.
Type parameters
| Type parameter | Value |
|---|---|
T extends Record<string, any> | Record<string, any> |
Returns
T
getPositions()
getPositions(
localIds):object[]
Get the absolute positions of the specified items.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds | number[] | The local IDs of the items to look up. |
Returns
object[]
getRelations()
getRelations(
localIds?):Promise<Map<number,RawRelationData>>
Gets the relations of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | number[] | The local IDs of the relations to get. If undefined, it will return all relations. |
Returns
Promise<Map<number, RawRelationData>>
getRepresentations()
getRepresentations(
localIds?):Promise<Map<number,RawRepresentation>>
Gets the representations of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the representations to get. If undefined, it will return all representations. |
Returns
Promise<Map<number, RawRepresentation>>
getRepresentationsIds()
getRepresentationsIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the representations IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getSamples()
getSamples(
localIds?):Promise<Map<number,RawSample>>
Gets the samples of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
localIds? | Iterable<number> | The local IDs of the samples to get. If undefined, it will return all samples. |
Returns
Promise<Map<number, RawSample>>
getSamplesIds()
getSamplesIds():
Promise<number[] |Uint32Array|Set<number>>
Gets all the samples IDs of the model.
Returns
Promise<number[] | Uint32Array | Set<number>>
getSection()
getSection(
plane,localIds?):Promise<ModelSection>
Gets the section (edges and fills) between the model and a given clipping plane.
Parameters
| Parameter | Type | Description |
|---|---|---|
plane | Plane | The plane to get the section of. |
localIds? | number[] | The local IDs of the items to get the section of. If undefined, it will return the section of all items. |
Returns
Promise<ModelSection>
getSpatialStructure()
getSpatialStructure():
any
Get the spatial structure of the model.
Returns
any