IafGraphicsSvc
cacheGraphicsFiles#
Request the Graphics Service to cache a graphics file in its file store for streaming later.
| Parameter | Required | Type | Description |
|---|---|---|---|
| files | Yes | undefined | |
| ctx | Yes | Ctx | context |
Promise<String> - ok: 204 response
let files = [ { "_fileId": "da9a12ac-699c-4232-8c06-fc789eb9d6e5" }, { "_fileId": "aa51b6b9-8c61-4bea-a5bf-66fd4d423f9e", "_fileVersionId": "81266d27-7fb6-4c80-bf3c-77038ffdbfd7" }]await IafGraphicsSvc.cacheGraphicsFiles(files, ctx);createFileSet#
Creates a GraphicsFileSet with a list of GraphicsFiles. The files in the GraphicsFileSet will be available for streaming in a single Iaf-Viewer session. The _id of the returned GraphicsFileSet should be provided to the Iaf-Viewer to setup the websocket connection for streaming geometry. A GraphicsFileSet can be used only by the user who created it. A GraphicsFileSet will be removed after the websocket connection is terminated.
| Parameter | Required | Type | Description |
|---|---|---|---|
| fileSet | Yes | GraphicsFileSet | GraphicsFileSet containing a list of GraphicsFiles that should be made available for an Iaf-Viewer session. |
| ctx | Yes | Ctx | Context storage that contains data, such as authorization token requirements, namespaces, or session storage. |
GraphicsFileSet - created: 201 response. The returned GraphicsFileSet contains an _id which should be passed to the Iaf-Viewer for setting up a session. The returned GraphicsFileSet will contain all or a sub-set of the input GraphicsFiles depending on which files exist in the File Service and to which files the user has READ access.
let fileSet = { files = [ { _fileId: "da9a12ac-699c-4232-8c06-fc789eb9d6e5" }, { _fileId: "aa51b6b9-8c61-4bea-a5bf-66fd4d423f9e", _fileVersionId: "81266d27-7fb6-4c80-bf3c-77038ffdbfd7" } ]};
let severFileSet = IafGraphicsSvc.createFileSet(files, ctx);createGraphicsData#
Creates graphics data object with specified properties for rendering in a 3D viewer.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | Context containing session or authorization details, with nsfilter as part of the namespace filtering. |
| data | Yes | Array | An array of markup objects, each containing points, type, viewerType, and styleConfig. |
Promise<Object> - Response data from the graphics service.
let data = [ {"_type": "markup","_properties": { points: [ { x: -10026.515145147227, y: -8477.090905149831, z: 23920.00041471026 }, { x: -3465.221490438962, y: -26919.918005364816, z: 23920.00041496129 } ], type: 'LINE', viewerType: '3D', styleConfig: { } } }];
let response = await IafGraphicsSvc.createGraphicsData(data, ctx);deleteGraphicsData#
Deletes graphics data object by ID.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | Context containing session or authorization details. |
| ids | Yes | undefined | |
| id | Yes | String | The ID of the markup item to delete. |
Promise<void> - A confirmation of deletion from the graphics service.
getLayersList#
Get the desired list of layers for a BIM Model.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | context |
Promise<String> - ok: 204 response
let layers = await IafGraphicsSvc.getLayersList();getMapboxToken#
Fetch the Mapbox access token.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | context |
Promise<String> - The Mapbox access token.
let token = await IafGraphicsSvc.getMapboxToken(ctx);getStatus#
Get the status of graphics service.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | context |
Promise<String> - ok: 204 response
let status = await IafGraphicsSvc.getStatus();readGraphicsDataById#
Reads graphics data object by ID.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | Context containing session or authorization details. |
| id | Yes | String | The ID of the markup item to retrieve. |
Promise<Object> - The markup item data from the graphics service.
readGraphicsDataByType#
Retrieves a list of markups filtered by from the Graphics Service.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | Context containing session or authorization details, with nsfilter as part of the namespace filtering. |
| type | Yes | undefined | |
| $2 | Yes | Object |
Promise<Object> - Response data from the graphics service.
let response = await IafGraphicsSvc.readGraphicsDataByIds(ctx);updateGraphicsDataById#
Updates graphics data object by ID with new properties.
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Ctx | Context containing session or authorization details. |
| id | Yes | String | The ID of the markup item to update. |
| data | Yes | Object | The updated data for the markup item. |
Promise<Object> - The updated markup item data from the graphics service.