-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Generalize ElementGraphicsRequestProps to support non-persistent geometry. Make element graphics APIs beta and clean them up. * Default format version to latest. * category is required; placement omits bounding box. * 2d vs 3d * test. * extract-api
- Loading branch information
Showing
20 changed files
with
315 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
common/changes/@bentley/imodeljs-backend/dynamic-graphics_2021-03-31-16-42.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@bentley/imodeljs-backend", | ||
"comment": "IModelDb.generateElementGraphics can generate graphics for a non-persistent geometry stream.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@bentley/imodeljs-backend", | ||
"email": "22944042+pmconne@users.noreply.github.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
common/changes/@bentley/imodeljs-common/dynamic-graphics_2021-03-31-16-42.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@bentley/imodeljs-common", | ||
"comment": "An ElementGraphicsRequest can supply a non-persistent geometry stream.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@bentley/imodeljs-common", | ||
"email": "22944042+pmconne@users.noreply.github.com" | ||
} |
11 changes: 11 additions & 0 deletions
11
common/changes/@bentley/imodeljs-frontend/dynamic-graphics_2021-03-31-16-42.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@bentley/imodeljs-frontend", | ||
"comment": "TileAdmin.requestElementGraphics can obtain graphics for a non-persistent geometry stream.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@bentley/imodeljs-frontend", | ||
"email": "22944042+pmconne@users.noreply.github.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
/** @packageDocumentation | ||
* @module Tiles | ||
*/ | ||
|
||
import { assert, ClientRequestContext, IModelStatus } from "@bentley/bentleyjs-core"; | ||
import { ElementGraphicsRequestProps, IModelError } from "@bentley/imodeljs-common"; | ||
import { ElementGraphicsStatus } from "@bentley/imodeljs-native"; | ||
import { IModelDb } from "./IModelDb"; | ||
|
||
/** See [[IModelDb.generateElementGraphics]] and IModelTileRpcImpl.requestElementGraphics. | ||
* @internal | ||
*/ | ||
export async function generateElementGraphics(request: ElementGraphicsRequestProps, iModel: IModelDb): Promise<Uint8Array | undefined> { | ||
const requestContext = ClientRequestContext.current; | ||
const result = await iModel.nativeDb.generateElementGraphics(request); | ||
|
||
requestContext.enter(); | ||
let error: string | undefined; | ||
switch (result.status) { | ||
case ElementGraphicsStatus.NoGeometry: | ||
case ElementGraphicsStatus.Canceled: | ||
return undefined; | ||
case ElementGraphicsStatus.Success: | ||
return result.content; | ||
case ElementGraphicsStatus.InvalidJson: | ||
error = "Invalid JSON"; | ||
break; | ||
case ElementGraphicsStatus.UnknownMajorFormatVersion: | ||
error = "Unknown major format version"; | ||
break; | ||
case ElementGraphicsStatus.ElementNotFound: | ||
error = `Element Id ${request.elementId} not found`; | ||
break; | ||
case ElementGraphicsStatus.DuplicateRequestId: | ||
error = `Duplicate request Id "${request.id}"`; | ||
break; | ||
} | ||
|
||
assert(undefined !== error); | ||
throw new IModelError(IModelStatus.BadRequest, error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.