@itwin/editor-common 3.0.0-dev.78 → 3.0.0-dev.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,10 +208,39 @@ export interface OffsetFacesProps {
208
208
  distances: number | number[];
209
209
  }
210
210
  /** @alpha */
211
+ export interface SubEntityFilter {
212
+ /** true to reject non-planar faces */
213
+ nonPlanarFaces?: true;
214
+ /** true to reject non-linear edges */
215
+ nonLinearEdges?: true;
216
+ /** true to reject laminar edges */
217
+ laminarEdges?: true;
218
+ /** true to reject smooth edges */
219
+ smoothEdges?: true;
220
+ /** true to reject smooth vertices */
221
+ smoothVertices?: true;
222
+ }
223
+ /** @alpha */
224
+ export interface LocateSubEntityProps {
225
+ /** The maximum number of face hits to return. Pass 0 to not pick faces. */
226
+ maxFace: number;
227
+ /** The maximum number of edge hits to return. Pass 0 to not pick edges. */
228
+ maxEdge: number;
229
+ /** The maximum number of vertex hits to return. Pass 0 to not pick vertices. */
230
+ maxVertex: number;
231
+ /** An edge will be picked if it is within this distance from the ray, a vertex twice this distance. */
232
+ maxDistance?: number;
233
+ /** When not locating faces, true to allow locate of back edges and vertices. */
234
+ hiddenEdgesVisible: boolean;
235
+ /** Optional filter to reject common types of faces, edges, and vertices. */
236
+ filter?: SubEntityFilter;
237
+ }
238
+ /** @alpha */
211
239
  export interface SolidModelingCommandIpc extends EditCommandIpc {
212
240
  clearElementGeometryCache(): Promise<void>;
213
241
  createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;
214
242
  getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, "writeChanges" | "insertProps">): Promise<SubEntityGeometryProps | undefined>;
