@reearth/core 0.0.7-alpha.6 → 0.0.7-alpha.60
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/LICENSE +177 -0
- package/dist/core.js +70987 -60888
- package/dist/core.umd.cjs +666 -680
- package/dist/{index-DqatWUTw.js → index-CUJ6HGQn.js} +1021 -908
- package/dist/index.d.ts +157 -71
- package/package.json +88 -74
- package/src/Map/ClusteredLayers/index.tsx +1 -1
- package/src/Map/Geoid/index.tsx +68 -0
- package/src/Map/Geoid/types.ts +8 -0
- package/src/Map/Layer/hooks.ts +7 -4
- package/src/Map/Layer/index.tsx +3 -1
- package/src/Map/Layers/hooks.ts +35 -8
- package/src/Map/Layers/index.tsx +13 -2
- package/src/Map/Layers/keys.ts +1 -0
- package/src/Map/Sketch/hooks.ts +454 -411
- package/src/Map/Sketch/index.tsx +68 -21
- package/src/Map/Sketch/sketchMachine.ts +427 -102
- package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
- package/src/Map/Sketch/types.ts +10 -20
- package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
- package/src/Map/Sketch/useSketch.ts +558 -0
- package/src/Map/Sketch/useSketchFeature.ts +198 -0
- package/src/Map/SpatialId/constants.ts +21 -0
- package/src/Map/SpatialId/hooks.ts +448 -0
- package/src/Map/SpatialId/index.tsx +63 -0
- package/src/Map/SpatialId/types.ts +68 -0
- package/src/Map/SpatialId/utils.ts +65 -0
- package/src/Map/hooks.ts +54 -8
- package/src/Map/index.tsx +42 -9
- package/src/Map/ref.ts +32 -3
- package/src/Map/types/index.ts +39 -3
- package/src/Map/types/viewerProperty.ts +10 -0
- package/src/Map/useTimelineManager.ts +4 -10
- package/src/Map/utils.ts +1 -1
- package/src/Visualizer/Error.tsx +4 -1
- package/src/Visualizer/context.tsx +5 -5
- package/src/Visualizer/coreContext.tsx +3 -1
- package/src/Visualizer/hooks.ts +56 -22
- package/src/Visualizer/index.stories.tsx +15 -0
- package/src/Visualizer/index.tsx +25 -6
- package/src/Visualizer/useViewport.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
- package/src/engines/Cesium/Feature/Box/hooks/edge.ts +1 -1
- package/src/engines/Cesium/Feature/Box/hooks/side.ts +1 -1
- package/src/engines/Cesium/Feature/Box/utils.ts +6 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +2 -0
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
- package/src/engines/Cesium/Feature/Marker/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -2
- package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +2 -2
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Resource/index.tsx +1 -27
- package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +136 -71
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +0 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
- package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +2 -2
- package/src/engines/Cesium/Feature/context.ts +1 -0
- package/src/engines/Cesium/Feature/index.tsx +9 -5
- package/src/engines/Cesium/Feature/utils.tsx +20 -12
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +7 -4
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
- package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +126 -35
- package/src/engines/Cesium/Sketch/constants.ts +5 -0
- package/src/engines/Cesium/Sketch/index.tsx +68 -29
- package/src/engines/Cesium/SpatialId/CoordinateIndicator.tsx +28 -0
- package/src/engines/Cesium/SpatialId/SpatialIdSpace.tsx +33 -0
- package/src/engines/Cesium/SpatialId/VerticalSpaceIndicator.tsx +32 -0
- package/src/engines/Cesium/SpatialId/index.ts +3 -0
- package/src/engines/Cesium/common.ts +55 -18
- package/src/engines/Cesium/core/Clock.tsx +1 -1
- package/src/engines/Cesium/core/Globe/index.tsx +73 -0
- package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
- package/src/engines/Cesium/core/Imagery.test.ts +29 -11
- package/src/engines/Cesium/core/Imagery.tsx +22 -6
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +2 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +13 -6
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +2 -1
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +3 -4
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +1 -1
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
- package/src/engines/Cesium/core/presets.ts +24 -28
- package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
- package/src/engines/Cesium/hooks/useCamera.ts +2 -2
- package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
- package/src/engines/Cesium/hooks/useEngineRef.ts +52 -5
- package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
- package/src/engines/Cesium/hooks/useInstance.ts +1 -1
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +3 -3
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +2 -2
- package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +115 -67
- package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
- package/src/engines/Cesium/hooks.ts +55 -14
- package/src/engines/Cesium/index.stories.tsx +0 -1
- package/src/engines/Cesium/index.tsx +20 -6
- package/src/engines/Cesium/pickMany.ts +2 -0
- package/src/engines/Cesium/types.ts +1 -1
- package/src/engines/Cesium/utils/mouse.ts +1 -1
- package/src/engines/Cesium/utils/utils.ts +1 -1
- package/src/mantle/atoms/compute.test.ts +4 -4
- package/src/mantle/atoms/compute.ts +8 -4
- package/src/mantle/compat/forward.ts +1 -1
- package/src/mantle/data/geojson.ts +53 -22
- package/src/mantle/data/georss.ts +2 -2
- package/src/mantle/data/gml.ts +2 -2
- package/src/mantle/data/gpx.ts +2 -2
- package/src/mantle/data/shapefile/parseZip.ts +1 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +72 -0
- package/src/mantle/evaluator/simple/expression/node.ts +10 -12
- package/src/mantle/types/appearance.ts +4 -2
- package/src/mantle/types/index.ts +3 -0
- package/src/{Visualizer → shared}/interactionMode.ts +3 -2
- package/src/test/setup.ts +1 -1
- package/src/test/utils.tsx +1 -1
- package/src/types/modules.d.ts +96 -0
- package/src/utils/StringMatcher.ts +1 -1
- package/src/utils/image.ts +2 -12
- package/src/utils/use-delayed-count.ts +1 -1
- package/src/utils/use-dnd/drop.ts +1 -1
- package/src/utils/util.ts +1 -1
- package/src/utils/value.ts +2 -2
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +0 -1
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
- package/dist/cesium/ThirdParty/Workers/package.json +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
- package/dist/cesium/Widgets/Animation/Animation.css +0 -127
- package/dist/cesium/Widgets/Animation/lighter.css +0 -70
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
- package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
- package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
- package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
- package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
- package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
- package/dist/cesium/Widgets/lighter.css +0 -237
- package/dist/cesium/Widgets/lighterShared.css +0 -46
- package/dist/cesium/Widgets/shared.css +0 -103
- package/dist/cesium/Widgets/widgets.css +0 -1346
- package/dist/cesium/Workers/chunk-2YD5QWGR.js +0 -28
- package/dist/cesium/Workers/chunk-3T4KR75X.js +0 -26
- package/dist/cesium/Workers/chunk-46KFVW24.js +0 -26
- package/dist/cesium/Workers/chunk-4EI6PP43.js +0 -28
- package/dist/cesium/Workers/chunk-4RS52VIY.js +0 -26
- package/dist/cesium/Workers/chunk-4YLYA3DC.js +0 -26
- package/dist/cesium/Workers/chunk-5ENAGXBI.js +0 -26
- package/dist/cesium/Workers/chunk-5VIB3TI5.js +0 -26
- package/dist/cesium/Workers/chunk-6NGZLDFZ.js +0 -26
- package/dist/cesium/Workers/chunk-6RGNWVZ2.js +0 -27
- package/dist/cesium/Workers/chunk-7AZZVJ52.js +0 -26
- package/dist/cesium/Workers/chunk-AMXAQQEL.js +0 -26
- package/dist/cesium/Workers/chunk-AQW44ZPC.js +0 -26
- package/dist/cesium/Workers/chunk-CPCMDW6Z.js +0 -26
- package/dist/cesium/Workers/chunk-DNL2WDRL.js +0 -26
- package/dist/cesium/Workers/chunk-ERW7V247.js +0 -26
- package/dist/cesium/Workers/chunk-EYRIA4TP.js +0 -26
- package/dist/cesium/Workers/chunk-F7RQIJML.js +0 -26
- package/dist/cesium/Workers/chunk-FPZMU6QP.js +0 -26
- package/dist/cesium/Workers/chunk-FZDVQW7A.js +0 -26
- package/dist/cesium/Workers/chunk-GAZ2U4FO.js +0 -26
- package/dist/cesium/Workers/chunk-I44IOOT4.js +0 -26
- package/dist/cesium/Workers/chunk-IALXUAD4.js +0 -26
- package/dist/cesium/Workers/chunk-IXBUEUZL.js +0 -26
- package/dist/cesium/Workers/chunk-J3GCYV5K.js +0 -26
- package/dist/cesium/Workers/chunk-KGSZTFHZ.js +0 -26
- package/dist/cesium/Workers/chunk-KKKPU2CI.js +0 -26
- package/dist/cesium/Workers/chunk-KTEJE5KE.js +0 -26
- package/dist/cesium/Workers/chunk-KYZ3DYY6.js +0 -26
- package/dist/cesium/Workers/chunk-L2QG4MRI.js +0 -26
- package/dist/cesium/Workers/chunk-MCE3KFYN.js +0 -26
- package/dist/cesium/Workers/chunk-MMLDGXML.js +0 -26
- package/dist/cesium/Workers/chunk-MTBRPBDQ.js +0 -26
- package/dist/cesium/Workers/chunk-OKT6VBRK.js +0 -26
- package/dist/cesium/Workers/chunk-PHYDKLSY.js +0 -26
- package/dist/cesium/Workers/chunk-PWPX3224.js +0 -26
- package/dist/cesium/Workers/chunk-QHOVE6WG.js +0 -26
- package/dist/cesium/Workers/chunk-QJ6MBL22.js +0 -26
- package/dist/cesium/Workers/chunk-QKO6VIG2.js +0 -26
- package/dist/cesium/Workers/chunk-QVEE4QL2.js +0 -26
- package/dist/cesium/Workers/chunk-RXQOQZ7S.js +0 -26
- package/dist/cesium/Workers/chunk-S3ZKQKMM.js +0 -26
- package/dist/cesium/Workers/chunk-SFEUMZSK.js +0 -26
- package/dist/cesium/Workers/chunk-T75MW4X3.js +0 -26
- package/dist/cesium/Workers/chunk-TVO2A75R.js +0 -66
- package/dist/cesium/Workers/chunk-UHR36K45.js +0 -27
- package/dist/cesium/Workers/chunk-UKJCDZOR.js +0 -26
- package/dist/cesium/Workers/chunk-VKVIYER6.js +0 -26
- package/dist/cesium/Workers/chunk-VPIQWTRZ.js +0 -26
- package/dist/cesium/Workers/chunk-XSX5HRFC.js +0 -26
- package/dist/cesium/Workers/chunk-Z5WQQHSL.js +0 -26
- package/dist/cesium/Workers/chunk-Z7B2VEL5.js +0 -26
- package/dist/cesium/Workers/combineGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxGeometry.js +0 -26
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleGeometry.js +0 -26
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createGeometry.js +0 -26
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereGeometry.js +0 -26
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
- package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
- package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
- package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
- package/dist/cesium/Workers/createWallGeometry.js +0 -26
- package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
- package/dist/cesium/Workers/decodeDraco.js +0 -26
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
- package/dist/cesium/Workers/decodeI3S.js +0 -26
- package/dist/cesium/Workers/transcodeKTX2.js +0 -56
- package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
- package/src/engines/Cesium/core/Globe.tsx +0 -104
- /package/src/{Visualizer → shared}/featureFlags.ts +0 -0
- /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// TODO: Refactor: move cesium related code to engine.
|
|
2
|
-
// import { Cartesian2, Cartesian3 } from "cesium";
|
|
3
2
|
import invariant from "tiny-invariant";
|
|
4
|
-
import { createMachine, type StateFrom } from "xstate";
|
|
3
|
+
import { createMachine, assign, type StateFrom } from "xstate";
|
|
5
4
|
|
|
6
5
|
import { type SketchType } from "./types";
|
|
7
6
|
|
|
@@ -24,15 +23,38 @@ export type EventObject =
|
|
|
24
23
|
pointerPosition: Position2d;
|
|
25
24
|
controlPoint: Position3d;
|
|
26
25
|
})
|
|
26
|
+
| ((
|
|
27
|
+
| { type: "EDIT_MARKER" }
|
|
28
|
+
| { type: "EDIT_POLYLINE" }
|
|
29
|
+
| { type: "EDIT_CIRCLE" }
|
|
30
|
+
| { type: "EDIT_RECTANGLE" }
|
|
31
|
+
| { type: "EDIT_POLYGON" }
|
|
32
|
+
| { type: "EDIT_EXTRUDED_CIRCLE" }
|
|
33
|
+
| { type: "EDIT_EXTRUDED_RECTANGLE" }
|
|
34
|
+
| { type: "EDIT_EXTRUDED_POLYGON" }
|
|
35
|
+
| { type: "CATCH" }
|
|
36
|
+
| { type: "UPDATE" }
|
|
37
|
+
| { type: "MOVE" }
|
|
38
|
+
| { type: "RELEASE" }
|
|
39
|
+
) & {
|
|
40
|
+
extrudedHeight?: number;
|
|
41
|
+
controlPoints: Position3d[];
|
|
42
|
+
catchedControlPointIndex?: number;
|
|
43
|
+
catchedExtrudedPoint?: boolean;
|
|
44
|
+
})
|
|
27
45
|
| { type: "CREATE" }
|
|
28
46
|
| { type: "CANCEL" }
|
|
29
|
-
| { type: "ABORT" }
|
|
47
|
+
| { type: "ABORT" }
|
|
48
|
+
| { type: "EXIT_EDIT" };
|
|
30
49
|
|
|
31
|
-
interface Context {
|
|
50
|
+
export interface Context {
|
|
32
51
|
lastPointerPosition?: Position2d;
|
|
33
52
|
lastControlPoint?: Position3d;
|
|
34
53
|
type?: SketchType;
|
|
35
54
|
controlPoints?: Position3d[];
|
|
55
|
+
catchedControlPointIndex?: number;
|
|
56
|
+
catchedExtrudedPoint?: boolean;
|
|
57
|
+
originalControlPoint?: Position3d;
|
|
36
58
|
}
|
|
37
59
|
|
|
38
60
|
export function createSketchMachine() {
|
|
@@ -76,9 +98,42 @@ export function createSketchMachine() {
|
|
|
76
98
|
target: "drawing.extrudedPolygon",
|
|
77
99
|
actions: ["createExtrudedPolygon"],
|
|
78
100
|
},
|
|
101
|
+
EDIT_MARKER: {
|
|
102
|
+
target: "editing.marker",
|
|
103
|
+
actions: ["editMarker"],
|
|
104
|
+
},
|
|
105
|
+
EDIT_POLYLINE: {
|
|
106
|
+
target: "editing.polyline",
|
|
107
|
+
actions: ["editPolyline"],
|
|
108
|
+
},
|
|
109
|
+
EDIT_CIRCLE: {
|
|
110
|
+
target: "editing.circle",
|
|
111
|
+
actions: ["editCircle"],
|
|
112
|
+
},
|
|
113
|
+
EDIT_RECTANGLE: {
|
|
114
|
+
target: "editing.rectangle",
|
|
115
|
+
actions: ["editRectangle"],
|
|
116
|
+
},
|
|
117
|
+
EDIT_POLYGON: {
|
|
118
|
+
target: "editing.polygon",
|
|
119
|
+
actions: ["editPolygon"],
|
|
120
|
+
},
|
|
121
|
+
EDIT_EXTRUDED_CIRCLE: {
|
|
122
|
+
target: "editing.circle",
|
|
123
|
+
actions: ["editExtrudedCircle"],
|
|
124
|
+
},
|
|
125
|
+
EDIT_EXTRUDED_RECTANGLE: {
|
|
126
|
+
target: "editing.extrudedRectangle",
|
|
127
|
+
actions: ["editExtrudedRectangle"],
|
|
128
|
+
},
|
|
129
|
+
EDIT_EXTRUDED_POLYGON: {
|
|
130
|
+
target: "editing.extrudedPolygon",
|
|
131
|
+
actions: ["editExtrudedPolygon"],
|
|
132
|
+
},
|
|
79
133
|
},
|
|
80
134
|
},
|
|
81
135
|
drawing: {
|
|
136
|
+
initial: "marker",
|
|
82
137
|
states: {
|
|
83
138
|
marker: {
|
|
84
139
|
initial: "vertex",
|
|
@@ -93,7 +148,7 @@ export function createSketchMachine() {
|
|
|
93
148
|
on: {
|
|
94
149
|
NEXT: {
|
|
95
150
|
target: "vertex",
|
|
96
|
-
|
|
151
|
+
reenter: false,
|
|
97
152
|
actions: ["pushPosition"],
|
|
98
153
|
},
|
|
99
154
|
},
|
|
@@ -121,7 +176,7 @@ export function createSketchMachine() {
|
|
|
121
176
|
NEXT: [
|
|
122
177
|
{
|
|
123
178
|
target: "vertex",
|
|
124
|
-
|
|
179
|
+
reenter: false,
|
|
125
180
|
actions: ["pushPosition"],
|
|
126
181
|
},
|
|
127
182
|
],
|
|
@@ -137,12 +192,12 @@ export function createSketchMachine() {
|
|
|
137
192
|
NEXT: [
|
|
138
193
|
{
|
|
139
194
|
target: "#sketch.extruding",
|
|
140
|
-
|
|
141
|
-
actions: ["pushPosition"],
|
|
195
|
+
guard: "willRectangleComplete",
|
|
196
|
+
actions: ["pushPosition", "recordOriginalControlPoint"],
|
|
142
197
|
},
|
|
143
198
|
{
|
|
144
199
|
target: "vertex",
|
|
145
|
-
|
|
200
|
+
reenter: false,
|
|
146
201
|
actions: ["pushPosition"],
|
|
147
202
|
},
|
|
148
203
|
],
|
|
@@ -157,7 +212,7 @@ export function createSketchMachine() {
|
|
|
157
212
|
on: {
|
|
158
213
|
NEXT: {
|
|
159
214
|
target: "vertex",
|
|
160
|
-
|
|
215
|
+
reenter: false,
|
|
161
216
|
actions: ["pushPosition"],
|
|
162
217
|
},
|
|
163
218
|
},
|
|
@@ -171,7 +226,7 @@ export function createSketchMachine() {
|
|
|
171
226
|
on: {
|
|
172
227
|
NEXT: {
|
|
173
228
|
target: "vertex",
|
|
174
|
-
|
|
229
|
+
reenter: false,
|
|
175
230
|
actions: ["pushPosition"],
|
|
176
231
|
},
|
|
177
232
|
EXTRUDE: {
|
|
@@ -190,7 +245,7 @@ export function createSketchMachine() {
|
|
|
190
245
|
CANCEL: [
|
|
191
246
|
{
|
|
192
247
|
target: ".history",
|
|
193
|
-
|
|
248
|
+
guard: "canPopPosition",
|
|
194
249
|
actions: ["popPosition"],
|
|
195
250
|
},
|
|
196
251
|
{
|
|
@@ -224,99 +279,369 @@ export function createSketchMachine() {
|
|
|
224
279
|
},
|
|
225
280
|
},
|
|
226
281
|
},
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
282
|
+
editing: {
|
|
283
|
+
initial: "marker",
|
|
284
|
+
states: {
|
|
285
|
+
marker: {
|
|
286
|
+
initial: "waiting",
|
|
287
|
+
states: {
|
|
288
|
+
waiting: {
|
|
289
|
+
on: {
|
|
290
|
+
CATCH: {
|
|
291
|
+
target: "moving",
|
|
292
|
+
reenter: false,
|
|
293
|
+
actions: ["catchControlPoint"],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
moving: {
|
|
298
|
+
on: {
|
|
299
|
+
MOVE: {
|
|
300
|
+
target: "moving",
|
|
301
|
+
reenter: false,
|
|
302
|
+
actions: ["moveControlPoint"],
|
|
303
|
+
},
|
|
304
|
+
RELEASE: {
|
|
305
|
+
target: "waiting",
|
|
306
|
+
actions: ["releaseControlPoint"],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
polyline: {
|
|
313
|
+
initial: "waiting",
|
|
314
|
+
states: {
|
|
315
|
+
waiting: {
|
|
316
|
+
on: {
|
|
317
|
+
CATCH: {
|
|
318
|
+
target: "moving",
|
|
319
|
+
reenter: false,
|
|
320
|
+
actions: ["catchControlPoint"],
|
|
321
|
+
},
|
|
322
|
+
UPDATE: {
|
|
323
|
+
target: "waiting",
|
|
324
|
+
reenter: false,
|
|
325
|
+
actions: ["updateControlPoints"],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
moving: {
|
|
330
|
+
on: {
|
|
331
|
+
MOVE: {
|
|
332
|
+
target: "moving",
|
|
333
|
+
reenter: false,
|
|
334
|
+
actions: ["moveControlPoint"],
|
|
335
|
+
},
|
|
336
|
+
RELEASE: {
|
|
337
|
+
target: "waiting",
|
|
338
|
+
actions: ["releaseControlPoint"],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
circle: {
|
|
345
|
+
initial: "waiting",
|
|
346
|
+
states: {
|
|
347
|
+
waiting: {
|
|
348
|
+
on: {
|
|
349
|
+
CATCH: {
|
|
350
|
+
target: "moving",
|
|
351
|
+
reenter: false,
|
|
352
|
+
actions: ["catchControlPoint"],
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
moving: {
|
|
357
|
+
on: {
|
|
358
|
+
MOVE: {
|
|
359
|
+
target: "moving",
|
|
360
|
+
reenter: false,
|
|
361
|
+
actions: ["moveControlPoint"],
|
|
362
|
+
},
|
|
363
|
+
RELEASE: {
|
|
364
|
+
target: "waiting",
|
|
365
|
+
actions: ["releaseControlPoint"],
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
rectangle: {
|
|
372
|
+
initial: "waiting",
|
|
373
|
+
states: {
|
|
374
|
+
waiting: {
|
|
375
|
+
on: {
|
|
376
|
+
CATCH: {
|
|
377
|
+
target: "moving",
|
|
378
|
+
reenter: false,
|
|
379
|
+
actions: ["catchControlPoint"],
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
moving: {
|
|
384
|
+
on: {
|
|
385
|
+
MOVE: {
|
|
386
|
+
target: "moving",
|
|
387
|
+
reenter: false,
|
|
388
|
+
actions: ["moveControlPoint"],
|
|
389
|
+
},
|
|
390
|
+
RELEASE: {
|
|
391
|
+
target: "waiting",
|
|
392
|
+
actions: ["releaseControlPoint"],
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
polygon: {
|
|
399
|
+
initial: "waiting",
|
|
400
|
+
states: {
|
|
401
|
+
waiting: {
|
|
402
|
+
on: {
|
|
403
|
+
CATCH: {
|
|
404
|
+
target: "moving",
|
|
405
|
+
reenter: false,
|
|
406
|
+
actions: ["catchControlPoint"],
|
|
407
|
+
},
|
|
408
|
+
UPDATE: {
|
|
409
|
+
target: "waiting",
|
|
410
|
+
reenter: false,
|
|
411
|
+
actions: ["updateControlPoints"],
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
moving: {
|
|
416
|
+
on: {
|
|
417
|
+
MOVE: {
|
|
418
|
+
target: "moving",
|
|
419
|
+
reenter: false,
|
|
420
|
+
actions: ["moveControlPoint"],
|
|
421
|
+
},
|
|
422
|
+
RELEASE: {
|
|
423
|
+
target: "waiting",
|
|
424
|
+
actions: ["releaseControlPoint"],
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
extrudedCircle: {
|
|
431
|
+
initial: "waiting",
|
|
432
|
+
states: {
|
|
433
|
+
waiting: {
|
|
434
|
+
on: {
|
|
435
|
+
CATCH: {
|
|
436
|
+
target: "moving",
|
|
437
|
+
reenter: false,
|
|
438
|
+
actions: ["catchControlPoint"],
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
moving: {
|
|
443
|
+
on: {
|
|
444
|
+
MOVE: {
|
|
445
|
+
target: "moving",
|
|
446
|
+
reenter: false,
|
|
447
|
+
actions: ["moveControlPoint"],
|
|
448
|
+
},
|
|
449
|
+
RELEASE: {
|
|
450
|
+
target: "waiting",
|
|
451
|
+
actions: ["releaseControlPoint"],
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
extrudedRectangle: {
|
|
458
|
+
initial: "waiting",
|
|
459
|
+
states: {
|
|
460
|
+
waiting: {
|
|
461
|
+
on: {
|
|
462
|
+
CATCH: {
|
|
463
|
+
target: "moving",
|
|
464
|
+
reenter: false,
|
|
465
|
+
actions: ["catchControlPoint"],
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
moving: {
|
|
470
|
+
on: {
|
|
471
|
+
MOVE: {
|
|
472
|
+
target: "moving",
|
|
473
|
+
reenter: false,
|
|
474
|
+
actions: ["moveControlPoint"],
|
|
475
|
+
},
|
|
476
|
+
RELEASE: {
|
|
477
|
+
target: "waiting",
|
|
478
|
+
actions: ["releaseControlPoint"],
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
extrudedPolygon: {
|
|
485
|
+
initial: "waiting",
|
|
486
|
+
states: {
|
|
487
|
+
waiting: {
|
|
488
|
+
on: {
|
|
489
|
+
CATCH: {
|
|
490
|
+
target: "moving",
|
|
491
|
+
reenter: false,
|
|
492
|
+
actions: ["catchControlPoint"],
|
|
493
|
+
},
|
|
494
|
+
UPDATE: {
|
|
495
|
+
target: "waiting",
|
|
496
|
+
reenter: false,
|
|
497
|
+
actions: ["updateControlPoints"],
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
moving: {
|
|
502
|
+
on: {
|
|
503
|
+
MOVE: {
|
|
504
|
+
target: "moving",
|
|
505
|
+
reenter: false,
|
|
506
|
+
actions: ["moveControlPoint"],
|
|
507
|
+
},
|
|
508
|
+
RELEASE: {
|
|
509
|
+
target: "waiting",
|
|
510
|
+
actions: ["releaseControlPoint"],
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
on: {
|
|
518
|
+
EXIT_EDIT: {
|
|
519
|
+
target: "idle",
|
|
520
|
+
actions: ["clearDrawing"],
|
|
521
|
+
},
|
|
522
|
+
},
|
|
316
523
|
},
|
|
317
524
|
},
|
|
318
525
|
},
|
|
319
|
-
)
|
|
526
|
+
).provide({
|
|
527
|
+
guards: {
|
|
528
|
+
canPopPosition: ({ context }) => context.controlPoints != null && context.controlPoints.length > 1,
|
|
529
|
+
willRectangleComplete: ({ context }) => context.controlPoints != null && context.controlPoints.length === 2,
|
|
530
|
+
},
|
|
531
|
+
actions: {
|
|
532
|
+
createMarker: assign(({ event }) => {
|
|
533
|
+
const e = event as Extract<EventObject, { type: "MARKER" }>;
|
|
534
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
535
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "marker" as SketchType, controlPoints: [controlPoint] };
|
|
536
|
+
}),
|
|
537
|
+
editMarker: assign(({ event }) => {
|
|
538
|
+
const e = event as Extract<EventObject, { type: "EDIT_MARKER" }>;
|
|
539
|
+
return { lastControlPoint: undefined, type: "marker" as SketchType, controlPoints: e.controlPoints };
|
|
540
|
+
}),
|
|
541
|
+
createPolyline: assign(({ event }) => {
|
|
542
|
+
const e = event as Extract<EventObject, { type: "POLYLINE" }>;
|
|
543
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
544
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "polyline" as SketchType, controlPoints: [controlPoint] };
|
|
545
|
+
}),
|
|
546
|
+
editPolyline: assign(({ event }) => {
|
|
547
|
+
const e = event as Extract<EventObject, { type: "EDIT_POLYLINE" }>;
|
|
548
|
+
return { lastControlPoint: undefined, type: "polyline" as SketchType, controlPoints: e.controlPoints };
|
|
549
|
+
}),
|
|
550
|
+
createCircle: assign(({ event }) => {
|
|
551
|
+
const e = event as Extract<EventObject, { type: "CIRCLE" }>;
|
|
552
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
553
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "circle" as SketchType, controlPoints: [controlPoint] };
|
|
554
|
+
}),
|
|
555
|
+
editCircle: assign(({ event }) => {
|
|
556
|
+
const e = event as Extract<EventObject, { type: "EDIT_CIRCLE" }>;
|
|
557
|
+
return { lastControlPoint: undefined, type: "circle" as SketchType, controlPoints: e.controlPoints };
|
|
558
|
+
}),
|
|
559
|
+
createRectangle: assign(({ event }) => {
|
|
560
|
+
const e = event as Extract<EventObject, { type: "RECTANGLE" }>;
|
|
561
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
562
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "rectangle" as SketchType, controlPoints: [controlPoint] };
|
|
563
|
+
}),
|
|
564
|
+
editRectangle: assign(({ event }) => {
|
|
565
|
+
const e = event as Extract<EventObject, { type: "EDIT_RECTANGLE" }>;
|
|
566
|
+
return { lastControlPoint: undefined, type: "rectangle" as SketchType, controlPoints: e.controlPoints };
|
|
567
|
+
}),
|
|
568
|
+
createPolygon: assign(({ event }) => {
|
|
569
|
+
const e = event as Extract<EventObject, { type: "POLYGON" }>;
|
|
570
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
571
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "polygon" as SketchType, controlPoints: [controlPoint] };
|
|
572
|
+
}),
|
|
573
|
+
editPolygon: assign(({ event }) => {
|
|
574
|
+
const e = event as Extract<EventObject, { type: "EDIT_POLYGON" }>;
|
|
575
|
+
return { lastControlPoint: undefined, type: "polygon" as SketchType, controlPoints: e.controlPoints };
|
|
576
|
+
}),
|
|
577
|
+
createExtrudedCircle: assign(({ event }) => {
|
|
578
|
+
const e = event as Extract<EventObject, { type: "EXTRUDED_CIRCLE" }>;
|
|
579
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
580
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "extrudedCircle" as SketchType, controlPoints: [controlPoint] };
|
|
581
|
+
}),
|
|
582
|
+
editExtrudedCircle: assign(({ event }) => {
|
|
583
|
+
const e = event as Extract<EventObject, { type: "EDIT_EXTRUDED_CIRCLE" }>;
|
|
584
|
+
return { lastControlPoint: undefined, type: "extrudedCircle" as SketchType, controlPoints: e.controlPoints };
|
|
585
|
+
}),
|
|
586
|
+
createExtrudedRectangle: assign(({ event }) => {
|
|
587
|
+
const e = event as Extract<EventObject, { type: "EXTRUDED_RECTANGLE" }>;
|
|
588
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
589
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "extrudedRectangle" as SketchType, controlPoints: [controlPoint] };
|
|
590
|
+
}),
|
|
591
|
+
editExtrudedRectangle: assign(({ event }) => {
|
|
592
|
+
const e = event as Extract<EventObject, { type: "EDIT_EXTRUDED_RECTANGLE" }>;
|
|
593
|
+
return { lastControlPoint: undefined, type: "extrudedRectangle" as SketchType, controlPoints: e.controlPoints };
|
|
594
|
+
}),
|
|
595
|
+
createExtrudedPolygon: assign(({ event }) => {
|
|
596
|
+
const e = event as Extract<EventObject, { type: "EXTRUDED_POLYGON" }>;
|
|
597
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
598
|
+
return { lastPointerPosition: [...e.pointerPosition] as Position2d, lastControlPoint: controlPoint, type: "extrudedPolygon" as SketchType, controlPoints: [controlPoint] };
|
|
599
|
+
}),
|
|
600
|
+
editExtrudedPolygon: assign(({ event }) => {
|
|
601
|
+
const e = event as Extract<EventObject, { type: "EDIT_EXTRUDED_POLYGON" }>;
|
|
602
|
+
return { lastControlPoint: undefined, type: "extrudedPolygon" as SketchType, controlPoints: e.controlPoints };
|
|
603
|
+
}),
|
|
604
|
+
pushPosition: assign(({ context, event }) => {
|
|
605
|
+
const e = event as Extract<EventObject, { type: "NEXT" | "EXTRUDE" }>;
|
|
606
|
+
const controlPoint = [...e.controlPoint] as Position3d;
|
|
607
|
+
return {
|
|
608
|
+
lastPointerPosition: [...e.pointerPosition] as Position2d,
|
|
609
|
+
lastControlPoint: controlPoint,
|
|
610
|
+
controlPoints: [...(context.controlPoints ?? []), controlPoint],
|
|
611
|
+
};
|
|
612
|
+
}),
|
|
613
|
+
popPosition: assign(({ context }) => {
|
|
614
|
+
invariant(context.controlPoints != null);
|
|
615
|
+
invariant(context.controlPoints.length > 1);
|
|
616
|
+
return { controlPoints: context.controlPoints.slice(0, -1) };
|
|
617
|
+
}),
|
|
618
|
+
clearDrawing: assign(() => ({
|
|
619
|
+
lastControlPoint: undefined,
|
|
620
|
+
type: undefined,
|
|
621
|
+
controlPoints: undefined,
|
|
622
|
+
catchedControlPointIndex: undefined,
|
|
623
|
+
catchedExtrudedPoint: undefined,
|
|
624
|
+
originalControlPoint: undefined,
|
|
625
|
+
})),
|
|
626
|
+
catchControlPoint: assign(({ event }) => {
|
|
627
|
+
const e = event as Extract<EventObject, { type: "CATCH" }>;
|
|
628
|
+
return { catchedControlPointIndex: e.catchedControlPointIndex, catchedExtrudedPoint: e.catchedExtrudedPoint };
|
|
629
|
+
}),
|
|
630
|
+
moveControlPoint: assign(({ event }) => {
|
|
631
|
+
const e = event as Extract<EventObject, { type: "MOVE" }>;
|
|
632
|
+
return { controlPoints: e.controlPoints };
|
|
633
|
+
}),
|
|
634
|
+
releaseControlPoint: assign(() => ({ catchedControlPointIndex: undefined, catchedExtrudedPoint: undefined })),
|
|
635
|
+
updateControlPoints: assign(({ event }) => {
|
|
636
|
+
const e = event as Extract<EventObject, { type: "UPDATE" }>;
|
|
637
|
+
return { controlPoints: e.controlPoints };
|
|
638
|
+
}),
|
|
639
|
+
recordOriginalControlPoint: assign(({ event }) => {
|
|
640
|
+
const e = event as Extract<EventObject, { type: "NEXT" }>;
|
|
641
|
+
return { originalControlPoint: [...e.controlPoint] as Position3d };
|
|
642
|
+
}),
|
|
643
|
+
},
|
|
644
|
+
});
|
|
320
645
|
}
|
|
321
646
|
|
|
322
647
|
export type SketchMachine = ReturnType<typeof createSketchMachine>;
|