@itwin/core-common 5.2.0-dev.5 → 5.2.0-dev.7
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/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/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/FeatureIndex.d.ts.map +1 -1
- package/lib/cjs/FeatureIndex.js +2 -1
- package/lib/cjs/FeatureIndex.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/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/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/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/FeatureIndex.d.ts.map +1 -1
- package/lib/esm/FeatureIndex.js +2 -1
- package/lib/esm/FeatureIndex.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/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/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":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqE;AACrE,wDAG8B;AAC9B,0CAAsD;AACtD,kDAA0I;AAC1I,sDAA+F;AAC/F,0CAAuC;AACvC,gDAA6C;AAC7C,+CAA4C;AAC5C,iDAAiE;AACjE,2CAAwC;AACxC,6CAA2D;AAE3D,2CAAuD;AA6DvD;;GAEG;AACH,IAAiB,UAAU,CAkC1B;AAlCD,WAAiB,UAAU;IACzB,2DAA2D;IAC3D,IAAY,IAOX;IAPD,WAAY,IAAI;QACd,mDAAmD;QACnD,iCAAS,CAAA;QACT,wGAAwG;QACxG,iCAAS,CAAA;QACT,2GAA2G;QAC3G,+BAAQ,CAAA;IACV,CAAC,EAPW,IAAI,GAAJ,eAAI,KAAJ,eAAI,QAOf;AAyBH,CAAC,EAlCgB,UAAU,0BAAV,UAAU,QAkC1B;AAkBD;;;;GAIG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,gBAAgB;IAChB,6DAAQ,CAAA;IACR;;OAEG;IACH,mFAAwB,CAAA;AAC1B,CA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M,EAAE,CAAC;gBAClG,CAAC;gBAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC/B,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACN,MAAM,aAAa,GAAG,0BAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAC,aAAa,YAAY,6BAAa,CAAC;oBAC3C,SAAS;gBAEX,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS;oBACvC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAE7D,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBAC3C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI;AAhND,wDAgNC","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 Geometry\n */\n\nimport { Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\nimport { Gradient } from \"../Gradient\";\nimport { IModelError } from \"../IModelError\";\nimport { AreaPattern } from \"./AreaPattern\";\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\nimport { LineStyle } from \"./LineStyle\";\nimport { TextString, TextStringProps } from \"./TextString\";\nimport { Base64EncodedString } from \"../Base64EncodedString\";\nimport { Placement2d, Placement3d } from \"./Placement\";\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\n\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryAppearanceProps {\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\n subCategory?: Id64String;\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\n color?: ColorDefProps;\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\n weight?: number;\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\n style?: Id64String;\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\n transparency?: number;\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\n displayPriority?: number;\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\n geometryClass?: GeometryClass;\n}\n\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface AreaFillProps {\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\n display: FillDisplay;\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\n transparency?: number;\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\n backgroundFill?: BackgroundFill;\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\n color?: ColorDefProps;\n /** Set fill using gradient properties. */\n gradient?: Gradient.SymbProps;\n}\n\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface MaterialProps {\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\n materialId?: Id64String;\n /** @internal */\n origin?: XYZProps;\n /** @internal */\n size?: XYZProps;\n /** @internal */\n rotation?: YawPitchRollProps;\n}\n\n/** JSON representation of a brep GeometryStream entry.\n * @public\n */\nexport namespace BRepEntity {\n /** Enum for type of solid kernel entity this represents */\n export enum Type {\n /** Body consisting of at least one solid region */\n Solid = 0,\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\n Sheet = 1,\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\n Wire = 2,\n }\n\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\n export interface FaceSymbologyProps {\n /** Optional color override for face */\n color?: ColorDefProps;\n /** Optional transparency override for face */\n transparency?: number;\n /** Optional material override for face */\n materialId?: Id64String;\n }\n\n /** Geometry entry representing raw brep data.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface DataProps {\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\n data?: Base64EncodedString;\n /** body type, default is Solid */\n type?: Type;\n /** body transform, default is identity */\n transform?: TransformProps;\n /** body face attachments */\n faceSymbology?: FaceSymbologyProps[];\n }\n}\n\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryPartInstanceProps {\n /** GeometryPart id */\n part: Id64String;\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\n rotation?: YawPitchRollProps;\n /** Optional scale to apply to part, 1.0 if undefined */\n scale?: number;\n}\n\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\n * @see GeometryStreamHeaderProps\n * @public\n * @extensions\n */\nexport enum GeometryStreamFlags {\n /** No flags. */\n None = 0,\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\n */\n ViewIndependent = 1 << 0,\n}\n\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\n * @public\n * @extensions\n */\nexport interface GeometryStreamHeaderProps {\n /** The flags applied to the geometry stream. */\n flags: GeometryStreamFlags;\n}\n\n/** Allowed GeometryStream entries - should only set one value.\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\n * @public\n * @extensions\n */\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\n header?: GeometryStreamHeaderProps;\n appearance?: GeometryAppearanceProps;\n styleMod?: LineStyle.ModifierProps;\n fill?: AreaFillProps;\n pattern?: AreaPattern.ParamsProps;\n material?: MaterialProps;\n geomPart?: GeometryPartInstanceProps;\n textString?: TextStringProps;\n brep?: BRepEntity.DataProps;\n image?: ImageGraphicProps;\n subRange?: LowAndHighXYZ;\n}\n\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\n\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\n * @public\n */\nexport class GeometryStreamBuilder {\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\n private _worldToLocal?: Transform;\n /** GeometryStream entries */\n public readonly geometryStream: GeometryStreamProps = [];\n\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\n */\n public setLocalToWorld(localToWorld?: Transform) {\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\n }\n\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\n * @see [[Placement3d]]\n */\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\n }\n\n /** Supply local to world transform from a Point2d and optional Angle.\n * @see [[Placement2d]]\n */\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\n }\n\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\n * @see [[PlacementProps]]\n */\n public setLocalToWorldFromPlacement(props: PlacementProps) {\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\n this.setLocalToWorld(placement.transform);\n }\n\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\n */\n public appendGeometryRanges() {\n this.geometryStream.push({ subRange: Range3d.createNull() });\n }\n\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\n */\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\n return true;\n }\n\n /** Change [[GeometryParams]] for subsequent geometry.\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\n */\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\n const appearance: GeometryAppearanceProps = {\n subCategory: geomParams.subCategoryId,\n color: geomParams.lineColor?.toJSON(),\n weight: geomParams.weight,\n style: geomParams.styleInfo?.styleId,\n transparency: geomParams.elmTransparency,\n displayPriority: geomParams.elmPriority,\n geometryClass: geomParams.geometryClass,\n };\n this.geometryStream.push({ appearance });\n\n if (undefined !== geomParams.materialId)\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\n\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\n const fill: AreaFillProps = {\n display: geomParams.fillDisplay,\n transparency: geomParams.fillTransparency,\n };\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\n fill.gradient = geomParams.gradient?.toJSON();\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\n fill.backgroundFill = geomParams.backgroundFill;\n else if (undefined !== geomParams.fillColor)\n fill.color = geomParams.fillColor.toJSON();\n this.geometryStream.push({ fill });\n }\n\n if (undefined !== geomParams.pattern) {\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\n return false;\n\n this.geometryStream.push({ pattern: localPattern.toJSON() });\n }\n\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\n return false;\n this.geometryStream.push({ styleMod: localStyleMod });\n }\n\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\n return true;\n }\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\n if (undefined !== instanceScale)\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\n const scales = new Vector3d();\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\n if (undefined === newRotation)\n return false;\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\n }\n\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendTextString(textString: TextString): boolean {\n if (this._worldToLocal) {\n textString = new TextString(textString);\n if (!textString.transformInPlace(this._worldToLocal)) {\n return false;\n }\n }\n\n this.geometryStream.push({ textString: textString.toJSON() });\n return true;\n }\n\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\n * @beta\n */\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\n for (const entry of block.entries) {\n let result: boolean;\n if (undefined !== entry.text) {\n result = this.appendTextString(new TextString(entry.text));\n } else if (undefined !== entry.color) {\n if (entry.color === \"subcategory\") {\n result = this.appendSubCategoryChange(Id64.invalid);\n } else {\n this.geometryStream.push({ appearance: { color: entry.color } });\n result = true;\n }\n } else {\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\n }\n\n if (!result) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\n public appendImage(image: ImageGraphic): boolean {\n if (undefined !== this._worldToLocal)\n image = image.cloneTransformed(this._worldToLocal);\n\n this.geometryStream.push({ image: image.toJSON() });\n return true;\n }\n\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendGeometry(geometry: GeometryQuery): boolean {\n if (undefined === this._worldToLocal) {\n const geomData = GeomJson.Writer.toIModelJson(geometry);\n if (undefined === geomData)\n return false;\n this.geometryStream.push(geomData);\n return true;\n }\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\n if (undefined === localGeometry)\n return false;\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\n if (undefined === localGeomData)\n return false;\n this.geometryStream.push(localGeomData);\n return true;\n }\n\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\n * @beta\n */\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ brep });\n return true;\n }\n const entityTrans = Transform.fromJSON(brep.transform);\n const localTrans = this._worldToLocal.multiplyTransformTransform(entityTrans);\n const localBrep: BRepEntity.DataProps = {\n data: brep.data,\n type: brep.type,\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\n faceSymbology: brep.faceSymbology,\n };\n this.geometryStream.push({ brep: localBrep });\n return true;\n }\n\n /** @internal */\n public getHeader(): GeometryStreamHeaderProps | undefined {\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\n }\n\n /** @internal */\n public obtainHeader(): GeometryStreamHeaderProps {\n const hdr = this.getHeader();\n if (undefined !== hdr)\n return hdr;\n\n const entry = { header: { flags: GeometryStreamFlags.None } };\n this.geometryStream.unshift(entry);\n return entry.header;\n }\n\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\n * @public\n */\n public get isViewIndependent(): boolean {\n const hdr = this.getHeader();\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\n }\n public set isViewIndependent(viewIndependent: boolean) {\n if (viewIndependent === this.isViewIndependent)\n return;\n\n const hdr = this.obtainHeader();\n if (viewIndependent)\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\n else\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\n }\n}\n\n/** Represents a text string within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface TextStringPrimitive {\n type: \"textString\";\n readonly textString: TextString;\n}\n\n/** Represents an image within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface ImagePrimitive {\n type: \"image\";\n readonly image: ImageGraphic;\n}\n\n/** Represents a reference to a GeometryPart within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface PartReference {\n type: \"partReference\";\n part: {\n id: Id64String;\n readonly toLocal?: Transform;\n };\n}\n\n/** Represents a BRep within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface BRepPrimitive {\n type: \"brep\";\n /** @beta */\n readonly brep: BRepEntity.DataProps;\n}\n\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface GeometryPrimitive {\n type: \"geometryQuery\";\n readonly geometry: AnyGeometryQuery;\n}\n\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\n * @public\n * @extensions\n */\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\n\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\n * @public\n * @extensions\n */\nexport interface GeometryStreamIteratorEntry {\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\n readonly geomParams: GeometryParams;\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\n readonly localToWorld?: Transform;\n /** Optional stored local range for the current geometric entry */\n readonly localRange?: Range3d;\n /** Returns the geometric primitive represented by this entry. */\n readonly primitive: GeometryStreamPrimitive;\n}\n\nclass IteratorEntry implements GeometryStreamIteratorEntry {\n private _primitive?: GeometryStreamPrimitive;\n public readonly geomParams: GeometryParams;\n public readonly localToWorld?: Transform;\n public localRange?: Range3d;\n\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\n this.localToWorld = localToWorld;\n }\n\n public get primitive() { return this._primitive!; }\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\n\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\n public setPartReference(id: Id64String, toLocal?: Transform) {\n this._primitive = {\n type: \"partReference\",\n part: { id, toLocal },\n };\n }\n}\n\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\n * @public\n */\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\n /** GeometryStream entries */\n public geometryStream: GeometryStreamProps;\n /** Flags applied to the entire geometry stream. */\n public readonly flags: GeometryStreamFlags;\n /** Current entry position */\n private _index = 0;\n /** Allocated on first call to next() and reused thereafter. */\n private _entry?: IteratorEntry;\n /** Used to initialize this._entry. */\n private readonly _appearance: Id64String | GeometryParams;\n private readonly _localToWorld?: Transform;\n\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\n */\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geometryStream = geometryStream;\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\n this._localToWorld = localToWorld;\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\n this.flags = geometryStream[0].header.flags;\n ++this._index;\n } else {\n this.flags = GeometryStreamFlags.None;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get entry() {\n if (undefined === this._entry)\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\n\n return this._entry;\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined)\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined) {\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\n const matrix = Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle))!;\n transform = Transform.createOriginAndMatrix(origin, matrix);\n }\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\n * Supply the partToWorld transform to return the part geometry in world coordinates.\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\n * @throws [[IModelError]] if geomPart.geom is undefined.\n */\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\n if (geomPart.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\n\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\n }\n\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\n public partToWorld(): Transform | undefined {\n if (undefined === this._entry)\n return this._localToWorld;\n\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\n return this._entry.localToWorld;\n\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\n }\n\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\n */\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\n while (this._index < this.geometryStream.length) {\n const entry = this.geometryStream[this._index++];\n if (entry.appearance) {\n this.entry.geomParams.resetAppearance();\n if (entry.appearance.subCategory)\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\n if (undefined !== entry.appearance.color)\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\n if (undefined !== entry.appearance.weight)\n this.entry.geomParams.weight = entry.appearance.weight;\n if (undefined !== entry.appearance.style)\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\n if (undefined !== entry.appearance.transparency)\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\n if (undefined !== entry.appearance.displayPriority)\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\n if (undefined !== entry.appearance.geometryClass)\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\n } else if (entry.styleMod) {\n if (this.entry.geomParams.styleInfo === undefined)\n continue;\n\n const styleMod = new LineStyle.Modifier(entry.styleMod);\n if (this.entry.localToWorld !== undefined)\n styleMod.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\n } else if (entry.fill) {\n if (entry.fill.display)\n this.entry.geomParams.fillDisplay = entry.fill.display;\n if (entry.fill.transparency)\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\n if (entry.fill.gradient)\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\n else if (entry.fill.backgroundFill)\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\n else if (entry.fill.color)\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\n } else if (entry.pattern) {\n const params = AreaPattern.Params.fromJSON(entry.pattern);\n if (this.entry.localToWorld !== undefined)\n params.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.pattern = params;\n } else if (entry.material) {\n if (entry.material.materialId)\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\n } else if (entry.subRange) {\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\n } else if (entry.geomPart) {\n let transform;\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\n transform = Transform.createRefs(origin, rotation);\n if (entry.geomPart.scale)\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\n }\n\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\n // will have a new subgraphic range for any geometric primitive following the part.\n this.entry.localRange = undefined;\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\n return { value: this.entry, done: false };\n } else if (entry.textString) {\n const textString = new TextString(entry.textString);\n if (this.entry.localToWorld !== undefined)\n textString.transformInPlace(this.entry.localToWorld);\n\n this.entry.setTextString(textString);\n return { value: this.entry, done: false };\n } else if (entry.image) {\n const image = ImageGraphic.fromJSON(entry.image);\n if (undefined !== this.entry.localToWorld)\n image.transformInPlace(this.entry.localToWorld);\n\n this.entry.setImage(image);\n return { value: this.entry, done: false };\n } else if (entry.brep) {\n if (this.entry.localToWorld !== undefined) {\n const entityTrans = Transform.fromJSON(entry.brep.transform);\n entry.brep.transform = this.entry.localToWorld.multiplyTransformTransform(entityTrans).toJSON();\n }\n\n this.entry.setBRep(entry.brep);\n return { value: this.entry, done: false };\n } else {\n const geometryQuery = GeomJson.Reader.parse(entry);\n if (!(geometryQuery instanceof GeometryQuery))\n continue;\n\n if (this.entry.localToWorld !== undefined)\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\n\n this.entry.setGeometryQuery(geometryQuery);\n return { value: this.entry, done: false };\n }\n }\n\n return { value: this.entry, done: true };\n }\n\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\n return this;\n }\n\n /** @internal */\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GeometryStream.js","sourceRoot":"","sources":["../../../src/geometry/GeometryStream.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoF;AACpF,wDAG8B;AAC9B,0CAAsD;AACtD,kDAA0I;AAC1I,sDAA+F;AAC/F,0CAAuC;AACvC,gDAA6C;AAC7C,+CAA4C;AAC5C,iDAAiE;AACjE,2CAAwC;AACxC,6CAA2D;AAE3D,2CAAuD;AA6DvD;;GAEG;AACH,IAAiB,UAAU,CAkC1B;AAlCD,WAAiB,UAAU;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CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB,KAAc,OAAO,mBAAmB,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CACpI;AAhND,wDAgNC","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 Geometry\n */\n\nimport { expectDefined, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, AnyGeometryQuery, GeometryQuery, IModelJson as GeomJson, LineSegment3d, LowAndHighXYZ, Matrix3d, Point2d, Point3d, Range3d, Transform, TransformProps,\n Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { GeometricElement2dProps, GeometricElement3dProps, GeometryPartProps, isPlacement2dProps, PlacementProps } from \"../ElementProps\";\nimport { BackgroundFill, FillDisplay, GeometryClass, GeometryParams } from \"../GeometryParams\";\nimport { Gradient } from \"../Gradient\";\nimport { IModelError } from \"../IModelError\";\nimport { AreaPattern } from \"./AreaPattern\";\nimport { ImageGraphic, ImageGraphicProps } from \"./ImageGraphic\";\nimport { LineStyle } from \"./LineStyle\";\nimport { TextString, TextStringProps } from \"./TextString\";\nimport { Base64EncodedString } from \"../Base64EncodedString\";\nimport { Placement2d, Placement3d } from \"./Placement\";\nimport { TextBlockGeometryProps } from \"../annotation/TextBlockGeometryProps\";\n\n/** Establish a non-default [[SubCategory]] or to override [[SubCategoryAppearance]] for the geometry that follows.\n * A GeometryAppearanceProps always signifies a reset to the [[SubCategoryAppearance]] for subsequent [[GeometryStreamProps]] entries for undefined values.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryAppearanceProps {\n /** Optional [[SubCategory]] id for subsequent geometry. Use to create a GeometryStream with geometry that is not on the default [[SubCategory]] for the element's [[Category]] or is has geometry on multiple subCategories. */\n subCategory?: Id64String;\n /** Optional color to override [[SubCategoryAppearance.color]] for subsequent geometry. */\n color?: ColorDefProps;\n /** Optional weight to override [[SubCategoryAppearance.weight]] for subsequent geometry. */\n weight?: number;\n /** Optional style to override [[SubCategoryAppearance.styleId]] for subsequent geometry. */\n style?: Id64String;\n /** Optional transparency, 0.0 if undefined. Effective transparency is a combination of this value and [[SubCategoryAppearance.color]]. */\n transparency?: number;\n /** Optional display priority (2d only), 0 if undefined. Effective display priority is a combination of this value and [[SubCategoryAppearance.priority]]. */\n displayPriority?: number;\n /** Optional GeometryClass (for DGN compatibility, subCategories preferred), [[GeometryClass.Primary]] if undefined. */\n geometryClass?: GeometryClass;\n}\n\n/** Add a [[gradient]], [[backgroundFill]], or solid [[color]] fill to subsequent planar regions (or meshes).\n * Only one value among [[gradient]], [[backgroundFill]], and [[color]] should be set.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface AreaFillProps {\n /** Fill display type, must be set to something other than [[FillDisplay.Never]] to display fill */\n display: FillDisplay;\n /** Optional fill transparency, will be the same as outline transparency if undefined. Allows for different fill and outline transparencies */\n transparency?: number;\n /** Set fill color to view background color. Use [[BackgroundFill.Solid]] for an opaque fill and [[BackgroundFill.Outline]] to display an outline using the line color */\n backgroundFill?: BackgroundFill;\n /** Set fill color to a specific color. If the fill color the same as the line color, it is an opaque fill, otherwise it is an outline fill */\n color?: ColorDefProps;\n /** Set fill using gradient properties. */\n gradient?: Gradient.SymbProps;\n}\n\n/** Override [[SubCategoryAppearance.materialId]] for subsequent surface and solid geometry.\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface MaterialProps {\n /** Material id to use, specify an invalid [[Id64]] to override [[SubCategoryAppearance.materialId]] with no material. */\n materialId?: Id64String;\n /** @internal */\n origin?: XYZProps;\n /** @internal */\n size?: XYZProps;\n /** @internal */\n rotation?: YawPitchRollProps;\n}\n\n/** JSON representation of a brep GeometryStream entry.\n * @public\n */\nexport namespace BRepEntity {\n /** Enum for type of solid kernel entity this represents */\n export enum Type {\n /** Body consisting of at least one solid region */\n Solid = 0,\n /** Body consisting of connected sets of faces having edges that are shared by a maximum of two faces */\n Sheet = 1,\n /** Body consisting of connected sets of edges having vertices that are shared by a maximum of two edges */\n Wire = 2,\n }\n\n /** Optional symbology that can be assigned to individual faces of a solid or sheet body */\n export interface FaceSymbologyProps {\n /** Optional color override for face */\n color?: ColorDefProps;\n /** Optional transparency override for face */\n transparency?: number;\n /** Optional material override for face */\n materialId?: Id64String;\n }\n\n /** Geometry entry representing raw brep data.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface DataProps {\n /** data as Base64 encoded string. Must be specifically requested using [[ElementLoadProps.wantBRepData]]. */\n data?: Base64EncodedString;\n /** body type, default is Solid */\n type?: Type;\n /** body transform, default is identity */\n transform?: TransformProps;\n /** body face attachments */\n faceSymbology?: FaceSymbologyProps[];\n }\n}\n\n/** Add a reference to a [[GeometryPart]] from the GeometryStream of a [[GeometricElement]].\n * @see [[GeometryStreamEntryProps]]\n * @public\n * @extensions\n */\nexport interface GeometryPartInstanceProps {\n /** GeometryPart id */\n part: Id64String;\n /** Optional translation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/translation, supply non-zero x and y only */\n origin?: XYZProps;\n /** Optional rotation relative to element's placement, 0.0,0.0,0.0 if undefined. For a 2d element/rotation, supply a non-zero yaw angle only */\n rotation?: YawPitchRollProps;\n /** Optional scale to apply to part, 1.0 if undefined */\n scale?: number;\n}\n\n/** Flags applied to the entire contents of a [[GeometryStreamProps]].\n * @see GeometryStreamHeaderProps\n * @public\n * @extensions\n */\nexport enum GeometryStreamFlags {\n /** No flags. */\n None = 0,\n /** When the geometry is displayed, it is always oriented to face the viewer. The placement origin of the element associated with the geometry is used as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume.\n */\n ViewIndependent = 1 << 0,\n}\n\n/** An entry in a [[GeometryStreamProps]] containing [[GeometryStreamFlags]] that apply to the geometry stream as a whole.\n * If this entry exists in the [[GeometryStreamProps]] array, it will always be the *first* entry.\n * @public\n * @extensions\n */\nexport interface GeometryStreamHeaderProps {\n /** The flags applied to the geometry stream. */\n flags: GeometryStreamFlags;\n}\n\n/** Allowed GeometryStream entries - should only set one value.\n * @see [GeometryStream]($docs/learning/common/geometrystream.md)\n * @public\n * @extensions\n */\nexport interface GeometryStreamEntryProps extends GeomJson.GeometryProps {\n header?: GeometryStreamHeaderProps;\n appearance?: GeometryAppearanceProps;\n styleMod?: LineStyle.ModifierProps;\n fill?: AreaFillProps;\n pattern?: AreaPattern.ParamsProps;\n material?: MaterialProps;\n geomPart?: GeometryPartInstanceProps;\n textString?: TextStringProps;\n brep?: BRepEntity.DataProps;\n image?: ImageGraphicProps;\n subRange?: LowAndHighXYZ;\n}\n\n/** A [[GeometricElement]]'s GeometryStream is represented by an array of [[GeometryStreamEntryProps]].\n * @public\n * @extensions\n */\nexport type GeometryStreamProps = GeometryStreamEntryProps[];\n\n/** GeometryStreamBuilder is a helper class for populating the [[GeometryStreamProps]] array needed to create a [[GeometricElement]] or [[GeometryPart]].\n * @public\n */\nexport class GeometryStreamBuilder {\n /** Current inverse placement transform, used for converting world coordinate input to be placement relative */\n private _worldToLocal?: Transform;\n /** GeometryStream entries */\n public readonly geometryStream: GeometryStreamProps = [];\n\n /** Supply optional local to world transform. Used to transform world coordinate input relative to element placement.\n * For a [[GeometricElement]]'s placement to be meaningful, world coordinate geometry should never be appended to an element with an identity placement.\n * Can be called with undefined or identity transform to start appending geometry supplied in local coordinates again.\n */\n public setLocalToWorld(localToWorld?: Transform) {\n this._worldToLocal = (undefined === localToWorld || localToWorld.isIdentity ? undefined : localToWorld.inverse());\n }\n\n /** Supply local to world transform from a Point3d and optional YawPitchRollAngles.\n * @see [[Placement3d]]\n */\n public setLocalToWorld3d(origin: Point3d, angles: YawPitchRollAngles = YawPitchRollAngles.createDegrees(0.0, 0.0, 0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(origin, angles.toMatrix3d()));\n }\n\n /** Supply local to world transform from a Point2d and optional Angle.\n * @see [[Placement2d]]\n */\n public setLocalToWorld2d(origin: Point2d, angle: Angle = Angle.createDegrees(0.0)) {\n this.setLocalToWorld(Transform.createOriginAndMatrix(Point3d.createFrom(origin), Matrix3d.createRotationAroundVector(Vector3d.unitZ(), angle)));\n }\n\n /** Supply local to world transform from a PlacementProps2d or PlacementProps3d.\n * @see [[PlacementProps]]\n */\n public setLocalToWorldFromPlacement(props: PlacementProps) {\n const placement = isPlacement2dProps(props) ? Placement2d.fromJSON(props) : Placement3d.fromJSON(props);\n this.setLocalToWorld(placement.transform);\n }\n\n /** Store local ranges in GeometryStream for all subsequent geometry appended. Can improve performance of range testing for elements with a GeometryStream\n * containing more than one [[GeometryQuery]] differentiable by range. Not useful for a single [[GeometryQuery]] as its range and that of the [[GeometricElement]] are the same.\n * Ignored when defining a [[GeometryPart]] and not needed when only appending [[GeometryPart]] instances to a [[GeometricElement]] as these store their own range.\n */\n public appendGeometryRanges() {\n this.geometryStream.push({ subRange: Range3d.createNull() });\n }\n\n /** Change [[SubCategory]] or reset to [[SubCategoryAppearance]] for subsequent geometry.\n * An invalid sub-category id can be supplied to force a reset to the current [[SubCategoryAppearance]].\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherit the symbology of their instance for anything not explicitly overridden.\n */\n public appendSubCategoryChange(subCategoryId: Id64String): boolean {\n this.geometryStream.push({ appearance: { subCategory: subCategoryId } });\n return true;\n }\n\n /** Change [[GeometryParams]] for subsequent geometry.\n * It is not valid to change the sub-category when defining a [[GeometryPart]]. A [[GeometryPart]] inherits the symbology of their instance for anything not explicitly overridden.\n */\n public appendGeometryParamsChange(geomParams: GeometryParams): boolean {\n const appearance: GeometryAppearanceProps = {\n subCategory: geomParams.subCategoryId,\n color: geomParams.lineColor?.toJSON(),\n weight: geomParams.weight,\n style: geomParams.styleInfo?.styleId,\n transparency: geomParams.elmTransparency,\n displayPriority: geomParams.elmPriority,\n geometryClass: geomParams.geometryClass,\n };\n this.geometryStream.push({ appearance });\n\n if (undefined !== geomParams.materialId)\n this.geometryStream.push({ material: { materialId: geomParams.materialId } });\n\n if (undefined !== geomParams.fillDisplay && FillDisplay.Never !== geomParams.fillDisplay) {\n const fill: AreaFillProps = {\n display: geomParams.fillDisplay,\n transparency: geomParams.fillTransparency,\n };\n if (undefined !== geomParams.gradient && Gradient.Mode.None !== geomParams.gradient.mode)\n fill.gradient = geomParams.gradient?.toJSON();\n else if (undefined !== geomParams.backgroundFill && BackgroundFill.None !== geomParams.backgroundFill)\n fill.backgroundFill = geomParams.backgroundFill;\n else if (undefined !== geomParams.fillColor)\n fill.color = geomParams.fillColor.toJSON();\n this.geometryStream.push({ fill });\n }\n\n if (undefined !== geomParams.pattern) {\n const localPattern = this._worldToLocal ? geomParams.pattern.clone() : geomParams.pattern;\n if (undefined !== this._worldToLocal && !localPattern.applyTransform(this._worldToLocal))\n return false;\n\n this.geometryStream.push({ pattern: localPattern.toJSON() });\n }\n\n if (undefined !== geomParams.styleInfo && undefined !== geomParams.styleInfo.styleMod) {\n const localStyleMod = new LineStyle.Modifier(geomParams.styleInfo.styleMod);\n if (undefined !== this._worldToLocal && !localStyleMod.applyTransform(this._worldToLocal))\n return false;\n this.geometryStream.push({ styleMod: localStyleMod });\n }\n\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement3d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart3d(partId: Id64String, instanceOrigin?: Point3d, instanceRotation?: YawPitchRollAngles, instanceScale?: number): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ geomPart: { part: partId, origin: instanceOrigin, rotation: instanceRotation, scale: instanceScale } });\n return true;\n }\n const partTrans = Transform.createOriginAndMatrix(instanceOrigin, instanceRotation ? instanceRotation.toMatrix3d() : Matrix3d.createIdentity());\n if (undefined !== instanceScale)\n partTrans.matrix.scaleColumnsInPlace(instanceScale, instanceScale, instanceScale);\n const resultTrans = this._worldToLocal.multiplyTransformTransform(partTrans);\n const scales = new Vector3d();\n if (!resultTrans.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(resultTrans.matrix);\n if (undefined === newRotation)\n return false;\n this.geometryStream.push({ geomPart: { part: partId, origin: resultTrans.getOrigin(), rotation: newRotation, scale: scales.x } });\n return true;\n }\n\n /** Append a [[GeometryPart]] instance with relative position, orientation, and scale to a [[GeometryStreamProps]] array for creating a [[GeometricElement2d]].\n * Not valid when defining a [[GeometryPart]] as nesting of parts is not supported.\n */\n public appendGeometryPart2d(partId: Id64String, instanceOrigin?: Point2d, instanceRotation?: Angle, instanceScale?: number): boolean {\n return this.appendGeometryPart3d(partId, instanceOrigin ? Point3d.createFrom(instanceOrigin) : undefined, instanceRotation ? new YawPitchRollAngles(instanceRotation) : undefined, instanceScale);\n }\n\n /** Append a [[TextString]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendTextString(textString: TextString): boolean {\n if (this._worldToLocal) {\n textString = new TextString(textString);\n if (!textString.transformInPlace(this._worldToLocal)) {\n return false;\n }\n }\n\n this.geometryStream.push({ textString: textString.toJSON() });\n return true;\n }\n\n /** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.\n * @beta\n */\n public appendTextBlock(block: TextBlockGeometryProps): boolean {\n for (const entry of block.entries) {\n let result: boolean;\n if (undefined !== entry.text) {\n result = this.appendTextString(new TextString(entry.text));\n } else if (undefined !== entry.color) {\n if (entry.color === \"subcategory\") {\n result = this.appendSubCategoryChange(Id64.invalid);\n } else {\n this.geometryStream.push({ appearance: { color: entry.color } });\n result = true;\n }\n } else {\n result = this.appendGeometry(LineSegment3d.fromJSON(entry.separator));\n }\n\n if (!result) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Append an [[ImageGraphic]] supplied in either local or world coordinates. */\n public appendImage(image: ImageGraphic): boolean {\n if (undefined !== this._worldToLocal)\n image = image.cloneTransformed(this._worldToLocal);\n\n this.geometryStream.push({ image: image.toJSON() });\n return true;\n }\n\n /** Append a [[GeometryQuery]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array */\n public appendGeometry(geometry: GeometryQuery): boolean {\n if (undefined === this._worldToLocal) {\n const geomData = GeomJson.Writer.toIModelJson(geometry);\n if (undefined === geomData)\n return false;\n this.geometryStream.push(geomData);\n return true;\n }\n const localGeometry = geometry.cloneTransformed(this._worldToLocal);\n if (undefined === localGeometry)\n return false;\n const localGeomData = GeomJson.Writer.toIModelJson(localGeometry);\n if (undefined === localGeomData)\n return false;\n this.geometryStream.push(localGeomData);\n return true;\n }\n\n /** Append [[BRepEntity.DataProps]] supplied in either local or world coordinates to the [[GeometryStreamProps]] array\n * @beta\n */\n public appendBRepData(brep: BRepEntity.DataProps): boolean {\n if (undefined === this._worldToLocal) {\n this.geometryStream.push({ brep });\n return true;\n }\n const entityTrans = Transform.fromJSON(brep.transform);\n const localTrans = this._worldToLocal.multiplyTransformTransform(entityTrans);\n const localBrep: BRepEntity.DataProps = {\n data: brep.data,\n type: brep.type,\n transform: localTrans.isIdentity ? undefined : localTrans.toJSON(),\n faceSymbology: brep.faceSymbology,\n };\n this.geometryStream.push({ brep: localBrep });\n return true;\n }\n\n /** @internal */\n public getHeader(): GeometryStreamHeaderProps | undefined {\n return 0 < this.geometryStream.length ? this.geometryStream[0].header : undefined;\n }\n\n /** @internal */\n public obtainHeader(): GeometryStreamHeaderProps {\n const hdr = this.getHeader();\n if (undefined !== hdr)\n return hdr;\n\n const entry = { header: { flags: GeometryStreamFlags.None } };\n this.geometryStream.unshift(entry);\n return entry.header;\n }\n\n /** Controls whether or not the geometry in the stream should be displayed as view-independent.\n * When view-independent geometry is displayed, it is always oriented to face the viewer, using the placement origin of the element as the rotation point.\n * If the placement origin is outside of the view, the geometry will not necessarily be displayed, even if rotating it to face the viewer would cause its range to intersect the viewed volume\n * @public\n */\n public get isViewIndependent(): boolean {\n const hdr = this.getHeader();\n return undefined !== hdr && GeometryStreamFlags.None !== (hdr.flags & GeometryStreamFlags.ViewIndependent);\n }\n public set isViewIndependent(viewIndependent: boolean) {\n if (viewIndependent === this.isViewIndependent)\n return;\n\n const hdr = this.obtainHeader();\n if (viewIndependent)\n hdr.flags |= GeometryStreamFlags.ViewIndependent;\n else\n hdr.flags &= ~GeometryStreamFlags.ViewIndependent;\n }\n}\n\n/** Represents a text string within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface TextStringPrimitive {\n type: \"textString\";\n readonly textString: TextString;\n}\n\n/** Represents an image within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface ImagePrimitive {\n type: \"image\";\n readonly image: ImageGraphic;\n}\n\n/** Represents a reference to a GeometryPart within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface PartReference {\n type: \"partReference\";\n part: {\n id: Id64String;\n readonly toLocal?: Transform;\n };\n}\n\n/** Represents a BRep within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface BRepPrimitive {\n type: \"brep\";\n /** @beta */\n readonly brep: BRepEntity.DataProps;\n}\n\n/** Represents one of a variety of GeometryQuery objects within a GeometryStream.\n * @public\n * @extensions\n */\nexport interface GeometryPrimitive {\n type: \"geometryQuery\";\n readonly geometry: AnyGeometryQuery;\n}\n\n/** Union of all possible geometric primitive types that may appear within a GeometryStream.\n * @public\n * @extensions\n */\nexport type GeometryStreamPrimitive = TextStringPrimitive | PartReference | BRepPrimitive | GeometryPrimitive | ImagePrimitive;\n\n/** Holds current state information for [[GeometryStreamIterator]]. Each entry represents exactly one geometry primitive in the stream.\n * @public\n * @extensions\n */\nexport interface GeometryStreamIteratorEntry {\n /** A [[GeometryParams]] representing the appearance of the current geometric entry */\n readonly geomParams: GeometryParams;\n /** Placement transform, used for converting placement relative, local coordinate entries to world */\n readonly localToWorld?: Transform;\n /** Optional stored local range for the current geometric entry */\n readonly localRange?: Range3d;\n /** Returns the geometric primitive represented by this entry. */\n readonly primitive: GeometryStreamPrimitive;\n}\n\nclass IteratorEntry implements GeometryStreamIteratorEntry {\n private _primitive?: GeometryStreamPrimitive;\n public readonly geomParams: GeometryParams;\n public readonly localToWorld?: Transform;\n public localRange?: Range3d;\n\n public constructor(appearance: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geomParams = typeof appearance === \"string\" ? new GeometryParams(appearance) : appearance;\n this.localToWorld = localToWorld;\n }\n\n public get primitive() { return expectDefined(this._primitive); }\n public set primitive(primitive: GeometryStreamPrimitive) { this._primitive = primitive; }\n\n public setGeometryQuery(geometry: AnyGeometryQuery) { this._primitive = { type: \"geometryQuery\", geometry }; }\n public setTextString(textString: TextString) { this._primitive = { type: \"textString\", textString }; }\n public setBRep(brep: BRepEntity.DataProps) { this._primitive = { type: \"brep\", brep }; }\n public setImage(image: ImageGraphic) { this._primitive = { type: \"image\", image }; }\n public setPartReference(id: Id64String, toLocal?: Transform) {\n this._primitive = {\n type: \"partReference\",\n part: { id, toLocal },\n };\n }\n}\n\n/** GeometryStreamIterator is a helper class for iterating a [[GeometryStreamProps]].\n * A [[GeometricElement]]'s GeometryStream must be specifically requested using [[ElementLoadProps.wantGeometry]].\n * Each [[GeometryStreamIteratorEntry]] returned by the iterator represents exactly one geometric primitive in the stream.\n * @public\n */\nexport class GeometryStreamIterator implements IterableIterator<GeometryStreamIteratorEntry> {\n /** GeometryStream entries */\n public geometryStream: GeometryStreamProps;\n /** Flags applied to the entire geometry stream. */\n public readonly flags: GeometryStreamFlags;\n /** Current entry position */\n private _index = 0;\n /** Allocated on first call to next() and reused thereafter. */\n private _entry?: IteratorEntry;\n /** Used to initialize this._entry. */\n private readonly _appearance: Id64String | GeometryParams;\n private readonly _localToWorld?: Transform;\n\n /** Construct a new GeometryStreamIterator given a [[GeometryStreamProps]] from either a [[GeometricElement3d]], [[GeometricElement2d]], or [[GeometryPart]].\n * Supply the [[GeometricElement]]'s category to initialize the appearance information for each geometric entry.\n */\n public constructor(geometryStream: GeometryStreamProps, categoryOrGeometryParams?: Id64String | GeometryParams, localToWorld?: Transform) {\n this.geometryStream = geometryStream;\n this._appearance = categoryOrGeometryParams ?? Id64.invalid;\n this._localToWorld = localToWorld;\n if (0 < geometryStream.length && undefined !== geometryStream[0].header) {\n this.flags = geometryStream[0].header.flags;\n ++this._index;\n } else {\n this.flags = GeometryStreamFlags.None;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get entry() {\n if (undefined === this._entry)\n this._entry = new IteratorEntry(this._appearance, this._localToWorld);\n\n return this._entry;\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement3d]].\n * If [[GeometricElement3dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement3d(element: Pick<GeometricElement3dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined)\n transform = Transform.createOriginAndMatrix(Point3d.fromJSON(element.placement.origin), YawPitchRollAngles.fromJSON(element.placement.angles).toMatrix3d());\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometricElement2d]].\n * If [[GeometricElement2dProps.placement]] is not undefined, placement relative entries will be returned transformed to world coordinates.\n * @throws [[IModelError]] if element.geom is undefined.\n */\n public static fromGeometricElement2d(element: Pick<GeometricElement2dProps, \"geom\" | \"placement\" | \"category\">) {\n if (element.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometricElement has no geometry or geometry wasn't requested\");\n\n let transform;\n if (element.placement !== undefined) {\n const origin = Point3d.createFrom(Point2d.fromJSON(element.placement.origin));\n const matrix = expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), Angle.fromJSON(element.placement.angle)));\n transform = Transform.createOriginAndMatrix(origin, matrix);\n }\n\n return new GeometryStreamIterator(element.geom, element.category, transform);\n }\n\n /** Create a new GeometryStream iterator for a [[GeometryPart]].\n * To iterate a part's GeometryStream in the context of a part instance found for a [[GeometricElement]], provide the optional [[GeometryParams]] and Transform from the [[GeometricElement]]'s [[GeometryStreamIterator]].\n * Supply the [[GeometryParams]] to return appearance information as inherited from the [[GeometricElement]].\n * Supply the partToWorld transform to return the part geometry in world coordinates.\n * Supply the partToLocal transform to return the part geometry relative to the [[GeometricElement]]'s placement.\n * @throws [[IModelError]] if geomPart.geom is undefined.\n */\n public static fromGeometryPart(geomPart: Pick<GeometryPartProps, \"geom\">, geomParams?: GeometryParams, partTransform?: Transform) {\n if (geomPart.geom === undefined)\n throw new IModelError(IModelStatus.NoGeometry, \"GeometryPart has no geometry or geometry wasn't requested\");\n\n return new GeometryStreamIterator(geomPart.geom, geomParams?.clone(), partTransform);\n }\n\n /** Get the transform that if applied to a [[GeometryPart]]'s GeometryStream entries would return them in world coordinates. */\n public partToWorld(): Transform | undefined {\n if (undefined === this._entry)\n return this._localToWorld;\n\n const partToLocal = \"partReference\" === this._entry.primitive.type ? this._entry.primitive.part.toLocal : undefined;\n if (this._entry.localToWorld === undefined || partToLocal === undefined)\n return this._entry.localToWorld;\n\n return this._entry.localToWorld.multiplyTransformTransform(partToLocal);\n }\n\n /** Advance to next displayable geometric entry while updating the current [[GeometryParams]] from appearance related entries.\n * Geometric entries are [[TextString]], [[GeometryQuery]], [[GeometryPart]], [[ImageGraphic]], and [[BRepEntity.DataProps]].\n */\n public next(): IteratorResult<GeometryStreamIteratorEntry> {\n // NOTE: localRange remains valid until we encounter either a new subRange entry or a geometry part reference.\n while (this._index < this.geometryStream.length) {\n const entry = this.geometryStream[this._index++];\n if (entry.appearance) {\n this.entry.geomParams.resetAppearance();\n if (entry.appearance.subCategory)\n this.entry.geomParams.subCategoryId = Id64.fromJSON(entry.appearance.subCategory);\n if (undefined !== entry.appearance.color)\n this.entry.geomParams.lineColor = ColorDef.fromJSON(entry.appearance.color);\n if (undefined !== entry.appearance.weight)\n this.entry.geomParams.weight = entry.appearance.weight;\n if (undefined !== entry.appearance.style)\n this.entry.geomParams.styleInfo = new LineStyle.Info(Id64.fromJSON(entry.appearance.style));\n if (undefined !== entry.appearance.transparency)\n this.entry.geomParams.elmTransparency = entry.appearance.transparency;\n if (undefined !== entry.appearance.displayPriority)\n this.entry.geomParams.elmPriority = entry.appearance.displayPriority;\n if (undefined !== entry.appearance.geometryClass)\n this.entry.geomParams.geometryClass = entry.appearance.geometryClass;\n } else if (entry.styleMod) {\n if (this.entry.geomParams.styleInfo === undefined)\n continue;\n\n const styleMod = new LineStyle.Modifier(entry.styleMod);\n if (this.entry.localToWorld !== undefined)\n styleMod.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.styleInfo = new LineStyle.Info(this.entry.geomParams.styleInfo.styleId, styleMod);\n } else if (entry.fill) {\n if (entry.fill.display)\n this.entry.geomParams.fillDisplay = entry.fill.display;\n if (entry.fill.transparency)\n this.entry.geomParams.fillTransparency = entry.fill.transparency;\n if (entry.fill.gradient)\n this.entry.geomParams.gradient = Gradient.Symb.fromJSON(entry.fill.gradient);\n else if (entry.fill.backgroundFill)\n this.entry.geomParams.backgroundFill = entry.fill.backgroundFill;\n else if (entry.fill.color)\n this.entry.geomParams.fillColor = ColorDef.fromJSON(entry.fill.color);\n } else if (entry.pattern) {\n const params = AreaPattern.Params.fromJSON(entry.pattern);\n if (this.entry.localToWorld !== undefined)\n params.applyTransform(this.entry.localToWorld);\n\n this.entry.geomParams.pattern = params;\n } else if (entry.material) {\n if (entry.material.materialId)\n this.entry.geomParams.materialId = Id64.fromJSON(entry.material.materialId);\n } else if (entry.subRange) {\n this.entry.localRange = Range3d.fromJSON(entry.subRange);\n } else if (entry.geomPart) {\n let transform;\n if (entry.geomPart.origin !== undefined || entry.geomPart.rotation !== undefined || entry.geomPart.scale !== undefined) {\n const origin = entry.geomPart.origin ? Point3d.fromJSON(entry.geomPart.origin) : Point3d.createZero();\n const rotation = entry.geomPart.rotation ? YawPitchRollAngles.fromJSON(entry.geomPart.rotation).toMatrix3d() : Matrix3d.createIdentity();\n transform = Transform.createRefs(origin, rotation);\n if (entry.geomPart.scale)\n transform.multiplyTransformTransform(Transform.createRefs(Point3d.createZero(), Matrix3d.createUniformScale(entry.geomPart.scale)), transform);\n }\n\n // Subgraphic range doesn't apply to parts. A sane geometry stream (i.e., any that has been through the native layers or GeometryStreamBuilder)\n // will have a new subgraphic range for any geometric primitive following the part.\n this.entry.localRange = undefined;\n this.entry.setPartReference(Id64.fromJSON(entry.geomPart.part), transform);\n return { value: this.entry, done: false };\n } else if (entry.textString) {\n const textString = new TextString(entry.textString);\n if (this.entry.localToWorld !== undefined)\n textString.transformInPlace(this.entry.localToWorld);\n\n this.entry.setTextString(textString);\n return { value: this.entry, done: false };\n } else if (entry.image) {\n const image = ImageGraphic.fromJSON(entry.image);\n if (undefined !== this.entry.localToWorld)\n image.transformInPlace(this.entry.localToWorld);\n\n this.entry.setImage(image);\n return { value: this.entry, done: false };\n } else if (entry.brep) {\n if (this.entry.localToWorld !== undefined) {\n const entityTrans = Transform.fromJSON(entry.brep.transform);\n entry.brep.transform = this.entry.localToWorld.multiplyTransformTransform(entityTrans).toJSON();\n }\n\n this.entry.setBRep(entry.brep);\n return { value: this.entry, done: false };\n } else {\n const geometryQuery = GeomJson.Reader.parse(entry);\n if (!(geometryQuery instanceof GeometryQuery))\n continue;\n\n if (this.entry.localToWorld !== undefined)\n geometryQuery.tryTransformInPlace(this.entry.localToWorld);\n\n this.entry.setGeometryQuery(geometryQuery);\n return { value: this.entry, done: false };\n }\n }\n\n return { value: this.entry, done: true };\n }\n\n public [Symbol.iterator](): IterableIterator<GeometryStreamIteratorEntry> {\n return this;\n }\n\n /** @internal */\n public get isViewIndependent(): boolean { return GeometryStreamFlags.None !== (this.flags & GeometryStreamFlags.ViewIndependent); }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineStyle.d.ts","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE5G,cAAc;AACd,yBAAiB,SAAS,CAAC;IAEzB;;;;OAIG;IACH,UAAiB,aAAa;QAC5B,qEAAqE;QACrE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mEAAmE;QACnE,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,iEAAiE;QACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,+EAA+E;QAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,uFAAuF;QACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,6DAA6D;QAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,mDAAmD;QACnD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kFAAkF;QAClF,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,6DAA6D;QAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,4IAA4I;QAC5I,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,qFAAqF;QACrF,MAAM,CAAC,EAAE,QAAQ,CAAC;QAClB,uFAAuF;QACvF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;KAC9B;IAED,2DAA2D;IAC3D,MAAa,QAAS,YAAW,aAAa;QACrC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,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
|
|
64
64
|
return false;
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
65
66
|
if (this.normal && !this.normal.isAlmostEqual(other.normal))
|
|
66
67
|
return false;
|
|
67
68
|
if ((this.rotation === undefined) !== (other.rotation === undefined))
|
|
68
69
|
return false;
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
69
71
|
if (this.rotation && !this.rotation.isAlmostEqual(other.rotation))
|
|
70
72
|
return false;
|
|
71
73
|
return true;
|
|
@@ -134,6 +136,7 @@ var LineStyle;
|
|
|
134
136
|
return false;
|
|
135
137
|
if ((this.styleMod === undefined) !== (other.styleMod === undefined))
|
|
136
138
|
return false;
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
140
|
if (this.styleMod && !this.styleMod.equals(other.styleMod))
|
|
138
141
|
return false;
|
|
139
142
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA4G;AAE5G,cAAc;AACd,IAAiB,SAAS,CAoLzB;AApLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QACZ,KAAK,CAAU;QACf,SAAS,CAAU;QACnB,QAAQ,CAAU;QAClB,UAAU,CAAU;QACpB,QAAQ,CAAU;QAClB,SAAS,CAAU;QACnB,UAAU,CAAU;QACpB,WAAW,CAAW;QACtB,WAAW,CAAW;QACtB,aAAa,CAAW;QACxB,MAAM,CAAY;QAClB,QAAQ,CAAsB;QAErC,yCAAyC;QACzC,YAAY,KAAoB;YAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,C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jC,IAAI,IAAI,CAAC,QAAQ;gBACf,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAC;YAE/B,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAnHY,kBAAQ,WAmHpB,CAAA;IAED,6EAA6E;IAC7E,MAAa,IAAI;QACR,OAAO,CAAa;QACpB,QAAQ,CAAY,CAAC,uDAAuD;QAEnF,sCAAsC;QACtC,YAAY,OAAmB,EAAE,QAAmB;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAED,0CAA0C;QACnC,KAAK;YACV,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACnF,CAAC;QAEM,MAAM,CAAC,KAAW;YACvB,IAAI,IAAI,KAAK,KAAK;gBAChB,OAAO,IAAI,CAAC;YACd,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;gBAChC,OAAO,KAAK,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC;gBAClE,OAAO,KAAK,CAAC;YACf,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA1BY,cAAI,OA0BhB,CAAA;AACH,CAAC,EApLgB,SAAS,yBAAT,SAAS,QAoLzB","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 Symbology\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\n\n/** @public */\nexport namespace LineStyle {\n\n /** Modify the line style appearance without changing the line style definition.\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface ModifierProps {\n /** Optional scale to apply to all length values, 1.0 if undefined */\n scale?: number;\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\n dashScale?: number;\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\n gapScale?: number;\n /** Optional start width in meters to apply to dashes, no width if undefined */\n startWidth?: number;\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\n endWidth?: number;\n /** Optional shift by distance in meters, 0.0 if undefined */\n distPhase?: number;\n /** Optional shift by fraction, 0.0 if undefined */\n fractPhase?: number;\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\n centerPhase?: boolean;\n /** Optional flag to enable or disable single segment mode */\n segmentMode?: boolean;\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\n physicalWidth?: boolean;\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\n normal?: XYZProps;\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\n rotation?: YawPitchRollProps;\n }\n\n /** Optional modifiers to override line style definition */\n export class Modifier implements ModifierProps {\n public scale?: number;\n public dashScale?: number;\n public gapScale?: number;\n public startWidth?: number;\n public endWidth?: number;\n public distPhase?: number;\n public fractPhase?: number;\n public centerPhase?: boolean;\n public segmentMode?: boolean;\n public physicalWidth?: boolean;\n public normal?: Vector3d;\n public rotation?: YawPitchRollAngles;\n\n /** constructor for LineStyle.Modifier */\n constructor(props: ModifierProps) {\n this.scale = props.scale;\n this.dashScale = props.dashScale;\n this.gapScale = props.gapScale;\n this.startWidth = props.startWidth;\n this.endWidth = props.endWidth;\n this.distPhase = props.distPhase;\n this.fractPhase = props.fractPhase;\n this.centerPhase = props.centerPhase;\n this.segmentMode = props.segmentMode;\n this.physicalWidth = props.physicalWidth;\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\n }\n\n /** Returns a deep copy of this object. */\n public clone() {\n return new Modifier(this);\n }\n\n /** Compare two LineStyle.Modifier for equivalence */\n public equals(other: Modifier): boolean {\n if (this === other) // same pointer\n return true;\n\n if (other.scale !== this.scale ||\n other.dashScale !== this.dashScale ||\n other.gapScale !== this.gapScale ||\n other.startWidth !== this.startWidth ||\n other.endWidth !== this.endWidth ||\n other.distPhase !== this.distPhase ||\n other.fractPhase !== this.fractPhase ||\n other.centerPhase !== this.centerPhase ||\n other.segmentMode !== this.segmentMode ||\n other.physicalWidth !== this.physicalWidth)\n return false;\n\n if ((this.normal === undefined) !== (other.normal === undefined))\n return false;\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\n return false;\n\n if ((this.rotation === undefined) !== (other.rotation === undefined))\n return false;\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\n return false;\n\n return true;\n }\n\n public applyTransform(transform: Transform): boolean {\n if (transform.isIdentity)\n return true;\n if (this.normal) {\n transform.matrix.multiplyVector(this.normal, this.normal);\n const normalized = this.normal.normalize();\n if (normalized)\n this.normal.setFrom(normalized);\n else\n return false;\n }\n if (this.rotation) {\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n this.rotation.setFrom(newRotation);\n }\n\n let scaleFactor;\n const scaleVector = Vector3d.create();\n const scaleMatrix = transform.matrix;\n scaleMatrix.normalizeRowsInPlace(scaleVector);\n\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\n else\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\n\n if (1.0 === scaleFactor)\n return true;\n\n if (this.scale)\n this.scale *= scaleFactor;\n\n if (this.physicalWidth)\n return true;\n\n if (this.startWidth)\n this.startWidth *= scaleFactor;\n\n if (this.endWidth)\n this.endWidth *= scaleFactor;\n\n return true;\n }\n }\n\n /** Line style id and optional modifiers to override line style definition */\n export class Info {\n public styleId: Id64String;\n public styleMod?: Modifier; // Optional modifiers to override line style definition\n\n /** Creates a LineStyle.Info object */\n constructor(styleId: Id64String, styleMod?: Modifier) {\n this.styleId = styleId;\n this.styleMod = styleMod;\n }\n\n /** Returns a deep copy of this object. */\n public clone(): Info {\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\n }\n\n public equals(other: Info): boolean {\n if (this === other)\n return true;\n if (this.styleId !== other.styleId)\n return false;\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\n return false;\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\n return false;\n return true;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../../src/geometry/LineStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA4G;AAE5G,cAAc;AACd,IAAiB,SAAS,CAuLzB;AAvLD,WAAiB,SAAS;IAkCxB,2DAA2D;IAC3D,MAAa,QAAQ;QACZ,KAAK,CAAU;QACf,SAAS,CAAU;QACnB,QAAQ,CAAU;QAClB,UAAU,CAAU;QACpB,QAAQ,CAAU;QAClB,SAAS,CAAU;QACnB,UAAU,CAAU;QACpB,WAAW,CAAW;QACtB,WAAW,CAAW;QACtB,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K,CAAC,QAAS,CAAC;gBACzD,OAAO,KAAK,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IA3BY,cAAI,OA2BhB,CAAA;AACH,CAAC,EAvLgB,SAAS,yBAAT,SAAS,QAuLzB","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 Symbology\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Transform, Vector3d, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\n\n/** @public */\nexport namespace LineStyle {\n\n /** Modify the line style appearance without changing the line style definition.\n * Applies to the style previously established by a [[GeometryAppearanceProps]] or current [[SubCategoryAppearance]].\n * Most of the modifiers affect the line style stroke pattern, with the orientation and scales being the exception.\n * @see [[GeometryStreamEntryProps]]\n */\n export interface ModifierProps {\n /** Optional scale to apply to all length values, 1.0 if undefined */\n scale?: number;\n /** Optional scale to apply to scalable dashes, 1.0 if undefined */\n dashScale?: number;\n /** Optional scale to apply to scalable gaps, 1.0 if undefined */\n gapScale?: number;\n /** Optional start width in meters to apply to dashes, no width if undefined */\n startWidth?: number;\n /** Optional end width in meters to apply to dashes, same as startWidth if undefined */\n endWidth?: number;\n /** Optional shift by distance in meters, 0.0 if undefined */\n distPhase?: number;\n /** Optional shift by fraction, 0.0 if undefined */\n fractPhase?: number;\n /** Optional flag to center stroke pattern and stretch ends, false if undefined */\n centerPhase?: boolean;\n /** Optional flag to enable or disable single segment mode */\n segmentMode?: boolean;\n /** Optional flag that denotes startWidth and endWidth represent physical widths that should not be affected by scale, false if undefined */\n physicalWidth?: boolean;\n /** Optional up vector for style (applicable to 3d only), 0.0,0.0,1.0 if undefined */\n normal?: XYZProps;\n /** Optional orientation for style (applicable to 3d only), 0.0,0.0,0.0 if undefined */\n rotation?: YawPitchRollProps;\n }\n\n /** Optional modifiers to override line style definition */\n export class Modifier implements ModifierProps {\n public scale?: number;\n public dashScale?: number;\n public gapScale?: number;\n public startWidth?: number;\n public endWidth?: number;\n public distPhase?: number;\n public fractPhase?: number;\n public centerPhase?: boolean;\n public segmentMode?: boolean;\n public physicalWidth?: boolean;\n public normal?: Vector3d;\n public rotation?: YawPitchRollAngles;\n\n /** constructor for LineStyle.Modifier */\n constructor(props: ModifierProps) {\n this.scale = props.scale;\n this.dashScale = props.dashScale;\n this.gapScale = props.gapScale;\n this.startWidth = props.startWidth;\n this.endWidth = props.endWidth;\n this.distPhase = props.distPhase;\n this.fractPhase = props.fractPhase;\n this.centerPhase = props.centerPhase;\n this.segmentMode = props.segmentMode;\n this.physicalWidth = props.physicalWidth;\n this.normal = props.normal ? Vector3d.fromJSON(props.normal) : undefined;\n this.rotation = props.rotation ? YawPitchRollAngles.fromJSON(props.rotation) : undefined;\n }\n\n /** Returns a deep copy of this object. */\n public clone() {\n return new Modifier(this);\n }\n\n /** Compare two LineStyle.Modifier for equivalence */\n public equals(other: Modifier): boolean {\n if (this === other) // same pointer\n return true;\n\n if (other.scale !== this.scale ||\n other.dashScale !== this.dashScale ||\n other.gapScale !== this.gapScale ||\n other.startWidth !== this.startWidth ||\n other.endWidth !== this.endWidth ||\n other.distPhase !== this.distPhase ||\n other.fractPhase !== this.fractPhase ||\n other.centerPhase !== this.centerPhase ||\n other.segmentMode !== this.segmentMode ||\n other.physicalWidth !== this.physicalWidth)\n return false;\n\n if ((this.normal === undefined) !== (other.normal === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.normal && !this.normal.isAlmostEqual(other.normal!))\n return false;\n\n if ((this.rotation === undefined) !== (other.rotation === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.rotation && !this.rotation.isAlmostEqual(other.rotation!))\n return false;\n\n return true;\n }\n\n public applyTransform(transform: Transform): boolean {\n if (transform.isIdentity)\n return true;\n if (this.normal) {\n transform.matrix.multiplyVector(this.normal, this.normal);\n const normalized = this.normal.normalize();\n if (normalized)\n this.normal.setFrom(normalized);\n else\n return false;\n }\n if (this.rotation) {\n const newTransform = this.rotation.toMatrix3d().multiplyMatrixTransform(transform);\n const scales = new Vector3d();\n if (!newTransform.matrix.normalizeColumnsInPlace(scales))\n return false;\n const newRotation = YawPitchRollAngles.createFromMatrix3d(newTransform.matrix);\n if (undefined === newRotation)\n return false;\n this.rotation.setFrom(newRotation);\n }\n\n let scaleFactor;\n const scaleVector = Vector3d.create();\n const scaleMatrix = transform.matrix;\n scaleMatrix.normalizeRowsInPlace(scaleVector);\n\n // Check for flatten transform, dividing scaleVector by 3 gives wrong scaleFactor\n if (scaleVector.x !== 0.0 && scaleVector.y !== 0.0 && scaleVector.z !== 0.0)\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 3.0;\n else\n scaleFactor = (scaleVector.x + scaleVector.y + scaleVector.z) / 2.0;\n\n if (1.0 === scaleFactor)\n return true;\n\n if (this.scale)\n this.scale *= scaleFactor;\n\n if (this.physicalWidth)\n return true;\n\n if (this.startWidth)\n this.startWidth *= scaleFactor;\n\n if (this.endWidth)\n this.endWidth *= scaleFactor;\n\n return true;\n }\n }\n\n /** Line style id and optional modifiers to override line style definition */\n export class Info {\n public styleId: Id64String;\n public styleMod?: Modifier; // Optional modifiers to override line style definition\n\n /** Creates a LineStyle.Info object */\n constructor(styleId: Id64String, styleMod?: Modifier) {\n this.styleId = styleId;\n this.styleMod = styleMod;\n }\n\n /** Returns a deep copy of this object. */\n public clone(): Info {\n return new Info(this.styleId, this.styleMod ? this.styleMod.clone() : undefined);\n }\n\n public equals(other: Info): boolean {\n if (this === other)\n return true;\n if (this.styleId !== other.styleId)\n return false;\n if ((this.styleMod === undefined) !== (other.styleMod === undefined))\n return false;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (this.styleMod && !this.styleMod.equals(other.styleMod!))\n return false;\n return true;\n }\n }\n}\n"]}
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ACnD,IAAW,OAAO,IAAI,OAAO,CAAoH;IAEjJ,oEAAoE;IAC7D,OAAO,CAAC,KAAK,EAAE,WAAW;IAMjC,kEAAkE;IAC3D,cAAc,IAAI,gBAAgB;IAczC;;OAEG;IACI,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;CASjD"}
|
|
@@ -89,7 +89,7 @@ class Placement2d {
|
|
|
89
89
|
this.bbox = bbox;
|
|
90
90
|
}
|
|
91
91
|
/** Get the rotation from local coordinates of this placement to world coordinates. */
|
|
92
|
-
get rotation() { return core_geometry_1.Matrix3d.createRotationAroundVector(core_geometry_1.Vector3d.unitZ(), this.angle); }
|
|
92
|
+
get rotation() { return (0, core_bentley_1.expectDefined)(core_geometry_1.Matrix3d.createRotationAroundVector(core_geometry_1.Vector3d.unitZ(), this.angle)); }
|
|
93
93
|
/** Get the transform from local coordinates of this placement to world coordinates. */
|
|
94
94
|
get transform() { return core_geometry_1.Transform.createOriginAndMatrix(core_geometry_1.Point3d.createFrom(this.origin), this.rotation); }
|
|
95
95
|
/** Create a new Placement2d from a Placement2dProps. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placement.js","sourceRoot":"","sources":["../../../src/geometry/Placement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmD;AACnD,wDAE8B;AAE9B,wCAAqC;AACrC,gDAA6C;AAsC7C;;;GAGG;AACH,MAAa,WAAW;IACI;IAAwB;IAAmC;IAArF,YAA0B,MAAe,EAAS,MAA0B,EAAS,IAAyB;QAApF,WAAM,GAAN,MAAM,CAAS;QAAS,WAAM,GAAN,MAAM,CAAoB;QAAS,SAAI,GAAJ,IAAI,CAAqB;IAAI,CAAC;IACnH,sFAAsF;IACtF,IAAW,QAAQ,KAAe,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACpE,uFAAuF;IACvF,IAAW,SAAS,KAAgB,OAAO,yBAAS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AI,CAAC,CAAC;IAChC,CAAC;IAED,kEAAkE;IAC3D,cAAc;QACnB,MAAM,KAAK,GAAG,IAAI,uBAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,OAAO;YACf,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,uBAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEzE,2CAA2C;QAC3C,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACzB,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAE,GAAG,CAAC,CAAE,2CAA2C;QACjE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAgB;QACvC,MAAM,SAAS,GAAG,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,kCAAkB,CAAC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY;YACnF,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AA1DD,kCA0DC","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 Geometry\n */\n\nimport { IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\nimport { Frustum } from \"../Frustum\";\nimport { IModelError } from \"../IModelError\";\n\n/** A Range3d that is aligned with the axes of spatial coordinates.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3d = Range3d;\n\n/** The properties of a Range3d.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3dProps = Range3dProps;\n\n/** A bounding box aligned to the orientation of a 3d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox3d = Range3d;\n\n/** A bounding box aligned to the orientation of a 2d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox2d = Range2d;\n\n/** A bounding box aligned to a local coordinate system\n * @public\n * @extensions\n */\nexport type LocalAlignedBox3d = Range3d;\n\n/** Either a Placement2d or Placement3d\n * @public\n * @extensions\n */\nexport type Placement = Placement2d | Placement3d;\n\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\n * All geometry of a GeometricElement are relative to its placement.\n * @public\n */\nexport class Placement3d implements Placement3dProps {\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return true; }\n\n /** Create a new Placement3d from a Placement3dProps. */\n public static fromJSON(json?: Placement3dProps): Placement3d {\n const props: any = json ? json : {};\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\n }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Set the contents of this Placement3d from another Placement3d */\n public setFrom(other: Placement3d) {\n this.origin.setFrom(other.origin);\n this.angles.setFrom(other.angles);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Determine whether this Placement3d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(this.bbox, range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n return range;\n }\n\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\n * * Specifically `this.angles` is set to the rotation specified by `other.matrix * this.transform.matrix`\n * and `this.origin` is set to the origin of `other * this.transform`.\n * * Since the placement transform is local-to-world, this means `other` is a world-to-world transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if (undefined === angles)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angles = angles;\n this.origin.setFrom(transform.origin);\n }\n}\n\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\n * @public\n */\nexport class Placement2d implements Placement2dProps {\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)!; }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\n /** Create a new Placement2d from a Placement2dProps. */\n public static fromJSON(json?: Placement2dProps): Placement2d {\n const props: any = json ? json : {};\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\n }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return false; }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Determine whether this Placement2d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Set the contents of this Placement2d from another Placement2d */\n public setFrom(other: Placement2d) {\n this.origin.setFrom(other.origin);\n this.angle.setFrom(other.angle);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\n range.high.z = 1.0;\n return range;\n }\n\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angle = angles.yaw;\n this.origin.setFrom(transform.origin);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Placement.js","sourceRoot":"","sources":["../../../src/geometry/Placement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,wDAE8B;A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AAI,CAAC,YAAY;YACnF,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF;AA1DD,kCA0DC","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 Geometry\n */\n\nimport { expectDefined, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n Angle, Constant, Matrix3d, Point2d, Point3d, Range2d, Range3d, Range3dProps, Transform, Vector3d, YawPitchRollAngles,\n} from \"@itwin/core-geometry\";\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\nimport { Frustum } from \"../Frustum\";\nimport { IModelError } from \"../IModelError\";\n\n/** A Range3d that is aligned with the axes of spatial coordinates.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3d = Range3d;\n\n/** The properties of a Range3d.\n * @public\n * @extensions\n */\nexport type AxisAlignedBox3dProps = Range3dProps;\n\n/** A bounding box aligned to the orientation of a 3d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox3d = Range3d;\n\n/** A bounding box aligned to the orientation of a 2d Element\n * @public\n * @extensions\n */\nexport type ElementAlignedBox2d = Range2d;\n\n/** A bounding box aligned to a local coordinate system\n * @public\n * @extensions\n */\nexport type LocalAlignedBox3d = Range3d;\n\n/** Either a Placement2d or Placement3d\n * @public\n * @extensions\n */\nexport type Placement = Placement2d | Placement3d;\n\n/** The placement of a GeometricElement3d. This includes the origin, orientation, and size (bounding box) of the element.\n * All geometry of a GeometricElement are relative to its placement.\n * @public\n */\nexport class Placement3d implements Placement3dProps {\n public constructor(public origin: Point3d, public angles: YawPitchRollAngles, public bbox: ElementAlignedBox3d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return this.angles.toMatrix3d(); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(this.origin, this.rotation); }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return true; }\n\n /** Create a new Placement3d from a Placement3dProps. */\n public static fromJSON(json?: Placement3dProps): Placement3d {\n const props: any = json ? json : {};\n return new Placement3d(Point3d.fromJSON(props.origin), YawPitchRollAngles.fromJSON(props.angles), Range3d.fromJSON<ElementAlignedBox3d>(props.bbox));\n }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Set the contents of this Placement3d from another Placement3d */\n public setFrom(other: Placement3d) {\n this.origin.setFrom(other.origin);\n this.angles.setFrom(other.angles);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Determine whether this Placement3d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(this.bbox, range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n return range;\n }\n\n /** Multiply the Transform of this Placement3d by the specified *other* Transform.\n * * Specifically `this.angles` is set to the rotation specified by `other.matrix * this.transform.matrix`\n * and `this.origin` is set to the origin of `other * this.transform`.\n * * Since the placement transform is local-to-world, this means `other` is a world-to-world transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement3d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if (undefined === angles)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angles = angles;\n this.origin.setFrom(transform.origin);\n }\n}\n\n/** The placement of a GeometricElement2d. This includes the origin, rotation, and size (bounding box) of the element.\n * @public\n */\nexport class Placement2d implements Placement2dProps {\n public constructor(public origin: Point2d, public angle: Angle, public bbox: ElementAlignedBox2d) { }\n /** Get the rotation from local coordinates of this placement to world coordinates. */\n public get rotation(): Matrix3d { return expectDefined(Matrix3d.createRotationAroundVector(Vector3d.unitZ(), this.angle)); }\n /** Get the transform from local coordinates of this placement to world coordinates. */\n public get transform(): Transform { return Transform.createOriginAndMatrix(Point3d.createFrom(this.origin), this.rotation); }\n /** Create a new Placement2d from a Placement2dProps. */\n public static fromJSON(json?: Placement2dProps): Placement2d {\n const props: any = json ? json : {};\n return new Placement2d(Point2d.fromJSON(props.origin), Angle.fromJSON(props.angle), Range2d.fromJSON(props.bbox));\n }\n /** determine if this is 3d placement */\n public get is3d(): boolean { return false; }\n\n /** Get the 8 corners, in world coordinates, of this placement. */\n public getWorldCorners(out?: Frustum): Frustum {\n const frust = Frustum.fromRange(this.bbox, out);\n frust.multiply(this.transform);\n return frust;\n }\n\n /** Determine whether this Placement2d is valid. */\n public get isValid(): boolean { return !this.bbox.isNull && Math.max(this.origin.maxAbs(), this.bbox.maxAbs()) < Constant.circumferenceOfEarth; }\n\n /** Set the contents of this Placement2d from another Placement2d */\n public setFrom(other: Placement2d) {\n this.origin.setFrom(other.origin);\n this.angle.setFrom(other.angle);\n this.bbox.setFrom(other.bbox);\n }\n\n /** Calculate the axis-aligned bounding box for this placement. */\n public calculateRange(): AxisAlignedBox3d {\n const range = new Range3d();\n if (!this.isValid)\n return range;\n\n this.transform.multiplyRange(Range3d.createRange2d(this.bbox, 0), range);\n\n // low and high are not allowed to be equal\n range.ensureMinLengths();\n range.low.z = - 1.0; // is the 2dFrustumDepth, which === 1 meter\n range.high.z = 1.0;\n return range;\n }\n\n /** Multiply the Transform of this Placement2d by the specified *other* Transform.\n * @throws [[IModelError]] if the Transform is invalid for a GeometricElement2d.\n */\n public multiplyTransform(other: Transform): void {\n const transform = other.multiplyTransformTransform(this.transform);\n const angles = YawPitchRollAngles.createFromMatrix3d(transform.matrix);\n if ((undefined === angles) || !angles.pitch.isAlmostZero || !angles.roll.isAlmostZero)\n throw new IModelError(IModelStatus.BadRequest, \"Invalid Transform\");\n\n this.angle = angles.yaw;\n this.origin.setFrom(transform.origin);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackedFeatureTable.d.ts","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"PackedFeatureTable.d.ts","sourceRoot":"","sources":["../../../src/internal/PackedFeatureTable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACkB,IAAI,EAAE,UAAU,EAAE,SAAS,EACnD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAW,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG3J;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,kBAAkB;IAC3D,SAAgB,IAAI,EAAE,WAAW,CAAC;IAClC,SAAgB,YAAY,EAAE,UAAU,CAAC;IACzC,SAAgB,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC;IAClD,SAAgB,WAAW,EAAE,MAAM,CAAC;IACpC,SAAgB,UAAU,EAAE,OAAO,CAAC;IACpC,SAAgB,IAAI,EAAE,SAAS,CAAC;IACzB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAEpC,IAAW,UAAU,IAAI,MAAM,CAAiC;IAEhE;;;OAGG;gBACgB,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAg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G,EAAE,SAAS,GAAG,SAAS,EAA4C;IAElG,IAAW,UAAU,WAEpB;IAEM,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa;IAM5E,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY;IAKpE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS;IAIjF,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;IAI7E,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;IAK3E,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIzD,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;IAiB5E,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;IAM1E,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAIhD,wBAAwB,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAGvF;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CASnD"}
|
|
@@ -70,7 +70,7 @@ class PackedFeatureTable {
|
|
|
70
70
|
for (const iv of featureTable.getArray()) {
|
|
71
71
|
const feature = iv.value;
|
|
72
72
|
const index = iv.index * 3;
|
|
73
|
-
let subCategoryIndex = subcategories.get(feature.subCategoryId);
|
|
73
|
+
let subCategoryIndex = (0, core_bentley_1.expectDefined)(subcategories.get(feature.subCategoryId));
|
|
74
74
|
(0, core_bentley_1.assert)(undefined !== subCategoryIndex); // we inserted it above...
|
|
75
75
|
subCategoryIndex |= (feature.geometryClass << 24);
|
|
76
76
|
uint32s[index + 0] = core_bentley_1.Id64.getLowerUint32(feature.elementId);
|