@realsee/dnalogel 3.77.3 → 3.78.0-alpha.0
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/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/dist/PanoTagPlugin/controller/Tag/BoxTag.d.ts +118 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.d.ts +157 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +13 -0
- package/dist/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/controller/index.d.ts +36 -1
- package/dist/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/dist/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tagPosition.d.ts +2 -2
- package/dist/index.cjs.js +160 -82
- package/dist/index.js +10904 -9736
- package/dist/index.umd.js +161 -83
- package/docs/.nojekyll +1 -0
- package/docs/assets/custom.css +0 -0
- package/docs/assets/highlight.css +127 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1493 -0
- package/docs/classes/AreaMakerPluginType.AreaMakerController.html +59 -0
- package/docs/classes/AreaMakerPluginType.AreaMakerItem.html +71 -0
- package/docs/classes/CSS3DRender.html +100 -0
- package/docs/classes/GuideLineItem.GuideLineItem.html +21 -0
- package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +70 -0
- package/docs/classes/ModelMakerPluginInstance.html +116 -0
- package/docs/classes/ModelMakerPluginType.ModelMakerBoxItem.html +52 -0
- package/docs/classes/ModelMakerPluginType.ModelMakerPolygonItem.html +52 -0
- package/docs/classes/ModelMakerPluginType.ModelMakerPrismItem.html +53 -0
- package/docs/classes/ModelRoomLabelController.html +19 -0
- package/docs/classes/MoveController.html +45 -0
- package/docs/classes/Object3DHelperController.html +45 -0
- package/docs/classes/PaintBrush.html +15 -0
- package/docs/classes/PanoMeasurePluginLine.html +24 -0
- package/docs/classes/PanoMeasurePluginModel.html +23 -0
- package/docs/classes/PanoMeasurePluginPoint.html +7 -0
- package/docs/classes/PanoMeasurePluginPolyline.html +27 -0
- package/docs/classes/PanoTagPluginController.html +119 -0
- package/docs/classes/Sculpt.html +77 -0
- package/docs/classes/Util.BetterTween.html +6 -0
- package/docs/classes/Util.FiveDomEvents.html +13 -0
- package/docs/classes/Util.FivePuppet.html +20 -0
- package/docs/classes/Util.Interval.html +11 -0
- package/docs/classes/Util.LegacyPointHelper.html +7 -0
- package/docs/classes/Util.LightTag.html +47 -0
- package/docs/classes/Util.LineSegments.html +4 -0
- package/docs/classes/Util.Magnifier.html +26 -0
- package/docs/classes/Util.Object3D.html +8 -0
- package/docs/classes/Util.PointDomHelper.html +8 -0
- package/docs/classes/Util.PointHelper.html +10 -0
- package/docs/classes/Util.PointSelector.html +66 -0
- package/docs/classes/Util.PointSelectorHelper.html +14 -0
- package/docs/classes/Util.Rectangle.html +12 -0
- package/docs/classes/Util.sculpt.BaseEditor.html +17 -0
- package/docs/classes/Util.sculpt.BoxMesh.html +48 -0
- package/docs/classes/Util.sculpt.BoxMeshEditor.html +18 -0
- package/docs/classes/Util.sculpt.CircleMesh.html +26 -0
- package/docs/classes/Util.sculpt.CircleMeshEditor.html +18 -0
- package/docs/classes/Util.sculpt.CircleWithEdgeMesh.html +26 -0
- package/docs/classes/Util.sculpt.CylinderMesh.html +25 -0
- package/docs/classes/Util.sculpt.CylinderMeshEditor.html +18 -0
- package/docs/classes/Util.sculpt.LineMesh.html +34 -0
- package/docs/classes/Util.sculpt.PointMesh.html +24 -0
- package/docs/classes/Util.sculpt.PolygonMesh.html +40 -0
- package/docs/classes/Util.sculpt.PrismMesh.html +48 -0
- package/docs/classes/Util.sculpt.PrismMeshEditor.html +18 -0
- package/docs/classes/Util.sculpt.RectangleMesh.html +41 -0
- package/docs/classes/Util.sculpt.RectangleMeshEditor.html +18 -0
- package/docs/classes/Util.sculpt.RectangleWithEdgeMesh.html +44 -0
- package/docs/classes/WalkController.html +42 -0
- package/docs/enums/CameraMovementEffect.html +4 -0
- package/docs/enums/ContentType.html +34 -0
- package/docs/enums/DIRECTION.html +5 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +5 -0
- package/docs/enums/DimensionType.html +4 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +4 -0
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +5 -0
- package/docs/enums/PaintBrushTypeEnum.html +4 -0
- package/docs/enums/PointType.html +4 -0
- package/docs/enums/Rotation.html +5 -0
- package/docs/functions/AreaMakerPlugin.html +1 -0
- package/docs/functions/CSS3DRenderPlugin.html +1 -0
- package/docs/functions/CameraMovementPlugin.html +2 -0
- package/docs/functions/CruisePlugin.html +1 -0
- package/docs/functions/CurrentPanoImagePlugin.html +1 -0
- package/docs/functions/FloorplanGuidePlugin.html +1 -0
- package/docs/functions/GuideLinePlugin.html +1 -0
- package/docs/functions/ItemLabelPlugin.html +1 -0
- package/docs/functions/MapviewFloorplanPlugin.html +1 -0
- package/docs/functions/MeasurePlugin.html +1 -0
- package/docs/functions/ModelChassisCompassPlugin.html +2 -0
- package/docs/functions/ModelEntryDoorGuidePlugin.html +2 -0
- package/docs/functions/ModelFloorplanPlugin.html +1 -0
- package/docs/functions/ModelItemLabelPlugin.html +1 -0
- package/docs/functions/ModelMakerPlugin.html +1 -0
- package/docs/functions/ModelRoomLabelPlugin.html +1 -0
- package/docs/functions/ModelTVVideoPlugin.html +1 -0
- package/docs/functions/ModelViewPlugin.html +2 -0
- package/docs/functions/MovePlugin.html +1 -0
- package/docs/functions/Object3DHelperPlugin.html +1 -0
- package/docs/functions/PanoCompassPlugin.html +1 -0
- package/docs/functions/PanoCursorRaycasterPlugin.html +2 -0
- package/docs/functions/PanoDoorLabelPlugin.html +1 -0
- package/docs/functions/PanoFloorplanRadarPlugin.html +1 -0
- package/docs/functions/PanoMeasurePlugin.html +1 -0
- package/docs/functions/PanoRulerPlugin.html +2 -0
- package/docs/functions/PanoRulerProPlugin.html +2 -0
- package/docs/functions/PanoSpatialTagPlugin.html +2 -0
- package/docs/functions/PanoTagPlugin.html +1 -0
- package/docs/functions/PanoVideoPlugin.html +10 -0
- package/docs/functions/PipelinePlugin.html +1 -0
- package/docs/functions/SculptPlugin.html +2 -0
- package/docs/functions/SculptPluginForFive.html +2 -0
- package/docs/functions/TopviewFloorplanPlugin.html +1 -0
- package/docs/functions/Util.awaitNextFrame.html +1 -0
- package/docs/functions/Util.blink.html +13 -0
- package/docs/functions/Util.blinkWithPreset.html +6 -0
- package/docs/functions/Util.bounding.html +1 -0
- package/docs/functions/Util.boundingBox.html +1 -0
- package/docs/functions/Util.boundingSphere.html +1 -0
- package/docs/functions/Util.boxVertex.html +7 -0
- package/docs/functions/Util.boxVertexes.html +1 -0
- package/docs/functions/Util.checkFiveModelLoaded.html +2 -0
- package/docs/functions/Util.cleanup.html +3 -0
- package/docs/functions/Util.convexHull.html +2 -0
- package/docs/functions/Util.equal.html +5 -0
- package/docs/functions/Util.fiveModelIsLoaded.html +2 -0
- package/docs/functions/Util.generatePolygonGeometry.html +2 -0
- package/docs/functions/Util.getCoordsFromClient.html +1 -0
- package/docs/functions/Util.getCoordsFromElement.html +1 -0
- package/docs/functions/Util.getFrameTime.html +3 -0
- package/docs/functions/Util.getGeometryArea.html +1 -0
- package/docs/functions/Util.getGeometryInfo.html +1 -0
- package/docs/functions/Util.getIntersectFromRelativePosition.html +1 -0
- package/docs/functions/Util.getRaycasterFromFivePointer.html +1 -0
- package/docs/functions/Util.initialCSS3DRender.html +1 -0
- package/docs/functions/Util.inside.html +1 -0
- package/docs/functions/Util.isModelLike.html +1 -0
- package/docs/functions/Util.isNil.html +2 -0
- package/docs/functions/Util.isPanoramaLike.html +1 -0
- package/docs/functions/Util.lookObject.html +7 -0
- package/docs/functions/Util.lookPoint.html +5 -0
- package/docs/functions/Util.nextFrame.html +1 -0
- package/docs/functions/Util.notNil.html +2 -0
- package/docs/functions/Util.reblink.html +13 -0
- package/docs/functions/Util.replaceStaticPrefix.html +8 -0
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -0
- package/docs/functions/Util.sculpt.createBox.html +1 -0
- package/docs/functions/Util.sculpt.createCircle.html +1 -0
- package/docs/functions/Util.sculpt.createCylinder.html +1 -0
- package/docs/functions/Util.sculpt.createLine.html +2 -0
- package/docs/functions/Util.sculpt.createPoint.html +1 -0
- package/docs/functions/Util.sculpt.createPolygon.html +1 -0
- package/docs/functions/Util.sculpt.createPrism.html +1 -0
- package/docs/functions/Util.sculpt.createRectangle.html +2 -0
- package/docs/functions/Util.sculpt.transformUnit.html +1 -0
- package/docs/functions/Util.sculpt.transformUnitSquare.html +1 -0
- package/docs/functions/Util.tag.html +1 -0
- package/docs/functions/Util.triangleArea.html +2 -0
- package/docs/functions/Util.triangleCenter.html +2 -0
- package/docs/functions/Util.tweenProgress.html +1 -0
- package/docs/functions/Util.uuid.html +2 -0
- package/docs/functions/Util.waitFiveModelLoaded.html +2 -0
- package/docs/functions/Util.worldBounding.html +1 -0
- package/docs/functions/Util.worldBoundingBox.html +1 -0
- package/docs/functions/Util.worldBoundingSphere.html +1 -0
- package/docs/functions/createPolyline.html +2 -0
- package/docs/functions/pluginFlag.html +1 -0
- package/docs/functions/validatePolygon.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +70 -0
- package/docs/interfaces/AreaMakerPluginType.AnimeOptions.html +4 -0
- package/docs/interfaces/AreaMakerPluginType.Config.html +8 -0
- package/docs/interfaces/AreaMakerPluginType.EventMap.html +25 -0
- package/docs/interfaces/AreaMakerPluginType.Params.html +4 -0
- package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItem.html +20 -0
- package/docs/interfaces/AreaMakerPluginType.ServerAreaMakerItemV1.html +13 -0
- package/docs/interfaces/AreaMakerPluginType.ServerDataV1.html +9 -0
- package/docs/interfaces/AreaMakerPluginType.ServerDataV2.html +3 -0
- package/docs/interfaces/AreaMakerPluginType.ShowHideOptions.html +3 -0
- package/docs/interfaces/AreaMakerPluginType.State.html +8 -0
- package/docs/interfaces/BoxAnimationConfig.html +6 -0
- package/docs/interfaces/BoxPosition.html +8 -0
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +9 -0
- package/docs/interfaces/CSS3DRenderPluginState.html +7 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +11 -0
- package/docs/interfaces/ContentTypeMapInterface.html +73 -0
- package/docs/interfaces/CruisePluginTypes.Config.html +7 -0
- package/docs/interfaces/CruisePluginTypes.CruiseKeyframe.html +8 -0
- package/docs/interfaces/CruisePluginTypes.EventMap.html +33 -0
- package/docs/interfaces/CruisePluginTypes.GuildLineConfig.html +6 -0
- package/docs/interfaces/CruisePluginTypes.MoveAction.html +16 -0
- package/docs/interfaces/CruisePluginTypes.MoveWithKeyframesAction.html +19 -0
- package/docs/interfaces/CruisePluginTypes.MoveWithPanoIndexAction.html +20 -0
- package/docs/interfaces/CruisePluginTypes.PluginData.html +8 -0
- package/docs/interfaces/CruisePluginTypes.PluginServerData.html +2 -0
- package/docs/interfaces/CruisePluginTypes.PluginState.html +15 -0
- package/docs/interfaces/CurrentPanoImagePluginType.Config.html +13 -0
- package/docs/interfaces/CurrentPanoImagePluginType.EventMap.html +15 -0
- package/docs/interfaces/CurrentPanoImagePluginType.Params.html +4 -0
- package/docs/interfaces/CurrentPanoImagePluginType.ShowHideOptions.html +3 -0
- package/docs/interfaces/CurrentPanoImagePluginType.State.html +7 -0
- package/docs/interfaces/FloorplanBounding.html +9 -0
- package/docs/interfaces/FloorplanData.html +7 -0
- package/docs/interfaces/FloorplanEntrance.html +14 -0
- package/docs/interfaces/FloorplanExtraObject.html +9 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +5 -0
- package/docs/interfaces/FloorplanFloorData.html +9 -0
- package/docs/interfaces/FloorplanImagePosition.html +4 -0
- package/docs/interfaces/FloorplanObserver.html +8 -0
- package/docs/interfaces/FloorplanOutlineItem.html +6 -0
- package/docs/interfaces/FloorplanPosition.html +4 -0
- package/docs/interfaces/FloorplanRoomItem.html +24 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +6 -0
- package/docs/interfaces/FloorplanServerBounding.html +9 -0
- package/docs/interfaces/FloorplanServerComputedData.html +6 -0
- package/docs/interfaces/FloorplanServerData.html +4 -0
- package/docs/interfaces/FloorplanServerDoorItem.html +6 -0
- package/docs/interfaces/FloorplanServerDoorPosition.html +4 -0
- package/docs/interfaces/FloorplanServerEntrance.html +14 -0
- package/docs/interfaces/FloorplanServerFloorData.html +8 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +4 -0
- package/docs/interfaces/FloorplanServerObserver.html +8 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +6 -0
- package/docs/interfaces/FloorplanServerPosition.html +4 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +27 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +6 -0
- package/docs/interfaces/GuideLineModeItem.GuideLineTagContainer.html +4 -0
- package/docs/interfaces/GuideLinePluginType.CatmullRomCurve3.html +7 -0
- package/docs/interfaces/GuideLinePluginType.EventMap.html +13 -0
- package/docs/interfaces/GuideLinePluginType.ExtraRouteData.html +5 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +8 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +2 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +32 -0
- package/docs/interfaces/GuideLinePluginType.GuideLineMeshStyle.html +4 -0
- package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +5 -0
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineStyle.html +42 -0
- package/docs/interfaces/GuideLinePluginType.ModelGuideLineTagData.html +3 -0
- package/docs/interfaces/GuideLinePluginType.PanoramaGuideLineStyle.html +57 -0
- package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +1 -0
- package/docs/interfaces/GuideLinePluginType.PluginServerData.html +2 -0
- package/docs/interfaces/GuideLinePluginType.PluginState.html +7 -0
- package/docs/interfaces/GuideLinePluginType.Route.html +13 -0
- package/docs/interfaces/HelperOffset.html +4 -0
- package/docs/interfaces/ImagePlaneGroup.html +3 -0
- package/docs/interfaces/ItemLabelPluginData.html +2 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +7 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +5 -0
- package/docs/interfaces/MinMax.html +3 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +3 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +4 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +3 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +4 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +4 -0
- package/docs/interfaces/ModelItemLabelPluginData.html +2 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +7 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +3 -0
- package/docs/interfaces/ModelMakerPluginType.BoxItemObjectData.html +17 -0
- package/docs/interfaces/ModelMakerPluginType.EventMap.html +18 -0
- package/docs/interfaces/ModelMakerPluginType.PrismItemObjectData.html +23 -0
- package/docs/interfaces/ModelMakerPluginType.ServerBaseItem.html +11 -0
- package/docs/interfaces/ModelMakerPluginType.ServerBoxItem.html +10 -0
- package/docs/interfaces/ModelMakerPluginType.ServerData.html +3 -0
- package/docs/interfaces/ModelMakerPluginType.ServerPrismItem.html +10 -0
- package/docs/interfaces/ModelMakerPluginType.ServerTrianglesItem.html +10 -0
- package/docs/interfaces/ModelMakerPluginType.State.html +8 -0
- package/docs/interfaces/ModelMakerPluginType.TrianglesItemObjectData.html +11 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +2 -0
- package/docs/interfaces/ModelTVVideoPluginData.html +5 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +4 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +2 -0
- package/docs/interfaces/ModelViewPluginExportType.html +8 -0
- package/docs/interfaces/Object3DHelperState.html +4 -0
- package/docs/interfaces/ObjectHelperControllers.html +5 -0
- package/docs/interfaces/PaintBrushAction.html +14 -0
- package/docs/interfaces/PaintBrushConfigs.html +8 -0
- package/docs/interfaces/PaintBrushState.html +6 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +16 -0
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +20 -0
- package/docs/interfaces/PanoMeasurePluginLineJson.html +4 -0
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +4 -0
- package/docs/interfaces/PanoMeasurePluginPointJson.html +3 -0
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +7 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +6 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +3 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +4 -0
- package/docs/interfaces/PanoRulerProPluginExportType.html +5 -0
- package/docs/interfaces/PanoRulerProPluginOptions.html +3 -0
- package/docs/interfaces/PanoRulerProPluginParameterType.html +3 -0
- package/docs/interfaces/PanoRulerProPluginState.html +4 -0
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +7 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +6 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +9 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +6 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +9 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +7 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +6 -0
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +3 -0
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +8 -0
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +2 -0
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +15 -0
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +2 -0
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +14 -0
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +13 -0
- package/docs/interfaces/PluginEventMap.html +16 -0
- package/docs/interfaces/Point.html +4 -0
- package/docs/interfaces/Room.html +5 -0
- package/docs/interfaces/RoomInfo.html +3 -0
- package/docs/interfaces/RoomLabel.html +16 -0
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/interfaces/Scissor.html +13 -0
- package/docs/interfaces/SculptConfig.html +19 -0
- package/docs/interfaces/State.html +7 -0
- package/docs/interfaces/TagCacheInterface.html +9 -0
- package/docs/interfaces/TagConfig.html +174 -0
- package/docs/interfaces/TagGLTFObjectGroup.html +3 -0
- package/docs/interfaces/TagIconAnimationConfig.html +7 -0
- package/docs/interfaces/TagIconUrl.html +22 -0
- package/docs/interfaces/TagObjectGroup.html +3 -0
- package/docs/interfaces/TagState.html +3 -0
- package/docs/interfaces/TagStyle.html +17 -0
- package/docs/interfaces/Tags.html +8 -0
- package/docs/interfaces/TemporaryState.html +2 -0
- package/docs/interfaces/Util.AnimeInstance.html +14 -0
- package/docs/interfaces/Util.BlinkAnimeOptions.html +21 -0
- package/docs/interfaces/Util.EventHandlerConfig.html +21 -0
- package/docs/interfaces/Util.FiveDomEvent.html +7 -0
- package/docs/interfaces/Util.FiveDomEventMap.html +20 -0
- package/docs/interfaces/Util.LegacyMouseGroupParameter.html +4 -0
- package/docs/interfaces/Util.MagnifierParameter.html +13 -0
- package/docs/interfaces/Util.MouseGroupParameter.html +4 -0
- package/docs/interfaces/Util.ObjectInitialState.html +9 -0
- package/docs/interfaces/Util.PointIntersection.html +21 -0
- package/docs/interfaces/Util.PointSelectorHelperConfig.html +6 -0
- package/docs/interfaces/Util.ReBlinkAnimeOptions.html +27 -0
- package/docs/modules/AreaMakerPluginType.html +17 -0
- package/docs/modules/CruisePluginTypes.html +14 -0
- package/docs/modules/CurrentPanoImagePluginType.html +6 -0
- package/docs/modules/GuideLineItem.html +2 -0
- package/docs/modules/GuideLineModeItem.html +3 -0
- package/docs/modules/GuideLinePluginType.html +25 -0
- package/docs/modules/ModelMakerPluginType.html +19 -0
- package/docs/modules/PanoVideoPluginType.html +8 -0
- package/docs/modules/SculptData.html +9 -0
- package/docs/modules/SculptType.html +2 -0
- package/docs/modules/Util.html +91 -0
- package/docs/modules/Util.sculpt.html +27 -0
- package/docs/modules.html +287 -0
- package/docs/types/AddObject3DHelperConfig.html +19 -0
- package/docs/types/AreaMakerPluginType.AreaMakerItemEventMap.html +7 -0
- package/docs/types/AreaMakerPluginType.ItemRenderer.html +1 -0
- package/docs/types/AreaMakerPluginType.PluginData.html +2 -0
- package/docs/types/AreaMakerPluginType.ServerData.html +2 -0
- package/docs/types/ArrayPosition.html +1 -0
- package/docs/types/AudioAppearance.html +1 -0
- package/docs/types/BoxTag.html +2 -0
- package/docs/types/CSS3DRenderExportType.html +1 -0
- package/docs/types/CSS3DRenderPluginExportType.html +1 -0
- package/docs/types/CSS3DRenderPluginParameterType.html +1 -0
- package/docs/types/ClassFunctionParameters.html +1 -0
- package/docs/types/Color.html +1 -0
- package/docs/types/ContentTypeConfigKey.html +1 -0
- package/docs/types/ContentTypeConfigKeySplit.html +1 -0
- package/docs/types/ContentTypeMap.html +1 -0
- package/docs/types/Create3DDomContainerReturnType.html +1 -0
- package/docs/types/Create3DElementReturnType.html +1 -0
- package/docs/types/CruisePluginExportType.html +1 -0
- package/docs/types/CruisePluginTypes.CruiseData.html +6 -0
- package/docs/types/CruisePluginTypes.MoveEffect.html +1 -0
- package/docs/types/CurrentPanoImagePluginExportType.html +1 -0
- package/docs/types/DeprecatedMediaPlaneProperty.html +3 -0
- package/docs/types/DeprecatedTagProperty.html +3 -0
- package/docs/types/Direction-1.html +1 -0
- package/docs/types/Direction4.html +1 -0
- package/docs/types/ElementRenderer.html +2 -0
- package/docs/types/FloorplanGuidePluginParameterType.html +1 -0
- package/docs/types/FloorplanGuidePluginReturnType.html +1 -0
- package/docs/types/FloorplanRuleLabels.html +2 -0
- package/docs/types/FloorplanServerRuleLabels.html +1 -0
- package/docs/types/GuideLinePluginExportType.html +1 -0
- package/docs/types/GuideLinePluginType.GuideLineItem.html +2 -0
- package/docs/types/GuideLinePluginType.GuideLineItemEventMap.html +1 -0
- package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +1 -0
- package/docs/types/GuideLinePluginType.GuideLineStyle.html +2 -0
- package/docs/types/GuideLinePluginType.ModelGuideLineTag.html +2 -0
- package/docs/types/GuideLinePluginType.PathItem.html +2 -0
- package/docs/types/GuideLinePluginType.PluginData.html +2 -0
- package/docs/types/GuideLinePluginType.RouteConfig.html +4 -0
- package/docs/types/HelperEventMap.html +1 -0
- package/docs/types/InternalHelperEventMap.html +1 -0
- package/docs/types/MapviewFloorplanPluginParameterType.html +1 -0
- package/docs/types/MapviewFloorplanPluginReturnType.html +1 -0
- package/docs/types/MaskPosition.html +3 -0
- package/docs/types/MaskTag.html +2 -0
- package/docs/types/MeasureEndReason.html +1 -0
- package/docs/types/MeasurePluginConfig.html +5 -0
- package/docs/types/MeasurePluginEventMap.html +1 -0
- package/docs/types/MediaData.html +2 -0
- package/docs/types/MediaStore.html +1 -0
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +1 -0
- package/docs/types/ModelFloorplanPluginParameterType.html +1 -0
- package/docs/types/ModelFloorplanPluginReturnType.html +1 -0
- package/docs/types/ModelId.html +1 -0
- package/docs/types/ModelMakerPluginType.ElementRenderer.html +1 -0
- package/docs/types/ModelMakerPluginType.ItemType.html +2 -0
- package/docs/types/ModelMakerPluginType.MarkerItem.html +1 -0
- package/docs/types/ModelMakerPluginType.ServerItem.html +2 -0
- package/docs/types/ModelRoomLabelPluginParameters.html +1 -0
- package/docs/types/ModelRoomLabelPluginReturnType.html +1 -0
- package/docs/types/MoveArgs.html +2 -0
- package/docs/types/MoveOpts.html +2 -0
- package/docs/types/Object3DHelperEventMap.html +1 -0
- package/docs/types/ObjectFit.html +1 -0
- package/docs/types/PaintBrushEventMap.html +1 -0
- package/docs/types/PanoCompassPluginData.html +1 -0
- package/docs/types/PanoCompassPluginExportType.html +1 -0
- package/docs/types/PanoCompassPluginParameterType.html +1 -0
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +1 -0
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +1 -0
- package/docs/types/PanoIndex.html +1 -0
- package/docs/types/PanoMeasurePluginEvent.html +1 -0
- package/docs/types/PanoMeasureReturnType.html +1 -0
- package/docs/types/PanoSpatialTagPluginId.html +1 -0
- package/docs/types/PanoTagPluginExportInterface.html +1 -0
- package/docs/types/PanoTagPluginParamsInterface.html +1 -0
- package/docs/types/PanoVideoPluginParameterType.html +1 -0
- package/docs/types/PanoVideoPluginReturnType.html +1 -0
- package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +2 -0
- package/docs/types/PipelinePluginParameterType.html +1 -0
- package/docs/types/PipelinePluginReturnType.html +1 -0
- package/docs/types/PlaneTag.html +2 -0
- package/docs/types/Point2DTag.html +2 -0
- package/docs/types/Point3DTag.html +2 -0
- package/docs/types/PointTagInstance.html +1 -0
- package/docs/types/PolygonPosition.html +3 -0
- package/docs/types/PolygonTag.html +2 -0
- package/docs/types/Position.html +1 -0
- package/docs/types/PositionFrom.html +1 -0
- package/docs/types/RotateArgs.html +2 -0
- package/docs/types/RotateOpts.html +2 -0
- package/docs/types/RuleLabelsKey.html +1 -0
- package/docs/types/RuleLabelsValue.html +1 -0
- package/docs/types/ScaleCallback.html +1 -0
- package/docs/types/ScalePosition.html +3 -0
- package/docs/types/SculptData.BoxData.html +1 -0
- package/docs/types/SculptData.CircleData.html +1 -0
- package/docs/types/SculptData.CylinderData.html +1 -0
- package/docs/types/SculptData.PointData.html +1 -0
- package/docs/types/SculptData.PolygonData.html +1 -0
- package/docs/types/SculptData.PolylineData.html +1 -0
- package/docs/types/SculptData.PrismData.html +1 -0
- package/docs/types/SculptData.RectangleData.html +1 -0
- package/docs/types/SculptType.Theme.html +10 -0
- package/docs/types/StickType.html +1 -0
- package/docs/types/Tag.html +17 -0
- package/docs/types/Tag2D.html +2 -0
- package/docs/types/Tag3D.html +2 -0
- package/docs/types/TagClickParams.html +1 -0
- package/docs/types/TagConfigByKey.html +1 -0
- package/docs/types/TagContentType.html +1 -0
- package/docs/types/TagContentTypeMapping.html +1 -0
- package/docs/types/TagDimensionType.html +1 -0
- package/docs/types/TagElement.html +2 -0
- package/docs/types/TagEvents.html +1 -0
- package/docs/types/TagGLTFObject.html +1 -0
- package/docs/types/TagHooks.html +1 -0
- package/docs/types/TagId.html +1 -0
- package/docs/types/TagInstance.html +1 -0
- package/docs/types/TagPlacement.html +5 -0
- package/docs/types/TagPointType.html +2 -0
- package/docs/types/TagRendererMap.html +1 -0
- package/docs/types/TopviewFloorplanPluginParameterType.html +1 -0
- package/docs/types/TopviewFloorplanPluginReturnType.html +1 -0
- package/docs/types/Util.ActionIfNoIntersection.html +1 -0
- package/docs/types/Util.AdherePoint.html +2 -0
- package/docs/types/Util.PointSelectorConfig.html +1 -0
- package/docs/types/Util.SupportedTarget.html +2 -0
- package/docs/types/Util.Target.html +2 -0
- package/docs/types/Util.ThreeObject.html +2 -0
- package/docs/types/WorkCode.html +1 -0
- package/docs/variables/FLOOR_TYPE_MAP.html +2 -0
- package/docs/variables/PLUGIN.html +1 -0
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +2 -0
- package/docs/variables/ROOM_TYPE_MAP.html +2 -0
- package/docs/variables/Util.ANIME_PRESETS.html +2 -0
- package/docs/variables/Util.CURRENT_PANO_IMAGE_DEFAULT_IMAGE.html +2 -0
- package/docs/variables/Util.DEFAULT_ANIME_CONFIG.html +2 -0
- package/docs/variables/Util.DEFAULT_STATIC_PREFIX.html +2 -0
- package/docs/variables/Util.DNALOGEL_DEFAULT_ASSETS.html +2 -0
- package/docs/variables/Util.ENTRY_DOOR_DEFAULT_IMAGE.html +2 -0
- package/docs/variables/Util.FLOORPLAN_DEFAULT_IMAGE.html +2 -0
- package/docs/variables/Util.GUIDELINE_DEFAULT_ARROW_TEXTURE.html +2 -0
- package/docs/variables/Util.GUIDELINE_WHITE_ARROW_TEXTURE.html +2 -0
- package/docs/variables/Util.MODEL_CHASSIS_COMPASS_DEFAULT_MODEL.html +2 -0
- package/docs/variables/Util.MODEL_ENTRY_DOOR_GUIDE_PLUGIN_DEFAULT_MODEL.html +2 -0
- package/docs/variables/Util.PANO_COMPASS_DEFAULT_IMAGE.html +2 -0
- package/docs/variables/Util.PANO_SPATIAL_TAG_BLUR_IMAGE.html +2 -0
- package/docs/variables/Util.PANO_TAG_DEFAULT_LINK_ICON.html +2 -0
- package/docs/variables/defaultGlobalConfig.html +1 -0
- package/docs/variables/itemLabelPluginServerParams.html +1 -0
- package/docs/variables/modelItemLabelPluginServerParams.html +1 -0
- package/docs/variables/modelRoomLabelPluginServerParams.html +1 -0
- package/libs/CruisePlugin/Move.js +7 -2
- package/libs/CruisePlugin/Work.js +7 -2
- package/libs/CruisePlugin/index.js +11 -6
- package/libs/GuideLinePlugin/Controller.js +9 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +7 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +7 -2
- package/libs/GuideLinePlugin/index.js +11 -6
- package/libs/PanoTagPlugin/Components/TagItem.js +122 -122
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +320 -289
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.d.ts +118 -0
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.js +505 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.d.ts +157 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.js +492 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +13 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.js +89 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.js +478 -0
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagUtil.js +21 -19
- package/libs/PanoTagPlugin/controller/index.d.ts +36 -1
- package/libs/PanoTagPlugin/controller/index.js +184 -121
- package/libs/PanoTagPlugin/index.js +16 -11
- package/libs/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -13
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.js +18 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.js +26 -14
- package/libs/PanoTagPlugin/utils/tagPosition.d.ts +2 -2
- package/libs/PanoTagPlugin/utils/tagPosition.js +46 -17
- package/libs/base/BasePlugin.js +5 -5
- package/libs/index.js +155 -150
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type PanoTagPluginController from '..';
|
|
2
|
+
import type { TagContentType, Tag as TagData, TagInstance, TagClickParams } from '../..';
|
|
3
|
+
import { BaseTag } from './BaseTag';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import type { PartialObjectDeep } from '../../../typings/typings';
|
|
6
|
+
import type { Tag } from '../..';
|
|
7
|
+
import type { State as FiveState } from '@realsee/five';
|
|
8
|
+
export type MaskTagInterface<C extends TagContentType = TagContentType> = TagInstance<C, 'Mask'>;
|
|
9
|
+
/**
|
|
10
|
+
* Mask 类型的标签
|
|
11
|
+
* 基于全景图 mask 和颜色区域进行物体标记
|
|
12
|
+
*/
|
|
13
|
+
export declare class MaskTag<C extends TagContentType = TagContentType> extends BaseTag<C, 'Mask'> {
|
|
14
|
+
/**
|
|
15
|
+
* Mask 纹理缓存(静态,所有 MaskTag 实例共享)
|
|
16
|
+
* key: mask URL, value: { texture: THREE.Texture, refCount: number, abortController?: AbortController }
|
|
17
|
+
*/
|
|
18
|
+
private static maskTextureCache;
|
|
19
|
+
/**
|
|
20
|
+
* mask 图片 URL(2:1 全景图格式)
|
|
21
|
+
*/
|
|
22
|
+
maskUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* 目标颜色(RGB 格式)
|
|
25
|
+
*/
|
|
26
|
+
targetColor: [number, number, number];
|
|
27
|
+
/**
|
|
28
|
+
* mask 渲染的 mesh 对象(使用 Sphere)
|
|
29
|
+
*/
|
|
30
|
+
maskMesh?: THREE.Mesh;
|
|
31
|
+
/**
|
|
32
|
+
* mask 纹理对象
|
|
33
|
+
*/
|
|
34
|
+
private maskTexture?;
|
|
35
|
+
/**
|
|
36
|
+
* 是否正在加载 mask
|
|
37
|
+
*/
|
|
38
|
+
private loadingMask;
|
|
39
|
+
/**
|
|
40
|
+
* 标签样式配置
|
|
41
|
+
*/
|
|
42
|
+
private tagStyle?;
|
|
43
|
+
/**
|
|
44
|
+
* 点击事件清理函数
|
|
45
|
+
*/
|
|
46
|
+
private clickEventDispose?;
|
|
47
|
+
constructor(plugin: PanoTagPluginController, tagData: TagData);
|
|
48
|
+
/**
|
|
49
|
+
* 计算法向量
|
|
50
|
+
* Mask 标签返回向上的法向量(因为是贴在 cube 面上)
|
|
51
|
+
*/
|
|
52
|
+
computeNormal(): THREE.Vector3;
|
|
53
|
+
/**
|
|
54
|
+
* 更新标签数据
|
|
55
|
+
*/
|
|
56
|
+
set(tag: PartialObjectDeep<Tag<C, 'Mask'>>, deepMerge?: boolean): void;
|
|
57
|
+
/**
|
|
58
|
+
* 重写 getVisible 方法
|
|
59
|
+
* Mask 标签仅在当前点位可见
|
|
60
|
+
*/
|
|
61
|
+
getVisible(fiveState?: Partial<FiveState>): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 点击事件处理
|
|
64
|
+
*/
|
|
65
|
+
onClick(params: Pick<TagClickParams, 'target'>): void;
|
|
66
|
+
/**
|
|
67
|
+
* 展开自己,收起其他标签
|
|
68
|
+
*/
|
|
69
|
+
unfoldAndFoldOthers(): void;
|
|
70
|
+
/**
|
|
71
|
+
* 展开标签详情
|
|
72
|
+
*/
|
|
73
|
+
unfold(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 折叠标签详情
|
|
76
|
+
*/
|
|
77
|
+
fold(): void;
|
|
78
|
+
/**
|
|
79
|
+
* 设置展开/折叠状态
|
|
80
|
+
*/
|
|
81
|
+
setUnfold(unfolded: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* 更新屏幕位置
|
|
84
|
+
*/
|
|
85
|
+
updateScreenPosition(): void;
|
|
86
|
+
/**
|
|
87
|
+
* 应用可见性变化
|
|
88
|
+
*/
|
|
89
|
+
applyVisible(): void;
|
|
90
|
+
/**
|
|
91
|
+
* 更新 mesh 的位置和旋转(跟随观察者)
|
|
92
|
+
* 参考 itemMask 实现
|
|
93
|
+
*/
|
|
94
|
+
private updateMeshTransform;
|
|
95
|
+
/**
|
|
96
|
+
* 初始化 Mask Mesh(使用 Sphere)
|
|
97
|
+
*/
|
|
98
|
+
private initializeMaskMesh;
|
|
99
|
+
/**
|
|
100
|
+
* 创建 Sphere mesh(参考 itemMask 实现)
|
|
101
|
+
*/
|
|
102
|
+
private createSphereMesh;
|
|
103
|
+
/**
|
|
104
|
+
* 获取 Mask 样式配置(合并用户配置和默认值)
|
|
105
|
+
*/
|
|
106
|
+
private getMaskStyle;
|
|
107
|
+
/**
|
|
108
|
+
* 设置点击事件
|
|
109
|
+
*/
|
|
110
|
+
private setupClickEvents;
|
|
111
|
+
/**
|
|
112
|
+
* 清理点击事件
|
|
113
|
+
*/
|
|
114
|
+
private cleanupClickEvents;
|
|
115
|
+
/**
|
|
116
|
+
* 重新加载 mask 图
|
|
117
|
+
*/
|
|
118
|
+
private reloadMask;
|
|
119
|
+
/**
|
|
120
|
+
* 更新 mask 样式
|
|
121
|
+
*/
|
|
122
|
+
private updateMaskStyle;
|
|
123
|
+
/**
|
|
124
|
+
* 销毁标签
|
|
125
|
+
*/
|
|
126
|
+
dispose(): void;
|
|
127
|
+
/**
|
|
128
|
+
* 加载 Mask 纹理(静态方法,支持缓存和引用计数)
|
|
129
|
+
* @param maskUrl mask 图片 URL
|
|
130
|
+
* @returns Promise<THREE.Texture>
|
|
131
|
+
*/
|
|
132
|
+
private static loadMaskTexture;
|
|
133
|
+
/**
|
|
134
|
+
* 释放 Mask 纹理(静态方法)
|
|
135
|
+
* @param maskUrl mask 图片 URL
|
|
136
|
+
*/
|
|
137
|
+
private static releaseMaskTexture;
|
|
138
|
+
/**
|
|
139
|
+
* 获取当前缓存的纹理统计信息(用于性能监控和调试)
|
|
140
|
+
* @returns 缓存统计信息
|
|
141
|
+
*/
|
|
142
|
+
static getCacheStats(): {
|
|
143
|
+
totalCached: number;
|
|
144
|
+
totalRefCount: number;
|
|
145
|
+
estimatedMemoryMB: number;
|
|
146
|
+
cacheEntries: Array<{
|
|
147
|
+
url: string;
|
|
148
|
+
refCount: number;
|
|
149
|
+
sizeMB: number;
|
|
150
|
+
}>;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* 强制清理所有缓存的纹理(用于内存管理,谨慎使用)
|
|
154
|
+
* 注意:这会释放所有纹理,即使它们仍在使用中
|
|
155
|
+
*/
|
|
156
|
+
static clearAllCache(): void;
|
|
157
|
+
}
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var w = Object.getOwnPropertySymbols;
|
|
3
|
+
var F = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var T = (p, o, t) => o in p ? E(p, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[o] = t, M = (p, o) => {
|
|
5
|
+
for (var t in o || (o = {}))
|
|
6
|
+
F.call(o, t) && T(p, t, o[t]);
|
|
7
|
+
if (w)
|
|
8
|
+
for (var t of w(o))
|
|
9
|
+
A.call(o, t) && T(p, t, o[t]);
|
|
10
|
+
return p;
|
|
11
|
+
};
|
|
12
|
+
var u = (p, o, t) => (T(p, typeof o != "symbol" ? o + "" : o, t), t);
|
|
13
|
+
var C = (p, o, t) => new Promise((e, i) => {
|
|
14
|
+
var s = (a) => {
|
|
15
|
+
try {
|
|
16
|
+
r(t.next(a));
|
|
17
|
+
} catch (c) {
|
|
18
|
+
i(c);
|
|
19
|
+
}
|
|
20
|
+
}, h = (a) => {
|
|
21
|
+
try {
|
|
22
|
+
r(t.throw(a));
|
|
23
|
+
} catch (c) {
|
|
24
|
+
i(c);
|
|
25
|
+
}
|
|
26
|
+
}, r = (a) => a.done ? e(a.value) : Promise.resolve(a.value).then(s, h);
|
|
27
|
+
r((t = t.apply(p, o)).next());
|
|
28
|
+
});
|
|
29
|
+
import { BaseTag as P } from "./BaseTag.js";
|
|
30
|
+
import * as n from "three";
|
|
31
|
+
import { maskVertexShader as V, maskFragmentShader as z } from "./MaskTag.shaders.js";
|
|
32
|
+
import "../../../shared-utils/Subscribe.js";
|
|
33
|
+
import "../../utils/tag/calculateTagConfig.js";
|
|
34
|
+
import "../../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
35
|
+
import "../../../shared-utils/typescript/entries.js";
|
|
36
|
+
import "../../utils/tag/adaptConfig.js";
|
|
37
|
+
import "../../typings/tag/TagConfig.js";
|
|
38
|
+
import "@realsee/five";
|
|
39
|
+
import "../../../shared-utils/tag.js";
|
|
40
|
+
import "../../../shared-utils/positionToVector3.js";
|
|
41
|
+
import "../../../shared-utils/five/vector3ToScreen.js";
|
|
42
|
+
import "../../../shared-utils/five/getFiveModel.js";
|
|
43
|
+
import "../../../shared-utils/Utils/FiveUtil.js";
|
|
44
|
+
import "../../../shared-utils/Utils/BaseUtil.js";
|
|
45
|
+
import "../../../shared-utils/Utils/WorkUtil.js";
|
|
46
|
+
import "../../../shared-utils/five/transformPosition.js";
|
|
47
|
+
import "../../../shared-utils/three/temp.js";
|
|
48
|
+
import "../../../shared-utils/three/core/Raycaster.js";
|
|
49
|
+
import "../../../shared-utils/dom/resizeObserver.js";
|
|
50
|
+
import "../../../shared-utils/five/fiveEveryReadyListener.js";
|
|
51
|
+
import "../../../shared-utils/throttle.js";
|
|
52
|
+
import "../../../vendor/hammerjs/hammer.js";
|
|
53
|
+
import "../../../shared-utils/three/PointSelector/index.js";
|
|
54
|
+
import "../../../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
|
|
55
|
+
import "../../../shared-utils/three/Magnifier.js";
|
|
56
|
+
import "../../../shared-utils/three/PointSelector/utils/PointHelper.js";
|
|
57
|
+
import "../../../shared-utils/three/Assets/index.js";
|
|
58
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
59
|
+
import "../../../shared-utils/even.js";
|
|
60
|
+
import "../../../shared-utils/CSS3DRender/OpacityMesh.js";
|
|
61
|
+
import "../../../shared-utils/three/centerPoint.js";
|
|
62
|
+
import "../../../shared-utils/three/getObjectVisible.js";
|
|
63
|
+
import "../../../shared-utils/three/CSS3DRenderer/index.js";
|
|
64
|
+
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
65
|
+
import "@realsee/five/line";
|
|
66
|
+
import "../../../shared-utils/isNil.js";
|
|
67
|
+
import "../../../shared-utils/three/core/Five_LineMaterial2.js";
|
|
68
|
+
import "../../../shared-utils/three/core/Sphere.js";
|
|
69
|
+
import "../../../shared-utils/three/blink.js";
|
|
70
|
+
import "../../../vendor/animejs/lib/anime.es.js";
|
|
71
|
+
import "../../../shared-utils/util.js";
|
|
72
|
+
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
73
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
74
|
+
import "../../../shared-utils/CSS3DRender/CSS3DRenderer.js";
|
|
75
|
+
import "../../../shared-utils/createResizeObserver.js";
|
|
76
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
77
|
+
import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
78
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
79
|
+
import "../../../shared-utils/three/PointSelector/utils/html.js";
|
|
80
|
+
import "../../../shared-utils/CSS3DRender/index.js";
|
|
81
|
+
import "../../../shared-utils/five/fiveModelLoad.js";
|
|
82
|
+
import "../../../shared-utils/three/PointSelector/utils/PointHelper2.js";
|
|
83
|
+
import "../../../Sculpt/Meshes/Line.js";
|
|
84
|
+
import "../../../Sculpt/typings/style.js";
|
|
85
|
+
import "../../../shared-utils/three/IObject3D.js";
|
|
86
|
+
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
87
|
+
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
88
|
+
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
89
|
+
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
90
|
+
import "../../../shared-utils/three/core/Line2.js";
|
|
91
|
+
import "../../../shared-utils/three/core/LineMaterial2.js";
|
|
92
|
+
import "../../../Sculpt/utils/unit.js";
|
|
93
|
+
import "../../../Sculpt/utils/renderDom.js";
|
|
94
|
+
import "../../../vendor/earcut/src/earcut.js";
|
|
95
|
+
import "../../../shared-utils/five/FivePuppet.js";
|
|
96
|
+
import "../../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
97
|
+
import "../../../shared-utils/isTouchDevice.js";
|
|
98
|
+
import "../../../shared-utils/five/getPosition.js";
|
|
99
|
+
import "../../../shared-utils/five/getRaycasterByNdcPosition.js";
|
|
100
|
+
import "../../../shared-utils/three/PointSelector/utils/contents.js";
|
|
101
|
+
import "../../../Sculpt/utils/three/rayOnLine.js";
|
|
102
|
+
import "../../../shared-utils/five/mode.js";
|
|
103
|
+
import "../../utils/tag/format.js";
|
|
104
|
+
import "../../../shared-utils/url/defaultUrls.js";
|
|
105
|
+
import "../../../shared-utils/vectorToCoordinate.js";
|
|
106
|
+
import "../../../shared-utils/formatRad.js";
|
|
107
|
+
import "../../../shared-utils/five/lookPoint.js";
|
|
108
|
+
import "../../../shared-utils/uuid.js";
|
|
109
|
+
import "../../utils/tagPosition.js";
|
|
110
|
+
import "../../utils/tag/tagCheck.js";
|
|
111
|
+
import "../../utils/checkRange.js";
|
|
112
|
+
import "../../../shared-utils/url/getUrl.js";
|
|
113
|
+
import "../../../shared-utils/five/getFloorIndex.js";
|
|
114
|
+
import "../../../shared-utils/safeObj.js";
|
|
115
|
+
import "../../utils/Cache.js";
|
|
116
|
+
import "../../../shared-utils/promise/withResolvers.js";
|
|
117
|
+
const l = class extends P {
|
|
118
|
+
constructor(t, e) {
|
|
119
|
+
super(t, e);
|
|
120
|
+
/**
|
|
121
|
+
* mask 图片 URL(2:1 全景图格式)
|
|
122
|
+
*/
|
|
123
|
+
u(this, "maskUrl");
|
|
124
|
+
/**
|
|
125
|
+
* 目标颜色(RGB 格式)
|
|
126
|
+
*/
|
|
127
|
+
u(this, "targetColor");
|
|
128
|
+
/**
|
|
129
|
+
* mask 渲染的 mesh 对象(使用 Sphere)
|
|
130
|
+
*/
|
|
131
|
+
u(this, "maskMesh");
|
|
132
|
+
/**
|
|
133
|
+
* mask 纹理对象
|
|
134
|
+
*/
|
|
135
|
+
u(this, "maskTexture");
|
|
136
|
+
/**
|
|
137
|
+
* 是否正在加载 mask
|
|
138
|
+
*/
|
|
139
|
+
u(this, "loadingMask", !1);
|
|
140
|
+
/**
|
|
141
|
+
* 标签样式配置
|
|
142
|
+
*/
|
|
143
|
+
u(this, "tagStyle");
|
|
144
|
+
/**
|
|
145
|
+
* 点击事件清理函数
|
|
146
|
+
*/
|
|
147
|
+
u(this, "clickEventDispose");
|
|
148
|
+
this.maskUrl = e.mask || "";
|
|
149
|
+
const i = e.color;
|
|
150
|
+
Array.isArray(i) ? this.targetColor = i : typeof i == "number" ? this.targetColor = [i >> 16 & 255, i >> 8 & 255, i & 255] : this.targetColor = [0, 0, 0], this.tagStyle = e.style, this.updateVisible(), this.currentVisible && this.initializeMaskMesh();
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 计算法向量
|
|
154
|
+
* Mask 标签返回向上的法向量(因为是贴在 cube 面上)
|
|
155
|
+
*/
|
|
156
|
+
computeNormal() {
|
|
157
|
+
return new n.Vector3(0, 1, 0);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 更新标签数据
|
|
161
|
+
*/
|
|
162
|
+
set(t, e = !0) {
|
|
163
|
+
if (super.set(t, e), t.style && (this.tagStyle = M(M({}, this.tagStyle), t.style)), t.mask && (this.maskUrl = t.mask, this.reloadMask()), t.color) {
|
|
164
|
+
const i = t.color;
|
|
165
|
+
Array.isArray(i) ? this.targetColor = i : typeof i == "number" && (this.targetColor = [i >> 16 & 255, i >> 8 & 255, i & 255]), this.updateMaskStyle();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 重写 getVisible 方法
|
|
170
|
+
* Mask 标签仅在当前点位可见
|
|
171
|
+
*/
|
|
172
|
+
getVisible(t) {
|
|
173
|
+
var s;
|
|
174
|
+
if (!this.enabled || !this.plugin.state.enabled || !this.fiveUtil.model)
|
|
175
|
+
return !1;
|
|
176
|
+
const e = M(M({}, this.five.getCurrentState()), t), { panoIndex: i } = e;
|
|
177
|
+
return i !== ((s = this.fiveState) == null ? void 0 : s.panoIndex) ? !1 : super.getVisible(e);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 点击事件处理
|
|
181
|
+
*/
|
|
182
|
+
onClick(t) {
|
|
183
|
+
t.target === "TagMaskModel" && this.unfoldAndFoldOthers();
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 展开自己,收起其他标签
|
|
187
|
+
*/
|
|
188
|
+
unfoldAndFoldOthers() {
|
|
189
|
+
if (this.isPopoverConfigEnabled())
|
|
190
|
+
return;
|
|
191
|
+
const t = this.can("fold"), e = this.can("unfold");
|
|
192
|
+
t && e && (this.state.unfolded = !this.state.unfolded, this.manuallyOperated = !0, this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }), this.state.unfolded && this.plugin.tags.forEach((i) => {
|
|
193
|
+
i.id !== this.id && i.fold();
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* 展开标签详情
|
|
198
|
+
*/
|
|
199
|
+
unfold() {
|
|
200
|
+
this.isPopoverConfigEnabled() || this.setUnfold(!0);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* 折叠标签详情
|
|
204
|
+
*/
|
|
205
|
+
fold() {
|
|
206
|
+
this.isPopoverConfigEnabled() || this.setUnfold(!1);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* 设置展开/折叠状态
|
|
210
|
+
*/
|
|
211
|
+
setUnfold(t) {
|
|
212
|
+
if (this.isPopoverConfigEnabled())
|
|
213
|
+
return;
|
|
214
|
+
const e = this.can("fold"), i = this.can("unfold");
|
|
215
|
+
e && i && (this.state.unfolded = t, this.hooks.emit(t ? "unfolded" : "folded"), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }));
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 更新屏幕位置
|
|
219
|
+
*/
|
|
220
|
+
updateScreenPosition() {
|
|
221
|
+
if (!this.currentVisible || !this.position || !Array.isArray(this.position)) {
|
|
222
|
+
this.screenPosition = null, this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const e = new n.Vector3(...this.position).clone().project(this.five.camera);
|
|
226
|
+
if (this.five.renderer) {
|
|
227
|
+
const i = this.five.renderer.getSize(new n.Vector2());
|
|
228
|
+
this.screenPosition = {
|
|
229
|
+
leftPx: (e.x + 1) / 2 * i.x,
|
|
230
|
+
topPx: (-e.y + 1) / 2 * i.y,
|
|
231
|
+
scale: 1
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* 应用可见性变化
|
|
238
|
+
*/
|
|
239
|
+
applyVisible() {
|
|
240
|
+
this.visible && !this.maskMesh && !this.loadingMask && this.initializeMaskMesh(), this.maskMesh && (this.maskMesh.visible = this.visible, this.updateMeshTransform()), this.updateScreenPosition();
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* 更新 mesh 的位置和旋转(跟随观察者)
|
|
244
|
+
* 参考 itemMask 实现
|
|
245
|
+
*/
|
|
246
|
+
updateMeshTransform() {
|
|
247
|
+
var i;
|
|
248
|
+
if (!this.maskMesh)
|
|
249
|
+
return;
|
|
250
|
+
const t = (i = this.fiveState) == null ? void 0 : i.panoIndex;
|
|
251
|
+
if (t === void 0)
|
|
252
|
+
return;
|
|
253
|
+
const e = this.workUtil.getObserver(t);
|
|
254
|
+
e && (this.maskMesh.position.copy(e.position), this.maskMesh.quaternion.copy(e.quaternion), this.five.needsRender = !0);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* 初始化 Mask Mesh(使用 Sphere)
|
|
258
|
+
*/
|
|
259
|
+
initializeMaskMesh() {
|
|
260
|
+
return C(this, null, function* () {
|
|
261
|
+
if (this.maskMesh || this.loadingMask || !this.maskUrl)
|
|
262
|
+
return;
|
|
263
|
+
this.loadingMask = !0;
|
|
264
|
+
const t = performance.now();
|
|
265
|
+
try {
|
|
266
|
+
this.maskTexture = yield l.loadMaskTexture(this.maskUrl), this.maskMesh = this.createSphereMesh(this.maskTexture), this.plugin.imagePlaneGroup.add(this.maskMesh), this.applyVisible(), this.five.needsRender = !0, this.setupClickEvents(), this.updateScreenPosition();
|
|
267
|
+
const e = performance.now() - t;
|
|
268
|
+
console.log(`[MaskTag Performance] Mesh initialized in ${e.toFixed(2)}ms for tag ${this.id}`);
|
|
269
|
+
} catch (e) {
|
|
270
|
+
console.error("[MaskTag] Failed to initialize mask mesh:", e);
|
|
271
|
+
} finally {
|
|
272
|
+
this.loadingMask = !1;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 创建 Sphere mesh(参考 itemMask 实现)
|
|
278
|
+
*/
|
|
279
|
+
createSphereMesh(t) {
|
|
280
|
+
const e = this.getMaskStyle(), i = new n.Vector4(this.targetColor[0] / 255, this.targetColor[1] / 255, this.targetColor[2] / 255, 1), s = new n.ShaderMaterial({
|
|
281
|
+
vertexShader: V,
|
|
282
|
+
fragmentShader: z,
|
|
283
|
+
uniforms: {
|
|
284
|
+
map: { value: t },
|
|
285
|
+
color: { value: i },
|
|
286
|
+
tolerance: { value: e.tolerance / 255 },
|
|
287
|
+
// 归一化容差
|
|
288
|
+
highlightColor: {
|
|
289
|
+
value: new n.Vector3(e.highlightColor[0] / 255, e.highlightColor[1] / 255, e.highlightColor[2] / 255)
|
|
290
|
+
},
|
|
291
|
+
opacity: { value: e.opacity }
|
|
292
|
+
},
|
|
293
|
+
depthWrite: !1,
|
|
294
|
+
depthTest: !1,
|
|
295
|
+
transparent: !0
|
|
296
|
+
}), h = new n.SphereGeometry(1, 60, 40);
|
|
297
|
+
h.rotateY(-Math.PI / 2), h.scale(-1, 1, 1);
|
|
298
|
+
const r = new n.Mesh(h, s);
|
|
299
|
+
r.renderOrder = -1e3;
|
|
300
|
+
let a = null;
|
|
301
|
+
const c = () => {
|
|
302
|
+
if (a)
|
|
303
|
+
return a;
|
|
304
|
+
if (!t.image)
|
|
305
|
+
return null;
|
|
306
|
+
try {
|
|
307
|
+
const m = document.createElement("canvas"), k = m.getContext("2d");
|
|
308
|
+
if (!k)
|
|
309
|
+
return null;
|
|
310
|
+
const d = t.image;
|
|
311
|
+
return m.width = d.width, m.height = d.height, k.drawImage(d, 0, 0), a = k.getImageData(0, 0, d.width, d.height), a;
|
|
312
|
+
} catch (m) {
|
|
313
|
+
return console.error("[MaskTag] Failed to get image data:", m), null;
|
|
314
|
+
}
|
|
315
|
+
}, g = r.raycast.bind(r);
|
|
316
|
+
return r.raycast = (m, k) => {
|
|
317
|
+
const d = [];
|
|
318
|
+
if (g(m, d), d.length > 0) {
|
|
319
|
+
const y = d[0];
|
|
320
|
+
if (y.uv && t.image) {
|
|
321
|
+
const f = c();
|
|
322
|
+
if (f) {
|
|
323
|
+
const S = Math.floor(y.uv.x * f.width), v = (Math.floor((1 - y.uv.y) * f.height) * f.width + S) * 4, x = [f.data[v], f.data[v + 1], f.data[v + 2]];
|
|
324
|
+
Math.abs(x[0] / 255 - this.targetColor[0] / 255) + Math.abs(x[1] / 255 - this.targetColor[1] / 255) + Math.abs(x[2] / 255 - this.targetColor[2] / 255) < e.tolerance && k.push(y);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}, r.__maskTag = this.id, r.__maskMesh = !0, r;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* 获取 Mask 样式配置(合并用户配置和默认值)
|
|
332
|
+
*/
|
|
333
|
+
getMaskStyle() {
|
|
334
|
+
var i, s, h;
|
|
335
|
+
const t = ((i = this.tagStyle) == null ? void 0 : i.mask) || {};
|
|
336
|
+
let e = [86, 134, 253];
|
|
337
|
+
return t.color ? Array.isArray(t.color) ? e = t.color : typeof t.color == "number" && (e = [t.color >> 16 & 255, t.color >> 8 & 255, t.color & 255]) : t.highlightColor && (Array.isArray(t.highlightColor) ? e = t.highlightColor : typeof t.highlightColor == "number" && (e = [t.highlightColor >> 16 & 255, t.highlightColor >> 8 & 255, t.highlightColor & 255])), {
|
|
338
|
+
tolerance: (s = t.tolerance) != null ? s : 1e-3,
|
|
339
|
+
// 参考 itemMask 默认 0.001(归一化后的值)
|
|
340
|
+
highlightColor: e,
|
|
341
|
+
opacity: (h = t.opacity) != null ? h : 0.6
|
|
342
|
+
// 默认 0.6(用于填充区域)
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* 设置点击事件
|
|
347
|
+
*/
|
|
348
|
+
setupClickEvents() {
|
|
349
|
+
if (!this.maskMesh || this.config.clickable === !1)
|
|
350
|
+
return;
|
|
351
|
+
this.cleanupClickEvents();
|
|
352
|
+
const t = (e) => {
|
|
353
|
+
this.plugin.hooks.emit("click", { event: e, target: "TagMaskModel", tag: this });
|
|
354
|
+
};
|
|
355
|
+
requestAnimationFrame(() => {
|
|
356
|
+
!this.maskMesh || !this.plugin.domEvents || (this.clickEventDispose = this.addObjectClickHandler(this, this.maskMesh, t));
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* 清理点击事件
|
|
361
|
+
*/
|
|
362
|
+
cleanupClickEvents() {
|
|
363
|
+
this.clickEventDispose && (this.clickEventDispose(), this.clickEventDispose = void 0);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 重新加载 mask 图
|
|
367
|
+
*/
|
|
368
|
+
reloadMask() {
|
|
369
|
+
return C(this, null, function* () {
|
|
370
|
+
this.maskMesh && (this.maskMesh.parent && this.maskMesh.parent.remove(this.maskMesh), this.maskMesh.geometry.dispose(), this.maskMesh.material && (Array.isArray(this.maskMesh.material) ? this.maskMesh.material.forEach((t) => t.dispose()) : this.maskMesh.material.dispose()), this.maskMesh = void 0), this.maskTexture && this.maskUrl && (l.releaseMaskTexture(this.maskUrl), this.maskTexture = void 0), yield this.initializeMaskMesh();
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* 更新 mask 样式
|
|
375
|
+
*/
|
|
376
|
+
updateMaskStyle() {
|
|
377
|
+
if (!this.maskMesh)
|
|
378
|
+
return;
|
|
379
|
+
const t = this.getMaskStyle(), e = this.maskMesh.material;
|
|
380
|
+
e.uniforms && (e.uniforms.color.value.set(this.targetColor[0] / 255, this.targetColor[1] / 255, this.targetColor[2] / 255, 1), e.uniforms.tolerance.value = t.tolerance / 255, e.uniforms.highlightColor.value.set(
|
|
381
|
+
t.highlightColor[0] / 255,
|
|
382
|
+
t.highlightColor[1] / 255,
|
|
383
|
+
t.highlightColor[2] / 255
|
|
384
|
+
), e.uniforms.opacity.value = t.opacity), this.five.needsRender = !0;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* 销毁标签
|
|
388
|
+
*/
|
|
389
|
+
dispose() {
|
|
390
|
+
this.cleanupClickEvents(), this.maskMesh && (this.maskMesh.parent && this.maskMesh.parent.remove(this.maskMesh), this.maskMesh.geometry.dispose(), this.maskMesh.material && (Array.isArray(this.maskMesh.material) ? this.maskMesh.material.forEach((t) => t.dispose()) : this.maskMesh.material.dispose()), this.maskMesh = void 0), this.maskTexture && this.maskUrl && (l.releaseMaskTexture(this.maskUrl), this.maskTexture = void 0);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* 加载 Mask 纹理(静态方法,支持缓存和引用计数)
|
|
394
|
+
* @param maskUrl mask 图片 URL
|
|
395
|
+
* @returns Promise<THREE.Texture>
|
|
396
|
+
*/
|
|
397
|
+
static loadMaskTexture(t) {
|
|
398
|
+
return C(this, null, function* () {
|
|
399
|
+
const e = l.maskTextureCache.get(t);
|
|
400
|
+
if (e)
|
|
401
|
+
return e.refCount++, e.texture;
|
|
402
|
+
const i = performance.now(), s = new AbortController(), h = new n.TextureLoader();
|
|
403
|
+
try {
|
|
404
|
+
const r = yield new Promise((c, g) => {
|
|
405
|
+
if (s.signal.aborted) {
|
|
406
|
+
g(new Error("Load aborted"));
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
h.load(
|
|
410
|
+
t,
|
|
411
|
+
(m) => {
|
|
412
|
+
s.signal.aborted ? (m.dispose(), g(new Error("Load aborted"))) : c(m);
|
|
413
|
+
},
|
|
414
|
+
void 0,
|
|
415
|
+
(m) => {
|
|
416
|
+
g(m);
|
|
417
|
+
}
|
|
418
|
+
), s.signal.addEventListener("abort", () => {
|
|
419
|
+
g(new Error("Load aborted"));
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
r.wrapS = n.ClampToEdgeWrapping, r.wrapT = n.ClampToEdgeWrapping, r.minFilter = n.LinearFilter, r.magFilter = n.LinearFilter, r.anisotropy = 4, l.maskTextureCache.set(t, {
|
|
423
|
+
texture: r,
|
|
424
|
+
refCount: 1,
|
|
425
|
+
abortController: s
|
|
426
|
+
});
|
|
427
|
+
const a = performance.now() - i;
|
|
428
|
+
if (console.log(`[MaskTag Performance] Texture loaded in ${a.toFixed(2)}ms, URL: ${t.substring(0, 50)}...`), r.image) {
|
|
429
|
+
const c = (r.image.width * r.image.height * 4 / 1048576).toFixed(2);
|
|
430
|
+
console.log(`[MaskTag Memory] Texture size: ${r.image.width}x${r.image.height}, estimated memory: ${c}MB`);
|
|
431
|
+
}
|
|
432
|
+
return r;
|
|
433
|
+
} catch (r) {
|
|
434
|
+
throw console.error("[MaskTag] Failed to load mask texture:", t, r), r;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* 释放 Mask 纹理(静态方法)
|
|
440
|
+
* @param maskUrl mask 图片 URL
|
|
441
|
+
*/
|
|
442
|
+
static releaseMaskTexture(t) {
|
|
443
|
+
var i;
|
|
444
|
+
const e = l.maskTextureCache.get(t);
|
|
445
|
+
e && (e.refCount--, e.refCount <= 0 && (console.log(`[MaskTag Memory] Releasing texture (refCount=0): ${t.substring(0, 50)}...`), (i = e.abortController) == null || i.abort(), e.texture.dispose(), l.maskTextureCache.delete(t)));
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* 获取当前缓存的纹理统计信息(用于性能监控和调试)
|
|
449
|
+
* @returns 缓存统计信息
|
|
450
|
+
*/
|
|
451
|
+
static getCacheStats() {
|
|
452
|
+
let t = 0, e = 0;
|
|
453
|
+
const i = [];
|
|
454
|
+
return l.maskTextureCache.forEach((s, h) => {
|
|
455
|
+
t += s.refCount;
|
|
456
|
+
let r = 0;
|
|
457
|
+
if (s.texture.image) {
|
|
458
|
+
const a = s.texture.image.width || 0, c = s.texture.image.height || 0;
|
|
459
|
+
r = a * c * 4 / (1024 * 1024), e += r;
|
|
460
|
+
}
|
|
461
|
+
i.push({
|
|
462
|
+
url: h.substring(0, 80),
|
|
463
|
+
refCount: s.refCount,
|
|
464
|
+
sizeMB: parseFloat(r.toFixed(2))
|
|
465
|
+
});
|
|
466
|
+
}), {
|
|
467
|
+
totalCached: l.maskTextureCache.size,
|
|
468
|
+
totalRefCount: t,
|
|
469
|
+
estimatedMemoryMB: parseFloat(e.toFixed(2)),
|
|
470
|
+
cacheEntries: i
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* 强制清理所有缓存的纹理(用于内存管理,谨慎使用)
|
|
475
|
+
* 注意:这会释放所有纹理,即使它们仍在使用中
|
|
476
|
+
*/
|
|
477
|
+
static clearAllCache() {
|
|
478
|
+
console.warn("[MaskTag] Clearing all texture cache"), l.maskTextureCache.forEach((t) => {
|
|
479
|
+
var e;
|
|
480
|
+
(e = t.abortController) == null || e.abort(), t.texture.dispose();
|
|
481
|
+
}), l.maskTextureCache.clear();
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
let b = l;
|
|
485
|
+
/**
|
|
486
|
+
* Mask 纹理缓存(静态,所有 MaskTag 实例共享)
|
|
487
|
+
* key: mask URL, value: { texture: THREE.Texture, refCount: number, abortController?: AbortController }
|
|
488
|
+
*/
|
|
489
|
+
u(b, "maskTextureCache", /* @__PURE__ */ new Map());
|
|
490
|
+
export {
|
|
491
|
+
b as MaskTag
|
|
492
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mask 标签的 Shader 代码
|
|
3
|
+
* 参考 itemMask 插件实现
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Vertex Shader
|
|
7
|
+
*/
|
|
8
|
+
export declare const maskVertexShader = "\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n";
|
|
9
|
+
/**
|
|
10
|
+
* Fragment Shader
|
|
11
|
+
* 实现颜色匹配和高亮渲染逻辑
|
|
12
|
+
*/
|
|
13
|
+
export declare const maskFragmentShader = "\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec2 vUv;\nuniform sampler2D map;\nuniform vec4 color;\nuniform float tolerance;\nuniform vec3 highlightColor;\nuniform float opacity;\n\nfloat colorGap(vec3 color1, vec3 color2) {\n float gap = abs(color1.r - color2.r) + abs(color1.g - color2.g) + abs(color1.b - color2.b);\n return gap;\n}\n\nvoid main() {\n vec4 image = texture2D(map, vUv);\n \n // \u8BA1\u7B97\u5F53\u524D\u50CF\u7D20\u4E0E\u76EE\u6807\u989C\u8272\u7684\u5DEE\u5F02\n float gap = colorGap(image.rgb, color.rgb);\n \n // \u6392\u9664\u9ED1\u8272\u50CF\u7D20\n if (image.r == 0.0 && image.g == 0.0 && image.b == 0.0) {\n discard;\n }\n \n // \u4F7F\u7528 fwidth \u8BA1\u7B97\u68AF\u5EA6\uFF0C\u5B9E\u73B0\u5E73\u6ED1\u7684\u989C\u8272\u5339\u914D\u8FB9\u754C\n #ifdef GL_OES_standard_derivatives\n float smoothRange = fwidth(gap) * 3.0;\n #else\n float smoothRange = 0.01;\n #endif\n \n // \u5E73\u6ED1\u7684\u989C\u8272\u5339\u914D\u56E0\u5B50\uFF080-1\uFF09\n float matchFactor = 1.0 - smoothstep(tolerance - smoothRange, tolerance + smoothRange, gap);\n \n if (matchFactor > 0.0) {\n // \u68C0\u6D4B\u8FB9\u7F18\uFF1A\u91C7\u6837\u5468\u56F4\u50CF\u7D20\n float edgeWidth = 0.004;\n \n vec4 colorLeft = texture2D(map, vUv + vec2(-edgeWidth, 0.0));\n vec4 colorRight = texture2D(map, vUv + vec2(edgeWidth, 0.0));\n vec4 colorUp = texture2D(map, vUv + vec2(0.0, -edgeWidth));\n vec4 colorDown = texture2D(map, vUv + vec2(0.0, edgeWidth));\n \n // \u8BA1\u7B97\u8FB9\u7F18\u5F3A\u5EA6\n float edgeStrength = 0.0;\n \n if (colorGap(colorLeft.rgb, color.rgb) >= tolerance || (colorLeft.r == 0.0 && colorLeft.g == 0.0 && colorLeft.b == 0.0)) {\n edgeStrength += 0.25;\n }\n if (colorGap(colorRight.rgb, color.rgb) >= tolerance || (colorRight.r == 0.0 && colorRight.g == 0.0 && colorRight.b == 0.0)) {\n edgeStrength += 0.25;\n }\n if (colorGap(colorUp.rgb, color.rgb) >= tolerance || (colorUp.r == 0.0 && colorUp.g == 0.0 && colorUp.b == 0.0)) {\n edgeStrength += 0.25;\n }\n if (colorGap(colorDown.rgb, color.rgb) >= tolerance || (colorDown.r == 0.0 && colorDown.g == 0.0 && colorDown.b == 0.0)) {\n edgeStrength += 0.25;\n }\n \n // \u8FB9\u7F18\u5E73\u6ED1\u8FC7\u6E21\uFF1AedgeStrength \u8D8A\u5927\u8D8A\u63A5\u8FD1\u8FB9\u7F18\n float alpha = mix(opacity, 1.0, smoothstep(0.0, 0.3, edgeStrength));\n \n // \u5E94\u7528\u5339\u914D\u56E0\u5B50\uFF08\u5E73\u6ED1\u989C\u8272\u8FB9\u754C\uFF09\n alpha *= matchFactor;\n \n gl_FragColor = vec4(highlightColor, alpha);\n } else {\n discard;\n }\n}\n";
|