@itwin/core-common 5.2.0-dev.3 → 5.2.0-dev.31
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.
- package/CHANGELOG.md +63 -1
- package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
- package/lib/cjs/AnalysisStyle.js +2 -0
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/BlobReader.d.ts.map +1 -1
- package/lib/cjs/BlobReader.js +10 -2
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.d.ts +2 -0
- package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +8 -0
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/FeatureIndex.d.ts.map +1 -1
- package/lib/cjs/FeatureIndex.js +2 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +0 -2
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/GeometryParams.d.ts.map +1 -1
- package/lib/cjs/GeometryParams.js +6 -0
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/Gradient.d.ts.map +1 -1
- package/lib/cjs/Gradient.js +5 -0
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js +4 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +7 -7
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/Localization.d.ts.map +1 -1
- package/lib/cjs/Localization.js +3 -0
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/TextureMapping.js +2 -2
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js +3 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Tween.d.ts +1 -1
- package/lib/cjs/Tween.d.ts.map +1 -1
- package/lib/cjs/Tween.js +4 -2
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +17 -68
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +18 -33
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextField.d.ts +86 -0
- package/lib/cjs/annotation/TextField.d.ts.map +1 -0
- package/lib/cjs/annotation/TextField.js +10 -0
- package/lib/cjs/annotation/TextField.js.map +1 -0
- package/lib/cjs/core-common.d.ts +1 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +1 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +1 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.d.ts.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js +13 -0
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js +7 -0
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +19 -10
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js +1 -0
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.d.ts.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js +7 -0
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +2 -2
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.d.ts.map +1 -1
- package/lib/cjs/geometry/LineStyle.js +3 -0
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.d.ts.map +1 -1
- package/lib/cjs/geometry/Placement.js +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js +66 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +1 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +4 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts +0 -3
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +10 -2
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/AnalysisStyle.d.ts.map +1 -1
- package/lib/esm/AnalysisStyle.js +2 -0
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/BlobReader.d.ts.map +1 -1
- package/lib/esm/BlobReader.js +10 -2
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.d.ts +2 -0
- package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +2 -2
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlTypes.js +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +8 -0
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/FeatureIndex.d.ts.map +1 -1
- package/lib/esm/FeatureIndex.js +2 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +0 -2
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/GeometryParams.d.ts.map +1 -1
- package/lib/esm/GeometryParams.js +6 -0
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/Gradient.d.ts.map +1 -1
- package/lib/esm/Gradient.js +5 -0
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js +4 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +8 -8
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/Localization.d.ts.map +1 -1
- package/lib/esm/Localization.js +3 -0
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/TextureMapping.js +3 -3
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js +3 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Tween.d.ts +1 -1
- package/lib/esm/Tween.d.ts.map +1 -1
- package/lib/esm/Tween.js +4 -2
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +17 -68
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +18 -33
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextField.d.ts +86 -0
- package/lib/esm/annotation/TextField.d.ts.map +1 -0
- package/lib/esm/annotation/TextField.js +9 -0
- package/lib/esm/annotation/TextField.js.map +1 -0
- package/lib/esm/core-common.d.ts +1 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +1 -0
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +1 -0
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.d.ts.map +1 -1
- package/lib/esm/geometry/AreaPattern.js +13 -0
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js +7 -0
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +20 -11
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js +1 -0
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.d.ts.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js +7 -0
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +3 -3
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/LineStyle.d.ts.map +1 -1
- package/lib/esm/geometry/LineStyle.js +3 -0
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.d.ts.map +1 -1
- package/lib/esm/geometry/Placement.js +2 -2
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js +2 -2
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/esm/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/esm/internal/annotations/FieldFormatter.js +62 -0
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +1 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -0
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.d.ts +0 -3
- package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +10 -2
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +2 -2
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackedFeatureTable.js","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwYH,kDASC;AA/YD,sDAE6B;AAC7B,kDAA2J;AAC3J,sDAAkD;AAElD;;;;GAIG;AACH,MAAa,kBAAkB;IACb,IAAI,CAAc;IAClB,YAAY,CAAa;IACzB,gBAAgB,CAAkB;IAClC,WAAW,CAAS;IACpB,UAAU,CAAU;IACpB,IAAI,CAAY;IACzB,gBAAgB,CAAa;IAEpC,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAEhE;;;OAGG;IACH,YAAmB,IAAiB,EAAE,OAAmB,EAAE,WAAmB,EAAE,IAAe,EAAE,gBAA4B;QAC3H,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,mBAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAEzC,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;YACzB,KAAK,CAAC;gBACJ,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;gBACxB,MAAM;YACR,KAAK,C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AAa,EAAE,EAAE,GAAG,IAAI,EAAE;QAC1B,aAAa,EAAE,8BAAa,CAAC,OAAO;QACpC,eAAe,EAAE,CAAC;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,mBAAmB,EAAE,CAAC;AAEnD,SAAS,wBAAwB,CAAC,KAAyB,EAAE,aAA4B,EAAE,SAAiB;IAC1G,IAAA,qBAAM,EAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAEtB,IAAI,OAAO,CAAC;IACZ,MAAM,aAAa,GAAG,4BAAa,CAAC,eAAe,EAAE,CAAC;IACtD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACtC,IAAA,qBAAM,EAAC,MAAM,IAAI,SAAS,CAAC,CAAC;QAC5B,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC;gBAC/B,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7H,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n assert, Id64, Id64String, UintArray,\n} from \"@itwin/core-bentley\";\nimport { BatchType, ComputeNodeId, Feature, FeatureTable, ModelFeature, PackedFeature, PackedFeatureWithIndex, RenderFeatureTable } from \"../FeatureTable\";\nimport { GeometryClass } from \"../GeometryParams\";\n\n/**\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\n * wherein each feature occupies 3 32-bit integers.\n * @internal\n */\nexport class PackedFeatureTable implements RenderFeatureTable {\n public readonly data: Uint32Array;\n public readonly batchModelId: Id64String;\n public readonly batchModelIdPair: Id64.Uint32Pair;\n public readonly numFeatures: number;\n public readonly anyDefined: boolean;\n public readonly type: BatchType;\n public animationNodeIds?: UintArray;\n\n public get byteLength(): number { return this.data.byteLength; }\n\n /** Construct a PackedFeatureTable from the packed binary data.\n * This is used internally when deserializing Tiles in iMdl format.\n * @internal\n */\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\n this.data = data;\n this.batchModelId = modelId;\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\n this.numFeatures = numFeatures;\n this.type = type;\n this.animationNodeIds = animationNodeIds;\n\n switch (this.numFeatures) {\n case 0:\n this.anyDefined = false;\n break;\n case 1:\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\n break;\n default:\n this.anyDefined = true;\n break;\n }\n\n assert(this.data.length >= this._subCategoriesOffset);\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\n }\n\n /** Create a packed feature table from a [[FeatureTable]]. */\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\n // the array cannot be resized after it is created.\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\n // back-end arrive within tiles already in the packed format.\n const subcategories = new Map<string, number>();\n for (const iv of featureTable.getArray()) {\n const found = subcategories.get(iv.value.subCategoryId.toString());\n if (undefined === found)\n subcategories.set(iv.value.subCategoryId, subcategories.size);\n }\n\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\n const subCategoriesOffset = 3 * featureTable.length;\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\n const uint32s = new Uint32Array(nUint32s);\n\n for (const iv of featureTable.getArray()) {\n const feature = iv.value;\n const index = iv.index * 3;\n\n let subCategoryIndex = subcategories.get(feature.subCategoryId)!;\n assert(undefined !== subCategoryIndex); // we inserted it above...\n subCategoryIndex |= (feature.geometryClass << 24);\n\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\n uint32s[index + 2] = subCategoryIndex;\n }\n\n subcategories.forEach((index: number, id: string, _map) => {\n const index32 = subCategoriesOffset + 2 * index;\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\n });\n\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\n }\n\n /** Retrieve the Feature associated with the specified index. */\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result, this.batchModelId);\n }\n\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n /** @internal */\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\n out = out ?? { lower: 0, upper: 0 };\n assert(featureIndex < this.numFeatures);\n const offset = 3 * featureIndex;\n out.lower = this.data[offset];\n out.upper = this.data[offset + 1];\n return out;\n }\n\n /** @internal */\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\n const index = 3 * featureIndex;\n let subCatIndex = this.data[index + 2];\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\n }\n\n /** @internal */\n public getAnimationNodeId(featureIndex: number): number {\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\n }\n\n /** @internal */\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n assert(featureIndex < this.numFeatures);\n\n const index32 = 3 * featureIndex;\n result.elementId.lower = this.data[index32];\n result.elementId.upper = this.data[index32 + 1];\n\n const subCatIndexAndClass = this.data[index32 + 2];\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\n\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n result.subCategoryId.lower = this.data[subCatIndex];\n result.subCategoryId.upper = this.data[subCatIndex + 1];\n\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\n result.modelId.lower = this.batchModelIdPair.lower;\n result.modelId.upper = this.batchModelIdPair.upper;\n\n return result;\n }\n\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n out.lower = this.batchModelIdPair.lower;\n out.upper = this.batchModelIdPair.upper;\n return out;\n }\n\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\n public findElementId(featureIndex: number): Id64String | undefined {\n if (featureIndex >= this.numFeatures)\n return undefined;\n else\n return this.readId(3 * featureIndex);\n }\n\n /** Return true if this table contains exactly 1 feature. */\n public get isUniform(): boolean { return 1 === this.numFeatures; }\n\n /** If this table contains exactly 1 feature, return it. */\n public getUniform(result: ModelFeature): ModelFeature | undefined {\n return this.isUniform ? this.getFeature(0, result) : undefined;\n }\n\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\n\n /** Unpack the features into a [[FeatureTable]]. */\n public unpack(): FeatureTable {\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\n const feature = ModelFeature.create();\n for (let i = 0; i < this.numFeatures; i++) {\n this.getFeature(i, feature);\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\n }\n\n return table;\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n assert(undefined === this.animationNodeIds);\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n for (let i = 0; i < this.numFeatures; i++) {\n this.getPackedFeature(i, output);\n output.index = i;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\n\n private readId(offset32: number): Id64String {\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\n }\n}\n\ninterface PackedFeatureModelEntry {\n lastFeatureIndex: number;\n idLower: number;\n idUpper: number;\n}\n\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\n\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\n * The model table itself consists of one entry per model, where each entry looks like:\n * indexOfLastFeatureInModel: u32\n * modelId: u64\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\n * This lookup can be optimized using binary search.\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\n * @internal\n */\nexport class PackedFeatureModelTable {\n private readonly _data: Uint32Array;\n\n public constructor(data: Uint32Array) {\n this._data = data;\n assert(this._data.length % 3 === 0);\n }\n\n /** The number of models in the table. */\n public get length(): number {\n return this._data.length / 3;\n }\n\n public get byteLength(): number {\n return this._data.byteLength;\n }\n\n private getLastFeatureIndex(modelIndex: number): number {\n return this._data[modelIndex * 3];\n }\n\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\n if (modelIndex >= this.length) {\n result.idLower = result.idUpper = 0;\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\n return result;\n }\n\n const index = modelIndex * 3;\n result.lastFeatureIndex = this._data[index + 0];\n result.idLower = this._data[index + 1];\n result.idUpper = this._data[index + 2];\n return result;\n }\n\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\n if (!result)\n result = { lower: 0, upper: 0 };\n else\n result.lower = result.upper = 0;\n\n let first = 0;\n const last = this.length;\n let count = last;\n while (count > 0) {\n const step = Math.floor(count / 2);\n const mid = first + step;\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\n if (featureIndex > lastFeatureIndex) {\n first = mid + 1;\n count -= step + 1;\n } else {\n count = step;\n }\n }\n\n if (first < last) {\n result.lower = this._data[first * 3 + 1];\n result.upper = this._data[first * 3 + 2];\n }\n\n return result;\n }\n}\n\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\n * @internal\n */\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\n private readonly _features: PackedFeatureTable;\n private readonly _models: PackedFeatureModelTable;\n\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\n this._features = features;\n this._models = models;\n }\n\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\n const featureData = data.subarray(0, modelTableOffset);\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\n\n const modelData = data.subarray(modelTableOffset);\n const models = new PackedFeatureModelTable(modelData);\n\n return new MultiModelPackedFeatureTable(features, models);\n }\n\n public get batchModelId() { return this._features.batchModelId; }\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\n public get numFeatures() { return this._features.numFeatures; }\n public get type() { return this._features.type; }\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\n\n public get byteLength() {\n return this._features.byteLength + this._models.byteLength;\n }\n\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n this._features.getPackedFeature(featureIndex, result);\n this._models.getModelIdPair(featureIndex, result.modelId);\n return result;\n }\n\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result);\n }\n\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n return this._features.getElementIdPair(featureIndex, out);\n }\n\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n this._models.getModelIdPair(featureIndex, out);\n return out;\n }\n\n public findElementId(featureIndex: number): Id64String | undefined {\n return this._features.findElementId(featureIndex);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\n let modelIndex = 0;\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\n\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\n if (featureIndex > modelEntry.lastFeatureIndex)\n this._models.getEntry(++modelIndex, modelEntry);\n\n this._features.getPackedFeature(featureIndex, output);\n output.modelId.lower = modelEntry.idLower;\n output.modelId.upper = modelEntry.idUpper;\n output.index = featureIndex;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n public getAnimationNodeId(featureIndex: number): number {\n return this._features.getAnimationNodeId(featureIndex);\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n}\n\nexport function createPackedFeature(): PackedFeature {\n const pair = { upper: 0, lower: 0 };\n return {\n modelId: { ...pair },\n elementId: { ...pair },\n subCategoryId: { ...pair },\n geometryClass: GeometryClass.Primary,\n animationNodeId: 0,\n };\n}\n\nconst scratchPackedFeature = createPackedFeature();\n\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\n assert(maxNodeId > 0);\n\n let nodeIds;\n const outputFeature = PackedFeature.createWithIndex();\n for (const feature of table.iterable(outputFeature)) {\n const nodeId = computeNodeId(feature);\n assert(nodeId <= maxNodeId);\n if (0 !== nodeId) {\n if (!nodeIds) {\n const size = table.numFeatures;\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\n }\n\n nodeIds[feature.index] = nodeId;\n }\n }\n\n return nodeIds;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"PackedFeatureTable.js","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwYH,kDASC;AA/YD,sDAE6B;AAC7B,kDAA2J;AAC3J,sDAAkD;AAElD;;;;GAIG;AACH,MAAa,kBAAkB;IACb,IAAI,CAAc;IAClB,YAAY,CAAa;IACzB,gBAAgB,CAAkB;IAClC,WAAW,CAAS;IACpB,UAAU,CAAU;IACpB,IAAI,CAAY;IACzB,gBAAgB,CAAa;IAEpC,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CA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gBAC/B,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7H,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n assert, expectDefined, Id64, Id64String, UintArray,\n} from \"@itwin/core-bentley\";\nimport { BatchType, ComputeNodeId, Feature, FeatureTable, ModelFeature, PackedFeature, PackedFeatureWithIndex, RenderFeatureTable } from \"../FeatureTable\";\nimport { GeometryClass } from \"../GeometryParams\";\n\n/**\n * An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,\n * wherein each feature occupies 3 32-bit integers.\n * @internal\n */\nexport class PackedFeatureTable implements RenderFeatureTable {\n public readonly data: Uint32Array;\n public readonly batchModelId: Id64String;\n public readonly batchModelIdPair: Id64.Uint32Pair;\n public readonly numFeatures: number;\n public readonly anyDefined: boolean;\n public readonly type: BatchType;\n public animationNodeIds?: UintArray;\n\n public get byteLength(): number { return this.data.byteLength; }\n\n /** Construct a PackedFeatureTable from the packed binary data.\n * This is used internally when deserializing Tiles in iMdl format.\n * @internal\n */\n public constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: UintArray) {\n this.data = data;\n this.batchModelId = modelId;\n this.batchModelIdPair = Id64.getUint32Pair(modelId);\n this.numFeatures = numFeatures;\n this.type = type;\n this.animationNodeIds = animationNodeIds;\n\n switch (this.numFeatures) {\n case 0:\n this.anyDefined = false;\n break;\n case 1:\n this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));\n break;\n default:\n this.anyDefined = true;\n break;\n }\n\n assert(this.data.length >= this._subCategoriesOffset);\n assert(undefined === this.animationNodeIds || this.animationNodeIds.length === this.numFeatures);\n }\n\n /** Create a packed feature table from a [[FeatureTable]]. */\n public static pack(featureTable: FeatureTable): PackedFeatureTable {\n // We must determine how many subcategories we have ahead of time to compute the size of the Uint32Array, as\n // the array cannot be resized after it is created.\n // We are not too worried about this as FeatureTables created on the front-end will contain few if any features; those obtained from the\n // back-end arrive within tiles already in the packed format.\n const subcategories = new Map<string, number>();\n for (const iv of featureTable.getArray()) {\n const found = subcategories.get(iv.value.subCategoryId.toString());\n if (undefined === found)\n subcategories.set(iv.value.subCategoryId, subcategories.size);\n }\n\n // We need 3 32-bit integers per feature, plus 2 32-bit integers per subcategory.\n const subCategoriesOffset = 3 * featureTable.length;\n const nUint32s = subCategoriesOffset + 2 * subcategories.size;\n const uint32s = new Uint32Array(nUint32s);\n\n for (const iv of featureTable.getArray()) {\n const feature = iv.value;\n const index = iv.index * 3;\n\n let subCategoryIndex = expectDefined(subcategories.get(feature.subCategoryId));\n assert(undefined !== subCategoryIndex); // we inserted it above...\n subCategoryIndex |= (feature.geometryClass << 24);\n\n uint32s[index + 0] = Id64.getLowerUint32(feature.elementId);\n uint32s[index + 1] = Id64.getUpperUint32(feature.elementId);\n uint32s[index + 2] = subCategoryIndex;\n }\n\n subcategories.forEach((index: number, id: string, _map) => {\n const index32 = subCategoriesOffset + 2 * index;\n uint32s[index32 + 0] = Id64.getLowerUint32(id);\n uint32s[index32 + 1] = Id64.getUpperUint32(id);\n });\n\n return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);\n }\n\n /** Retrieve the Feature associated with the specified index. */\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result, this.batchModelId);\n }\n\n /** Returns the Feature associated with the specified index, or undefined if the index is out of range. */\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n /** @internal */\n public getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair {\n out = out ?? { lower: 0, upper: 0 };\n assert(featureIndex < this.numFeatures);\n const offset = 3 * featureIndex;\n out.lower = this.data[offset];\n out.upper = this.data[offset + 1];\n return out;\n }\n\n /** @internal */\n public getSubCategoryIdPair(featureIndex: number): Id64.Uint32Pair {\n const index = 3 * featureIndex;\n let subCatIndex = this.data[index + 2];\n subCatIndex = (subCatIndex & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n return { lower: this.data[subCatIndex], upper: this.data[subCatIndex + 1] };\n }\n\n /** @internal */\n public getAnimationNodeId(featureIndex: number): number {\n return undefined !== this.animationNodeIds && featureIndex < this.numFeatures ? this.animationNodeIds[featureIndex] : 0;\n }\n\n /** @internal */\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n assert(featureIndex < this.numFeatures);\n\n const index32 = 3 * featureIndex;\n result.elementId.lower = this.data[index32];\n result.elementId.upper = this.data[index32 + 1];\n\n const subCatIndexAndClass = this.data[index32 + 2];\n result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;\n\n let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;\n subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;\n result.subCategoryId.lower = this.data[subCatIndex];\n result.subCategoryId.upper = this.data[subCatIndex + 1];\n\n result.animationNodeId = this.getAnimationNodeId(featureIndex);\n result.modelId.lower = this.batchModelIdPair.lower;\n result.modelId.upper = this.batchModelIdPair.upper;\n\n return result;\n }\n\n public getModelIdPair(_featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n out.lower = this.batchModelIdPair.lower;\n out.upper = this.batchModelIdPair.upper;\n return out;\n }\n\n /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */\n public findElementId(featureIndex: number): Id64String | undefined {\n if (featureIndex >= this.numFeatures)\n return undefined;\n else\n return this.readId(3 * featureIndex);\n }\n\n /** Return true if this table contains exactly 1 feature. */\n public get isUniform(): boolean { return 1 === this.numFeatures; }\n\n /** If this table contains exactly 1 feature, return it. */\n public getUniform(result: ModelFeature): ModelFeature | undefined {\n return this.isUniform ? this.getFeature(0, result) : undefined;\n }\n\n public get isVolumeClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isPlanarClassifier(): boolean { return BatchType.VolumeClassifier === this.type; }\n public get isClassifier(): boolean { return this.isVolumeClassifier || this.isPlanarClassifier; }\n\n /** Unpack the features into a [[FeatureTable]]. */\n public unpack(): FeatureTable {\n const table = new FeatureTable(this.numFeatures, this.batchModelId);\n const feature = ModelFeature.create();\n for (let i = 0; i < this.numFeatures; i++) {\n this.getFeature(i, feature);\n table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);\n }\n\n return table;\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n assert(undefined === this.animationNodeIds);\n this.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n for (let i = 0; i < this.numFeatures; i++) {\n this.getPackedFeature(i, output);\n output.index = i;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n private get _subCategoriesOffset(): number { return this.numFeatures * 3; }\n\n private readId(offset32: number): Id64String {\n return Id64.fromUint32Pair(this.data[offset32], this.data[offset32 + 1]);\n }\n}\n\ninterface PackedFeatureModelEntry {\n lastFeatureIndex: number;\n idLower: number;\n idUpper: number;\n}\n\nconst scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };\n\n/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].\n * The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.\n * The model table itself consists of one entry per model, where each entry looks like:\n * indexOfLastFeatureInModel: u32\n * modelId: u64\n * The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.\n * This lookup can be optimized using binary search.\n * Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.\n * @internal\n */\nexport class PackedFeatureModelTable {\n private readonly _data: Uint32Array;\n\n public constructor(data: Uint32Array) {\n this._data = data;\n assert(this._data.length % 3 === 0);\n }\n\n /** The number of models in the table. */\n public get length(): number {\n return this._data.length / 3;\n }\n\n public get byteLength(): number {\n return this._data.byteLength;\n }\n\n private getLastFeatureIndex(modelIndex: number): number {\n return this._data[modelIndex * 3];\n }\n\n public getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry {\n if (modelIndex >= this.length) {\n result.idLower = result.idUpper = 0;\n result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;\n return result;\n }\n\n const index = modelIndex * 3;\n result.lastFeatureIndex = this._data[index + 0];\n result.idLower = this._data[index + 1];\n result.idUpper = this._data[index + 2];\n return result;\n }\n\n /** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */\n public getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair {\n if (!result)\n result = { lower: 0, upper: 0 };\n else\n result.lower = result.upper = 0;\n\n let first = 0;\n const last = this.length;\n let count = last;\n while (count > 0) {\n const step = Math.floor(count / 2);\n const mid = first + step;\n const lastFeatureIndex = this.getLastFeatureIndex(mid);\n if (featureIndex > lastFeatureIndex) {\n first = mid + 1;\n count -= step + 1;\n } else {\n count = step;\n }\n }\n\n if (first < last) {\n result.lower = this._data[first * 3 + 1];\n result.upper = this._data[first * 3 + 2];\n }\n\n return result;\n }\n}\n\n/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.\n * @internal\n */\nexport class MultiModelPackedFeatureTable implements RenderFeatureTable {\n private readonly _features: PackedFeatureTable;\n private readonly _models: PackedFeatureModelTable;\n\n public constructor(features: PackedFeatureTable, models: PackedFeatureModelTable) {\n this._features = features;\n this._models = models;\n }\n\n public static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable {\n const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;\n const featureData = data.subarray(0, modelTableOffset);\n const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);\n\n const modelData = data.subarray(modelTableOffset);\n const models = new PackedFeatureModelTable(modelData);\n\n return new MultiModelPackedFeatureTable(features, models);\n }\n\n public get batchModelId() { return this._features.batchModelId; }\n public get batchModelIdPair() { return this._features.batchModelIdPair; }\n public get numFeatures() { return this._features.numFeatures; }\n public get type() { return this._features.type; }\n public get animationNodeIds(): UintArray | undefined { return this._features.animationNodeIds; }\n public set animationNodeIds(ids: UintArray | undefined) { this._features.animationNodeIds = ids; }\n\n public get byteLength() {\n return this._features.byteLength + this._models.byteLength;\n }\n\n public getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature {\n this._features.getPackedFeature(featureIndex, result);\n this._models.getModelIdPair(featureIndex, result.modelId);\n return result;\n }\n\n public getFeature(featureIndex: number, result: ModelFeature): ModelFeature {\n const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);\n return ModelFeature.unpack(packed, result);\n }\n\n public findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined {\n return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;\n }\n\n public getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n return this._features.getElementIdPair(featureIndex, out);\n }\n\n public getModelIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair {\n this._models.getModelIdPair(featureIndex, out);\n return out;\n }\n\n public findElementId(featureIndex: number): Id64String | undefined {\n return this._features.findElementId(featureIndex);\n }\n\n public * iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex> {\n // Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.\n let modelIndex = 0;\n const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);\n\n for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {\n if (featureIndex > modelEntry.lastFeatureIndex)\n this._models.getEntry(++modelIndex, modelEntry);\n\n this._features.getPackedFeature(featureIndex, output);\n output.modelId.lower = modelEntry.idLower;\n output.modelId.upper = modelEntry.idUpper;\n output.index = featureIndex;\n yield output;\n }\n }\n\n public iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex> {\n return {\n [Symbol.iterator]: () => this.iterator(output),\n };\n }\n\n public getAnimationNodeId(featureIndex: number): number {\n return this._features.getAnimationNodeId(featureIndex);\n }\n\n public populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void {\n this._features.animationNodeIds = populateAnimationNodeIds(this, computeNodeId, maxNodeId);\n }\n}\n\nexport function createPackedFeature(): PackedFeature {\n const pair = { upper: 0, lower: 0 };\n return {\n modelId: { ...pair },\n elementId: { ...pair },\n subCategoryId: { ...pair },\n geometryClass: GeometryClass.Primary,\n animationNodeId: 0,\n };\n}\n\nconst scratchPackedFeature = createPackedFeature();\n\nfunction populateAnimationNodeIds(table: RenderFeatureTable, computeNodeId: ComputeNodeId, maxNodeId: number): UintArray | undefined {\n assert(maxNodeId > 0);\n\n let nodeIds;\n const outputFeature = PackedFeature.createWithIndex();\n for (const feature of table.iterable(outputFeature)) {\n const nodeId = computeNodeId(feature);\n assert(nodeId <= maxNodeId);\n if (0 !== nodeId) {\n if (!nodeIds) {\n const size = table.numFeatures;\n nodeIds = maxNodeId < 0x100 ? new Uint8Array(size) : (maxNodeId < 0x10000 ? new Uint16Array(size) : new Uint32Array(size));\n }\n\n nodeIds[feature.index] = nodeId;\n }\n }\n\n return nodeIds;\n}\n\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { XAndY, XYAndZ } from "@itwin/core-geometry";
|
|
2
|
+
import { FieldFormatOptions, FieldPropertyType } from "../../annotation/TextField";
|
|
3
|
+
/** A FieldPropertyPath must ultimately resolve to one of these primitive types.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export type FieldPrimitiveValue = boolean | number | string | Date | XAndY | XYAndZ | Uint8Array;
|
|
7
|
+
/** Resolved value of a field.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export interface FieldValue {
|
|
11
|
+
value: FieldPrimitiveValue;
|
|
12
|
+
type: FieldPropertyType;
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare function formatFieldValue(value: FieldValue, options: FieldFormatOptions | undefined): string | undefined;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare function isKnownFieldPropertyType(type: string): type is FieldPropertyType;
|
|
18
|
+
//# sourceMappingURL=FieldFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFormatter.d.ts","sourceRoot":"","sources":["../../../../src/internal/annotations/FieldFormatter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAA8B,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/G;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,IAAI,EAAE,iBAAiB,CAAC;CACzB;AA8DD,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG/G;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAEhF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.formatFieldValue = formatFieldValue;
|
|
8
|
+
exports.isKnownFieldPropertyType = isKnownFieldPropertyType;
|
|
9
|
+
const formatters = {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
11
|
+
"string": (v, o) => formatString(v.toString(), o),
|
|
12
|
+
"datetime": (v, o) => formatString(formatDateTime(v, o?.dateTime), o),
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
14
|
+
"quantity": (v, o) => formatString(v.toString(), o),
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
16
|
+
"coordinate": (v, o) => formatString(v.toString(), o),
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
18
|
+
"boolean": (v, o) => formatString(v.toString(), o),
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
20
|
+
"int-enum": (v, o) => formatString(v.toString(), o),
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
22
|
+
"string-enum": (v, o) => formatString(v.toString(), o),
|
|
23
|
+
};
|
|
24
|
+
function formatString(s, o) {
|
|
25
|
+
if (undefined === s || !o) {
|
|
26
|
+
return s;
|
|
27
|
+
}
|
|
28
|
+
switch (o.case) {
|
|
29
|
+
case "upper":
|
|
30
|
+
s = s.toUpperCase();
|
|
31
|
+
break;
|
|
32
|
+
case "lower":
|
|
33
|
+
s = s.toLowerCase();
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
if (o.prefix || o.suffix) {
|
|
37
|
+
s = `${o.prefix ?? ""}${s}${o.suffix ?? ""}`;
|
|
38
|
+
}
|
|
39
|
+
return s;
|
|
40
|
+
}
|
|
41
|
+
function formatDateTime(v, o) {
|
|
42
|
+
if (!(v instanceof Date))
|
|
43
|
+
return undefined;
|
|
44
|
+
if (!isNaN(v.getTime())) {
|
|
45
|
+
if (o?.formatOptions) {
|
|
46
|
+
const locale = o.locale ?? "en-US";
|
|
47
|
+
if (!Intl.DateTimeFormat.supportedLocalesOf([locale], { localeMatcher: "lookup" }).includes(locale)) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const formatter = new Intl.DateTimeFormat(locale, o.formatOptions);
|
|
51
|
+
return formatter.format(v);
|
|
52
|
+
}
|
|
53
|
+
return v.toString();
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
/** @internal */
|
|
58
|
+
function formatFieldValue(value, options) {
|
|
59
|
+
const formatter = formatters[value.type];
|
|
60
|
+
return formatter ? formatter(value.value, options) : undefined;
|
|
61
|
+
}
|
|
62
|
+
/** @internal */
|
|
63
|
+
function isKnownFieldPropertyType(type) {
|
|
64
|
+
return type in formatters;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=FieldFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFormatter.js","sourceRoot":"","sources":["../../../../src/internal/annotations/FieldFormatter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AA+E/F,4CAGC;AAGD,4DAEC;AAnED,MAAM,UAAU,GAAmD;IACj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AC,CAAC,SAAS,CAAC;AACjE,CAAC;AAED,gBAAgB;AAChB,SAAgB,wBAAwB,CAAC,IAAY;IACnD,OAAO,IAAI,IAAI,UAAU,CAAC;AAC5B,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*--------------------------------------------------------------------------------------------*/\n\nimport { XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { DateTimeFieldFormatOptions, FieldFormatOptions, FieldPropertyType } from \"../../annotation/TextField\";\n\n/** A FieldPropertyPath must ultimately resolve to one of these primitive types.\n * @internal\n */\nexport type FieldPrimitiveValue = boolean | number | string | Date | XAndY | XYAndZ | Uint8Array;\n\n/** Resolved value of a field.\n * @internal\n */\nexport interface FieldValue {\n value: FieldPrimitiveValue;\n type: FieldPropertyType;\n}\n\ntype FieldFormatter = (value: FieldPrimitiveValue, options: FieldFormatOptions | undefined) => string | undefined;\n\nconst formatters: { [type: string]: FieldFormatter | undefined } = {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"string\": (v, o) => formatString(v.toString(), o),\n\n \"datetime\": (v, o) => formatString(formatDateTime(v, o?.dateTime), o),\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"quantity\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"coordinate\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"boolean\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"int-enum\": (v, o) => formatString(v.toString(), o),\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n \"string-enum\": (v, o) => formatString(v.toString(), o),\n};\n\nfunction formatString(s: string | undefined, o?: FieldFormatOptions): string | undefined {\n if (undefined === s || !o) {\n return s;\n }\n\n switch (o.case) {\n case \"upper\":\n s = s.toUpperCase();\n break;\n case \"lower\":\n s = s.toLowerCase();\n break;\n }\n\n if (o.prefix || o.suffix) {\n s = `${o.prefix ?? \"\"}${s}${o.suffix ?? \"\"}`;\n }\n\n return s;\n}\n\nfunction formatDateTime(v: FieldPrimitiveValue, o?: DateTimeFieldFormatOptions): string | undefined {\n if (!(v instanceof Date))\n return undefined;\n\n if (!isNaN(v.getTime())) {\n if (o?.formatOptions) {\n const locale = o.locale ?? \"en-US\";\n if (!Intl.DateTimeFormat.supportedLocalesOf([locale], { localeMatcher: \"lookup\" }).includes(locale)) {\n return undefined;\n }\n\n const formatter = new Intl.DateTimeFormat(locale, o.formatOptions);\n return formatter.format(v);\n }\n return v.toString();\n }\n return undefined;\n}\n\n/** @internal */\nexport function formatFieldValue(value: FieldValue, options: FieldFormatOptions | undefined): string | undefined {\n const formatter = formatters[value.type];\n return formatter ? formatter(value.value, options) : undefined;\n}\n\n/** @internal */\nexport function isKnownFieldPropertyType(type: string): type is FieldPropertyType {\n return type in formatters;\n}\n\n"]}
|
|
@@ -4,4 +4,5 @@ export { MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTab
|
|
|
4
4
|
export type { BackendReadable, BackendWritable, BackendBuffer } from "./BackendTypes";
|
|
5
5
|
export { RenderMaterialParams } from "./RenderMaterialParams";
|
|
6
6
|
export { RenderTextureParams } from "./RenderTextureParams";
|
|
7
|
+
export { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from "./annotations/FieldFormatter";
|
|
7
8
|
//# sourceMappingURL=cross-package.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.RenderTextureParams = exports.RenderMaterialParams = exports.PackedFeatureTable = exports.PackedFeatureModelTable = exports.MultiModelPackedFeatureTable = exports.SilhouetteEdgeArgs = exports.PolylineEdgeArgs = exports.MeshPolyline = exports.MeshEdges = exports.MeshEdge = exports.EdgeArgs = void 0;
|
|
7
|
+
exports.isKnownFieldPropertyType = exports.formatFieldValue = exports.RenderTextureParams = exports.RenderMaterialParams = exports.PackedFeatureTable = exports.PackedFeatureModelTable = exports.MultiModelPackedFeatureTable = exports.SilhouetteEdgeArgs = exports.PolylineEdgeArgs = exports.MeshPolyline = exports.MeshEdges = exports.MeshEdge = exports.EdgeArgs = void 0;
|
|
8
8
|
var RenderMesh_1 = require("./RenderMesh");
|
|
9
9
|
Object.defineProperty(exports, "EdgeArgs", { enumerable: true, get: function () { return RenderMesh_1.EdgeArgs; } });
|
|
10
10
|
Object.defineProperty(exports, "MeshEdge", { enumerable: true, get: function () { return RenderMesh_1.MeshEdge; } });
|
|
@@ -20,4 +20,7 @@ var RenderMaterialParams_1 = require("./RenderMaterialParams");
|
|
|
20
20
|
Object.defineProperty(exports, "RenderMaterialParams", { enumerable: true, get: function () { return RenderMaterialParams_1.RenderMaterialParams; } });
|
|
21
21
|
var RenderTextureParams_1 = require("./RenderTextureParams");
|
|
22
22
|
Object.defineProperty(exports, "RenderTextureParams", { enumerable: true, get: function () { return RenderTextureParams_1.RenderTextureParams; } });
|
|
23
|
+
var FieldFormatter_1 = require("./annotations/FieldFormatter");
|
|
24
|
+
Object.defineProperty(exports, "formatFieldValue", { enumerable: true, get: function () { return FieldFormatter_1.formatFieldValue; } });
|
|
25
|
+
Object.defineProperty(exports, "isKnownFieldPropertyType", { enumerable: true, get: function () { return FieldFormatter_1.isKnownFieldPropertyType; } });
|
|
23
26
|
//# sourceMappingURL=cross-package.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;AADU,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAyB,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAExI,2DAE8B;AAD5B,kIAAA,4BAA4B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAG3E,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA","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*--------------------------------------------------------------------------------------------*/\n\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\n"]}
|
|
1
|
+
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;AADU,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAyB,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAExI,2DAE8B;AAD5B,kIAAA,4BAA4B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAG3E,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,+DAAqI;AAAjF,kHAAA,gBAAgB,OAAA;AAAE,0HAAA,wBAAwB,OAAA","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*--------------------------------------------------------------------------------------------*/\n\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\nexport { type FieldPrimitiveValue, type FieldValue, formatFieldValue, isKnownFieldPropertyType } from \"./annotations/FieldFormatter\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcConfiguration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RpcConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcConfiguration.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAA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a;cAElD,IAAI;IAYpB,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;cAItC,IAAI;CAGrB"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RpcDirectRequest = exports.RpcDirectProtocol = exports.RpcDefaultConfiguration = exports.RpcConfiguration = exports.RpcRoutingMap = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module RpcInterface
|
|
10
|
+
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
4
12
|
const RpcManager_1 = require("../../RpcManager");
|
|
5
13
|
const RpcControl_1 = require("./RpcControl");
|
|
6
14
|
const RpcProtocol_1 = require("./RpcProtocol");
|
|
@@ -12,7 +20,7 @@ var RpcRoutingMap;
|
|
|
12
20
|
(function (RpcRoutingMap) {
|
|
13
21
|
function create() {
|
|
14
22
|
const configurations = new Map();
|
|
15
|
-
return Object.assign((routing) => configurations.get(routing.id)(), { configurations });
|
|
23
|
+
return Object.assign((routing) => configurations.get((0, core_bentley_1.expectDefined)(routing).id)(), { configurations });
|
|
16
24
|
}
|
|
17
25
|
RpcRoutingMap.create = create;
|
|
18
26
|
})(RpcRoutingMap || (exports.RpcRoutingMap = RpcRoutingMap = {}));
|
|
@@ -172,7 +180,7 @@ class RpcDirectRequest extends RpcRequest_1.RpcRequest {
|
|
|
172
180
|
this.headers.set(name, value);
|
|
173
181
|
}
|
|
174
182
|
async load() {
|
|
175
|
-
return this.fulfillment.result;
|
|
183
|
+
return (0, core_bentley_1.expectDefined)(this.fulfillment).result;
|
|
176
184
|
}
|
|
177
185
|
}
|
|
178
186
|
exports.RpcDirectRequest = RpcDirectRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcConfiguration.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcConfiguration.ts"],"names":[],"mappings":";;;AAQA,iDAA8C;AAC9C,6CAAiD;AAEjD,+CAAmE;AACnE,+CAAyC;AACzC,6CAA0C;AAE1C,uDAAoD;AAQpD,gBAAgB;AAChB,IAAiB,aAAa,CAK7B;AALD,WAAiB,aAAa;IAC5B,SAAgB,MAAM;QACpB,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,OAAyB,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,OAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7G,CAAC;IAHe,oBAAM,SAGrB,CAAA;AACH,CAAC,EALgB,aAAa,6BAAb,aAAa,QAK7B;AAED;;;GAGG;AACH,MAAsB,gBAAgB;IACpC;;OAEG;IACI,MAAM,CAAC,eAAe,GAAY,KAAK,CAAC;IAE/C,iGAAiG;IAC1F,MAAM,CAAC,wBAAwB,GAAY,KAAK,CAAC;IAExD;;;OAGG;IACI,MAAM,CAAC,UAAU,GAAY,KAAK,CAAC;IAE1C;;;;OAIG;IACI,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAC;IAE3C,4EAA4E;IACrE,MAAM,CAAC,MAAM,CAAyB,UAAqC,EAAE,QAAkC;QACpH,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,qBAAkD,CAAC;QACpF,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,WAAW,EAAE,CAAC;YACxD,UAAU,CAAC,SAAS,CAAC,qBAAqB,GAAG,QAAQ,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,cAAc,CAA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a,gBAAiB,SAAQ,uBAAU;IACvC,OAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;IACzC,WAAW,GAAsC,SAAS,CAAC;IAExD,KAAK,CAAC,IAAI;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO,IAAI,OAAO,CAAS,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YACnD,IAAI,CAAC;gBACH,IAAI,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACxD,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAES,SAAS,CAAC,IAAY,EAAE,KAAa;QAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,OAAO,IAAI,CAAC,WAAY,CAAC,MAAM,CAAC;IAClC,CAAC;CACF;AAvBD,4CAuBC","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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcManager } from \"../../RpcManager\";\nimport { RpcControlChannel } from \"./RpcControl\";\nimport { SerializedRpcActivity } from \"./RpcInvocation\";\nimport { RpcProtocol, RpcRequestFulfillment } from \"./RpcProtocol\";\nimport { INSTANCE } from \"./RpcRegistry\";\nimport { RpcRequest } from \"./RpcRequest\";\nimport { RpcRequestContext } from \"./RpcRequestContext\";\nimport { RpcRoutingToken } from \"./RpcRoutingToken\";\n\n/** @internal */\nexport type RpcConfigurationSupplier = (routing?: RpcRoutingToken) => { new(): RpcConfiguration }; // eslint-disable-line @typescript-eslint/prefer-function-type\n\n/** @internal */\nexport interface RpcRoutingMap extends RpcConfigurationSupplier { configurations: Map<number, RpcConfigurationSupplier> }\n\n/** @internal */\nexport namespace RpcRoutingMap {\n export function create(): RpcRoutingMap {\n const configurations = new Map();\n return Object.assign((routing?: RpcRoutingToken) => configurations.get(routing!.id)(), { configurations });\n }\n}\n\n/** A RpcConfiguration specifies how calls on an RPC interface will be marshalled, plus other operating parameters.\n * RpcConfiguration is the base class for specific configurations.\n * @beta\n */\nexport abstract class RpcConfiguration {\n /** Whether development mode is enabled.\n * @note This parameter determines whether developer convenience features like backend stack traces are available.\n */\n public static developmentMode: boolean = false;\n\n /** Whether frontend checks that are relevant in a cloud-hosted routing scenario are disabled. */\n public static disableRoutingValidation: boolean = false;\n\n /** Whether strict mode is enabled.\n * This parameter determines system behaviors relating to strict checking:\n * - Whether an error is thrown if the type marshaling system encounters an unregistered type (only in strict mode).\n */\n public static strictMode: boolean = false;\n\n /**\n * Whether to throw an error when the IModelRpcProps in the operation parameter list differs from the token in the URL.\n * @note By default, a warning is logged and the operation is allowed to proceed.\n * @note The parameter token is always replaced by the url token (unless RpcOperationPolicy.allowTokenMismatch is set).\n */\n public static throwOnTokenMismatch = false;\n\n /** @internal Sets the configuration supplier for an RPC interface class. */\n public static assign<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>, supplier: RpcConfigurationSupplier): void {\n const map = definition.prototype.configurationSupplier as RpcRoutingMap | undefined;\n if (!map || typeof (map.configurations) === \"undefined\") {\n definition.prototype.configurationSupplier = supplier;\n } else {\n map.configurations.set(RpcRoutingToken.default.id, supplier);\n }\n }\n\n /** Sets the configuration supplier for an RPC interface class for a given routing. */\n public static assignWithRouting<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>, routing: RpcRoutingToken, configuration: new () => RpcConfiguration): void {\n if (!definition.prototype.configurationSupplier) {\n RpcConfiguration.assign(definition, RpcRoutingMap.create());\n }\n\n let map = definition.prototype.configurationSupplier as RpcRoutingMap;\n if (typeof (map.configurations) === \"undefined\") {\n const existing = map as RpcConfigurationSupplier;\n map = RpcRoutingMap.create();\n RpcConfiguration.assign(definition, map);\n map.configurations.set(RpcRoutingToken.default.id, existing);\n }\n\n const supplier = () => configuration;\n map.configurations.set(routing.id, supplier);\n }\n\n /** Obtains the instance of an RPC configuration class. */\n public static obtain<T extends RpcConfiguration>(configurationConstructor: new () => T): T {\n let instance = (configurationConstructor as any)[INSTANCE] as T;\n if (!instance)\n instance = (configurationConstructor as any)[INSTANCE] = new configurationConstructor();\n\n return instance;\n }\n\n /** @internal Enables passing of application-specific context with each RPC request. */\n public static requestContext: RpcRequestContext = {\n getId: (_request: RpcRequest): string => \"\",\n serialize: async (request: RpcRequest): Promise<SerializedRpcActivity> => ({\n id: request.id,\n applicationId: \"\",\n applicationVersion: \"\",\n sessionId: \"\",\n authorization: \"\",\n }),\n };\n\n /** @internal */\n public attached: RpcInterfaceDefinition[] = [];\n\n /** The protocol of the configuration.\n * @internal\n */\n public abstract readonly protocol: RpcProtocol;\n\n /** The RPC interfaces managed by the configuration. */\n public abstract readonly interfaces: () => RpcInterfaceDefinition[];\n\n /** @internal */\n public allowAttachedInterfaces: boolean = true;\n\n /** @internal */\n public get attachedInterfaces(): ReadonlyArray<RpcInterfaceDefinition> { return this.attached; }\n\n /** The target interval (in milliseconds) between connection attempts for pending RPC operation requests. */\n public pendingOperationRetryInterval = 10000;\n\n /** The maximum number of transient faults permitted before request failure. */\n public transientFaultLimit = 4;\n\n /** @internal */\n public readonly routing: RpcRoutingToken = RpcRoutingToken.default;\n\n /** The control channel for the configuration.\n * @internal\n */\n public readonly controlChannel = RpcControlChannel.obtain(this);\n\n /** @internal */\n public attach<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>): void {\n if (!this.allowAttachedInterfaces) {\n return;\n }\n\n if (this.interfaces().indexOf(definition) !== -1 || this.attached.indexOf(definition) !== -1) {\n return;\n }\n\n this.attached.push(definition);\n RpcConfiguration.assign(definition, () => this.constructor as any);\n RpcManager.initializeInterface(definition);\n }\n\n /** Initializes the RPC interfaces managed by the configuration. */\n public static initializeInterfaces(configuration: RpcConfiguration) {\n configuration.interfaces().forEach((definition) => RpcManager.initializeInterface(definition));\n }\n\n /** @internal */\n public static supply(definition: RpcInterface): RpcConfiguration {\n return RpcConfiguration.obtain(definition.configurationSupplier ? definition.configurationSupplier(definition.routing) : RpcDefaultConfiguration);\n }\n\n /** @internal */\n public onRpcClientInitialized(definition: RpcInterfaceDefinition, client: RpcInterface): void {\n this.protocol.onRpcClientInitialized(definition, client);\n }\n\n /** @internal */\n public onRpcImplInitialized(definition: RpcInterfaceDefinition, impl: RpcInterface): void {\n this.protocol.onRpcImplInitialized(definition, impl);\n }\n\n /** @internal */\n public onRpcClientTerminated(definition: RpcInterfaceDefinition, client: RpcInterface): void {\n this.protocol.onRpcClientTerminated(definition, client);\n }\n\n /** @internal */\n public onRpcImplTerminated(definition: RpcInterfaceDefinition, impl: RpcInterface): void {\n this.protocol.onRpcImplTerminated(definition, impl);\n }\n}\n\n/** A default configuration that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDefaultConfiguration extends RpcConfiguration {\n public interfaces = () => [];\n public protocol: RpcProtocol = new RpcDirectProtocol(this);\n}\n\n/** A default protocol that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDirectProtocol extends RpcProtocol {\n public readonly requestType = RpcDirectRequest;\n}\n\n/** A default request type that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDirectRequest extends RpcRequest {\n public headers: Map<string, string> = new Map();\n public fulfillment: RpcRequestFulfillment | undefined = undefined;\n\n protected async send() {\n const request = await this.protocol.serialize(this);\n return new Promise<number>(async (resolve, reject) => {\n try {\n this.fulfillment = await this.protocol.fulfill(request);\n resolve(this.fulfillment.status);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n });\n }\n\n protected setHeader(name: string, value: string): void {\n this.headers.set(name, value);\n }\n\n protected async load() {\n return this.fulfillment!.result;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RpcConfiguration.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcConfiguration.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAoD;AAEpD,iDAA8C;AAC9C,6CAAiD;AAEjD,+CAAmE;AACnE,+CAAyC;AACzC,6CAA0C;AAE1C,uDAAoD;AAQpD,gBAAgB;AAChB,IAAiB,aAAa,CAK7B;AALD,WAAiB,aAAa;IAC5B,SAAgB,MAAM;QACpB,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,OAAyB,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAA,4BAAa,EAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAC3H,CAAC;IAHe,oBAAM,SAGrB,CAAA;AACH,CAAC,EALgB,aAAa,6BAAb,aAAa,QAK7B;AAED;;;GAGG;AACH,MAAsB,gBAAgB;IACpC;;OAEG;IACI,MAAM,CAAC,eAAe,GAAY,KAAK,CAAC;IAE/C,iGAAiG;IAC1F,MAAM,CAAC,wBAAwB,GAAY,KAAK,CAAC;IAExD;;;OAGG;IACI,MAAM,CAAC,UAAU,GAAY,KAAK,CAAC;IAE1C;;;;OAIG;IACI,MAAM,CAAC,oBAAoB,GAAG,KAAK,CAAC;IAE3C,4EAA4E;IACrE,MAAM,CAAC,MAAM,CAAyB,UAAqC,EAAE,QAAkC;QACpH,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,qBAAkD,CAAC;QACpF,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAA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C,CAAC;CAC5D;AAHD,0DAGC;AAED;;GAEG;AACH,MAAa,iBAAkB,SAAQ,yBAAW;IAChC,WAAW,GAAG,gBAAgB,CAAC;CAChD;AAFD,8CAEC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,uBAAU;IACvC,OAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;IACzC,WAAW,GAAsC,SAAS,CAAC;IAExD,KAAK,CAAC,IAAI;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO,IAAI,OAAO,CAAS,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YACnD,IAAI,CAAC;gBACH,IAAI,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACxD,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAES,SAAS,CAAC,IAAY,EAAE,KAAa;QAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,OAAO,IAAA,4BAAa,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IAChD,CAAC;CACF;AAvBD,4CAuBC","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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { expectDefined } from \"@itwin/core-bentley\";\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcManager } from \"../../RpcManager\";\nimport { RpcControlChannel } from \"./RpcControl\";\nimport { SerializedRpcActivity } from \"./RpcInvocation\";\nimport { RpcProtocol, RpcRequestFulfillment } from \"./RpcProtocol\";\nimport { INSTANCE } from \"./RpcRegistry\";\nimport { RpcRequest } from \"./RpcRequest\";\nimport { RpcRequestContext } from \"./RpcRequestContext\";\nimport { RpcRoutingToken } from \"./RpcRoutingToken\";\n\n/** @internal */\nexport type RpcConfigurationSupplier = (routing?: RpcRoutingToken) => { new(): RpcConfiguration }; // eslint-disable-line @typescript-eslint/prefer-function-type\n\n/** @internal */\nexport interface RpcRoutingMap extends RpcConfigurationSupplier { configurations: Map<number, RpcConfigurationSupplier> }\n\n/** @internal */\nexport namespace RpcRoutingMap {\n export function create(): RpcRoutingMap {\n const configurations = new Map();\n return Object.assign((routing?: RpcRoutingToken) => configurations.get(expectDefined(routing).id)(), { configurations });\n }\n}\n\n/** A RpcConfiguration specifies how calls on an RPC interface will be marshalled, plus other operating parameters.\n * RpcConfiguration is the base class for specific configurations.\n * @beta\n */\nexport abstract class RpcConfiguration {\n /** Whether development mode is enabled.\n * @note This parameter determines whether developer convenience features like backend stack traces are available.\n */\n public static developmentMode: boolean = false;\n\n /** Whether frontend checks that are relevant in a cloud-hosted routing scenario are disabled. */\n public static disableRoutingValidation: boolean = false;\n\n /** Whether strict mode is enabled.\n * This parameter determines system behaviors relating to strict checking:\n * - Whether an error is thrown if the type marshaling system encounters an unregistered type (only in strict mode).\n */\n public static strictMode: boolean = false;\n\n /**\n * Whether to throw an error when the IModelRpcProps in the operation parameter list differs from the token in the URL.\n * @note By default, a warning is logged and the operation is allowed to proceed.\n * @note The parameter token is always replaced by the url token (unless RpcOperationPolicy.allowTokenMismatch is set).\n */\n public static throwOnTokenMismatch = false;\n\n /** @internal Sets the configuration supplier for an RPC interface class. */\n public static assign<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>, supplier: RpcConfigurationSupplier): void {\n const map = definition.prototype.configurationSupplier as RpcRoutingMap | undefined;\n if (!map || typeof (map.configurations) === \"undefined\") {\n definition.prototype.configurationSupplier = supplier;\n } else {\n map.configurations.set(RpcRoutingToken.default.id, supplier);\n }\n }\n\n /** Sets the configuration supplier for an RPC interface class for a given routing. */\n public static assignWithRouting<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>, routing: RpcRoutingToken, configuration: new () => RpcConfiguration): void {\n if (!definition.prototype.configurationSupplier) {\n RpcConfiguration.assign(definition, RpcRoutingMap.create());\n }\n\n let map = definition.prototype.configurationSupplier as RpcRoutingMap;\n if (typeof (map.configurations) === \"undefined\") {\n const existing = map as RpcConfigurationSupplier;\n map = RpcRoutingMap.create();\n RpcConfiguration.assign(definition, map);\n map.configurations.set(RpcRoutingToken.default.id, existing);\n }\n\n const supplier = () => configuration;\n map.configurations.set(routing.id, supplier);\n }\n\n /** Obtains the instance of an RPC configuration class. */\n public static obtain<T extends RpcConfiguration>(configurationConstructor: new () => T): T {\n let instance = (configurationConstructor as any)[INSTANCE] as T;\n if (!instance)\n instance = (configurationConstructor as any)[INSTANCE] = new configurationConstructor();\n\n return instance;\n }\n\n /** @internal Enables passing of application-specific context with each RPC request. */\n public static requestContext: RpcRequestContext = {\n getId: (_request: RpcRequest): string => \"\",\n serialize: async (request: RpcRequest): Promise<SerializedRpcActivity> => ({\n id: request.id,\n applicationId: \"\",\n applicationVersion: \"\",\n sessionId: \"\",\n authorization: \"\",\n }),\n };\n\n /** @internal */\n public attached: RpcInterfaceDefinition[] = [];\n\n /** The protocol of the configuration.\n * @internal\n */\n public abstract readonly protocol: RpcProtocol;\n\n /** The RPC interfaces managed by the configuration. */\n public abstract readonly interfaces: () => RpcInterfaceDefinition[];\n\n /** @internal */\n public allowAttachedInterfaces: boolean = true;\n\n /** @internal */\n public get attachedInterfaces(): ReadonlyArray<RpcInterfaceDefinition> { return this.attached; }\n\n /** The target interval (in milliseconds) between connection attempts for pending RPC operation requests. */\n public pendingOperationRetryInterval = 10000;\n\n /** The maximum number of transient faults permitted before request failure. */\n public transientFaultLimit = 4;\n\n /** @internal */\n public readonly routing: RpcRoutingToken = RpcRoutingToken.default;\n\n /** The control channel for the configuration.\n * @internal\n */\n public readonly controlChannel = RpcControlChannel.obtain(this);\n\n /** @internal */\n public attach<T extends RpcInterface>(definition: RpcInterfaceDefinition<T>): void {\n if (!this.allowAttachedInterfaces) {\n return;\n }\n\n if (this.interfaces().indexOf(definition) !== -1 || this.attached.indexOf(definition) !== -1) {\n return;\n }\n\n this.attached.push(definition);\n RpcConfiguration.assign(definition, () => this.constructor as any);\n RpcManager.initializeInterface(definition);\n }\n\n /** Initializes the RPC interfaces managed by the configuration. */\n public static initializeInterfaces(configuration: RpcConfiguration) {\n configuration.interfaces().forEach((definition) => RpcManager.initializeInterface(definition));\n }\n\n /** @internal */\n public static supply(definition: RpcInterface): RpcConfiguration {\n return RpcConfiguration.obtain(definition.configurationSupplier ? definition.configurationSupplier(definition.routing) : RpcDefaultConfiguration);\n }\n\n /** @internal */\n public onRpcClientInitialized(definition: RpcInterfaceDefinition, client: RpcInterface): void {\n this.protocol.onRpcClientInitialized(definition, client);\n }\n\n /** @internal */\n public onRpcImplInitialized(definition: RpcInterfaceDefinition, impl: RpcInterface): void {\n this.protocol.onRpcImplInitialized(definition, impl);\n }\n\n /** @internal */\n public onRpcClientTerminated(definition: RpcInterfaceDefinition, client: RpcInterface): void {\n this.protocol.onRpcClientTerminated(definition, client);\n }\n\n /** @internal */\n public onRpcImplTerminated(definition: RpcInterfaceDefinition, impl: RpcInterface): void {\n this.protocol.onRpcImplTerminated(definition, impl);\n }\n}\n\n/** A default configuration that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDefaultConfiguration extends RpcConfiguration {\n public interfaces = () => [];\n public protocol: RpcProtocol = new RpcDirectProtocol(this);\n}\n\n/** A default protocol that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDirectProtocol extends RpcProtocol {\n public readonly requestType = RpcDirectRequest;\n}\n\n/** A default request type that can be used for basic testing within a library.\n * @internal\n */\nexport class RpcDirectRequest extends RpcRequest {\n public headers: Map<string, string> = new Map();\n public fulfillment: RpcRequestFulfillment | undefined = undefined;\n\n protected async send() {\n const request = await this.protocol.serialize(this);\n return new Promise<number>(async (resolve, reject) => {\n try {\n this.fulfillment = await this.protocol.fulfill(request);\n resolve(this.fulfillment.status);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n });\n }\n\n protected setHeader(name: string, value: string): void {\n this.headers.set(name, value);\n }\n\n protected async load() {\n return expectDefined(this.fulfillment).result;\n }\n}\n"]}
|
|
@@ -85,7 +85,7 @@ class BentleyCloudRpcProtocol extends WebAppRpcProtocol_1.WebAppRpcProtocol {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
iTwinId = encodeURIComponent(token.iTwinId || "");
|
|
88
|
-
iModelId = encodeURIComponent(token.iModelId);
|
|
88
|
+
iModelId = encodeURIComponent(token.iModelId || "");
|
|
89
89
|
routeChangesetId = token.changeset?.id || "0";
|
|
90
90
|
appMode = AppMode.MilestoneReview;
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BentleyCloudRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/BentleyCloudRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AAEpD,mDAAgD;AAChD,+DAA4D;AAC5D,uDAAoD;AAIpD,2DAAwD;AAGxD,IAAK,OAEJ;AAFD,WAAK,OAAO;IACV,gCAAqB,CAAA;AACvB,CAAC,EAFI,OAAO,KAAP,OAAO,QAEX;AAED;;GAEG;AACH,MAAsB,uBAAwB,SAAQ,qCAAiB;IACrD,UAAU,GAAG,IAAI,CAAC;IAElC,iFAAiF;IACjE,yCAAyC,GAA0B;QACjF,8CAA8C;QAC9C,EAAE,EAAE,kBAAkB;QAEtB,kDAAkD;QAClD,aAAa,EAAE,kBAAkB;QAE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------------------------------------------------\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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { RpcRequest } from \"../core/RpcRequest\";\nimport { OpenAPIParameter } from \"./OpenAPI\";\nimport { WebAppRpcProtocol } from \"./WebAppRpcProtocol\";\nimport { SerializedRpcActivity } from \"../core/RpcInvocation\";\n\nenum AppMode {\n MilestoneReview = \"1\",\n}\n\n/** An http protocol for Bentley cloud RPC interface deployments.\n * @internal\n */\nexport abstract class BentleyCloudRpcProtocol extends WebAppRpcProtocol {\n public override checkToken = true;\n\n /** The name of various HTTP request headers based on client's request context */\n public override serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\n /** The name of the HTTP request id header. */\n id: \"X-Correlation-Id\",\n\n /** The name of the HTTP application id header. */\n applicationId: \"X-Application-Id\",\n\n /** The name of the HTTP application version header. */\n applicationVersion: \"X-Application-Version\",\n\n /** The name of the HTTP session id header. */\n sessionId: \"X-Session-Id\",\n\n /** The name of the HTTP authorization header. */\n authorization: \"Authorization\",\n };\n\n /** The name of the RPC protocol version header. */\n public override protocolVersionHeaderName = \"X-Protocol-Version\";\n\n /** Returns the operation specified by an OpenAPI-compatible URI path. */\n public override getOperationFromPath(path: string): SerializedRpcOperation {\n const url = new URL(path, \"https://localhost/\");\n const components = url.pathname.split(\"/\").filter((x) => x); // filter out empty segments\n\n const operationComponent = components.slice(-1)[0];\n const encodedRequest = url.searchParams.get(\"parameters\") || \"\";\n\n // The encodedRequest should be base64 - fail now if any other characters detected.\n if (/[^a-zA-Z0-9=+\\/$]/.test(encodedRequest))\n throw new IModelError(BentleyStatus.ERROR, `Invalid request: Malformed URL parameters detected.`);\n\n const firstHyphen = operationComponent.indexOf(\"-\");\n const lastHyphen = operationComponent.lastIndexOf(\"-\");\n const interfaceDefinition = operationComponent.slice(0, firstHyphen);\n const interfaceVersion = operationComponent.slice(firstHyphen + 1, lastHyphen);\n const operationName = operationComponent.slice(lastHyphen + 1);\n\n return { interfaceDefinition, operationName, interfaceVersion, encodedRequest };\n }\n\n /** Supplies the OpenAPI-compatible URI path for an RPC operation. */\n public override supplyPathForOperation(operation: RpcOperation, request: RpcRequest | undefined) {\n const prefix = this.pathPrefix;\n const appTitle = this.info.title;\n const appVersion = this.info.version;\n const operationId = `${operation.interfaceDefinition.interfaceName}-${operation.interfaceVersion}-${operation.operationName}`;\n\n let appMode: string = \"\";\n let iTwinId: string = \"\";\n let iModelId: string = \"\";\n let routeChangesetId: string | undefined;\n /* Note: The changesetId field is omitted in the route in the case of ReadWrite connections since the connection is generally expected to be at the\n * latest version and not some specific changeset. Also, for the first version (before any changesets), the changesetId in the route is arbitrarily\n * set to \"0\" instead of an empty string, since the latter is more un-intuitive for a route. However, in all other use cases, including the changesetId\n * held by the IModelRpcProps itself, the changesetId of \"\" (i.e., empty string) signifies the first version - this is more intuitive and retains\n * compatibility with the majority of use cases. */\n\n if (request === undefined) {\n appMode = \"{modeId}\";\n iTwinId = \"{iTwinId}\";\n iModelId = \"{iModelId}\";\n routeChangesetId = \"{changeSetId}\";\n } else {\n let token = operation.policy.token(request) || RpcOperation.fallbackToken;\n\n if (!token || !token.iModelId) {\n if (RpcConfiguration.disableRoutingValidation) {\n token = { key: \"\" };\n } else {\n throw new IModelError(BentleyStatus.ERROR, \"Invalid iModelToken for RPC operation request\");\n }\n }\n\n iTwinId = encodeURIComponent(token.iTwinId || \"\");\n iModelId = encodeURIComponent(token.iModelId!);\n\n routeChangesetId = token.changeset?.id || \"0\";\n appMode = AppMode.MilestoneReview;\n }\n\n return `${prefix}/${appTitle}/${appVersion}/mode/${appMode}/context/${iTwinId}/imodel/${iModelId}${!!routeChangesetId ? `/changeset/${routeChangesetId}` : \"\"}/${operationId}`;\n }\n\n /**\n * Inflates the IModelRpcProps from the URL path for each request on the backend.\n * @note This function updates the IModelRpcProps value supplied in the request body.\n */\n public override inflateToken(tokenFromBody: IModelRpcProps, request: SerializedRpcRequest): IModelRpcProps {\n const urlPathComponents = request.path.split(\"/\");\n\n let iModelId = tokenFromBody.iModelId;\n let iTwinId = tokenFromBody.iTwinId;\n const changeset = { id: tokenFromBody.changeset?.id ?? \"0\", index: tokenFromBody.changeset?.index };\n\n for (let i = 0; i <= urlPathComponents.length; ++i) {\n const key = urlPathComponents[i];\n const value = urlPathComponents[i + 1];\n if (key === \"mode\") {\n ++i;\n } else if (key === \"context\") {\n iTwinId = value;\n ++i;\n } else if (key === \"imodel\") {\n iModelId = value;\n ++i;\n } else if (key === \"changeset\") {\n changeset.id = (value === \"0\") ? \"\" : value;\n ++i;\n }\n }\n\n // Overwrite the key if it includes a : because its most likely a guid. We know what it should be based off of the url.\n // Leave it alone if its a non guid key.\n return { key: tokenFromBody.key === undefined || tokenFromBody.key.includes(\":\") ? `${iModelId}:${changeset.id}` : tokenFromBody.key, iTwinId, iModelId, changeset };\n }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[] {\n return [\n { name: \"modeId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"iTwinId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"iModelId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"changeSetId\", in: \"path\", required: false, schema: { type: \"string\" } },\n ];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BentleyCloudRpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/web/BentleyCloudRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;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,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC3E,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC5E,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;SACjF,CAAC;IACJ,CAAC;CACF;AApID,0DAoIC","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*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { IModelError } from \"../../IModelError\";\nimport { RpcConfiguration } from \"../core/RpcConfiguration\";\nimport { RpcOperation } from \"../core/RpcOperation\";\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\nimport { RpcRequest } from \"../core/RpcRequest\";\nimport { OpenAPIParameter } from \"./OpenAPI\";\nimport { WebAppRpcProtocol } from \"./WebAppRpcProtocol\";\nimport { SerializedRpcActivity } from \"../core/RpcInvocation\";\n\nenum AppMode {\n MilestoneReview = \"1\",\n}\n\n/** An http protocol for Bentley cloud RPC interface deployments.\n * @internal\n */\nexport abstract class BentleyCloudRpcProtocol extends WebAppRpcProtocol {\n public override checkToken = true;\n\n /** The name of various HTTP request headers based on client's request context */\n public override serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\n /** The name of the HTTP request id header. */\n id: \"X-Correlation-Id\",\n\n /** The name of the HTTP application id header. */\n applicationId: \"X-Application-Id\",\n\n /** The name of the HTTP application version header. */\n applicationVersion: \"X-Application-Version\",\n\n /** The name of the HTTP session id header. */\n sessionId: \"X-Session-Id\",\n\n /** The name of the HTTP authorization header. */\n authorization: \"Authorization\",\n };\n\n /** The name of the RPC protocol version header. */\n public override protocolVersionHeaderName = \"X-Protocol-Version\";\n\n /** Returns the operation specified by an OpenAPI-compatible URI path. */\n public override getOperationFromPath(path: string): SerializedRpcOperation {\n const url = new URL(path, \"https://localhost/\");\n const components = url.pathname.split(\"/\").filter((x) => x); // filter out empty segments\n\n const operationComponent = components.slice(-1)[0];\n const encodedRequest = url.searchParams.get(\"parameters\") || \"\";\n\n // The encodedRequest should be base64 - fail now if any other characters detected.\n if (/[^a-zA-Z0-9=+\\/$]/.test(encodedRequest))\n throw new IModelError(BentleyStatus.ERROR, `Invalid request: Malformed URL parameters detected.`);\n\n const firstHyphen = operationComponent.indexOf(\"-\");\n const lastHyphen = operationComponent.lastIndexOf(\"-\");\n const interfaceDefinition = operationComponent.slice(0, firstHyphen);\n const interfaceVersion = operationComponent.slice(firstHyphen + 1, lastHyphen);\n const operationName = operationComponent.slice(lastHyphen + 1);\n\n return { interfaceDefinition, operationName, interfaceVersion, encodedRequest };\n }\n\n /** Supplies the OpenAPI-compatible URI path for an RPC operation. */\n public override supplyPathForOperation(operation: RpcOperation, request: RpcRequest | undefined) {\n const prefix = this.pathPrefix;\n const appTitle = this.info.title;\n const appVersion = this.info.version;\n const operationId = `${operation.interfaceDefinition.interfaceName}-${operation.interfaceVersion}-${operation.operationName}`;\n\n let appMode: string = \"\";\n let iTwinId: string = \"\";\n let iModelId: string = \"\";\n let routeChangesetId: string | undefined;\n /* Note: The changesetId field is omitted in the route in the case of ReadWrite connections since the connection is generally expected to be at the\n * latest version and not some specific changeset. Also, for the first version (before any changesets), the changesetId in the route is arbitrarily\n * set to \"0\" instead of an empty string, since the latter is more un-intuitive for a route. However, in all other use cases, including the changesetId\n * held by the IModelRpcProps itself, the changesetId of \"\" (i.e., empty string) signifies the first version - this is more intuitive and retains\n * compatibility with the majority of use cases. */\n\n if (request === undefined) {\n appMode = \"{modeId}\";\n iTwinId = \"{iTwinId}\";\n iModelId = \"{iModelId}\";\n routeChangesetId = \"{changeSetId}\";\n } else {\n let token = operation.policy.token(request) || RpcOperation.fallbackToken;\n\n if (!token || !token.iModelId) {\n if (RpcConfiguration.disableRoutingValidation) {\n token = { key: \"\" };\n } else {\n throw new IModelError(BentleyStatus.ERROR, \"Invalid iModelToken for RPC operation request\");\n }\n }\n\n iTwinId = encodeURIComponent(token.iTwinId || \"\");\n iModelId = encodeURIComponent(token.iModelId || \"\");\n\n routeChangesetId = token.changeset?.id || \"0\";\n appMode = AppMode.MilestoneReview;\n }\n\n return `${prefix}/${appTitle}/${appVersion}/mode/${appMode}/context/${iTwinId}/imodel/${iModelId}${!!routeChangesetId ? `/changeset/${routeChangesetId}` : \"\"}/${operationId}`;\n }\n\n /**\n * Inflates the IModelRpcProps from the URL path for each request on the backend.\n * @note This function updates the IModelRpcProps value supplied in the request body.\n */\n public override inflateToken(tokenFromBody: IModelRpcProps, request: SerializedRpcRequest): IModelRpcProps {\n const urlPathComponents = request.path.split(\"/\");\n\n let iModelId = tokenFromBody.iModelId;\n let iTwinId = tokenFromBody.iTwinId;\n const changeset = { id: tokenFromBody.changeset?.id ?? \"0\", index: tokenFromBody.changeset?.index };\n\n for (let i = 0; i <= urlPathComponents.length; ++i) {\n const key = urlPathComponents[i];\n const value = urlPathComponents[i + 1];\n if (key === \"mode\") {\n ++i;\n } else if (key === \"context\") {\n iTwinId = value;\n ++i;\n } else if (key === \"imodel\") {\n iModelId = value;\n ++i;\n } else if (key === \"changeset\") {\n changeset.id = (value === \"0\") ? \"\" : value;\n ++i;\n }\n }\n\n // Overwrite the key if it includes a : because its most likely a guid. We know what it should be based off of the url.\n // Leave it alone if its a non guid key.\n return { key: tokenFromBody.key === undefined || tokenFromBody.key.includes(\":\") ? `${iModelId}:${changeset.id}` : tokenFromBody.key, iTwinId, iModelId, changeset };\n }\n\n /** Returns the OpenAPI-compatible URI path parameters for an RPC operation.\n * @internal\n */\n public supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[] {\n return [\n { name: \"modeId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"iTwinId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"iModelId\", in: \"path\", required: true, schema: { type: \"string\" } },\n { name: \"changeSetId\", in: \"path\", required: false, schema: { type: \"string\" } },\n ];\n }\n}\n"]}
|
|
@@ -131,7 +131,7 @@ class WebAppRpcRequest extends RpcRequest_1.RpcRequest {
|
|
|
131
131
|
resolve(await this.loadBinary(response));
|
|
132
132
|
}
|
|
133
133
|
else if (responseType === RpcConstants_1.RpcContentType.Multipart) {
|
|
134
|
-
resolve(await this.loadMultipart(response, contentType));
|
|
134
|
+
resolve(await this.loadMultipart(response, (0, core_bentley_1.expectNotNull)(contentType)));
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
137
137
|
resolve(await this.loadText(response));
|