243
+ locateSubEntities(id: Id64String, spacePoint: XYZProps, direction: XYZProps, opts: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined>;
215
244
  getClosestFace(id: Id64String, testPoint: XYZProps, preferredDirection?: XYZProps): Promise<SubEntityLocationProps | undefined>;
216
245
  offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
217
246
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBuiltInIpc.d.ts","sourceRoot":"","sources":["../../src/EditorBuiltInIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtL,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,aAAa;AACb,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,aAAa;AACb,MAAM,WAAW,8BAA8B;IAC7C,+BAA+B;IAC/B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,aAAa;AACb,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,aAAa;AACb,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QA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CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IAChI,WAAW,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;CAC5I"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBuiltInIpc.js","sourceRoot":"","sources":["../../src/EditorBuiltInIpc.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH,aAAa;AACA,QAAA,mBAAmB,GAAG;IACjC,oBAAoB,EAAE,mBAAmB;IACzC,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAgJF,aAAa;AACb,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,yCAAyC;IACzC,iDAAQ,CAAA;IACR,uCAAuC;IACvC,iDAAQ,CAAA;IACR,qBAAqB;IACrB,qDAAU,CAAA;AACZ,CAAC,EAPW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAOxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { CompressedId64Set, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Matrix3dProps, Range3dProps, TransformProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, EcefLocationProps, ElementGeometryDataEntry, ElementGeometryInfo, ElementGeometryOpcode, GeometricElementProps, GeometryPartProps } from \"@itwin/core-common\";\r\nimport { EditCommandIpc } from \"./EditorIpc\";\r\n\r\n/** @alpha */\r\nexport const editorBuiltInCmdIds = {\r\n cmdBasicManipulation: \"basicManipulation\",\r\n cmdSolidModeling: \"solidModeling\",\r\n};\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometricElementData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** Whether entries are supplied local to placement transform or in world coordinates */\r\n isWorld?: boolean;\r\n /** If true, create geometry that displays oriented to face the camera */\r\n viewIndependent?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryPartData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** If true, create geometry part with 2d geometry */\r\n is2dPart?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryFilter {\r\n /** Optional limit on number of displayable entries to accept */\r\n maxDisplayable?: number;\r\n /** Optional array of displayable opCodes to accept */\r\n accept?: ElementGeometryOpcode[];\r\n /** Optional array of displayable opCodes to reject */\r\n reject?: ElementGeometryOpcode[];\r\n /** Optional geometry type filter\r\n * curves - true to accept single curves and paths\r\n * surfaces - true to accept loops, planar regions, open polyfaces, and sheet bodies\r\n * solids - true to accept capped solids, closed polyfaces, and solid bodies\r\n */\r\n geometry?: { curves: boolean, surfaces: boolean, solids: boolean };\r\n}\r\n\r\n/** @alpha */\r\nexport interface BasicManipulationCommandIpc extends EditCommandIpc {\r\n deleteElements(ids: CompressedId64Set): Promise<IModelStatus>;\r\n transformPlacement(ids: CompressedId64Set, transform: TransformProps): Promise<IModelStatus>;\r\n rotatePlacement(ids: CompressedId64Set, matrix: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus>;\r\n\r\n /** Create and insert a new geometric element.\r\n * @param props Properties for the new [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometricElement(props: GeometricElementProps, data?: FlatBufferGeometricElementData): Promise<Id64String>;\r\n\r\n /** Create and insert a new geometry part element.\r\n * @param props Properties for the new [GeometryPart]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometryPartProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometryPart(props: GeometryPartProps, data?: FlatBufferGeometryPartData): Promise<Id64String>;\r\n\r\n /** Update an existing geometric element.\r\n * @param propsOrId Properties or element id to update for an existing [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to update the element\r\n */\r\n updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: FlatBufferGeometricElementData): Promise<void>;\r\n\r\n /** Request geometry from an existing element. Because a GeometryStream can be large and may contain information\r\n * that is not always useful to frontend code, filter options are provided to restrict what GeometryStreams are returned.\r\n * For example, a tool may only be interested in a GeometryStream that stores a single CurveCollection.\r\n * @param id Element id of an existing [GeometricElement]($backend) or [GeometryPart]($backend).\r\n * @param filter Optional criteria for accepting a GeometryStream.\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to query the element\r\n */\r\n requestElementGeometry(id: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined>;\r\n\r\n /** Update the project extents for the iModel.\r\n * @param extents New project extents.\r\n * @throws [[IModelError]] if unable to update the extents property.\r\n */\r\n updateProjectExtents(extents: Range3dProps): Promise<void>;\r\n\r\n /** Update the position of the iModel on the earth.\r\n * @param ecefLocation New ecef location properties.\r\n * @throws [[IModelError]] if unable to update the ecef location property.\r\n * @note Clears the geographic coordinate reference system of the iModel, should only be called if invalid.\r\n */\r\n updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryCacheFilter {\r\n /** Optional lower limit on number of geometric primitives to accept */\r\n minGeom?: number;\r\n /** Optional upper limit on number of geometric primitives to accept */\r\n maxGeom?: number;\r\n /** Whether to accept geometry from parts. */\r\n parts: boolean;\r\n /** Whether to accept single curves and paths. */\r\n curves: boolean;\r\n /** Whether to accept loops, planar regions, open polyfaces, and sheet bodies. */\r\n surfaces: boolean;\r\n /** Whether to accept capped solids, closed polyfaces, and solid bodies. */\r\n solids: boolean;\r\n /** Whether to accept text, image graphics, etc. */\r\n other: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultOptions {\r\n /** If true, return geometry as data that can be converted to a render graphic */\r\n wantGraphic?: true | undefined;\r\n /** If true, return geometry as flatbuffer format data.\r\n * The data is potentially large and may include brep entries that cannot be directly\r\n * inspected or manipulated on the frontend, request only as needed. */\r\n wantGeometry?: true | undefined;\r\n /** If true, return geometry range. */\r\n wantRange?: true | undefined;\r\n /** If true, return geometry appearance information. */\r\n wantAppearance?: true | undefined;\r\n /** The chord tolerance to use when creating the graphic (default is 0.01) */\r\n chordTolerance?: number;\r\n /** Unique identifier for the render graphic request */\r\n requestId?: string;\r\n /** If true, a successful result updates the source element or is inserted as a new element when insertProps is supplied */\r\n writeChanges?: true | undefined;\r\n /** If specified, writeChanges inserts a new [GeometricElement]($backend) using these properties */\r\n insertProps?: GeometricElementProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultProps {\r\n /** The element's geometry stream graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The element's geometry stream information */\r\n geometry?: ElementGeometryInfo;\r\n /** The element's range box (available as ElementGeometryInfo.bbox when returning geometry) */\r\n range?: Range3dProps;\r\n /** The element's category (available as ElementGeometryInfo.category when returning geometry) */\r\n categoryId?: Id64String;\r\n /** The result element id (different than source id when requesting insert instead of update) */\r\n elementId?: Id64String;\r\n}\r\n\r\n/** @alpha */\r\nexport enum SubEntityType {\r\n /** A single bounded part of a surface */\r\n Face = 0,\r\n /** A single bounded part of a curve */\r\n Edge = 1,\r\n /** A single point */\r\n Vertex = 2,\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityProps {\r\n /** Identifies the geometric primitive in the geometry stream that owns this sub-entity when there are more than one */\r\n index?: number;\r\n /** Identifies the type of sub-entity */\r\n type: SubEntityType;\r\n /** Identifies a face, edge, or vertex of the geometric primitive */\r\n id: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityLocationProps {\r\n /** The information to identify the sub-entity */\r\n subEntity: SubEntityProps;\r\n /** The face, edge, or vertex location in world coordinates from closest point or locate request */\r\n point?: XYZProps;\r\n /** The face normal in world coordinates of the identified location on sub-entity */\r\n normal?: XYZProps;\r\n /** The face or edge u parameter of identified location on sub-entity */\r\n uParam?: number;\r\n /** The face v parameter of identified location on sub-entity */\r\n vParam?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityAppearanceProps {\r\n /** Category id for geometry. */\r\n category: Id64String;\r\n /** SubCategory id for geometry. */\r\n subCategory?: Id64String;\r\n /** Material id for geometry. */\r\n material?: Id64String;\r\n /** color of geometry. */\r\n color?: ColorDefProps;\r\n /** transparency of geometry. */\r\n transparency?: number;\r\n /** weight of geometry. */\r\n weight?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityGeometryProps {\r\n /** The face, edge, or vertex graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The face, edge, or vertex geometry in world coordinates */\r\n geometry?: ElementGeometryDataEntry;\r\n /** The face or edge range box for the sub-entity geometry */\r\n range?: Range3dProps;\r\n /** The appearance information for the sub-entity geometry */\r\n appearance?: SubEntityAppearanceProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface OffsetFacesProps {\r\n /** The faces to offset */\r\n faces: SubEntityProps | SubEntityProps[];\r\n /** The offset to apply to all faces, or the offset for each face */\r\n distances: number | number[];\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityFilter {\r\n /** true to reject non-planar faces */\r\n nonPlanarFaces?: true;\r\n /** true to reject non-linear edges */\r\n nonLinearEdges?: true;\r\n /** true to reject laminar edges */\r\n laminarEdges?: true;\r\n /** true to reject smooth edges */\r\n smoothEdges?: true;\r\n /** true to reject smooth vertices */\r\n smoothVertices?: true;\r\n}\r\n\r\n/** @alpha */\r\nexport interface LocateSubEntityProps {\r\n /** The maximum number of face hits to return. Pass 0 to not pick faces. */\r\n maxFace: number;\r\n /** The maximum number of edge hits to return. Pass 0 to not pick edges. */\r\n maxEdge: number;\r\n /** The maximum number of vertex hits to return. Pass 0 to not pick vertices. */\r\n maxVertex: number;\r\n /** An edge will be picked if it is within this distance from the ray, a vertex twice this distance. */\r\n maxDistance?: number;\r\n /** When not locating faces, true to allow locate of back edges and vertices. */\r\n hiddenEdgesVisible: boolean;\r\n /** Optional filter to reject common types of faces, edges, and vertices. */\r\n filter?: SubEntityFilter;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SolidModelingCommandIpc extends EditCommandIpc {\r\n clearElementGeometryCache(): Promise<void>;\r\n createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;\r\n getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, \"writeChanges\" | \"insertProps\">): Promise<SubEntityGeometryProps | undefined>;\r\n locateSubEntities(id: Id64String, spacePoint: XYZProps, direction: XYZProps, opts: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined>;\r\n getClosestFace(id: Id64String, testPoint: XYZProps, preferredDirection?: XYZProps): Promise<SubEntityLocationProps | undefined>;\r\n offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;\r\n}\r\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorIpc.d.ts","sourceRoot":"","sources":["../../src/EditorIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,gBAAgB;AAChB,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,aAAa;AACb,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACrF,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5D;AAED,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;CACtF"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorIpc.js","sourceRoot":"","sources":["../../src/EditorIpc.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gBAAgB;AACH,QAAA,aAAa,GAAG,QAAQ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\n/** @internal */\r\nexport const editorChannel = \"editor\";\r\n\r\n/** @alpha */\r\nexport interface EditorIpc {\r\n startCommand: (commandId: string, iModelKey: string, ...args: any[]) => Promise<any>;\r\n callMethod: (name: string, ...args: any[]) => Promise<any>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface EditCommandIpc {\r\n ping: () => Promise<{ commandId: string, version: string, [propName: string]: any }>;\r\n}\r\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-common.d.ts","sourceRoot":"","sources":["../../src/editor-common.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-common.js","sourceRoot":"","sources":["../../src/editor-common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8CAA4B;AAC5B,qDAAmC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport * from \"./EditorIpc\";\nexport * from \"./EditorBuiltInIpc\";\n"]}
@@ -0,0 +1,247 @@
1
+ /** @packageDocumentation
2
+ * @module Editing
3
+ */
4
+ import { CompressedId64Set, Id64String, IModelStatus } from "@itwin/core-bentley";
5
+ import { Matrix3dProps, Range3dProps, TransformProps, XYZProps } from "@itwin/core-geometry";
6
+ import { ColorDefProps, EcefLocationProps, ElementGeometryDataEntry, ElementGeometryInfo, ElementGeometryOpcode, GeometricElementProps, GeometryPartProps } from "@itwin/core-common";
7
+ import { EditCommandIpc } from "./EditorIpc";
8
+ /** @alpha */
9
+ export declare const editorBuiltInCmdIds: {
10
+ cmdBasicManipulation: string;
11
+ cmdSolidModeling: string;
12
+ };
13
+ /** @alpha */
14
+ export interface FlatBufferGeometricElementData {
15
+ /** The geometry stream data */
16
+ entryArray: ElementGeometryDataEntry[];
17
+ /** Whether entries are supplied local to placement transform or in world coordinates */
18
+ isWorld?: boolean;
19
+ /** If true, create geometry that displays oriented to face the camera */
20
+ viewIndependent?: boolean;
21
+ }
22
+ /** @alpha */
23
+ export interface FlatBufferGeometryPartData {
24
+ /** The geometry stream data */
25
+ entryArray: ElementGeometryDataEntry[];
26
+ /** If true, create geometry part with 2d geometry */
27
+ is2dPart?: boolean;
28
+ }
29
+ /** @alpha */
30
+ export interface FlatBufferGeometryFilter {
31
+ /** Optional limit on number of displayable entries to accept */
32
+ maxDisplayable?: number;
33
+ /** Optional array of displayable opCodes to accept */
34
+ accept?: ElementGeometryOpcode[];
35
+ /** Optional array of displayable opCodes to reject */
36
+ reject?: ElementGeometryOpcode[];
37
+ /** Optional geometry type filter
38
+ * curves - true to accept single curves and paths
39
+ * surfaces - true to accept loops, planar regions, open polyfaces, and sheet bodies
40
+ * solids - true to accept capped solids, closed polyfaces, and solid bodies
41
+ */
42
+ geometry?: {
43
+ curves: boolean;
44
+ surfaces: boolean;
45
+ solids: boolean;
46
+ };
47
+ }
48
+ /** @alpha */
49
+ export interface BasicManipulationCommandIpc extends EditCommandIpc {
50
+ deleteElements(ids: CompressedId64Set): Promise<IModelStatus>;
51
+ transformPlacement(ids: CompressedId64Set, transform: TransformProps): Promise<IModelStatus>;
52
+ rotatePlacement(ids: CompressedId64Set, matrix: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus>;
53
+ /** Create and insert a new geometric element.
54
+ * @param props Properties for the new [GeometricElement]($backend)
55
+ * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].
56
+ * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)
57
+ * @throws [[IModelError]] if unable to insert the element
58
+ */
59
+ insertGeometricElement(props: GeometricElementProps, data?: FlatBufferGeometricElementData): Promise<Id64String>;
60
+ /** Create and insert a new geometry part element.
61
+ * @param props Properties for the new [GeometryPart]($backend)
62
+ * @param data Optional binary format GeometryStream representation used in lieu of [[GeometryPartProps.geom]].
63
+ * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)
64
+ * @throws [[IModelError]] if unable to insert the element
65
+ */
66
+ insertGeometryPart(props: GeometryPartProps, data?: FlatBufferGeometryPartData): Promise<Id64String>;
67
+ /** Update an existing geometric element.
68
+ * @param propsOrId Properties or element id to update for an existing [GeometricElement]($backend)
69
+ * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].
70
+ * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)
71
+ * @throws [[IModelError]] if unable to update the element
72
+ */
73
+ updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: FlatBufferGeometricElementData): Promise<void>;
74
+ /** Request geometry from an existing element. Because a GeometryStream can be large and may contain information
75
+ * that is not always useful to frontend code, filter options are provided to restrict what GeometryStreams are returned.
76
+ * For example, a tool may only be interested in a GeometryStream that stores a single CurveCollection.
77
+ * @param id Element id of an existing [GeometricElement]($backend) or [GeometryPart]($backend).
78
+ * @param filter Optional criteria for accepting a GeometryStream.
79
+ * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)
80
+ * @throws [[IModelError]] if unable to query the element
81
+ */
82
+ requestElementGeometry(id: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined>;
83
+ /** Update the project extents for the iModel.
84
+ * @param extents New project extents.
85
+ * @throws [[IModelError]] if unable to update the extents property.
86
+ */
87
+ updateProjectExtents(extents: Range3dProps): Promise<void>;
88
+ /** Update the position of the iModel on the earth.
89
+ * @param ecefLocation New ecef location properties.
90
+ * @throws [[IModelError]] if unable to update the ecef location property.
91
+ * @note Clears the geographic coordinate reference system of the iModel, should only be called if invalid.
92
+ */
93
+ updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void>;
94
+ }
95
+ /** @alpha */
96
+ export interface ElementGeometryCacheFilter {
97
+ /** Optional lower limit on number of geometric primitives to accept */
98
+ minGeom?: number;
99
+ /** Optional upper limit on number of geometric primitives to accept */
100
+ maxGeom?: number;
101
+ /** Whether to accept geometry from parts. */
102
+ parts: boolean;
103
+ /** Whether to accept single curves and paths. */
104
+ curves: boolean;
105
+ /** Whether to accept loops, planar regions, open polyfaces, and sheet bodies. */
106
+ surfaces: boolean;
107
+ /** Whether to accept capped solids, closed polyfaces, and solid bodies. */
108
+ solids: boolean;
109
+ /** Whether to accept text, image graphics, etc. */
110
+ other: boolean;
111
+ }
112
+ /** @alpha */
113
+ export interface ElementGeometryResultOptions {
114
+ /** If true, return geometry as data that can be converted to a render graphic */
115
+ wantGraphic?: true | undefined;
116
+ /** If true, return geometry as flatbuffer format data.
117
+ * The data is potentially large and may include brep entries that cannot be directly
118
+ * inspected or manipulated on the frontend, request only as needed. */
119
+ wantGeometry?: true | undefined;
120
+ /** If true, return geometry range. */
121
+ wantRange?: true | undefined;
122
+ /** If true, return geometry appearance information. */
123
+ wantAppearance?: true | undefined;
124
+ /** The chord tolerance to use when creating the graphic (default is 0.01) */
125
+ chordTolerance?: number;
126
+ /** Unique identifier for the render graphic request */
127
+ requestId?: string;
128
+ /** If true, a successful result updates the source element or is inserted as a new element when insertProps is supplied */
129
+ writeChanges?: true | undefined;
130
+ /** If specified, writeChanges inserts a new [GeometricElement]($backend) using these properties */
131
+ insertProps?: GeometricElementProps;
132
+ }
133
+ /** @alpha */
134
+ export interface ElementGeometryResultProps {
135
+ /** The element's geometry stream graphic data in world coordinates */
136
+ graphic?: Uint8Array;
137
+ /** The element's geometry stream information */
138
+ geometry?: ElementGeometryInfo;
139
+ /** The element's range box (available as ElementGeometryInfo.bbox when returning geometry) */
140
+ range?: Range3dProps;
141
+ /** The element's category (available as ElementGeometryInfo.category when returning geometry) */
142
+ categoryId?: Id64String;
143
+ /** The result element id (different than source id when requesting insert instead of update) */
144
+ elementId?: Id64String;
145
+ }
146
+ /** @alpha */
147
+ export declare enum SubEntityType {
148
+ /** A single bounded part of a surface */
149
+ Face = 0,
150
+ /** A single bounded part of a curve */
151
+ Edge = 1,
152
+ /** A single point */
153
+ Vertex = 2
154
+ }
155
+ /** @alpha */
156
+ export interface SubEntityProps {
157
+ /** Identifies the geometric primitive in the geometry stream that owns this sub-entity when there are more than one */
158
+ index?: number;
159
+ /** Identifies the type of sub-entity */
160
+ type: SubEntityType;
161
+ /** Identifies a face, edge, or vertex of the geometric primitive */
162
+ id: number;
163
+ }
164
+ /** @alpha */
165
+ export interface SubEntityLocationProps {
166
+ /** The information to identify the sub-entity */
167
+ subEntity: SubEntityProps;
168
+ /** The face, edge, or vertex location in world coordinates from closest point or locate request */
169
+ point?: XYZProps;
170
+ /** The face normal in world coordinates of the identified location on sub-entity */
171
+ normal?: XYZProps;
172
+ /** The face or edge u parameter of identified location on sub-entity */
173
+ uParam?: number;
174
+ /** The face v parameter of identified location on sub-entity */
175
+ vParam?: number;
176
+ }
177
+ /** @alpha */
178
+ export interface SubEntityAppearanceProps {
179
+ /** Category id for geometry. */
180
+ category: Id64String;
181
+ /** SubCategory id for geometry. */
182
+ subCategory?: Id64String;
183
+ /** Material id for geometry. */
184
+ material?: Id64String;
185
+ /** color of geometry. */
186
+ color?: ColorDefProps;
187
+ /** transparency of geometry. */
188
+ transparency?: number;
189
+ /** weight of geometry. */
190
+ weight?: number;
191
+ }
192
+ /** @alpha */
193
+ export interface SubEntityGeometryProps {
194
+ /** The face, edge, or vertex graphic data in world coordinates */
195
+ graphic?: Uint8Array;
196
+ /** The face, edge, or vertex geometry in world coordinates */
197
+ geometry?: ElementGeometryDataEntry;
198
+ /** The face or edge range box for the sub-entity geometry */
199
+ range?: Range3dProps;
200
+ /** The appearance information for the sub-entity geometry */
201
+ appearance?: SubEntityAppearanceProps;
202
+ }
203
+ /** @alpha */
204
+ export interface OffsetFacesProps {
205
+ /** The faces to offset */
206
+ faces: SubEntityProps | SubEntityProps[];
207
+ /** The offset to apply to all faces, or the offset for each face */
208
+ distances: number | number[];
209
+ }
210
+ /** @alpha */
211
+ export interface SubEntityFilter {
212
+ /** true to reject non-planar faces */
213
+ nonPlanarFaces?: true;
214
+ /** true to reject non-linear edges */
215
+ nonLinearEdges?: true;
216
+ /** true to reject laminar edges */
217
+ laminarEdges?: true;
218
+ /** true to reject smooth edges */
219
+ smoothEdges?: true;
220
+ /** true to reject smooth vertices */
221
+ smoothVertices?: true;
222
+ }
223
+ /** @alpha */
224
+ export interface LocateSubEntityProps {
225
+ /** The maximum number of face hits to return. Pass 0 to not pick faces. */
226
+ maxFace: number;
227
+ /** The maximum number of edge hits to return. Pass 0 to not pick edges. */
228
+ maxEdge: number;
229
+ /** The maximum number of vertex hits to return. Pass 0 to not pick vertices. */
230
+ maxVertex: number;
231
+ /** An edge will be picked if it is within this distance from the ray, a vertex twice this distance. */
232
+ maxDistance?: number;
233
+ /** When not locating faces, true to allow locate of back edges and vertices. */
234
+ hiddenEdgesVisible: boolean;
235
+ /** Optional filter to reject common types of faces, edges, and vertices. */
236
+ filter?: SubEntityFilter;
237
+ }
238
+ /** @alpha */
239
+ export interface SolidModelingCommandIpc extends EditCommandIpc {
240
+ clearElementGeometryCache(): Promise<void>;
241
+ createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;
242
+ getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, "writeChanges" | "insertProps">): Promise<SubEntityGeometryProps | undefined>;
243
+ locateSubEntities(id: Id64String, spacePoint: XYZProps, direction: XYZProps, opts: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined>;
244
+ getClosestFace(id: Id64String, testPoint: XYZProps, preferredDirection?: XYZProps): Promise<SubEntityLocationProps | undefined>;
245
+ offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;
246
+ }
247
+ //# sourceMappingURL=EditorBuiltInIpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBuiltInIpc.d.ts","sourceRoot":"","sources":["../../src/EditorBuiltInIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtL,OAAO,EAAE,cAAc,EA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F;IAChF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,aAAa;AACb,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,0BAA0B,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClG,oBAAoB,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,4BAA4B,EAAE,cAAc,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IACvL,iBAAiB,CAAC,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,EAAE,GAAG,SAAS,CAAC,CAAC;IACxJ,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IAChI,WAAW,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;CAC5I"}
@@ -0,0 +1,23 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Editing
7
+ */
8
+ /** @alpha */
9
+ export const editorBuiltInCmdIds = {
10
+ cmdBasicManipulation: "basicManipulation",
11
+ cmdSolidModeling: "solidModeling",
12
+ };
13
+ /** @alpha */
14
+ export var SubEntityType;
15
+ (function (SubEntityType) {
16
+ /** A single bounded part of a surface */
17
+ SubEntityType[SubEntityType["Face"] = 0] = "Face";
18
+ /** A single bounded part of a curve */
19
+ SubEntityType[SubEntityType["Edge"] = 1] = "Edge";
20
+ /** A single point */
21
+ SubEntityType[SubEntityType["Vertex"] = 2] = "Vertex";
22
+ })(SubEntityType || (SubEntityType = {}));
23
+ //# sourceMappingURL=EditorBuiltInIpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBuiltInIpc.js","sourceRoot":"","sources":["../../src/EditorBuiltInIpc.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH,aAAa;AACb,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oBAAoB,EAAE,mBAAmB;IACzC,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAgJF,aAAa;AACb,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,yCAAyC;IACzC,iDAAQ,CAAA;IACR,uCAAuC;IACvC,iDAAQ,CAAA;IACR,qBAAqB;IACrB,qDAAU,CAAA;AACZ,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { CompressedId64Set, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Matrix3dProps, Range3dProps, TransformProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, EcefLocationProps, ElementGeometryDataEntry, ElementGeometryInfo, ElementGeometryOpcode, GeometricElementProps, GeometryPartProps } from \"@itwin/core-common\";\r\nimport { EditCommandIpc } from \"./EditorIpc\";\r\n\r\n/** @alpha */\r\nexport const editorBuiltInCmdIds = {\r\n cmdBasicManipulation: \"basicManipulation\",\r\n cmdSolidModeling: \"solidModeling\",\r\n};\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometricElementData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** Whether entries are supplied local to placement transform or in world coordinates */\r\n isWorld?: boolean;\r\n /** If true, create geometry that displays oriented to face the camera */\r\n viewIndependent?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryPartData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** If true, create geometry part with 2d geometry */\r\n is2dPart?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryFilter {\r\n /** Optional limit on number of displayable entries to accept */\r\n maxDisplayable?: number;\r\n /** Optional array of displayable opCodes to accept */\r\n accept?: ElementGeometryOpcode[];\r\n /** Optional array of displayable opCodes to reject */\r\n reject?: ElementGeometryOpcode[];\r\n /** Optional geometry type filter\r\n * curves - true to accept single curves and paths\r\n * surfaces - true to accept loops, planar regions, open polyfaces, and sheet bodies\r\n * solids - true to accept capped solids, closed polyfaces, and solid bodies\r\n */\r\n geometry?: { curves: boolean, surfaces: boolean, solids: boolean };\r\n}\r\n\r\n/** @alpha */\r\nexport interface BasicManipulationCommandIpc extends EditCommandIpc {\r\n deleteElements(ids: CompressedId64Set): Promise<IModelStatus>;\r\n transformPlacement(ids: CompressedId64Set, transform: TransformProps): Promise<IModelStatus>;\r\n rotatePlacement(ids: CompressedId64Set, matrix: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus>;\r\n\r\n /** Create and insert a new geometric element.\r\n * @param props Properties for the new [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometricElement(props: GeometricElementProps, data?: FlatBufferGeometricElementData): Promise<Id64String>;\r\n\r\n /** Create and insert a new geometry part element.\r\n * @param props Properties for the new [GeometryPart]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometryPartProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometryPart(props: GeometryPartProps, data?: FlatBufferGeometryPartData): Promise<Id64String>;\r\n\r\n /** Update an existing geometric element.\r\n * @param propsOrId Properties or element id to update for an existing [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to update the element\r\n */\r\n updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: FlatBufferGeometricElementData): Promise<void>;\r\n\r\n /** Request geometry from an existing element. Because a GeometryStream can be large and may contain information\r\n * that is not always useful to frontend code, filter options are provided to restrict what GeometryStreams are returned.\r\n * For example, a tool may only be interested in a GeometryStream that stores a single CurveCollection.\r\n * @param id Element id of an existing [GeometricElement]($backend) or [GeometryPart]($backend).\r\n * @param filter Optional criteria for accepting a GeometryStream.\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to query the element\r\n */\r\n requestElementGeometry(id: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined>;\r\n\r\n /** Update the project extents for the iModel.\r\n * @param extents New project extents.\r\n * @throws [[IModelError]] if unable to update the extents property.\r\n */\r\n updateProjectExtents(extents: Range3dProps): Promise<void>;\r\n\r\n /** Update the position of the iModel on the earth.\r\n * @param ecefLocation New ecef location properties.\r\n * @throws [[IModelError]] if unable to update the ecef location property.\r\n * @note Clears the geographic coordinate reference system of the iModel, should only be called if invalid.\r\n */\r\n updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryCacheFilter {\r\n /** Optional lower limit on number of geometric primitives to accept */\r\n minGeom?: number;\r\n /** Optional upper limit on number of geometric primitives to accept */\r\n maxGeom?: number;\r\n /** Whether to accept geometry from parts. */\r\n parts: boolean;\r\n /** Whether to accept single curves and paths. */\r\n curves: boolean;\r\n /** Whether to accept loops, planar regions, open polyfaces, and sheet bodies. */\r\n surfaces: boolean;\r\n /** Whether to accept capped solids, closed polyfaces, and solid bodies. */\r\n solids: boolean;\r\n /** Whether to accept text, image graphics, etc. */\r\n other: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultOptions {\r\n /** If true, return geometry as data that can be converted to a render graphic */\r\n wantGraphic?: true | undefined;\r\n /** If true, return geometry as flatbuffer format data.\r\n * The data is potentially large and may include brep entries that cannot be directly\r\n * inspected or manipulated on the frontend, request only as needed. */\r\n wantGeometry?: true | undefined;\r\n /** If true, return geometry range. */\r\n wantRange?: true | undefined;\r\n /** If true, return geometry appearance information. */\r\n wantAppearance?: true | undefined;\r\n /** The chord tolerance to use when creating the graphic (default is 0.01) */\r\n chordTolerance?: number;\r\n /** Unique identifier for the render graphic request */\r\n requestId?: string;\r\n /** If true, a successful result updates the source element or is inserted as a new element when insertProps is supplied */\r\n writeChanges?: true | undefined;\r\n /** If specified, writeChanges inserts a new [GeometricElement]($backend) using these properties */\r\n insertProps?: GeometricElementProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultProps {\r\n /** The element's geometry stream graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The element's geometry stream information */\r\n geometry?: ElementGeometryInfo;\r\n /** The element's range box (available as ElementGeometryInfo.bbox when returning geometry) */\r\n range?: Range3dProps;\r\n /** The element's category (available as ElementGeometryInfo.category when returning geometry) */\r\n categoryId?: Id64String;\r\n /** The result element id (different than source id when requesting insert instead of update) */\r\n elementId?: Id64String;\r\n}\r\n\r\n/** @alpha */\r\nexport enum SubEntityType {\r\n /** A single bounded part of a surface */\r\n Face = 0,\r\n /** A single bounded part of a curve */\r\n Edge = 1,\r\n /** A single point */\r\n Vertex = 2,\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityProps {\r\n /** Identifies the geometric primitive in the geometry stream that owns this sub-entity when there are more than one */\r\n index?: number;\r\n /** Identifies the type of sub-entity */\r\n type: SubEntityType;\r\n /** Identifies a face, edge, or vertex of the geometric primitive */\r\n id: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityLocationProps {\r\n /** The information to identify the sub-entity */\r\n subEntity: SubEntityProps;\r\n /** The face, edge, or vertex location in world coordinates from closest point or locate request */\r\n point?: XYZProps;\r\n /** The face normal in world coordinates of the identified location on sub-entity */\r\n normal?: XYZProps;\r\n /** The face or edge u parameter of identified location on sub-entity */\r\n uParam?: number;\r\n /** The face v parameter of identified location on sub-entity */\r\n vParam?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityAppearanceProps {\r\n /** Category id for geometry. */\r\n category: Id64String;\r\n /** SubCategory id for geometry. */\r\n subCategory?: Id64String;\r\n /** Material id for geometry. */\r\n material?: Id64String;\r\n /** color of geometry. */\r\n color?: ColorDefProps;\r\n /** transparency of geometry. */\r\n transparency?: number;\r\n /** weight of geometry. */\r\n weight?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityGeometryProps {\r\n /** The face, edge, or vertex graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The face, edge, or vertex geometry in world coordinates */\r\n geometry?: ElementGeometryDataEntry;\r\n /** The face or edge range box for the sub-entity geometry */\r\n range?: Range3dProps;\r\n /** The appearance information for the sub-entity geometry */\r\n appearance?: SubEntityAppearanceProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface OffsetFacesProps {\r\n /** The faces to offset */\r\n faces: SubEntityProps | SubEntityProps[];\r\n /** The offset to apply to all faces, or the offset for each face */\r\n distances: number | number[];\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityFilter {\r\n /** true to reject non-planar faces */\r\n nonPlanarFaces?: true;\r\n /** true to reject non-linear edges */\r\n nonLinearEdges?: true;\r\n /** true to reject laminar edges */\r\n laminarEdges?: true;\r\n /** true to reject smooth edges */\r\n smoothEdges?: true;\r\n /** true to reject smooth vertices */\r\n smoothVertices?: true;\r\n}\r\n\r\n/** @alpha */\r\nexport interface LocateSubEntityProps {\r\n /** The maximum number of face hits to return. Pass 0 to not pick faces. */\r\n maxFace: number;\r\n /** The maximum number of edge hits to return. Pass 0 to not pick edges. */\r\n maxEdge: number;\r\n /** The maximum number of vertex hits to return. Pass 0 to not pick vertices. */\r\n maxVertex: number;\r\n /** An edge will be picked if it is within this distance from the ray, a vertex twice this distance. */\r\n maxDistance?: number;\r\n /** When not locating faces, true to allow locate of back edges and vertices. */\r\n hiddenEdgesVisible: boolean;\r\n /** Optional filter to reject common types of faces, edges, and vertices. */\r\n filter?: SubEntityFilter;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SolidModelingCommandIpc extends EditCommandIpc {\r\n clearElementGeometryCache(): Promise<void>;\r\n createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;\r\n getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, \"writeChanges\" | \"insertProps\">): Promise<SubEntityGeometryProps | undefined>;\r\n locateSubEntities(id: Id64String, spacePoint: XYZProps, direction: XYZProps, opts: LocateSubEntityProps): Promise<SubEntityLocationProps[] | undefined>;\r\n getClosestFace(id: Id64String, testPoint: XYZProps, preferredDirection?: XYZProps): Promise<SubEntityLocationProps | undefined>;\r\n offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;\r\n}\r\n"]}
@@ -0,0 +1,19 @@
1
+ /** @packageDocumentation
2
+ * @module Editing
3
+ */
4
+ /** @internal */
5
+ export declare const editorChannel = "editor";
6
+ /** @alpha */
7
+ export interface EditorIpc {
8
+ startCommand: (commandId: string, iModelKey: string, ...args: any[]) => Promise<any>;
9
+ callMethod: (name: string, ...args: any[]) => Promise<any>;
10
+ }
11
+ /** @alpha */
12
+ export interface EditCommandIpc {
13
+ ping: () => Promise<{
14
+ commandId: string;
15
+ version: string;
16
+ [propName: string]: any;
17
+ }>;
18
+ }
19
+ //# sourceMappingURL=EditorIpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorIpc.d.ts","sourceRoot":"","sources":["../../src/EditorIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,gBAAgB;AAChB,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,aAAa;AACb,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACrF,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5D;AAED,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;CACtF"}
@@ -0,0 +1,10 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Editing
7
+ */
8
+ /** @internal */
9
+ export const editorChannel = "editor";
10
+ //# sourceMappingURL=EditorIpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorIpc.js","sourceRoot":"","sources":["../../src/EditorIpc.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,gBAAgB;AAChB,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\n/** @internal */\r\nexport const editorChannel = \"editor\";\r\n\r\n/** @alpha */\r\nexport interface EditorIpc {\r\n startCommand: (commandId: string, iModelKey: string, ...args: any[]) => Promise<any>;\r\n callMethod: (name: string, ...args: any[]) => Promise<any>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface EditCommandIpc {\r\n ping: () => Promise<{ commandId: string, version: string, [propName: string]: any }>;\r\n}\r\n"]}
@@ -0,0 +1,3 @@
1
+ export * from "./EditorIpc";
2
+ export * from "./EditorBuiltInIpc";
3
+ //# sourceMappingURL=editor-common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-common.d.ts","sourceRoot":"","sources":["../../src/editor-common.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export * from "./EditorIpc";
6
+ export * from "./EditorBuiltInIpc";
7
+ //# sourceMappingURL=editor-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-common.js","sourceRoot":"","sources":["../../src/editor-common.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport * from \"./EditorIpc\";\nexport * from \"./EditorBuiltInIpc\";\n"]}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@itwin/editor-common",
3
- "version": "3.0.0-dev.78",
3
+ "version": "3.0.0-dev.82",
4
4
  "description": "iModel.js editing properties common to frontend and backend",
5
- "main": "lib/editor-common.js",
6
- "typings": "lib/editor-common",
5
+ "main": "lib/cjs/editor-common.js",
6
+ "module": "lib/esm/editor-common.js",
7
+ "typings": "lib/cjs/editor-common",
7
8
  "imodeljsSharedLibrary": false,
8
9
  "license": "MIT",
9
10
  "repository": {
@@ -22,16 +23,16 @@
22
23
  "url": "http://www.bentley.com"
23
24
  },
24
25
  "peerDependencies": {
25
- "@itwin/core-bentley": "^3.0.0-dev.78",
26
- "@itwin/core-geometry": "^3.0.0-dev.78",
27
- "@itwin/core-common": "^3.0.0-dev.78"
26
+ "@itwin/core-bentley": "^3.0.0-dev.82",
27
+ "@itwin/core-geometry": "^3.0.0-dev.82",
28
+ "@itwin/core-common": "^3.0.0-dev.82"
28
29
  },
29
30
  "devDependencies": {
30
- "@itwin/core-bentley": "3.0.0-dev.78",
31
- "@itwin/build-tools": "3.0.0-dev.78",
32
- "@itwin/eslint-plugin": "3.0.0-dev.78",
33
- "@itwin/core-geometry": "3.0.0-dev.78",
34
- "@itwin/core-common": "3.0.0-dev.78",
31
+ "@itwin/core-bentley": "3.0.0-dev.82",
32
+ "@itwin/build-tools": "3.0.0-dev.82",
33
+ "@itwin/eslint-plugin": "3.0.0-dev.82",
34
+ "@itwin/core-geometry": "3.0.0-dev.82",
35
+ "@itwin/core-common": "3.0.0-dev.82",
35
36
  "@types/chai": "^4.1.4",
36
37
  "@types/mocha": "^8.2.2",
37
38
  "@types/node": "14.14.31",
@@ -50,7 +51,9 @@
50
51
  },
51
52
  "scripts": {
52
53
  "compile": "npm run -s build",
53
- "build": "tsc 1>&2",
54
+ "build": "npm run -s build:cjs && npm run -s build:esm",
55
+ "build:cjs": "tsc 1>&2 --outDir lib/cjs",
56
+ "build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
54
57
  "clean": "rimraf lib .rush/temp/package-deps*.json",
55
58
  "docs": "betools docs --includes=../../generated-docs/extract --json=../../generated-docs/editor/editor-common/file.json --tsIndexFile=./editor-common.ts --onlyJson",
56
59
  "extract-api": "betools extract-api --entry=editor-common",
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorBuiltInIpc.d.ts","sourceRoot":"","sources":["../src/EditorBuiltInIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtL,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,aAAa;AACb,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,aAAa;AACb,MAAM,WAAW,8BAA8B;IAC7C,+BAA+B;IAC/B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,aAAa;AACb,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,aAAa;AACb,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;I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AA;IACR,uCAAuC;IACvC,iDAAQ,CAAA;IACR,qBAAqB;IACrB,qDAAU,CAAA;AACZ,CAAC,EAPW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAOxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { CompressedId64Set, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Matrix3dProps, Range3dProps, TransformProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, EcefLocationProps, ElementGeometryDataEntry, ElementGeometryInfo, ElementGeometryOpcode, GeometricElementProps, GeometryPartProps } from \"@itwin/core-common\";\r\nimport { EditCommandIpc } from \"./EditorIpc\";\r\n\r\n/** @alpha */\r\nexport const editorBuiltInCmdIds = {\r\n cmdBasicManipulation: \"basicManipulation\",\r\n cmdSolidModeling: \"solidModeling\",\r\n};\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometricElementData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** Whether entries are supplied local to placement transform or in world coordinates */\r\n isWorld?: boolean;\r\n /** If true, create geometry that displays oriented to face the camera */\r\n viewIndependent?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryPartData {\r\n /** The geometry stream data */\r\n entryArray: ElementGeometryDataEntry[];\r\n /** If true, create geometry part with 2d geometry */\r\n is2dPart?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface FlatBufferGeometryFilter {\r\n /** Optional limit on number of displayable entries to accept */\r\n maxDisplayable?: number;\r\n /** Optional array of displayable opCodes to accept */\r\n accept?: ElementGeometryOpcode[];\r\n /** Optional array of displayable opCodes to reject */\r\n reject?: ElementGeometryOpcode[];\r\n /** Optional geometry type filter\r\n * curves - true to accept single curves and paths\r\n * surfaces - true to accept loops, planar regions, open polyfaces, and sheet bodies\r\n * solids - true to accept capped solids, closed polyfaces, and solid bodies\r\n */\r\n geometry?: { curves: boolean, surfaces: boolean, solids: boolean };\r\n}\r\n\r\n/** @alpha */\r\nexport interface BasicManipulationCommandIpc extends EditCommandIpc {\r\n deleteElements(ids: CompressedId64Set): Promise<IModelStatus>;\r\n transformPlacement(ids: CompressedId64Set, transform: TransformProps): Promise<IModelStatus>;\r\n rotatePlacement(ids: CompressedId64Set, matrix: Matrix3dProps, aboutCenter: boolean): Promise<IModelStatus>;\r\n\r\n /** Create and insert a new geometric element.\r\n * @param props Properties for the new [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometricElement(props: GeometricElementProps, data?: FlatBufferGeometricElementData): Promise<Id64String>;\r\n\r\n /** Create and insert a new geometry part element.\r\n * @param props Properties for the new [GeometryPart]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometryPartProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to insert the element\r\n */\r\n insertGeometryPart(props: GeometryPartProps, data?: FlatBufferGeometryPartData): Promise<Id64String>;\r\n\r\n /** Update an existing geometric element.\r\n * @param propsOrId Properties or element id to update for an existing [GeometricElement]($backend)\r\n * @param data Optional binary format GeometryStream representation used in lieu of [[GeometricElementProps.geom]].\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to update the element\r\n */\r\n updateGeometricElement(propsOrId: GeometricElementProps | Id64String, data?: FlatBufferGeometricElementData): Promise<void>;\r\n\r\n /** Request geometry from an existing element. Because a GeometryStream can be large and may contain information\r\n * that is not always useful to frontend code, filter options are provided to restrict what GeometryStreams are returned.\r\n * For example, a tool may only be interested in a GeometryStream that stores a single CurveCollection.\r\n * @param id Element id of an existing [GeometricElement]($backend) or [GeometryPart]($backend).\r\n * @param filter Optional criteria for accepting a GeometryStream.\r\n * @see [GeometryStream]($docs/learning/common/geometrystream.md), [ElementGeometry]($backend)\r\n * @throws [[IModelError]] if unable to query the element\r\n */\r\n requestElementGeometry(id: Id64String, filter?: FlatBufferGeometryFilter): Promise<ElementGeometryInfo | undefined>;\r\n\r\n /** Update the project extents for the iModel.\r\n * @param extents New project extents.\r\n * @throws [[IModelError]] if unable to update the extents property.\r\n */\r\n updateProjectExtents(extents: Range3dProps): Promise<void>;\r\n\r\n /** Update the position of the iModel on the earth.\r\n * @param ecefLocation New ecef location properties.\r\n * @throws [[IModelError]] if unable to update the ecef location property.\r\n * @note Clears the geographic coordinate reference system of the iModel, should only be called if invalid.\r\n */\r\n updateEcefLocation(ecefLocation: EcefLocationProps): Promise<void>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryCacheFilter {\r\n /** Optional lower limit on number of geometric primitives to accept */\r\n minGeom?: number;\r\n /** Optional upper limit on number of geometric primitives to accept */\r\n maxGeom?: number;\r\n /** Whether to accept geometry from parts. */\r\n parts: boolean;\r\n /** Whether to accept single curves and paths. */\r\n curves: boolean;\r\n /** Whether to accept loops, planar regions, open polyfaces, and sheet bodies. */\r\n surfaces: boolean;\r\n /** Whether to accept capped solids, closed polyfaces, and solid bodies. */\r\n solids: boolean;\r\n /** Whether to accept text, image graphics, etc. */\r\n other: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultOptions {\r\n /** If true, return geometry as data that can be converted to a render graphic */\r\n wantGraphic?: true | undefined;\r\n /** If true, return geometry as flatbuffer format data.\r\n * The data is potentially large and may include brep entries that cannot be directly\r\n * inspected or manipulated on the frontend, request only as needed. */\r\n wantGeometry?: true | undefined;\r\n /** If true, return geometry range. */\r\n wantRange?: true | undefined;\r\n /** If true, return geometry appearance information. */\r\n wantAppearance?: true | undefined;\r\n /** The chord tolerance to use when creating the graphic (default is 0.01) */\r\n chordTolerance?: number;\r\n /** Unique identifier for the render graphic request */\r\n requestId?: string;\r\n /** If true, a successful result updates the source element or is inserted as a new element when insertProps is supplied */\r\n writeChanges?: true | undefined;\r\n /** If specified, writeChanges inserts a new [GeometricElement]($backend) using these properties */\r\n insertProps?: GeometricElementProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface ElementGeometryResultProps {\r\n /** The element's geometry stream graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The element's geometry stream information */\r\n geometry?: ElementGeometryInfo;\r\n /** The element's range box (available as ElementGeometryInfo.bbox when returning geometry) */\r\n range?: Range3dProps;\r\n /** The element's category (available as ElementGeometryInfo.category when returning geometry) */\r\n categoryId?: Id64String;\r\n /** The result element id (different than source id when requesting insert instead of update) */\r\n elementId?: Id64String;\r\n}\r\n\r\n/** @alpha */\r\nexport enum SubEntityType {\r\n /** A single bounded part of a surface */\r\n Face = 0,\r\n /** A single bounded part of a curve */\r\n Edge = 1,\r\n /** A single point */\r\n Vertex = 2,\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityProps {\r\n /** Identifies the geometric primitive in the geometry stream that owns this sub-entity when there are more than one */\r\n index?: number;\r\n /** Identifies the type of sub-entity */\r\n type: SubEntityType;\r\n /** Identifies a face, edge, or vertex of the geometric primitive */\r\n id: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityLocationProps {\r\n /** The information to identify the sub-entity */\r\n subEntity: SubEntityProps;\r\n /** The face, edge, or vertex location in world coordinates from closest point or locate request */\r\n point?: XYZProps;\r\n /** The face normal in world coordinates of the identified location on sub-entity */\r\n normal?: XYZProps;\r\n /** The face or edge u parameter of identified location on sub-entity */\r\n uParam?: number;\r\n /** The face v parameter of identified location on sub-entity */\r\n vParam?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityAppearanceProps {\r\n /** Category id for geometry. */\r\n category: Id64String;\r\n /** SubCategory id for geometry. */\r\n subCategory?: Id64String;\r\n /** Material id for geometry. */\r\n material?: Id64String;\r\n /** color of geometry. */\r\n color?: ColorDefProps;\r\n /** transparency of geometry. */\r\n transparency?: number;\r\n /** weight of geometry. */\r\n weight?: number;\r\n}\r\n\r\n/** @alpha */\r\nexport interface SubEntityGeometryProps {\r\n /** The face, edge, or vertex graphic data in world coordinates */\r\n graphic?: Uint8Array;\r\n /** The face, edge, or vertex geometry in world coordinates */\r\n geometry?: ElementGeometryDataEntry;\r\n /** The face or edge range box for the sub-entity geometry */\r\n range?: Range3dProps;\r\n /** The appearance information for the sub-entity geometry */\r\n appearance?: SubEntityAppearanceProps;\r\n}\r\n\r\n/** @alpha */\r\nexport interface OffsetFacesProps {\r\n /** The faces to offset */\r\n faces: SubEntityProps | SubEntityProps[];\r\n /** The offset to apply to all faces, or the offset for each face */\r\n distances: number | number[];\r\n}\r\n\r\n/** @alpha */\r\nexport interface SolidModelingCommandIpc extends EditCommandIpc {\r\n clearElementGeometryCache(): Promise<void>;\r\n createElementGeometryCache(id: Id64String, filter?: ElementGeometryCacheFilter): Promise<boolean>;\r\n getSubEntityGeometry(id: Id64String, subEntity: SubEntityProps, opts: Omit<ElementGeometryResultOptions, \"writeChanges\" | \"insertProps\">): Promise<SubEntityGeometryProps | undefined>;\r\n getClosestFace(id: Id64String, testPoint: XYZProps, preferredDirection?: XYZProps): Promise<SubEntityLocationProps | undefined>;\r\n offsetFaces(id: Id64String, params: OffsetFacesProps, opts: ElementGeometryResultOptions): Promise<ElementGeometryResultProps | undefined>;\r\n}\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorIpc.d.ts","sourceRoot":"","sources":["../src/EditorIpc.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,gBAAgB;AAChB,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,aAAa;AACb,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACrF,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5D;AAED,aAAa;AACb,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;CACtF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorIpc.js","sourceRoot":"","sources":["../src/EditorIpc.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gBAAgB;AACH,QAAA,aAAa,GAAG,QAAQ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\n/** @internal */\r\nexport const editorChannel = \"editor\";\r\n\r\n/** @alpha */\r\nexport interface EditorIpc {\r\n startCommand: (commandId: string, iModelKey: string, ...args: any[]) => Promise<any>;\r\n callMethod: (name: string, ...args: any[]) => Promise<any>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface EditCommandIpc {\r\n ping: () => Promise<{ commandId: string, version: string, [propName: string]: any }>;\r\n}\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-common.d.ts","sourceRoot":"","sources":["../src/editor-common.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-common.js","sourceRoot":"","sources":["../src/editor-common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8CAA4B;AAC5B,qDAAmC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport * from \"./EditorIpc\";\nexport * from \"./EditorBuiltInIpc\";\n"]}