@itwin/core-common 5.2.0-dev.3 → 5.2.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -1
- package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
- package/lib/cjs/AnalysisStyle.js +2 -0
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/BlobReader.d.ts.map +1 -1
- package/lib/cjs/BlobReader.js +10 -2
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.d.ts +2 -0
- package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +8 -0
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/FeatureIndex.d.ts.map +1 -1
- package/lib/cjs/FeatureIndex.js +2 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +0 -2
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/GeometryParams.d.ts.map +1 -1
- package/lib/cjs/GeometryParams.js +6 -0
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/Gradient.d.ts.map +1 -1
- package/lib/cjs/Gradient.js +5 -0
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js +4 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +7 -7
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/Localization.d.ts.map +1 -1
- package/lib/cjs/Localization.js +3 -0
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/TextureMapping.js +2 -2
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js +3 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Tween.d.ts +1 -1
- package/lib/cjs/Tween.d.ts.map +1 -1
- package/lib/cjs/Tween.js +4 -2
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +17 -68
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +18 -33
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextField.d.ts +86 -0
- package/lib/cjs/annotation/TextField.d.ts.map +1 -0
- package/lib/cjs/annotation/TextField.js +10 -0
- package/lib/cjs/annotation/TextField.js.map +1 -0
- package/lib/cjs/core-common.d.ts +1 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +1 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +1 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.d.ts.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js +13 -0
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js +7 -0
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +19 -10
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js +1 -0
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.d.ts.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js +7 -0
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +2 -2
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.d.ts.map +1 -1
- package/lib/cjs/geometry/LineStyle.js +3 -0
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.d.ts.map +1 -1
- package/lib/cjs/geometry/Placement.js +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js +66 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +1 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +4 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts +0 -3
- package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +10 -2
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/AnalysisStyle.d.ts.map +1 -1
- package/lib/esm/AnalysisStyle.js +2 -0
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/BlobReader.d.ts.map +1 -1
- package/lib/esm/BlobReader.js +10 -2
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.d.ts +2 -0
- package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +2 -2
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlTypes.js +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +8 -0
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/FeatureIndex.d.ts.map +1 -1
- package/lib/esm/FeatureIndex.js +2 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +0 -2
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/GeometryParams.d.ts.map +1 -1
- package/lib/esm/GeometryParams.js +6 -0
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/Gradient.d.ts.map +1 -1
- package/lib/esm/Gradient.js +5 -0
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js +4 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +8 -8
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/Localization.d.ts.map +1 -1
- package/lib/esm/Localization.js +3 -0
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/TextureMapping.js +3 -3
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js +3 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Tween.d.ts +1 -1
- package/lib/esm/Tween.d.ts.map +1 -1
- package/lib/esm/Tween.js +4 -2
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +17 -68
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +18 -33
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextField.d.ts +86 -0
- package/lib/esm/annotation/TextField.d.ts.map +1 -0
- package/lib/esm/annotation/TextField.js +9 -0
- package/lib/esm/annotation/TextField.js.map +1 -0
- package/lib/esm/core-common.d.ts +1 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +1 -0
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +1 -0
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.d.ts.map +1 -1
- package/lib/esm/geometry/AreaPattern.js +13 -0
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js +7 -0
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +20 -11
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js +1 -0
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.d.ts.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js +7 -0
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +3 -3
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/LineStyle.d.ts.map +1 -1
- package/lib/esm/geometry/LineStyle.js +3 -0
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.d.ts.map +1 -1
- package/lib/esm/geometry/Placement.js +2 -2
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js +2 -2
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/esm/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/esm/internal/annotations/FieldFormatter.js +62 -0
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +1 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -0
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.d.ts +0 -3
- package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +10 -2
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +2 -2
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThematicDisplay.js","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC9B,kDAAkD;IAClD,mEAAU,CAAA;IACV,mDAAmD;IACnD,qEAAW,CAAA;IACX,yJAAyJ;IACzJ,+FAAwB,CAAA;IACxB,uIAAuI;IACvI,uEAAY,CAAA;AACd,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B;AAED;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,gCAQX;AARD,WAAY,gCAAgC;IAC1C,wFAAwF;IACxF,qGAAe,CAAA;IACf;;;OAGG;IACH,mIAA8B,CAAA;AAChC,CAAC,EARW,gCAAgC,KAAhC,gCAAgC,QAQ3C;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,2BAeX;AAfD,WAAY,2BAA2B;IACrC,uEAAuE;IACvE,mFAAW,CAAA;IACX,uEAAuE;IACv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ACH,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA2B;QAChD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAEM,MAAM;QACX,MAAM,IAAI,GAAyB;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC3B,CAAC;QAEF,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAErD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 { compareNumbers } from \"@itwin/core-bentley\";\nimport { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { Gradient } from \"./Gradient\";\nimport { TextureTransparency } from \"./TextureProps\";\n\n/** A thematic gradient mode used to generate and apply a thematic effect to a scene.\n * @see [[ThematicGradientSettings.mode]]\n * @public\n * @extensions\n */\nexport enum ThematicGradientMode {\n /** Apply a smooth color gradient to the scene. */\n Smooth = 0,\n /** Apply a stepped color gradient to the scene. */\n Stepped = 1,\n /** Apply a stepped color gradient to the scene with delimiters (lines between the color steps). Can only be used with [[ThematicDisplayMode.Height]]. */\n SteppedWithDelimiter = 2,\n /** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */\n IsoLines = 3,\n}\n\n/** Describes how transparency is computed when applying a thematic gradient to a surface.\n * Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.\n * Each surface to which the gradient is applied has its own transparency.\n * The transparency mode determines how these two values are combined to compute the final transparency.\n * @see [[ThematicGradientSettings.transparencyMode]].\n * @public\n * @extensions\n */\nexport enum ThematicGradientTransparencyMode {\n /** Ignore the gradient's transparency, applying only the surface's own transparency. */\n SurfaceOnly = 0,\n /** The final transparency is computed from the product of the surface and gradient alpha channels.\n * (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).\n * If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].\n */\n MultiplySurfaceAndGradient = 1,\n}\n\n/** A color scheme used to generate the colors of a thematic gradient within an applied range.\n * @see [[ThematicGradientSettings.colorScheme]]\n * @see [[ThematicDisplay.range]]\n * @public\n * @extensions\n */\nexport enum ThematicGradientColorScheme {\n /** A color gradient scheme that represents a blue-to-red gradation. */\n BlueRed = 0,\n /** A color gradient scheme that represents a red-to-blue gradation. */\n RedBlue = 1,\n /** A color gradient scheme that represents a monochrome (black-to-white) gradation. */\n Monochrome = 2,\n /** A color gradient scheme that suits a topographic gradation. */\n Topographic = 3,\n /** A color gradient scheme that suits a sea-mountain gradation. */\n SeaMountain = 4,\n /** A custom color gradient scheme configured by the user.\n * @see [[ThematicGradientSettings.customKeys]]\n */\n Custom = 5,\n}\n\n/** JSON representation of a [[ThematicGradientSettings]].\n * @public\n * @extensions\n **/\nexport interface ThematicGradientSettingsProps {\n /** See [[ThematicGradientSettings.mode]]. */\n mode?: ThematicGradientMode;\n /** See [[ThematicGradientSettings.stepCount]]. */\n stepCount?: number;\n /** See [[ThematicGradientSettings.marginColor]]. */\n marginColor?: ColorDefProps;\n /** See [[ThematicGradientSettings.colorScheme]]. */\n colorScheme?: ThematicGradientColorScheme;\n /** See [[ThematicGradientSettings.customKeys. */\n customKeys?: Gradient.KeyColorProps[];\n /** See [[ThematicGradientSettings.colorMix]]. */\n colorMix?: number;\n /** See [[ThematicGradientSettings.transparencyMode]]. */\n transparencyMode?: ThematicGradientTransparencyMode;\n}\n\n/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].\n * @public\n */\nexport class ThematicGradientSettings {\n /** The thematic image mode used to generate the gradient. Defaults to [[ThematicGradientMode.Smooth]]. */\n public readonly mode: ThematicGradientMode;\n /** The step count value used for [[ThematicGradientMode.Stepped]], [[ThematicGradientMode.SteppedWithDelimiter]], and [[ThematicGradientMode.IsoLines]]. Defaults to 10. Cannot be less than 2. */\n public readonly stepCount: number;\n /** The margin color used at the extremes of the gradient, when outside the applied range. Defaults to a black color using [[ColorDef.fromJSON]] with no arguments. */\n public readonly marginColor: ColorDef;\n /** The color scheme used to generate the colors of the gradient color within the applied range. Defaults to [[ThematicGradientColorScheme.BlueRed]]. */\n public readonly colorScheme: ThematicGradientColorScheme;\n /** The key color values that must be provided when using a custom thematic color scheme.\n * Defaults to empty, unless using a custom thematic color scheme. In that case, this defaults to two key colors going from white to black.\n * When using a custom thematic color scheme, there must be at least two entries in here. If there are not, it will revert to the default settings.\n */\n public readonly customKeys: Gradient.KeyColor[];\n /** The percentage to mix in the original color with the thematic display gradient color (0-1).\n * Applies to background map terrain and point clouds only. Defaults to 0. */\n public readonly colorMix: number;\n /** Specifies how the transparency is computed. Defaults to [[ThematicGradientTransparencyMode.SurfaceOnly]].\n * @note This property is ignored for gradients applied using an [[AnalysisStyle]] via [[AnalysisStyleThematic]] - in that case, only the color and\n * transparency of the thematic gradient are applied.\n */\n public readonly transparencyMode: ThematicGradientTransparencyMode;\n\n public static get margin(): number { return .001; } // A fixed portion of the gradient for out of range values.\n public static get contentRange(): number { return 1.0 - 2.0 * ThematicGradientSettings.margin; }\n public static get contentMax(): number { return 1.0 - ThematicGradientSettings.margin; }\n\n public static readonly defaults = new ThematicGradientSettings({});\n\n private static _defaultCustomKeys = [[0.0, 255, 255, 255], [1.0, 0, 0, 0]];\n\n /** @alpha */\n public get textureTransparency(): TextureTransparency {\n let transp = TextureTransparency.Opaque;\n if (ThematicGradientColorScheme.Custom === this.colorScheme) {\n let haveOpaque = false;\n let haveTransparent = false;\n for (const key of this.customKeys) {\n const isOpaque = key.color.isOpaque;\n haveOpaque = haveOpaque || isOpaque;\n haveTransparent = haveTransparent || !isOpaque;\n }\n\n if (haveTransparent)\n transp = haveOpaque ? TextureTransparency.Mixed : TextureTransparency.Translucent;\n }\n\n if (transp !== TextureTransparency.Mixed)\n if (this.marginColor.isOpaque !== (transp === TextureTransparency.Opaque))\n transp = TextureTransparency.Mixed;\n\n return transp;\n }\n\n public equals(other: ThematicGradientSettings): boolean {\n if (this.mode !== other.mode || this.stepCount !== other.stepCount || !this.marginColor.equals(other.marginColor)\n || this.colorScheme !== other.colorScheme || this.customKeys.length !== other.customKeys.length\n || this.colorMix !== other.colorMix || this.transparencyMode !== other.transparencyMode) {\n return false;\n }\n\n return this.customKeys.every((key, index) => Gradient.keyColorEquals(key, other.customKeys[index]));\n }\n\n /** Compares two sets of thematic gradient settings.\n * @param lhs First set of thematic gradient settings to compare\n * @param rhs Second set of thematic gradient settings to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n */\n public static compare(lhs: ThematicGradientSettings, rhs: ThematicGradientSettings): number {\n let diff = 0;\n if ((diff = compareNumbers(lhs.mode, rhs.mode)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.stepCount, rhs.stepCount)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.marginColor.tbgr, rhs.marginColor.tbgr)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.colorScheme, rhs.colorScheme)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.colorMix, rhs.colorMix)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.customKeys.length, rhs.customKeys.length)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.transparencyMode, rhs.transparencyMode)) !== 0)\n return diff;\n\n for (let i = 0; i < lhs.customKeys.length; i++)\n if ((diff = compareNumbers(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)\n return diff;\n\n return diff;\n }\n\n private constructor(json?: ThematicGradientSettingsProps) {\n this.customKeys = [];\n if (undefined === json) {\n this.mode = ThematicGradientMode.Smooth;\n this.stepCount = 10;\n this.marginColor = ColorDef.fromJSON();\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\n this.colorMix = 0.0;\n this.transparencyMode = ThematicGradientTransparencyMode.SurfaceOnly;\n } else {\n this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;\n if (this.mode < ThematicGradientMode.Smooth || this.mode > ThematicGradientMode.IsoLines)\n this.mode = ThematicGradientMode.Smooth;\n\n this.stepCount = (typeof json.stepCount === \"number\") ? json.stepCount : 10;\n if (this.stepCount < 2)\n this.stepCount = 2;\n\n this.marginColor = ColorDef.fromJSON(json.marginColor);\n\n this.colorScheme = (json.colorScheme !== undefined && json.colorScheme !== null) ? json.colorScheme : ThematicGradientColorScheme.BlueRed;\n if (this.colorScheme < ThematicGradientColorScheme.BlueRed || this.colorScheme > ThematicGradientColorScheme.Custom)\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\n\n if (json.customKeys !== undefined && json.customKeys !== null)\n json.customKeys.forEach((key) => this.customKeys.push(new Gradient.KeyColor(key)));\n\n // Enforce 2 entries in custom color keys if violated\n if (this.colorScheme === ThematicGradientColorScheme.Custom && this.customKeys.length < 2) {\n this.customKeys = [];\n for (const keyValue of ThematicGradientSettings._defaultCustomKeys)\n this.customKeys.push(new Gradient.KeyColor({ value: keyValue[0], color: ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));\n }\n\n this.colorMix = json.colorMix ?? 0.0;\n this.transparencyMode = json.transparencyMode ?? ThematicGradientTransparencyMode.SurfaceOnly;\n }\n }\n\n public static fromJSON(json?: ThematicGradientSettingsProps) {\n return json ? new ThematicGradientSettings(json) : this.defaults;\n }\n\n public toJSON(): ThematicGradientSettingsProps {\n const props: ThematicGradientSettingsProps = {};\n if (ThematicGradientMode.Smooth !== this.mode)\n props.mode = this.mode;\n\n if (10 !== this.stepCount)\n props.stepCount = this.stepCount;\n\n const marginColor = this.marginColor.toJSON();\n if (0 !== marginColor)\n props.marginColor = marginColor;\n\n if (ThematicGradientColorScheme.BlueRed !== this.colorScheme)\n props.colorScheme = this.colorScheme;\n\n if (0 !== this.colorMix)\n props.colorMix = this.colorMix;\n\n if (ThematicGradientTransparencyMode.SurfaceOnly !== this.transparencyMode)\n props.transparencyMode = this.transparencyMode;\n\n if (this.customKeys.length > 0)\n props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });\n\n return props;\n }\n\n /** Create a copy of this ThematicGradientSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A ThematicGradientSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: ThematicGradientSettingsProps): ThematicGradientSettings {\n if (undefined === changedProps)\n return ThematicGradientSettings.fromJSON(this.toJSON());\n\n const props: ThematicGradientSettingsProps = {\n mode: undefined !== changedProps.mode ? changedProps.mode : this.mode,\n stepCount: undefined !== changedProps.stepCount ? changedProps.stepCount : this.stepCount,\n marginColor: undefined !== changedProps.marginColor ? changedProps.marginColor : this.marginColor.tbgr,\n colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,\n customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),\n colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,\n transparencyMode: changedProps.transparencyMode ?? this.transparencyMode,\n };\n\n return ThematicGradientSettings.fromJSON(props);\n }\n}\n\n/** JSON representation of a [[ThematicDisplaySensor]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplaySensorProps {\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\n position?: XYZProps;\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\n value?: number;\n}\n\n/** A sensor in world space, used for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n */\nexport class ThematicDisplaySensor {\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\n public position: Readonly<Point3d>;\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\n public readonly value: number;\n\n private constructor(json?: ThematicDisplaySensorProps) {\n if (undefined === json) {\n this.position = Point3d.fromJSON();\n this.value = 0;\n } else {\n this.position = Point3d.fromJSON(json.position);\n this.value = (typeof json.value !== \"number\") ? 0 : json.value;\n if (this.value < 0)\n this.value = 0;\n else if (this.value > 1)\n this.value = 1;\n }\n }\n\n public equals(other: ThematicDisplaySensor): boolean {\n return (this.value === other.value) && this.position.isAlmostEqual(other.position);\n }\n\n public static fromJSON(json?: ThematicDisplaySensorProps) {\n return new ThematicDisplaySensor(json);\n }\n\n public toJSON(): ThematicDisplaySensorProps {\n return {\n position: this.position.toJSON(),\n value: this.value,\n };\n }\n}\n\n/** JSON representation of a [[ThematicDisplaySensorSettings]] for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplaySensorSettingsProps {\n /** This is the list of sensors. Defaults to an empty array. */\n sensors?: ThematicDisplaySensorProps[];\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\n * Defaults to zero.\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\n */\n distanceCutoff?: number;\n}\n\n/** Settings for sensor-based thematic display for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n */\nexport class ThematicDisplaySensorSettings {\n /** This is the list of sensors. Defaults to an empty array. */\n public readonly sensors: ThematicDisplaySensor[];\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\n * Defaults to zero.\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\n */\n public readonly distanceCutoff: number;\n\n private constructor(json?: ThematicDisplaySensorSettingsProps) {\n this.sensors = [];\n if (undefined !== json) {\n if (json.sensors !== undefined && json.sensors !== null) {\n json.sensors.forEach((sensorJSON) => this.sensors.push(ThematicDisplaySensor.fromJSON(sensorJSON)));\n }\n this.distanceCutoff = (typeof json.distanceCutoff === \"number\") ? json.distanceCutoff : 0;\n } else {\n this.distanceCutoff = 0;\n }\n }\n\n public equals(other: ThematicDisplaySensorSettings): boolean {\n if (this.distanceCutoff !== other.distanceCutoff)\n return false;\n\n const thisSensors = this.sensors;\n const otherSensors = other.sensors;\n\n if (thisSensors.length !== otherSensors.length)\n return false;\n\n for (let i = 0; i < thisSensors.length; i++) {\n if (!thisSensors[i].equals(otherSensors[i]))\n return false;\n }\n\n return true;\n }\n\n public static fromJSON(json?: ThematicDisplaySensorSettingsProps) {\n return new ThematicDisplaySensorSettings(json);\n }\n\n public toJSON(): ThematicDisplaySensorSettingsProps {\n const json: ThematicDisplaySensorSettingsProps = {};\n\n json.sensors = [];\n this.sensors.forEach((sensor) => json.sensors!.push(sensor.toJSON()));\n\n json.distanceCutoff = this.distanceCutoff;\n\n return json;\n }\n}\n\n/** The thematic display mode. This determines how to apply the thematic color gradient to the geometry.\n * @public\n * @extensions\n */\nexport enum ThematicDisplayMode {\n /** The color gradient will be mapped to surface geometry and point clouds based on world height in meters. */\n Height = 0,\n /** The color gradient will be mapped to surface geometry and point clouds using inverse distance weighting based on world positions and corresponding values from a list of sensors.\n * @note Performance will decrease as more sensors are added.\n */\n InverseDistanceWeightedSensors = 1,\n /** The color gradient will be mapped to surface geometry based on the slope of the surface. The slope value is calculated based on the angle between the surface and the axis specified in the associated [[ThematicDisplay]] object.\n * @note This display mode does not affect point clouds.\n */\n Slope = 2,\n /** The color gradient will be mapped to surface geometry based on the direction of a sun shining on the surface.\n * @note This display mode does not affect point clouds.\n */\n HillShade = 3,\n}\n\n/** JSON representation of the thematic display setup of a [[DisplayStyle3d]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplayProps {\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\n displayMode?: ThematicDisplayMode;\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\n gradientSettings?: ThematicGradientSettingsProps;\n /** The range to use when applying the thematic gradient for height and slope mode.\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\n * For [[ThematicDisplayMode.Slope]], this is a range in degrees with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\n * Defaults to a null range.\n */\n range?: Range1dProps;\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], calculating the slope of a surface is done in relation to the axis. Defaults to {0,0,0}. */\n axis?: XYZProps;\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\n sunDirection?: XYZProps;\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\n * @public\n */\n sensorSettings?: ThematicDisplaySensorSettingsProps;\n}\n\n/** The thematic display setup of a [[DisplayStyle3d]].\n * Thematic display allows a user to colorize a scene using a color gradient in a way that provides a visual cue about certain attributes of the rendered geometry. This scene colorization will be done based on certain geometric attributes like height, surface slope, position of surfaces relative to a sun position, or geometric position relative to a list of sensors.\n * The documentation for [[ThematicDisplayMode]] describes how each mode colorizes the scene.\n * @note Applying thematic display to geometry prevents shadows from applying to the same geometry.\n * @public\n */\nexport class ThematicDisplay {\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\n public readonly displayMode: ThematicDisplayMode;\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\n public readonly gradientSettings: ThematicGradientSettings;\n /** The range to use when applying the thematic gradient for height and slope mode.\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\n * For [[ThematicDisplayMode.Slope]], this is a range in radians with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\n * Defaults to a null range.\n */\n public readonly range: Range1d;\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], the slope of a surface is calculated in relation to this axis. Defaults to {0,0,0}. */\n public readonly axis: Vector3d;\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\n public readonly sunDirection: Vector3d;\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\n * @public\n */\n public readonly sensorSettings: ThematicDisplaySensorSettings;\n\n public equals(other: ThematicDisplay): boolean {\n if (this.displayMode !== other.displayMode)\n return false;\n if (!this.gradientSettings.equals(other.gradientSettings))\n return false;\n if (!this.range.isAlmostEqual(other.range))\n return false;\n if (!this.axis.isAlmostEqual(other.axis))\n return false;\n if (!this.sunDirection.isAlmostEqual(other.sunDirection))\n return false;\n if (!this.sensorSettings.equals(other.sensorSettings))\n return false;\n\n return true;\n }\n\n private constructor(json?: ThematicDisplayProps) {\n if (undefined === json) {\n this.displayMode = ThematicDisplayMode.Height;\n this.gradientSettings = ThematicGradientSettings.fromJSON();\n this.axis = Vector3d.fromJSON();\n this.range = Range1d.fromJSON();\n this.sunDirection = Vector3d.fromJSON();\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON();\n } else {\n this.displayMode = (json.displayMode !== undefined && json.displayMode !== null) ? json.displayMode : ThematicDisplayMode.Height;\n if (this.displayMode < ThematicDisplayMode.Height || this.displayMode > ThematicDisplayMode.HillShade)\n this.displayMode = ThematicDisplayMode.Height;\n this.gradientSettings = ThematicGradientSettings.fromJSON(json.gradientSettings);\n this.axis = Vector3d.fromJSON(json.axis);\n this.range = Range1d.fromJSON(json.range);\n this.sunDirection = Vector3d.fromJSON(json.sunDirection);\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON(json.sensorSettings);\n }\n if (ThematicDisplayMode.Height !== this.displayMode) {\n // Disallow isoline and stepped-with-delimiter gradient modes in any mode other than height.\n if (ThematicGradientMode.IsoLines === this.gradientSettings.mode || ThematicGradientMode.SteppedWithDelimiter === this.gradientSettings.mode) {\n const gradientSettingsJSON = this.gradientSettings.toJSON();\n gradientSettingsJSON.mode = ThematicGradientMode.Smooth;\n this.gradientSettings = ThematicGradientSettings.fromJSON(gradientSettingsJSON);\n }\n if (ThematicDisplayMode.Slope === this.displayMode) {\n if (this.range.low < 0.0)\n this.range.low = 0.0;\n if (this.range.high > 90.0)\n this.range.high = 90.0;\n }\n }\n }\n\n public static fromJSON(json?: ThematicDisplayProps) {\n return new ThematicDisplay(json);\n }\n\n public toJSON(): ThematicDisplayProps {\n const json: ThematicDisplayProps = {\n displayMode: this.displayMode,\n gradientSettings: this.gradientSettings.toJSON(),\n axis: this.axis.toJSON(),\n sunDirection: this.sunDirection.toJSON(),\n range: this.range.toJSON(),\n };\n\n if (this.sensorSettings.sensors.length > 0)\n json.sensorSettings = this.sensorSettings.toJSON();\n\n return json;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ThematicDisplay.js","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;A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AAC,OAAO,CAAC,MAAM,GAAG,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAErD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 { compareNumbers } from \"@itwin/core-bentley\";\nimport { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from \"@itwin/core-geometry\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { Gradient } from \"./Gradient\";\nimport { TextureTransparency } from \"./TextureProps\";\n\n/** A thematic gradient mode used to generate and apply a thematic effect to a scene.\n * @see [[ThematicGradientSettings.mode]]\n * @public\n * @extensions\n */\nexport enum ThematicGradientMode {\n /** Apply a smooth color gradient to the scene. */\n Smooth = 0,\n /** Apply a stepped color gradient to the scene. */\n Stepped = 1,\n /** Apply a stepped color gradient to the scene with delimiters (lines between the color steps). Can only be used with [[ThematicDisplayMode.Height]]. */\n SteppedWithDelimiter = 2,\n /** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */\n IsoLines = 3,\n}\n\n/** Describes how transparency is computed when applying a thematic gradient to a surface.\n * Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.\n * Each surface to which the gradient is applied has its own transparency.\n * The transparency mode determines how these two values are combined to compute the final transparency.\n * @see [[ThematicGradientSettings.transparencyMode]].\n * @public\n * @extensions\n */\nexport enum ThematicGradientTransparencyMode {\n /** Ignore the gradient's transparency, applying only the surface's own transparency. */\n SurfaceOnly = 0,\n /** The final transparency is computed from the product of the surface and gradient alpha channels.\n * (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).\n * If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].\n */\n MultiplySurfaceAndGradient = 1,\n}\n\n/** A color scheme used to generate the colors of a thematic gradient within an applied range.\n * @see [[ThematicGradientSettings.colorScheme]]\n * @see [[ThematicDisplay.range]]\n * @public\n * @extensions\n */\nexport enum ThematicGradientColorScheme {\n /** A color gradient scheme that represents a blue-to-red gradation. */\n BlueRed = 0,\n /** A color gradient scheme that represents a red-to-blue gradation. */\n RedBlue = 1,\n /** A color gradient scheme that represents a monochrome (black-to-white) gradation. */\n Monochrome = 2,\n /** A color gradient scheme that suits a topographic gradation. */\n Topographic = 3,\n /** A color gradient scheme that suits a sea-mountain gradation. */\n SeaMountain = 4,\n /** A custom color gradient scheme configured by the user.\n * @see [[ThematicGradientSettings.customKeys]]\n */\n Custom = 5,\n}\n\n/** JSON representation of a [[ThematicGradientSettings]].\n * @public\n * @extensions\n **/\nexport interface ThematicGradientSettingsProps {\n /** See [[ThematicGradientSettings.mode]]. */\n mode?: ThematicGradientMode;\n /** See [[ThematicGradientSettings.stepCount]]. */\n stepCount?: number;\n /** See [[ThematicGradientSettings.marginColor]]. */\n marginColor?: ColorDefProps;\n /** See [[ThematicGradientSettings.colorScheme]]. */\n colorScheme?: ThematicGradientColorScheme;\n /** See [[ThematicGradientSettings.customKeys. */\n customKeys?: Gradient.KeyColorProps[];\n /** See [[ThematicGradientSettings.colorMix]]. */\n colorMix?: number;\n /** See [[ThematicGradientSettings.transparencyMode]]. */\n transparencyMode?: ThematicGradientTransparencyMode;\n}\n\n/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].\n * @public\n */\nexport class ThematicGradientSettings {\n /** The thematic image mode used to generate the gradient. Defaults to [[ThematicGradientMode.Smooth]]. */\n public readonly mode: ThematicGradientMode;\n /** The step count value used for [[ThematicGradientMode.Stepped]], [[ThematicGradientMode.SteppedWithDelimiter]], and [[ThematicGradientMode.IsoLines]]. Defaults to 10. Cannot be less than 2. */\n public readonly stepCount: number;\n /** The margin color used at the extremes of the gradient, when outside the applied range. Defaults to a black color using [[ColorDef.fromJSON]] with no arguments. */\n public readonly marginColor: ColorDef;\n /** The color scheme used to generate the colors of the gradient color within the applied range. Defaults to [[ThematicGradientColorScheme.BlueRed]]. */\n public readonly colorScheme: ThematicGradientColorScheme;\n /** The key color values that must be provided when using a custom thematic color scheme.\n * Defaults to empty, unless using a custom thematic color scheme. In that case, this defaults to two key colors going from white to black.\n * When using a custom thematic color scheme, there must be at least two entries in here. If there are not, it will revert to the default settings.\n */\n public readonly customKeys: Gradient.KeyColor[];\n /** The percentage to mix in the original color with the thematic display gradient color (0-1).\n * Applies to background map terrain and point clouds only. Defaults to 0. */\n public readonly colorMix: number;\n /** Specifies how the transparency is computed. Defaults to [[ThematicGradientTransparencyMode.SurfaceOnly]].\n * @note This property is ignored for gradients applied using an [[AnalysisStyle]] via [[AnalysisStyleThematic]] - in that case, only the color and\n * transparency of the thematic gradient are applied.\n */\n public readonly transparencyMode: ThematicGradientTransparencyMode;\n\n public static get margin(): number { return .001; } // A fixed portion of the gradient for out of range values.\n public static get contentRange(): number { return 1.0 - 2.0 * ThematicGradientSettings.margin; }\n public static get contentMax(): number { return 1.0 - ThematicGradientSettings.margin; }\n\n public static readonly defaults = new ThematicGradientSettings({});\n\n private static _defaultCustomKeys = [[0.0, 255, 255, 255], [1.0, 0, 0, 0]];\n\n /** @alpha */\n public get textureTransparency(): TextureTransparency {\n let transp = TextureTransparency.Opaque;\n if (ThematicGradientColorScheme.Custom === this.colorScheme) {\n let haveOpaque = false;\n let haveTransparent = false;\n for (const key of this.customKeys) {\n const isOpaque = key.color.isOpaque;\n haveOpaque = haveOpaque || isOpaque;\n haveTransparent = haveTransparent || !isOpaque;\n }\n\n if (haveTransparent)\n transp = haveOpaque ? TextureTransparency.Mixed : TextureTransparency.Translucent;\n }\n\n if (transp !== TextureTransparency.Mixed)\n if (this.marginColor.isOpaque !== (transp === TextureTransparency.Opaque))\n transp = TextureTransparency.Mixed;\n\n return transp;\n }\n\n public equals(other: ThematicGradientSettings): boolean {\n if (this.mode !== other.mode || this.stepCount !== other.stepCount || !this.marginColor.equals(other.marginColor)\n || this.colorScheme !== other.colorScheme || this.customKeys.length !== other.customKeys.length\n || this.colorMix !== other.colorMix || this.transparencyMode !== other.transparencyMode) {\n return false;\n }\n\n return this.customKeys.every((key, index) => Gradient.keyColorEquals(key, other.customKeys[index]));\n }\n\n /** Compares two sets of thematic gradient settings.\n * @param lhs First set of thematic gradient settings to compare\n * @param rhs Second set of thematic gradient settings to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n */\n public static compare(lhs: ThematicGradientSettings, rhs: ThematicGradientSettings): number {\n let diff = 0;\n if ((diff = compareNumbers(lhs.mode, rhs.mode)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.stepCount, rhs.stepCount)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.marginColor.tbgr, rhs.marginColor.tbgr)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.colorScheme, rhs.colorScheme)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.colorMix, rhs.colorMix)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.customKeys.length, rhs.customKeys.length)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.transparencyMode, rhs.transparencyMode)) !== 0)\n return diff;\n\n for (let i = 0; i < lhs.customKeys.length; i++)\n if ((diff = compareNumbers(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)\n return diff;\n\n return diff;\n }\n\n private constructor(json?: ThematicGradientSettingsProps) {\n this.customKeys = [];\n if (undefined === json) {\n this.mode = ThematicGradientMode.Smooth;\n this.stepCount = 10;\n this.marginColor = ColorDef.fromJSON();\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\n this.colorMix = 0.0;\n this.transparencyMode = ThematicGradientTransparencyMode.SurfaceOnly;\n } else {\n this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;\n if (this.mode < ThematicGradientMode.Smooth || this.mode > ThematicGradientMode.IsoLines)\n this.mode = ThematicGradientMode.Smooth;\n\n this.stepCount = (typeof json.stepCount === \"number\") ? json.stepCount : 10;\n if (this.stepCount < 2)\n this.stepCount = 2;\n\n this.marginColor = ColorDef.fromJSON(json.marginColor);\n\n this.colorScheme = (json.colorScheme !== undefined && json.colorScheme !== null) ? json.colorScheme : ThematicGradientColorScheme.BlueRed;\n if (this.colorScheme < ThematicGradientColorScheme.BlueRed || this.colorScheme > ThematicGradientColorScheme.Custom)\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\n\n if (json.customKeys !== undefined && json.customKeys !== null)\n json.customKeys.forEach((key) => this.customKeys.push(new Gradient.KeyColor(key)));\n\n // Enforce 2 entries in custom color keys if violated\n if (this.colorScheme === ThematicGradientColorScheme.Custom && this.customKeys.length < 2) {\n this.customKeys = [];\n for (const keyValue of ThematicGradientSettings._defaultCustomKeys)\n this.customKeys.push(new Gradient.KeyColor({ value: keyValue[0], color: ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));\n }\n\n this.colorMix = json.colorMix ?? 0.0;\n this.transparencyMode = json.transparencyMode ?? ThematicGradientTransparencyMode.SurfaceOnly;\n }\n }\n\n public static fromJSON(json?: ThematicGradientSettingsProps) {\n return json ? new ThematicGradientSettings(json) : this.defaults;\n }\n\n public toJSON(): ThematicGradientSettingsProps {\n const props: ThematicGradientSettingsProps = {};\n if (ThematicGradientMode.Smooth !== this.mode)\n props.mode = this.mode;\n\n if (10 !== this.stepCount)\n props.stepCount = this.stepCount;\n\n const marginColor = this.marginColor.toJSON();\n if (0 !== marginColor)\n props.marginColor = marginColor;\n\n if (ThematicGradientColorScheme.BlueRed !== this.colorScheme)\n props.colorScheme = this.colorScheme;\n\n if (0 !== this.colorMix)\n props.colorMix = this.colorMix;\n\n if (ThematicGradientTransparencyMode.SurfaceOnly !== this.transparencyMode)\n props.transparencyMode = this.transparencyMode;\n\n if (this.customKeys.length > 0)\n props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });\n\n return props;\n }\n\n /** Create a copy of this ThematicGradientSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A ThematicGradientSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: ThematicGradientSettingsProps): ThematicGradientSettings {\n if (undefined === changedProps)\n return ThematicGradientSettings.fromJSON(this.toJSON());\n\n const props: ThematicGradientSettingsProps = {\n mode: undefined !== changedProps.mode ? changedProps.mode : this.mode,\n stepCount: undefined !== changedProps.stepCount ? changedProps.stepCount : this.stepCount,\n marginColor: undefined !== changedProps.marginColor ? changedProps.marginColor : this.marginColor.tbgr,\n colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,\n customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),\n colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,\n transparencyMode: changedProps.transparencyMode ?? this.transparencyMode,\n };\n\n return ThematicGradientSettings.fromJSON(props);\n }\n}\n\n/** JSON representation of a [[ThematicDisplaySensor]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplaySensorProps {\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\n position?: XYZProps;\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\n value?: number;\n}\n\n/** A sensor in world space, used for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n */\nexport class ThematicDisplaySensor {\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\n public position: Readonly<Point3d>;\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\n public readonly value: number;\n\n private constructor(json?: ThematicDisplaySensorProps) {\n if (undefined === json) {\n this.position = Point3d.fromJSON();\n this.value = 0;\n } else {\n this.position = Point3d.fromJSON(json.position);\n this.value = (typeof json.value !== \"number\") ? 0 : json.value;\n if (this.value < 0)\n this.value = 0;\n else if (this.value > 1)\n this.value = 1;\n }\n }\n\n public equals(other: ThematicDisplaySensor): boolean {\n return (this.value === other.value) && this.position.isAlmostEqual(other.position);\n }\n\n public static fromJSON(json?: ThematicDisplaySensorProps) {\n return new ThematicDisplaySensor(json);\n }\n\n public toJSON(): ThematicDisplaySensorProps {\n return {\n position: this.position.toJSON(),\n value: this.value,\n };\n }\n}\n\n/** JSON representation of a [[ThematicDisplaySensorSettings]] for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplaySensorSettingsProps {\n /** This is the list of sensors. Defaults to an empty array. */\n sensors?: ThematicDisplaySensorProps[];\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\n * Defaults to zero.\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\n */\n distanceCutoff?: number;\n}\n\n/** Settings for sensor-based thematic display for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\n * @public\n */\nexport class ThematicDisplaySensorSettings {\n /** This is the list of sensors. Defaults to an empty array. */\n public readonly sensors: ThematicDisplaySensor[];\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\n * Defaults to zero.\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\n */\n public readonly distanceCutoff: number;\n\n private constructor(json?: ThematicDisplaySensorSettingsProps) {\n this.sensors = [];\n if (undefined !== json) {\n if (json.sensors !== undefined && json.sensors !== null) {\n json.sensors.forEach((sensorJSON) => this.sensors.push(ThematicDisplaySensor.fromJSON(sensorJSON)));\n }\n this.distanceCutoff = (typeof json.distanceCutoff === \"number\") ? json.distanceCutoff : 0;\n } else {\n this.distanceCutoff = 0;\n }\n }\n\n public equals(other: ThematicDisplaySensorSettings): boolean {\n if (this.distanceCutoff !== other.distanceCutoff)\n return false;\n\n const thisSensors = this.sensors;\n const otherSensors = other.sensors;\n\n if (thisSensors.length !== otherSensors.length)\n return false;\n\n for (let i = 0; i < thisSensors.length; i++) {\n if (!thisSensors[i].equals(otherSensors[i]))\n return false;\n }\n\n return true;\n }\n\n public static fromJSON(json?: ThematicDisplaySensorSettingsProps) {\n return new ThematicDisplaySensorSettings(json);\n }\n\n public toJSON(): ThematicDisplaySensorSettingsProps {\n const json: ThematicDisplaySensorSettingsProps = {};\n\n json.sensors = [];\n for (const sensor of this.sensors) {\n json.sensors.push(sensor.toJSON());\n }\n\n json.distanceCutoff = this.distanceCutoff;\n\n return json;\n }\n}\n\n/** The thematic display mode. This determines how to apply the thematic color gradient to the geometry.\n * @public\n * @extensions\n */\nexport enum ThematicDisplayMode {\n /** The color gradient will be mapped to surface geometry and point clouds based on world height in meters. */\n Height = 0,\n /** The color gradient will be mapped to surface geometry and point clouds using inverse distance weighting based on world positions and corresponding values from a list of sensors.\n * @note Performance will decrease as more sensors are added.\n */\n InverseDistanceWeightedSensors = 1,\n /** The color gradient will be mapped to surface geometry based on the slope of the surface. The slope value is calculated based on the angle between the surface and the axis specified in the associated [[ThematicDisplay]] object.\n * @note This display mode does not affect point clouds.\n */\n Slope = 2,\n /** The color gradient will be mapped to surface geometry based on the direction of a sun shining on the surface.\n * @note This display mode does not affect point clouds.\n */\n HillShade = 3,\n}\n\n/** JSON representation of the thematic display setup of a [[DisplayStyle3d]].\n * @public\n * @extensions\n */\nexport interface ThematicDisplayProps {\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\n displayMode?: ThematicDisplayMode;\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\n gradientSettings?: ThematicGradientSettingsProps;\n /** The range to use when applying the thematic gradient for height and slope mode.\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\n * For [[ThematicDisplayMode.Slope]], this is a range in degrees with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\n * Defaults to a null range.\n */\n range?: Range1dProps;\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], calculating the slope of a surface is done in relation to the axis. Defaults to {0,0,0}. */\n axis?: XYZProps;\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\n sunDirection?: XYZProps;\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\n * @public\n */\n sensorSettings?: ThematicDisplaySensorSettingsProps;\n}\n\n/** The thematic display setup of a [[DisplayStyle3d]].\n * Thematic display allows a user to colorize a scene using a color gradient in a way that provides a visual cue about certain attributes of the rendered geometry. This scene colorization will be done based on certain geometric attributes like height, surface slope, position of surfaces relative to a sun position, or geometric position relative to a list of sensors.\n * The documentation for [[ThematicDisplayMode]] describes how each mode colorizes the scene.\n * @note Applying thematic display to geometry prevents shadows from applying to the same geometry.\n * @public\n */\nexport class ThematicDisplay {\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\n public readonly displayMode: ThematicDisplayMode;\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\n public readonly gradientSettings: ThematicGradientSettings;\n /** The range to use when applying the thematic gradient for height and slope mode.\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\n * For [[ThematicDisplayMode.Slope]], this is a range in radians with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\n * Defaults to a null range.\n */\n public readonly range: Range1d;\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], the slope of a surface is calculated in relation to this axis. Defaults to {0,0,0}. */\n public readonly axis: Vector3d;\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\n public readonly sunDirection: Vector3d;\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\n * @public\n */\n public readonly sensorSettings: ThematicDisplaySensorSettings;\n\n public equals(other: ThematicDisplay): boolean {\n if (this.displayMode !== other.displayMode)\n return false;\n if (!this.gradientSettings.equals(other.gradientSettings))\n return false;\n if (!this.range.isAlmostEqual(other.range))\n return false;\n if (!this.axis.isAlmostEqual(other.axis))\n return false;\n if (!this.sunDirection.isAlmostEqual(other.sunDirection))\n return false;\n if (!this.sensorSettings.equals(other.sensorSettings))\n return false;\n\n return true;\n }\n\n private constructor(json?: ThematicDisplayProps) {\n if (undefined === json) {\n this.displayMode = ThematicDisplayMode.Height;\n this.gradientSettings = ThematicGradientSettings.fromJSON();\n this.axis = Vector3d.fromJSON();\n this.range = Range1d.fromJSON();\n this.sunDirection = Vector3d.fromJSON();\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON();\n } else {\n this.displayMode = (json.displayMode !== undefined && json.displayMode !== null) ? json.displayMode : ThematicDisplayMode.Height;\n if (this.displayMode < ThematicDisplayMode.Height || this.displayMode > ThematicDisplayMode.HillShade)\n this.displayMode = ThematicDisplayMode.Height;\n this.gradientSettings = ThematicGradientSettings.fromJSON(json.gradientSettings);\n this.axis = Vector3d.fromJSON(json.axis);\n this.range = Range1d.fromJSON(json.range);\n this.sunDirection = Vector3d.fromJSON(json.sunDirection);\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON(json.sensorSettings);\n }\n if (ThematicDisplayMode.Height !== this.displayMode) {\n // Disallow isoline and stepped-with-delimiter gradient modes in any mode other than height.\n if (ThematicGradientMode.IsoLines === this.gradientSettings.mode || ThematicGradientMode.SteppedWithDelimiter === this.gradientSettings.mode) {\n const gradientSettingsJSON = this.gradientSettings.toJSON();\n gradientSettingsJSON.mode = ThematicGradientMode.Smooth;\n this.gradientSettings = ThematicGradientSettings.fromJSON(gradientSettingsJSON);\n }\n if (ThematicDisplayMode.Slope === this.displayMode) {\n if (this.range.low < 0.0)\n this.range.low = 0.0;\n if (this.range.high > 90.0)\n this.range.high = 90.0;\n }\n }\n }\n\n public static fromJSON(json?: ThematicDisplayProps) {\n return new ThematicDisplay(json);\n }\n\n public toJSON(): ThematicDisplayProps {\n const json: ThematicDisplayProps = {\n displayMode: this.displayMode,\n gradientSettings: this.gradientSettings.toJSON(),\n axis: this.axis.toJSON(),\n sunDirection: this.sunDirection.toJSON(),\n range: this.range.toJSON(),\n };\n\n if (this.sensorSettings.sensors.length > 0)\n json.sensorSettings = this.sensorSettings.toJSON();\n\n return json;\n }\n}\n"]}
|
package/lib/esm/Tween.d.ts
CHANGED
package/lib/esm/Tween.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tween.d.ts","sourceRoot":"","sources":["../../src/Tween.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;GASG;AAMH;;;;;;GAMG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,wBAAwB,CAAW;IAC3C,OAAO,CAAC,OAAO,CAAK;IACb,MAAM;IAEN,MAAM;IAIN,SAAS;IAIT,GAAG,CAAC,KAAK,EAAE,KAAK;IAKhB,MAAM,CAAC,KAAK,EAAE,KAAK;IAKnB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO;IAiC/C,mGAAmG;IAC5F,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;QAC9B,EAAE,EAAE,GAAG,CAAC;QACR,QAAQ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AQ,CAAC,EAAE,aAAa;IAKnC,MAAM,CAAC,QAAQ,EAAE,aAAa;IAK9B,MAAM,CAAC,IAAI,EAAE,MAAM;CAmG3B;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;kBAEL,MAAM;;;gBAMR,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAST,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAUT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAUT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAUT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAMT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAeT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAST,MAAM;iBAUL,MAAM;mBAUJ,MAAM;;;gBAiBT,MAAM;iBAKL,MAAM;mBAKJ,MAAM;;;gBAUT,MAAM;iBAIL,MAAM;mBAUJ,MAAM;;CAOpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;gBAEZ,GAAG,KAAK,MAAM;gBAed,GAAG,KAAK,MAAM;oBAYV,GAAG,KAAK,MAAM;;qBAuBf,MAAM,MAAM,MAAM,KAAK,MAAM;uBAI3B,MAAM,KAAK,MAAM;uBAOnB,MAAM;yBAeF,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK,MAAM;;CAQzE,CAAC"}
|
package/lib/esm/Tween.js
CHANGED
|
@@ -94,7 +94,7 @@ export class Tween {
|
|
|
94
94
|
_group;
|
|
95
95
|
_object;
|
|
96
96
|
_isPaused = false;
|
|
97
|
-
_pauseStart;
|
|
97
|
+
_pauseStart = 0;
|
|
98
98
|
_valuesStart = {};
|
|
99
99
|
_valuesEnd = {};
|
|
100
100
|
_valuesStartRepeat = {};
|
|
@@ -181,7 +181,7 @@ export class Tween {
|
|
|
181
181
|
if (this._isPaused || !this._isPlaying)
|
|
182
182
|
return this;
|
|
183
183
|
this._isPaused = true;
|
|
184
|
-
this._pauseStart = time
|
|
184
|
+
this._pauseStart = time ?? Date.now();
|
|
185
185
|
this._group.remove(this);
|
|
186
186
|
return this;
|
|
187
187
|
}
|
|
@@ -189,6 +189,8 @@ export class Tween {
|
|
|
189
189
|
if (!this._isPaused || !this._isPlaying)
|
|
190
190
|
return this;
|
|
191
191
|
this._isPaused = false;
|
|
192
|
+
// _startTime is always valid when _isPlaying is true.
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
192
194
|
this._startTime += (time === undefined ? Date.now() : time) - this._pauseStart;
|
|
193
195
|
this._pauseStart = 0;
|
|
194
196
|
this._group.add(this);
|
package/lib/esm/Tween.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tween.js","sourceRoot":"","sources":["../../src/Tween.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;;;;;GASG;AAEH,oCAAoC;AACpC,iCAAiC;AACjC,yDAAyD;AAEzD;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACT,OAAO,GAAQ,EAAE,CAAC;IAClB,wBAAwB,GAAQ,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,CAAC;IACb,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAEnC,MAAM;QACX,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEM,SAAS;QACd,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAEM,GAAG,CAAC,KAAY;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,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AAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,CAAS,EAAE,EAAE;YACxE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;YAC3B,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;YAC3B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAClB,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAE,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;QACjG,CAAC;KACF;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tween\n */\n\n/**\n * Adapted from:\n *\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\n\n// cSpell:ignore tweens yoyo catmull\n/* eslint-disable guard-for-in */\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** A group of `Tween`s. This class is called `Group` in the tween.js library.\n * @note Unlike tween.js, we do NOT create any global instances of this class\n * like the global object `TWEEN` in tween.js. You must create an instance of this class, and then create [[Tween]]s by\n * calling [[Tweens.create]] or by calling `new Tween()` and pass your Group as its first argument.\n * @see The [tween.js users guide](https://github.com/tweenjs/tween.js/blob/master/docs/user_guide.md)\n * @public\n */\nexport class Tweens {\n private _tweens: any = {};\n private _tweensAddedDuringUpdate: any = {};\n private _nextId = 0;\n public nextId() { return this._nextId++; }\n\n public getAll() {\n return Object.keys(this._tweens).map((tweenId) => this._tweens[tweenId]);\n }\n\n public removeAll() {\n this._tweens = {};\n }\n\n public add(tween: Tween) {\n this._tweens[tween.getId()] = tween;\n this._tweensAddedDuringUpdate[tween.getId()] = tween;\n }\n\n public remove(tween: Tween) {\n delete this._tweens[tween.getId()];\n delete this._tweensAddedDuringUpdate[tween.getId()];\n }\n\n public update(time?: number, preserve?: boolean) {\n let tweenIds = Object.keys(this._tweens);\n\n if (tweenIds.length === 0)\n return false;\n\n time = time !== undefined ? time : Date.now();\n\n // Tweens are updated in \"batches\". If you add a new tween during an\n // update, then the new tween will be updated in the next batch.\n // If you remove a tween during an update, it may or may not be updated.\n // However, if the removed tween was added during the current batch,\n // then it will not be updated.\n while (tweenIds.length > 0) {\n this._tweensAddedDuringUpdate = {};\n\n for (const tweenId of tweenIds) {\n const tween = this._tweens[tweenId];\n if (tween && tween.update(time) === false) {\n tween._isPlaying = false;\n\n if (!preserve) {\n delete this._tweens[tweenId];\n }\n }\n }\n\n tweenIds = Object.keys(this._tweensAddedDuringUpdate);\n }\n\n return true;\n }\n\n /** Create a new Tween owned by this Group. Equivalent to `new TWEEN.Tween` in tween.js library. */\n public create(from: any, opts?: {\n to: any;\n duration: number;\n onUpdate: UpdateCallback;\n onComplete?: TweenCallback;\n delay?: number;\n start?: boolean;\n easing?: EasingFunction;\n interpolation?: InterpolationFunction;\n }) {\n const t = new Tween(this, from);\n if (opts) {\n t.to(opts.to)\n .duration(opts.duration)\n .onUpdate(opts.onUpdate)\n .delay(opts.delay)\n .easing(opts.easing)\n .interpolation(opts.interpolation)\n .onComplete(opts.onComplete);\n if (opts.start)\n t.start();\n }\n return t;\n }\n}\n\n/**\n * @public\n * @extensions\n */\nexport type TweenCallback = (obj: any) => void;\n/**\n * @public\n * @extensions\n */\nexport type UpdateCallback = (obj: any, t: number) => void;\n/**\n * @public\n * @extensions\n */\nexport type EasingFunction = (k: number) => number;\n/**\n * @public\n * @extensions\n */\nexport type InterpolationFunction = (v: any, k: number) => number;\n\n/** A Tween for interpolating values of an object. Instances of this class are owned by a `Tweens` group.\n * @see The [tween.js users guide](https://github.com/tweenjs/tween.js/blob/master/docs/user_guide.md)\n * @public\n */\nexport class Tween {\n private _isPaused = false;\n private _pauseStart?: number;\n private _valuesStart: any = {};\n private _valuesEnd: any = {};\n private _valuesStartRepeat: any = {};\n private _duration = 1000;\n private _repeat = 0;\n private _repeatDelayTime?: number;\n private _yoyo = false;\n private _isPlaying = false;\n private _reversed = false;\n private _delayTime = 0;\n private _startTime?: number;\n private _easingFunction = Easing.Linear.None;\n private _interpolationFunction = Interpolation.Linear;\n private _chainedTweens: Tween[] = [];\n private _onStartCallback?: TweenCallback;\n private _onStartCallbackFired = false;\n private _onUpdateCallback?: UpdateCallback;\n private _onRepeatCallback?: TweenCallback;\n private _onCompleteCallback?: TweenCallback;\n private _onStopCallback?: TweenCallback;\n private _id: number;\n\n constructor(private _group: Tweens, private _object: any) {\n this._id = _group.nextId();\n }\n\n public getId() { return this._id; }\n public get isPlaying() { return this._isPlaying; }\n public get isPaused() { return this._isPaused; }\n\n public to(properties: any, duration?: number) {\n this._valuesEnd = Object.create(properties);\n\n if (duration !== undefined)\n this._duration = duration;\n\n return this;\n }\n\n public duration(d: number) {\n this._duration = d;\n return this;\n }\n\n public start(time?: string | number) {\n this._group.add(this);\n this._isPlaying = true;\n this._isPaused = false;\n this._onStartCallbackFired = false;\n this._startTime = time !== undefined ? typeof time === \"string\" ? Date.now() + parseFloat(time) : time : Date.now();\n this._startTime += this._delayTime;\n\n for (const property in this._valuesEnd) {\n // Check if an Array was provided as property value\n if (this._valuesEnd[property] instanceof Array) {\n if (this._valuesEnd[property].length === 0)\n continue;\n\n // Create a local copy of the Array with the start value at the front\n this._valuesEnd[property] = [this._object[property]].concat(this._valuesEnd[property]);\n }\n\n // If `to()` specifies a property that doesn't exist in the source object,\n // we should not set that property in the object\n if (this._object[property] === undefined)\n continue;\n\n // Save the starting value, but only once.\n if (typeof (this._valuesStart[property]) === \"undefined\")\n this._valuesStart[property] = this._object[property];\n\n if ((this._valuesStart[property] instanceof Array) === false)\n this._valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n\n this._valuesStartRepeat[property] = this._valuesStart[property] || 0;\n }\n\n return this;\n }\n\n public stop() {\n if (!this._isPlaying)\n return this;\n\n this._group.remove(this);\n this._isPlaying = false;\n this._isPaused = false;\n\n if (this._onStopCallback !== undefined)\n this._onStopCallback(this._object);\n\n this.stopChainedTweens();\n return this;\n }\n\n public end() {\n this.update(Infinity);\n return this;\n }\n\n public pause(time: number) {\n if (this._isPaused || !this._isPlaying)\n return this;\n\n this._isPaused = true;\n this._pauseStart = time === undefined ? Date.now() : time;\n this._group.remove(this);\n return this;\n }\n\n public resume(time?: number) {\n if (!this._isPaused || !this._isPlaying)\n return this;\n\n this._isPaused = false;\n this._startTime! += (time === undefined ? Date.now() : time) - this._pauseStart!;\n this._pauseStart = 0;\n this._group.add(this);\n return this;\n }\n\n public stopChainedTweens() {\n for (let i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n this._chainedTweens[i].stop();\n }\n }\n\n public group(group: Tweens) {\n this._group = group;\n return this;\n }\n\n public delay(amount?: number) {\n if (undefined !== amount)\n this._delayTime = amount;\n return this;\n }\n\n public repeat(times: number) {\n this._repeat = times;\n return this;\n }\n\n public repeatDelay(amount: number) {\n this._repeatDelayTime = amount;\n return this;\n }\n\n public yoyo(yoyo: boolean) {\n this._yoyo = yoyo;\n return this;\n }\n\n public easing(easingFunction?: EasingFunction) {\n if (easingFunction)\n this._easingFunction = easingFunction;\n return this;\n }\n\n public interpolation(interpolationFunction?: InterpolationFunction) {\n if (interpolationFunction)\n this._interpolationFunction = interpolationFunction;\n return this;\n }\n\n public chain(...tweens: Tween[]) {\n this._chainedTweens = tweens;\n return this;\n }\n\n public onStart(callback: TweenCallback) {\n this._onStartCallback = callback;\n return this;\n }\n\n public onUpdate(callback: UpdateCallback) {\n this._onUpdateCallback = callback;\n return this;\n }\n\n public onRepeat(callback: TweenCallback) {\n this._onRepeatCallback = callback;\n return this;\n }\n\n public onComplete(callback?: TweenCallback) {\n this._onCompleteCallback = callback;\n return this;\n }\n\n public onStop(callback: TweenCallback) {\n this._onStopCallback = callback;\n return this;\n }\n\n public update(time: number) {\n if (undefined === this._startTime || time < this._startTime)\n return true;\n\n if (this._onStartCallbackFired === false) {\n if (this._onStartCallback !== undefined) {\n this._onStartCallback(this._object);\n }\n\n this._onStartCallbackFired = true;\n }\n\n let elapsed = (time - this._startTime) / this._duration;\n elapsed = (this._duration === 0 || elapsed > 1) ? 1 : elapsed;\n\n const value = this._easingFunction(elapsed);\n\n let property: any;\n\n for (property in this._valuesEnd) {\n // Don't update properties that do not exist in the source object\n if (this._valuesStart[property] === undefined)\n continue;\n\n const start = this._valuesStart[property] || 0;\n let end = this._valuesEnd[property];\n\n if (end instanceof Array) {\n this._object[property] = this._interpolationFunction(end, value);\n } else {\n // Parses relative end values with start as base (e.g.: +10, -3)\n if (typeof (end) === \"string\") {\n\n if (end.charAt(0) === \"+\" || end.charAt(0) === \"-\")\n end = start + parseFloat(end);\n else\n end = parseFloat(end);\n }\n\n // Protect against non numeric properties.\n if (typeof (end) === \"number\")\n this._object[property] = start + (end - start) * value;\n }\n }\n\n if (this._onUpdateCallback !== undefined)\n this._onUpdateCallback(this._object, elapsed);\n\n if (elapsed === 1) {\n if (this._repeat > 0) {\n if (isFinite(this._repeat))\n this._repeat--;\n\n // Reassign starting values, restart by making startTime = now\n for (property in this._valuesStartRepeat) {\n\n if (typeof (this._valuesEnd[property]) === \"string\") {\n this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);\n }\n\n if (this._yoyo) {\n const tmp = this._valuesStartRepeat[property];\n\n this._valuesStartRepeat[property] = this._valuesEnd[property];\n this._valuesEnd[property] = tmp;\n }\n\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n\n if (this._yoyo)\n this._reversed = !this._reversed;\n\n if (this._repeatDelayTime !== undefined)\n this._startTime = time + this._repeatDelayTime;\n else\n this._startTime = time + this._delayTime;\n\n if (this._onRepeatCallback !== undefined)\n this._onRepeatCallback(this._object);\n\n return true;\n\n } else {\n\n if (this._onCompleteCallback !== undefined)\n this._onCompleteCallback(this._object);\n\n for (let i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n // Make the chained tweens start exactly at the time they should,\n // even if the `update()` method was called way past the duration of the tween\n this._chainedTweens[i].start(this._startTime + this._duration);\n }\n return false;\n }\n\n }\n return true;\n }\n}\n\n/** Easing functions from tween.js\n * @public\n */\nexport const Easing = {\n Linear: {\n None: (k: number) => {\n return k;\n },\n },\n\n Quadratic: {\n In: (k: number) => {\n return k * k;\n },\n\n Out: (k: number) => {\n return k * (2 - k);\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return - 0.5 * (--k * (k - 2) - 1);\n },\n },\n\n Cubic: {\n In: (k: number) => {\n return k * k * k;\n },\n\n Out: (k: number) => {\n return --k * k * k + 1;\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n },\n\n Quartic: {\n In: (k: number) => {\n return k * k * k * k;\n },\n\n Out: (k: number) => {\n return 1 - (--k * k * k * k);\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n\n return - 0.5 * ((k -= 2) * k * k * k - 2);\n },\n },\n\n Quintic: {\n In: (k: number) => {\n return k * k * k * k * k;\n },\n\n Out: (k: number) => {\n return --k * k * k * k * k + 1;\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n },\n\n Sinusoidal: {\n In: (k: number) => {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n\n Out: (k: number) => {\n return Math.sin(k * Math.PI / 2);\n },\n\n InOut: (k: number) => {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n },\n\n Exponential: {\n In: (k: number) => {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n\n Out: (k: number) => {\n return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k);\n },\n\n InOut: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n if ((k *= 2) < 1)\n return 0.5 * Math.pow(1024, k - 1);\n\n return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2);\n },\n },\n\n Circular: {\n In: (k: number) => {\n return 1 - Math.sqrt(1 - k * k);\n },\n\n Out: (k: number) => {\n return Math.sqrt(1 - (--k * k));\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1)\n return - 0.5 * (Math.sqrt(1 - k * k) - 1);\n\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n },\n\n Elastic: {\n In: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n return -Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);\n },\n\n Out: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n return Math.pow(2, -10 * k) * Math.sin((k - 0.1) * 5 * Math.PI) + 1;\n },\n\n InOut: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n k *= 2;\n\n if (k < 1)\n return -0.5 * Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);\n\n return 0.5 * Math.pow(2, -10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI) + 1;\n },\n },\n\n Back: {\n In: (k: number) => {\n const s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n\n Out: (k: number) => {\n const s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n\n InOut: (k: number) => {\n const s = 1.70158 * 1.525;\n if ((k *= 2) < 1)\n return 0.5 * (k * k * ((s + 1) * k - s));\n\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n },\n\n Bounce: {\n In: (k: number) => {\n return 1 - Easing.Bounce.Out(1 - k);\n },\n\n Out: (k: number) => {\n if (k < (1 / 2.75))\n return 7.5625 * k * k;\n if (k < (2 / 2.75))\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n if (k < (2.5 / 2.75))\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n },\n\n InOut: (k: number) => {\n if (k < 0.5)\n return Easing.Bounce.In(k * 2) * 0.5;\n\n return Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5;\n },\n },\n};\n\n/** Interpolation functions from tween.js\n * @public\n */\nexport const Interpolation = {\n\n Linear: (v: any, k: number) => {\n const m = v.length - 1;\n const f = m * k;\n const i = Math.floor(f);\n const fn = Interpolation.Utils.Linear;\n\n if (k < 0)\n return fn(v[0], v[1], f);\n\n if (k > 1)\n return fn(v[m], v[m - 1], m - f);\n\n return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n },\n\n Bezier: (v: any, k: number) => {\n let b = 0;\n const n = v.length - 1;\n const pw = Math.pow;\n const bn = Interpolation.Utils.Bernstein;\n\n for (let i = 0; i <= n; i++)\n b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n\n return b;\n },\n\n CatmullRom: (v: any, k: number) => {\n const m = v.length - 1;\n let f = m * k;\n let i = Math.floor(f);\n const fn = Interpolation.Utils.CatmullRom;\n\n if (v[0] === v[m]) {\n if (k < 0) {\n i = Math.floor(f = m * (1 + k));\n }\n return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n } else {\n if (k < 0)\n return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n\n if (k > 1)\n return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n\n return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n }\n },\n\n Utils: {\n Linear: (p0: number, p1: number, t: number) => {\n return (p1 - p0) * t + p0;\n },\n\n Bernstein: (n: number, i: number) => {\n const fc = Interpolation.Utils.Factorial;\n return fc(n) / fc(i) / fc(n - i);\n },\n\n Factorial: (() => {\n const a = [1];\n return (n: number) => {\n let s = 1;\n\n if (a[n])\n return a[n];\n\n for (let i = n; i > 1; i--)\n s *= i;\n\n a[n] = s;\n return s;\n };\n\n })(),\n\n CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => {\n const v0 = (p2 - p0) * 0.5;\n const v1 = (p3 - p1) * 0.5;\n const t2 = t * t;\n const t3 = t * t2;\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (- 3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n },\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Tween.js","sourceRoot":"","sources":["../../src/Tween.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;;;;;;;GASG;AAEH,oCAAoC;AACpC,iCAAiC;AACjC,yDAAyD;AAEzD;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACT,OAAO,GAAQ,EAAE,CAAC;IAClB,wBAAwB,GAAQ,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,CAAC;IACb,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAEnC,MAAM;QACX,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,C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GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;oBACxB,CAAC,IAAI,CAAC,CAAC;gBAET,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACT,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;QAEJ,CAAC,CAAC,EAAE;QAEJ,UAAU,EAAE,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,CAAS,EAAE,EAAE;YACxE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;YAC3B,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;YAC3B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAClB,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAE,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;QACjG,CAAC;KACF;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tween\n */\n\n/**\n * Adapted from:\n *\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\n\n// cSpell:ignore tweens yoyo catmull\n/* eslint-disable guard-for-in */\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** A group of `Tween`s. This class is called `Group` in the tween.js library.\n * @note Unlike tween.js, we do NOT create any global instances of this class\n * like the global object `TWEEN` in tween.js. You must create an instance of this class, and then create [[Tween]]s by\n * calling [[Tweens.create]] or by calling `new Tween()` and pass your Group as its first argument.\n * @see The [tween.js users guide](https://github.com/tweenjs/tween.js/blob/master/docs/user_guide.md)\n * @public\n */\nexport class Tweens {\n private _tweens: any = {};\n private _tweensAddedDuringUpdate: any = {};\n private _nextId = 0;\n public nextId() { return this._nextId++; }\n\n public getAll() {\n return Object.keys(this._tweens).map((tweenId) => this._tweens[tweenId]);\n }\n\n public removeAll() {\n this._tweens = {};\n }\n\n public add(tween: Tween) {\n this._tweens[tween.getId()] = tween;\n this._tweensAddedDuringUpdate[tween.getId()] = tween;\n }\n\n public remove(tween: Tween) {\n delete this._tweens[tween.getId()];\n delete this._tweensAddedDuringUpdate[tween.getId()];\n }\n\n public update(time?: number, preserve?: boolean) {\n let tweenIds = Object.keys(this._tweens);\n\n if (tweenIds.length === 0)\n return false;\n\n time = time !== undefined ? time : Date.now();\n\n // Tweens are updated in \"batches\". If you add a new tween during an\n // update, then the new tween will be updated in the next batch.\n // If you remove a tween during an update, it may or may not be updated.\n // However, if the removed tween was added during the current batch,\n // then it will not be updated.\n while (tweenIds.length > 0) {\n this._tweensAddedDuringUpdate = {};\n\n for (const tweenId of tweenIds) {\n const tween = this._tweens[tweenId];\n if (tween && tween.update(time) === false) {\n tween._isPlaying = false;\n\n if (!preserve) {\n delete this._tweens[tweenId];\n }\n }\n }\n\n tweenIds = Object.keys(this._tweensAddedDuringUpdate);\n }\n\n return true;\n }\n\n /** Create a new Tween owned by this Group. Equivalent to `new TWEEN.Tween` in tween.js library. */\n public create(from: any, opts?: {\n to: any;\n duration: number;\n onUpdate: UpdateCallback;\n onComplete?: TweenCallback;\n delay?: number;\n start?: boolean;\n easing?: EasingFunction;\n interpolation?: InterpolationFunction;\n }) {\n const t = new Tween(this, from);\n if (opts) {\n t.to(opts.to)\n .duration(opts.duration)\n .onUpdate(opts.onUpdate)\n .delay(opts.delay)\n .easing(opts.easing)\n .interpolation(opts.interpolation)\n .onComplete(opts.onComplete);\n if (opts.start)\n t.start();\n }\n return t;\n }\n}\n\n/**\n * @public\n * @extensions\n */\nexport type TweenCallback = (obj: any) => void;\n/**\n * @public\n * @extensions\n */\nexport type UpdateCallback = (obj: any, t: number) => void;\n/**\n * @public\n * @extensions\n */\nexport type EasingFunction = (k: number) => number;\n/**\n * @public\n * @extensions\n */\nexport type InterpolationFunction = (v: any, k: number) => number;\n\n/** A Tween for interpolating values of an object. Instances of this class are owned by a `Tweens` group.\n * @see The [tween.js users guide](https://github.com/tweenjs/tween.js/blob/master/docs/user_guide.md)\n * @public\n */\nexport class Tween {\n private _isPaused = false;\n private _pauseStart = 0;\n private _valuesStart: any = {};\n private _valuesEnd: any = {};\n private _valuesStartRepeat: any = {};\n private _duration = 1000;\n private _repeat = 0;\n private _repeatDelayTime?: number;\n private _yoyo = false;\n private _isPlaying = false;\n private _reversed = false;\n private _delayTime = 0;\n private _startTime?: number;\n private _easingFunction = Easing.Linear.None;\n private _interpolationFunction = Interpolation.Linear;\n private _chainedTweens: Tween[] = [];\n private _onStartCallback?: TweenCallback;\n private _onStartCallbackFired = false;\n private _onUpdateCallback?: UpdateCallback;\n private _onRepeatCallback?: TweenCallback;\n private _onCompleteCallback?: TweenCallback;\n private _onStopCallback?: TweenCallback;\n private _id: number;\n\n constructor(private _group: Tweens, private _object: any) {\n this._id = _group.nextId();\n }\n\n public getId() { return this._id; }\n public get isPlaying() { return this._isPlaying; }\n public get isPaused() { return this._isPaused; }\n\n public to(properties: any, duration?: number) {\n this._valuesEnd = Object.create(properties);\n\n if (duration !== undefined)\n this._duration = duration;\n\n return this;\n }\n\n public duration(d: number) {\n this._duration = d;\n return this;\n }\n\n public start(time?: string | number) {\n this._group.add(this);\n this._isPlaying = true;\n this._isPaused = false;\n this._onStartCallbackFired = false;\n this._startTime = time !== undefined ? typeof time === \"string\" ? Date.now() + parseFloat(time) : time : Date.now();\n this._startTime += this._delayTime;\n\n for (const property in this._valuesEnd) {\n // Check if an Array was provided as property value\n if (this._valuesEnd[property] instanceof Array) {\n if (this._valuesEnd[property].length === 0)\n continue;\n\n // Create a local copy of the Array with the start value at the front\n this._valuesEnd[property] = [this._object[property]].concat(this._valuesEnd[property]);\n }\n\n // If `to()` specifies a property that doesn't exist in the source object,\n // we should not set that property in the object\n if (this._object[property] === undefined)\n continue;\n\n // Save the starting value, but only once.\n if (typeof (this._valuesStart[property]) === \"undefined\")\n this._valuesStart[property] = this._object[property];\n\n if ((this._valuesStart[property] instanceof Array) === false)\n this._valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n\n this._valuesStartRepeat[property] = this._valuesStart[property] || 0;\n }\n\n return this;\n }\n\n public stop() {\n if (!this._isPlaying)\n return this;\n\n this._group.remove(this);\n this._isPlaying = false;\n this._isPaused = false;\n\n if (this._onStopCallback !== undefined)\n this._onStopCallback(this._object);\n\n this.stopChainedTweens();\n return this;\n }\n\n public end() {\n this.update(Infinity);\n return this;\n }\n\n public pause(time: number) {\n if (this._isPaused || !this._isPlaying)\n return this;\n\n this._isPaused = true;\n this._pauseStart = time ?? Date.now();\n this._group.remove(this);\n return this;\n }\n\n public resume(time?: number) {\n if (!this._isPaused || !this._isPlaying)\n return this;\n\n this._isPaused = false;\n // _startTime is always valid when _isPlaying is true.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._startTime! += (time === undefined ? Date.now() : time) - this._pauseStart;\n this._pauseStart = 0;\n this._group.add(this);\n return this;\n }\n\n public stopChainedTweens() {\n for (let i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n this._chainedTweens[i].stop();\n }\n }\n\n public group(group: Tweens) {\n this._group = group;\n return this;\n }\n\n public delay(amount?: number) {\n if (undefined !== amount)\n this._delayTime = amount;\n return this;\n }\n\n public repeat(times: number) {\n this._repeat = times;\n return this;\n }\n\n public repeatDelay(amount: number) {\n this._repeatDelayTime = amount;\n return this;\n }\n\n public yoyo(yoyo: boolean) {\n this._yoyo = yoyo;\n return this;\n }\n\n public easing(easingFunction?: EasingFunction) {\n if (easingFunction)\n this._easingFunction = easingFunction;\n return this;\n }\n\n public interpolation(interpolationFunction?: InterpolationFunction) {\n if (interpolationFunction)\n this._interpolationFunction = interpolationFunction;\n return this;\n }\n\n public chain(...tweens: Tween[]) {\n this._chainedTweens = tweens;\n return this;\n }\n\n public onStart(callback: TweenCallback) {\n this._onStartCallback = callback;\n return this;\n }\n\n public onUpdate(callback: UpdateCallback) {\n this._onUpdateCallback = callback;\n return this;\n }\n\n public onRepeat(callback: TweenCallback) {\n this._onRepeatCallback = callback;\n return this;\n }\n\n public onComplete(callback?: TweenCallback) {\n this._onCompleteCallback = callback;\n return this;\n }\n\n public onStop(callback: TweenCallback) {\n this._onStopCallback = callback;\n return this;\n }\n\n public update(time: number) {\n if (undefined === this._startTime || time < this._startTime)\n return true;\n\n if (this._onStartCallbackFired === false) {\n if (this._onStartCallback !== undefined) {\n this._onStartCallback(this._object);\n }\n\n this._onStartCallbackFired = true;\n }\n\n let elapsed = (time - this._startTime) / this._duration;\n elapsed = (this._duration === 0 || elapsed > 1) ? 1 : elapsed;\n\n const value = this._easingFunction(elapsed);\n\n let property: any;\n\n for (property in this._valuesEnd) {\n // Don't update properties that do not exist in the source object\n if (this._valuesStart[property] === undefined)\n continue;\n\n const start = this._valuesStart[property] || 0;\n let end = this._valuesEnd[property];\n\n if (end instanceof Array) {\n this._object[property] = this._interpolationFunction(end, value);\n } else {\n // Parses relative end values with start as base (e.g.: +10, -3)\n if (typeof (end) === \"string\") {\n\n if (end.charAt(0) === \"+\" || end.charAt(0) === \"-\")\n end = start + parseFloat(end);\n else\n end = parseFloat(end);\n }\n\n // Protect against non numeric properties.\n if (typeof (end) === \"number\")\n this._object[property] = start + (end - start) * value;\n }\n }\n\n if (this._onUpdateCallback !== undefined)\n this._onUpdateCallback(this._object, elapsed);\n\n if (elapsed === 1) {\n if (this._repeat > 0) {\n if (isFinite(this._repeat))\n this._repeat--;\n\n // Reassign starting values, restart by making startTime = now\n for (property in this._valuesStartRepeat) {\n\n if (typeof (this._valuesEnd[property]) === \"string\") {\n this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);\n }\n\n if (this._yoyo) {\n const tmp = this._valuesStartRepeat[property];\n\n this._valuesStartRepeat[property] = this._valuesEnd[property];\n this._valuesEnd[property] = tmp;\n }\n\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n\n if (this._yoyo)\n this._reversed = !this._reversed;\n\n if (this._repeatDelayTime !== undefined)\n this._startTime = time + this._repeatDelayTime;\n else\n this._startTime = time + this._delayTime;\n\n if (this._onRepeatCallback !== undefined)\n this._onRepeatCallback(this._object);\n\n return true;\n\n } else {\n\n if (this._onCompleteCallback !== undefined)\n this._onCompleteCallback(this._object);\n\n for (let i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n // Make the chained tweens start exactly at the time they should,\n // even if the `update()` method was called way past the duration of the tween\n this._chainedTweens[i].start(this._startTime + this._duration);\n }\n return false;\n }\n\n }\n return true;\n }\n}\n\n/** Easing functions from tween.js\n * @public\n */\nexport const Easing = {\n Linear: {\n None: (k: number) => {\n return k;\n },\n },\n\n Quadratic: {\n In: (k: number) => {\n return k * k;\n },\n\n Out: (k: number) => {\n return k * (2 - k);\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return - 0.5 * (--k * (k - 2) - 1);\n },\n },\n\n Cubic: {\n In: (k: number) => {\n return k * k * k;\n },\n\n Out: (k: number) => {\n return --k * k * k + 1;\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n },\n\n Quartic: {\n In: (k: number) => {\n return k * k * k * k;\n },\n\n Out: (k: number) => {\n return 1 - (--k * k * k * k);\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n\n return - 0.5 * ((k -= 2) * k * k * k - 2);\n },\n },\n\n Quintic: {\n In: (k: number) => {\n return k * k * k * k * k;\n },\n\n Out: (k: number) => {\n return --k * k * k * k * k + 1;\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n },\n\n Sinusoidal: {\n In: (k: number) => {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n\n Out: (k: number) => {\n return Math.sin(k * Math.PI / 2);\n },\n\n InOut: (k: number) => {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n },\n\n Exponential: {\n In: (k: number) => {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n\n Out: (k: number) => {\n return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k);\n },\n\n InOut: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n if ((k *= 2) < 1)\n return 0.5 * Math.pow(1024, k - 1);\n\n return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2);\n },\n },\n\n Circular: {\n In: (k: number) => {\n return 1 - Math.sqrt(1 - k * k);\n },\n\n Out: (k: number) => {\n return Math.sqrt(1 - (--k * k));\n },\n\n InOut: (k: number) => {\n if ((k *= 2) < 1)\n return - 0.5 * (Math.sqrt(1 - k * k) - 1);\n\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n },\n\n Elastic: {\n In: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n return -Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);\n },\n\n Out: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n return Math.pow(2, -10 * k) * Math.sin((k - 0.1) * 5 * Math.PI) + 1;\n },\n\n InOut: (k: number) => {\n if (k === 0)\n return 0;\n\n if (k === 1)\n return 1;\n\n k *= 2;\n\n if (k < 1)\n return -0.5 * Math.pow(2, 10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI);\n\n return 0.5 * Math.pow(2, -10 * (k - 1)) * Math.sin((k - 1.1) * 5 * Math.PI) + 1;\n },\n },\n\n Back: {\n In: (k: number) => {\n const s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n\n Out: (k: number) => {\n const s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n\n InOut: (k: number) => {\n const s = 1.70158 * 1.525;\n if ((k *= 2) < 1)\n return 0.5 * (k * k * ((s + 1) * k - s));\n\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n },\n\n Bounce: {\n In: (k: number) => {\n return 1 - Easing.Bounce.Out(1 - k);\n },\n\n Out: (k: number) => {\n if (k < (1 / 2.75))\n return 7.5625 * k * k;\n if (k < (2 / 2.75))\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n if (k < (2.5 / 2.75))\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n },\n\n InOut: (k: number) => {\n if (k < 0.5)\n return Easing.Bounce.In(k * 2) * 0.5;\n\n return Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5;\n },\n },\n};\n\n/** Interpolation functions from tween.js\n * @public\n */\nexport const Interpolation = {\n\n Linear: (v: any, k: number) => {\n const m = v.length - 1;\n const f = m * k;\n const i = Math.floor(f);\n const fn = Interpolation.Utils.Linear;\n\n if (k < 0)\n return fn(v[0], v[1], f);\n\n if (k > 1)\n return fn(v[m], v[m - 1], m - f);\n\n return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n },\n\n Bezier: (v: any, k: number) => {\n let b = 0;\n const n = v.length - 1;\n const pw = Math.pow;\n const bn = Interpolation.Utils.Bernstein;\n\n for (let i = 0; i <= n; i++)\n b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n\n return b;\n },\n\n CatmullRom: (v: any, k: number) => {\n const m = v.length - 1;\n let f = m * k;\n let i = Math.floor(f);\n const fn = Interpolation.Utils.CatmullRom;\n\n if (v[0] === v[m]) {\n if (k < 0) {\n i = Math.floor(f = m * (1 + k));\n }\n return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n } else {\n if (k < 0)\n return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n\n if (k > 1)\n return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n\n return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n }\n },\n\n Utils: {\n Linear: (p0: number, p1: number, t: number) => {\n return (p1 - p0) * t + p0;\n },\n\n Bernstein: (n: number, i: number) => {\n const fc = Interpolation.Utils.Factorial;\n return fc(n) / fc(i) / fc(n - i);\n },\n\n Factorial: (() => {\n const a = [1];\n return (n: number) => {\n let s = 1;\n\n if (a[n])\n return a[n];\n\n for (let i = n; i > 1; i--)\n s *= i;\n\n a[n] = s;\n return s;\n };\n\n })(),\n\n CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => {\n const v0 = (p2 - p0) * 0.5;\n const v1 = (p3 - p1) * 0.5;\n const t2 = t * t;\n const t3 = t * t2;\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (- 3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n },\n },\n};\n"]}
|
|
@@ -156,7 +156,7 @@ export declare class TextAnnotation {
|
|
|
156
156
|
/**
|
|
157
157
|
* Creates a new TextAnnotation instance from its JSON representation.
|
|
158
158
|
*/
|
|
159
|
-
static fromJSON(props
|
|
159
|
+
static fromJSON(props?: TextAnnotationProps): TextAnnotation;
|
|
160
160
|
/**
|
|
161
161
|
* Converts this annotation to its JSON representation.
|
|
162
162
|
*/
|
|
@@ -1 +1 @@
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,GAAG,cAAc;IAenE;;OAEG;IACI,MAAM,IAAI,mBAAmB;IA6BpC;;;;;;;;;;OAUG;IACI,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,GAAE,MAAU,GAAG,SAAS;IAcjF;;;OAGG;IACI,kBAAkB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAyBxD,0FAA0F;IAC1F,OAAO,CAAC,eAAe;IAsBvB,0EAA0E;IACnE,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;CAW9C"}
|
|
@@ -44,7 +44,7 @@ export class TextAnnotation {
|
|
|
44
44
|
static create(args) {
|
|
45
45
|
const offset = args?.offset ?? new Point3d();
|
|
46
46
|
const angles = args?.orientation ?? new YawPitchRollAngles();
|
|
47
|
-
const textBlock = args?.textBlock ?? TextBlock.
|
|
47
|
+
const textBlock = args?.textBlock ?? TextBlock.create();
|
|
48
48
|
const anchor = args?.anchor ?? { vertical: "top", horizontal: "left" };
|
|
49
49
|
const leaders = args?.leaders ?? undefined;
|
|
50
50
|
return new TextAnnotation(offset, angles, textBlock, anchor, leaders);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAW,SAAS,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AA4HxD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACI,WAAW,CAAqB;IACvC,8BAA8B;IACvB,SAAS,CAAY;IAC5B,iEAAiE;IAC1D,MAAM,CAAuB;IACpC,8IAA8I;IACvI,MAAM,CAAU;IACvB,0CAA0C;IACnC,OAAO,CAA0B;IAExC,YAAoB,MAAe,EAAE,MAA0B,EAAE,SAAoB,EAAE,MAA4B,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AC;YAClD,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACxC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;YACvC,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3D,CAAC;CACF","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 Annotation\n */\n\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\nimport { TextStyleSettingsProps } from \"./TextStyle\";\n\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\n * @beta\n */\nexport interface TextAnnotationAnchor {\n /**\n * The vertical alignment of the anchor point.\n * \"top\" aligns the anchor point with the top of the text's bounding box.\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\n */\n vertical: \"top\" | \"middle\" | \"bottom\";\n\n /**\n * The horizontal alignment of the anchor point.\n * \"left\" aligns the anchor point with left side of the text's bounding box.\n * \"center\" aligns the anchor point with center of the text with's bounding box.\n * \"right\" aligns the anchor point with right side of the text's bounding box.\n */\n horizontal: \"left\" | \"center\" | \"right\";\n}\n\n/**\n * Describes how to attach a [[TextAnnotationLeader]] to the frame around a [[TextBlock]].\n * Leader can be attached using one of the three modes:\n * - KeyPoint: attach to a point on the frame specified by the given curveIndex and fractional position.\n * - TextPoint: attach to a point that is projected on to the frame from the point on a particular line of text specified by [[LeaderTextPointOptions]].\n * - Nearest: attach to the point on frame that is nearest to [[TextAnnotationLeader.startPoint]].\n * @beta\n */\nexport type LeaderAttachment =\n | { mode: \"KeyPoint\"; curveIndex: number; fraction: number }\n | { mode: \"TextPoint\"; position: LeaderTextPointOptions }\n | { mode: \"Nearest\" };\n\n/**\n * Specifies the possible positions to attach a leader on the frame around a [[TextBlock]]\n * when [[TextAnnotationLeader.attachment.mode]] is set to TextPoint.\n * TopLeft : attach to a point projected onto the frame from the point on the left side of the first line of text.\n * TopRight : attach to a point projected onto the frame from the point on the right side of the first line of text.\n * BottomLeft : attach to a point projected onto the frame from the point on the left side of the last line of text.\n * BottomRight : attach to a point projected onto the frame from the point on the right side of the last line of text.\n * @beta\n */\nexport type LeaderTextPointOptions = \"TopLeft\" | \"TopRight\" | \"BottomLeft\" | \"BottomRight\"\n\n/**\n * A line that connects a [[TextAnnotation]] to a point in space relative to another element in the iModel.\n * A leader is always attached to the frame around the annotation's [[TextBlock]].\n * If the frame is not visible, the leader attaches to an invisible rectangular frame around the text block.\n * @see [[TextAnnotation.leaders]] for the leaders associated with an annotation.\n * @see [[TextStyleSettings.leader]] and [[styleOverrides]] to customize the appearance of leaders.\n * @beta\n*/\nexport interface TextAnnotationLeader {\n /** The point where the leader starts.\n * This is the point on another element where the leader points to */\n startPoint: Point3d;\n /** Describes how to attach the leader to the frame around [[textBlock]].*/\n attachment: LeaderAttachment;\n /** Optional intermediate points that the leader should pass through.\n * If not specified, the leader will be a straight line from startPoint to the point on the frame.\n * For now, intermediate points are a set of points which create additional LineSegments in the leader, but there could be intermediate shapes instead of straight LineSegments in future*/\n intermediatePoints?: Point3d[];\n /** Optional style overrides for the leader. If not specified, the leader will use the style defined by [[TextBlock.styleName]] as it is.\n * If specified, these overrides will be applied to the style.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n/**\n * JSON representation of a [[TextAnnotationLeader]].\n * @beta\n */\nexport interface TextAnnotationLeaderProps {\n /** See [[TextAnnotationLeader.startPoint]]. */\n startPoint: XYZProps;\n /** See [[TextAnnotationLeader.attachment]]. */\n attachment: LeaderAttachment;\n /** See [[TextAnnotationLeader.intermediatePoints]]. Default: no intermediate points. */\n intermediatePoints?: XYZProps[];\n /** See [[TextAnnotationLeader.styleOverrides]]. Default: no style overrides. */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/**\n * JSON representation of a [[TextAnnotation]].\n * @beta\n */\nexport interface TextAnnotationProps {\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\n offset?: XYZProps;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollProps;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlockProps;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeaderProps[];\n}\n\n/** Arguments supplied to [[TextAnnotation.create]].\n * @beta\n */\nexport interface TextAnnotationCreateArgs {\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\n offset?: Point3d;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollAngles;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlock;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeader[];\n}\n\n/**\n * Represents a formatted block of text positioned in 2d or 3d space.\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\n * edges, or in the center of the box.\n * - The [[orientation]] is applied to rotate the box around the anchor point.\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\n * @see [appendTextAnnotationGeometry]($backend) to construct the geometry and append it to an [[ElementGeometry.Builder]].\n * @beta\n */\nexport class TextAnnotation {\n /** The rotation of the annotation.\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\n */\n public orientation: YawPitchRollAngles;\n /** The formatted document. */\n public textBlock: TextBlock;\n /** Describes how to compute the [[textBlock]]'s anchor point. */\n public anchor: TextAnnotationAnchor;\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\n public offset: Point3d;\n /** The leaders of the text annotation. */\n public leaders?: TextAnnotationLeader[];\n\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor, leaders?: TextAnnotationLeader[]) {\n this.offset = offset;\n this.orientation = angles;\n this.textBlock = textBlock;\n this.anchor = anchor;\n this.leaders = leaders;\n }\n\n /** Creates a new TextAnnotation. */\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\n const offset = args?.offset ?? new Point3d();\n const angles = args?.orientation ?? new YawPitchRollAngles();\n const textBlock = args?.textBlock ?? TextBlock.createEmpty();\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\n const leaders = args?.leaders ?? undefined;\n return new TextAnnotation(offset, angles, textBlock, anchor, leaders);\n }\n\n /**\n * Creates a new TextAnnotation instance from its JSON representation.\n */\n public static fromJSON(props: TextAnnotationProps | undefined): TextAnnotation {\n return TextAnnotation.create({\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\n anchor: props?.anchor ? { ...props.anchor } : undefined,\n leaders: props?.leaders ? props.leaders.map((leader) => ({\n startPoint: Point3d.fromJSON(leader.startPoint),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => Point3d.fromJSON(point)) : undefined,\n })) : undefined,\n });\n }\n\n /**\n * Converts this annotation to its JSON representation.\n */\n public toJSON(): TextAnnotationProps {\n const props: TextAnnotationProps = {};\n\n // Even if the text block is empty, we want to record its style ID and overrides, e.g.,\n // so the user can pick up where they left off editing it next time.\n props.textBlock = this.textBlock.toJSON();\n\n if (!this.offset.isZero) {\n props.offset = this.offset.toJSON();\n }\n\n if (!this.orientation.isIdentity()) {\n props.orientation = this.orientation.toJSON();\n }\n\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\n props.anchor = { ...this.anchor };\n }\n\n props.leaders = this.leaders?.map((leader) => ({\n startPoint: leader.startPoint.toJSON(),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => point.toJSON()) : undefined,\n })) ?? undefined;\n\n return props;\n }\n\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\n * The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.\n * If a scale factor is specified, the transform will also scale the annotation by that factor. Usually, this should come from the [[Drawing]] containing the annotation.\n * @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.\n * @param scaleFactor A factor by which to scale the annotation. Default: 1 (no scaling).\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\n * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.\n */\n public computeTransform(boundingBox: Range2d, scaleFactor: number = 1): Transform {\n const anchorPt = this.computeAnchorPoint(boundingBox);\n const matrix = this.orientation.toMatrix3d();\n\n const transform = Transform.createIdentity();\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\n const scaleTransform = Transform.createScaleAboutPoint(anchorPt, scaleFactor);\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\n transform.multiplyTransformTransform(translation, transform);\n transform.multiplyTransformTransform(scaleTransform, transform);\n transform.multiplyTransformTransform(rotation, transform);\n return transform;\n }\n\n /** Compute the anchor point of this annotation as specified by [[anchor]].\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\n */\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\n let x = boundingBox.low.x;\n let y = boundingBox.high.y;\n\n switch (this.anchor.horizontal) {\n case \"center\":\n x += boundingBox.xLength() / 2;\n break;\n case \"right\":\n x += boundingBox.xLength();\n break;\n }\n\n switch (this.anchor.vertical) {\n case \"middle\":\n y -= boundingBox.yLength() / 2;\n break;\n case \"bottom\":\n y -= boundingBox.yLength();\n break;\n }\n\n return new Point3d(x, y, 0);\n }\n\n /** Returns true if the leaders of this annotation are equal to the leaders of `other`. */\n private areLeadersEqual(leadersA?: TextAnnotationLeader[], leadersB?: TextAnnotationLeader[]): boolean {\n if (leadersA === leadersB) return true;\n if (!leadersA || !leadersB || leadersA.length !== leadersB.length) return false;\n\n for (let i = 0; i < leadersA.length; ++i) {\n const a = leadersA[i];\n const b = leadersB[i];\n\n if (!a.startPoint.isAlmostEqual(b.startPoint)) return false;\n if (JSON.stringify(a.attachment) !== JSON.stringify(b.attachment)) return false;\n if (JSON.stringify(a.styleOverrides) !== JSON.stringify(b.styleOverrides)) return false;\n\n const pointsA = a.intermediatePoints ?? [];\n const pointsB = b.intermediatePoints ?? [];\n if (pointsA.length !== pointsB.length) return false;\n for (let j = 0; j < pointsA.length; ++j) {\n if (!pointsA[j].isAlmostEqual(pointsB[j])) return false;\n }\n }\n return true;\n }\n\n /** Returns true if this annotation is logically equivalent to `other`. */\n public equals(other: TextAnnotation): boolean {\n if (this.anchor.horizontal !== other.anchor.horizontal ||\n this.anchor.vertical !== other.anchor.vertical ||\n !this.orientation.isAlmostEqual(other.orientation) ||\n !this.offset.isAlmostEqual(other.offset) ||\n !this.textBlock.equals(other.textBlock))\n return false;\n\n return this.areLeadersEqual(this.leaders, other.leaders);\n\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"TextAnnotation.js","sourceRoot":"","sources":["../../../src/annotation/TextAnnotation.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAW,SAAS,EAAY,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AA4HxD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACI,WAAW,CAAqB;IACvC,8BAA8B;IACvB,SAAS,CAAY;IAC5B,iEAAiE;IAC1D,MAAM,CAAuB;IACpC,8IAA8I;IACvI,MAAM,CAAU;IACvB,0CAA0C;IACnC,OAAO,CAA0B;IAExC,YAAoB,MAAe,EAAE,MAA0B,EAAE,SAAoB,EAAE,MAA4B,EAAE,OAAgC;QACnJ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,oCAAoC;IAC7B,MAAM,CAAC,MAAM,CAAC,IAA+B;QAClD,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC7C,MAAM,MAAM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CAAC,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;gBAAE,OAAO,KAAK,CAAC;YAExF,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC;YAC3C,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAC;YACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAAE,OAAO,KAAK,CAAC;YAC1D,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0EAA0E;IACnE,MAAM,CAAC,KAAqB;QACjC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;YACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ;YAC9C,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC;YAClD,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;YACxC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;YACvC,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE3D,CAAC;CACF","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 Annotation\n */\n\nimport { Point3d, Range2d, Transform, XYZProps, YawPitchRollAngles, YawPitchRollProps } from \"@itwin/core-geometry\";\nimport { TextBlock, TextBlockProps } from \"./TextBlock\";\nimport { TextStyleSettingsProps } from \"./TextStyle\";\n\n/** Describes how to compute the \"anchor point\" for a [[TextAnnotation]].\n * The anchor point is a point on or inside of the 2d bounding box enclosing the contents of the annotation's [[TextBlock]].\n * The annotation can be rotated and translated relative to the anchor point. The anchor point also serves as the snap point\n * when [AccuSnap]($frontend) is set to [SnapMode.Origin]($frontend).\n * [[TextAnnotation.computeTransform]] will align the anchor point with (0, 0).\n * @see [[TextAnnotation]] for a description of how the anchor point is computed.\n * @beta\n */\nexport interface TextAnnotationAnchor {\n /**\n * The vertical alignment of the anchor point.\n * \"top\" aligns the anchor point with the top of the text's bounding box.\n * \"middle\" aligns the anchor point with the middle of the text's bounding box.\n * \"bottom\" aligns the anchor point with the bottom of the text's bounding box.\n */\n vertical: \"top\" | \"middle\" | \"bottom\";\n\n /**\n * The horizontal alignment of the anchor point.\n * \"left\" aligns the anchor point with left side of the text's bounding box.\n * \"center\" aligns the anchor point with center of the text with's bounding box.\n * \"right\" aligns the anchor point with right side of the text's bounding box.\n */\n horizontal: \"left\" | \"center\" | \"right\";\n}\n\n/**\n * Describes how to attach a [[TextAnnotationLeader]] to the frame around a [[TextBlock]].\n * Leader can be attached using one of the three modes:\n * - KeyPoint: attach to a point on the frame specified by the given curveIndex and fractional position.\n * - TextPoint: attach to a point that is projected on to the frame from the point on a particular line of text specified by [[LeaderTextPointOptions]].\n * - Nearest: attach to the point on frame that is nearest to [[TextAnnotationLeader.startPoint]].\n * @beta\n */\nexport type LeaderAttachment =\n | { mode: \"KeyPoint\"; curveIndex: number; fraction: number }\n | { mode: \"TextPoint\"; position: LeaderTextPointOptions }\n | { mode: \"Nearest\" };\n\n/**\n * Specifies the possible positions to attach a leader on the frame around a [[TextBlock]]\n * when [[TextAnnotationLeader.attachment.mode]] is set to TextPoint.\n * TopLeft : attach to a point projected onto the frame from the point on the left side of the first line of text.\n * TopRight : attach to a point projected onto the frame from the point on the right side of the first line of text.\n * BottomLeft : attach to a point projected onto the frame from the point on the left side of the last line of text.\n * BottomRight : attach to a point projected onto the frame from the point on the right side of the last line of text.\n * @beta\n */\nexport type LeaderTextPointOptions = \"TopLeft\" | \"TopRight\" | \"BottomLeft\" | \"BottomRight\"\n\n/**\n * A line that connects a [[TextAnnotation]] to a point in space relative to another element in the iModel.\n * A leader is always attached to the frame around the annotation's [[TextBlock]].\n * If the frame is not visible, the leader attaches to an invisible rectangular frame around the text block.\n * @see [[TextAnnotation.leaders]] for the leaders associated with an annotation.\n * @see [[TextStyleSettings.leader]] and [[styleOverrides]] to customize the appearance of leaders.\n * @beta\n*/\nexport interface TextAnnotationLeader {\n /** The point where the leader starts.\n * This is the point on another element where the leader points to */\n startPoint: Point3d;\n /** Describes how to attach the leader to the frame around [[textBlock]].*/\n attachment: LeaderAttachment;\n /** Optional intermediate points that the leader should pass through.\n * If not specified, the leader will be a straight line from startPoint to the point on the frame.\n * For now, intermediate points are a set of points which create additional LineSegments in the leader, but there could be intermediate shapes instead of straight LineSegments in future*/\n intermediatePoints?: Point3d[];\n /** Optional style overrides for the leader. If not specified, the leader will use the style defined by [[TextBlock.styleName]] as it is.\n * If specified, these overrides will be applied to the style.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n/**\n * JSON representation of a [[TextAnnotationLeader]].\n * @beta\n */\nexport interface TextAnnotationLeaderProps {\n /** See [[TextAnnotationLeader.startPoint]]. */\n startPoint: XYZProps;\n /** See [[TextAnnotationLeader.attachment]]. */\n attachment: LeaderAttachment;\n /** See [[TextAnnotationLeader.intermediatePoints]]. Default: no intermediate points. */\n intermediatePoints?: XYZProps[];\n /** See [[TextAnnotationLeader.styleOverrides]]. Default: no style overrides. */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/**\n * JSON representation of a [[TextAnnotation]].\n * @beta\n */\nexport interface TextAnnotationProps {\n /** See [[TextAnnotation.offset]]. Default: [0, 0, 0]. */\n offset?: XYZProps;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollProps;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlockProps;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeaderProps[];\n}\n\n/** Arguments supplied to [[TextAnnotation.create]].\n * @beta\n */\nexport interface TextAnnotationCreateArgs {\n /** See [[TextAnnotation.offset]]. Default: (0, 0, 0). */\n offset?: Point3d;\n /** See [[TextAnnotation.orientation]]. Default: no rotation. */\n orientation?: YawPitchRollAngles;\n /** See [[TextAnnotation.textBlock]]. Default: an empty text block. */\n textBlock?: TextBlock;\n /** See [[TextAnnotation.anchor]]. Default: top-left. */\n anchor?: TextAnnotationAnchor;\n /** See [[TextAnnotation.leader]]. Default: an empty leader array */\n leaders?: TextAnnotationLeader[];\n}\n\n/**\n * Represents a formatted block of text positioned in 2d or 3d space.\n * [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.\n * Other types of elements may store multiple TextAnnotations, positioned relative to one another.\n * The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:\n * - First, a bounding box is computed enclosing the contents of the [[textBlock].\n * - Then, an \"anchor point\" is computed based on the bounding box and the [[anchor]] property. The anchor point can be at one of the four corners of the box, in the middle of one of its four\n * edges, or in the center of the box.\n * - The [[orientation]] is applied to rotate the box around the anchor point.\n * - Finally, the [[offset]] is added to the anchor point to apply translation.\n * @see [appendTextAnnotationGeometry]($backend) to construct the geometry and append it to an [[ElementGeometry.Builder]].\n * @beta\n */\nexport class TextAnnotation {\n /** The rotation of the annotation.\n * @note When defining an annotation for a [TextAnnotation2d]($backend), only the `yaw` component (rotation around the Z axis) is used.\n */\n public orientation: YawPitchRollAngles;\n /** The formatted document. */\n public textBlock: TextBlock;\n /** Describes how to compute the [[textBlock]]'s anchor point. */\n public anchor: TextAnnotationAnchor;\n /** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */\n public offset: Point3d;\n /** The leaders of the text annotation. */\n public leaders?: TextAnnotationLeader[];\n\n private constructor(offset: Point3d, angles: YawPitchRollAngles, textBlock: TextBlock, anchor: TextAnnotationAnchor, leaders?: TextAnnotationLeader[]) {\n this.offset = offset;\n this.orientation = angles;\n this.textBlock = textBlock;\n this.anchor = anchor;\n this.leaders = leaders;\n }\n\n /** Creates a new TextAnnotation. */\n public static create(args?: TextAnnotationCreateArgs): TextAnnotation {\n const offset = args?.offset ?? new Point3d();\n const angles = args?.orientation ?? new YawPitchRollAngles();\n const textBlock = args?.textBlock ?? TextBlock.create();\n const anchor = args?.anchor ?? { vertical: \"top\", horizontal: \"left\" };\n const leaders = args?.leaders ?? undefined;\n return new TextAnnotation(offset, angles, textBlock, anchor, leaders);\n }\n\n /**\n * Creates a new TextAnnotation instance from its JSON representation.\n */\n public static fromJSON(props?: TextAnnotationProps): TextAnnotation {\n return TextAnnotation.create({\n offset: props?.offset ? Point3d.fromJSON(props.offset) : undefined,\n orientation: props?.orientation ? YawPitchRollAngles.fromJSON(props.orientation) : undefined,\n textBlock: props?.textBlock ? TextBlock.create(props.textBlock) : undefined,\n anchor: props?.anchor ? { ...props.anchor } : undefined,\n leaders: props?.leaders ? props.leaders.map((leader) => ({\n startPoint: Point3d.fromJSON(leader.startPoint),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => Point3d.fromJSON(point)) : undefined,\n })) : undefined,\n });\n }\n\n /**\n * Converts this annotation to its JSON representation.\n */\n public toJSON(): TextAnnotationProps {\n const props: TextAnnotationProps = {};\n\n // Even if the text block is empty, we want to record its style ID and overrides, e.g.,\n // so the user can pick up where they left off editing it next time.\n props.textBlock = this.textBlock.toJSON();\n\n if (!this.offset.isZero) {\n props.offset = this.offset.toJSON();\n }\n\n if (!this.orientation.isIdentity()) {\n props.orientation = this.orientation.toJSON();\n }\n\n if (this.anchor.vertical !== \"top\" || this.anchor.horizontal !== \"left\") {\n props.anchor = { ...this.anchor };\n }\n\n props.leaders = this.leaders?.map((leader) => ({\n startPoint: leader.startPoint.toJSON(),\n attachment: leader.attachment,\n styleOverrides: leader.styleOverrides ?? undefined,\n intermediatePoints: leader.intermediatePoints ? leader.intermediatePoints.map((point) => point.toJSON()) : undefined,\n })) ?? undefined;\n\n return props;\n }\n\n /** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.\n * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored\n * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.\n * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].\n * The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.\n * If a scale factor is specified, the transform will also scale the annotation by that factor. Usually, this should come from the [[Drawing]] containing the annotation.\n * @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.\n * @param scaleFactor A factor by which to scale the annotation. Default: 1 (no scaling).\n * @see [[computeAnchorPoint]] to compute the transform's anchor point.\n * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.\n */\n public computeTransform(boundingBox: Range2d, scaleFactor: number = 1): Transform {\n const anchorPt = this.computeAnchorPoint(boundingBox);\n const matrix = this.orientation.toMatrix3d();\n\n const transform = Transform.createIdentity();\n const translation = Transform.createTranslation(this.offset.minus(anchorPt));\n const scaleTransform = Transform.createScaleAboutPoint(anchorPt, scaleFactor);\n const rotation = Transform.createFixedPointAndMatrix(anchorPt, matrix);\n transform.multiplyTransformTransform(translation, transform);\n transform.multiplyTransformTransform(scaleTransform, transform);\n transform.multiplyTransformTransform(rotation, transform);\n return transform;\n }\n\n /** Compute the anchor point of this annotation as specified by [[anchor]].\n * @param boundingBox A box fully containing the [[textBlock]].\n * @see [[computeTransform]] to compute the transform relative to the anchor point.\n */\n public computeAnchorPoint(boundingBox: Range2d): Point3d {\n let x = boundingBox.low.x;\n let y = boundingBox.high.y;\n\n switch (this.anchor.horizontal) {\n case \"center\":\n x += boundingBox.xLength() / 2;\n break;\n case \"right\":\n x += boundingBox.xLength();\n break;\n }\n\n switch (this.anchor.vertical) {\n case \"middle\":\n y -= boundingBox.yLength() / 2;\n break;\n case \"bottom\":\n y -= boundingBox.yLength();\n break;\n }\n\n return new Point3d(x, y, 0);\n }\n\n /** Returns true if the leaders of this annotation are equal to the leaders of `other`. */\n private areLeadersEqual(leadersA?: TextAnnotationLeader[], leadersB?: TextAnnotationLeader[]): boolean {\n if (leadersA === leadersB) return true;\n if (!leadersA || !leadersB || leadersA.length !== leadersB.length) return false;\n\n for (let i = 0; i < leadersA.length; ++i) {\n const a = leadersA[i];\n const b = leadersB[i];\n\n if (!a.startPoint.isAlmostEqual(b.startPoint)) return false;\n if (JSON.stringify(a.attachment) !== JSON.stringify(b.attachment)) return false;\n if (JSON.stringify(a.styleOverrides) !== JSON.stringify(b.styleOverrides)) return false;\n\n const pointsA = a.intermediatePoints ?? [];\n const pointsB = b.intermediatePoints ?? [];\n if (pointsA.length !== pointsB.length) return false;\n for (let j = 0; j < pointsA.length; ++j) {\n if (!pointsA[j].isAlmostEqual(pointsB[j])) return false;\n }\n }\n return true;\n }\n\n /** Returns true if this annotation is logically equivalent to `other`. */\n public equals(other: TextAnnotation): boolean {\n if (this.anchor.horizontal !== other.anchor.horizontal ||\n this.anchor.vertical !== other.anchor.vertical ||\n !this.orientation.isAlmostEqual(other.orientation) ||\n !this.offset.isAlmostEqual(other.offset) ||\n !this.textBlock.equals(other.textBlock))\n return false;\n\n return this.areLeadersEqual(this.leaders, other.leaders);\n\n }\n}"]}
|