@vcmap/ui 5.0.0-rc.18 → 5.0.0-rc.21
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/README.md +6 -6
- package/build/build.js +2 -2
- package/build/buildCesium.js +3 -3
- package/build/buildHelpers.js +2 -1
- package/config/base.config.json +0 -4
- package/config/dev.config.json +35 -14
- package/config/www.config.json +4 -0
- package/dist/assets/cesium/Workers/ArcType-ce2e50ab.js +37 -0
- package/dist/assets/cesium/Workers/AttributeCompression-b646d393.js +716 -0
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-ff186ccc.js +258 -0
- package/dist/assets/cesium/Workers/BoundingRectangle-be5924f4.js +369 -0
- package/dist/assets/cesium/Workers/BoxGeometry-12eeccaf.js +884 -0
- package/dist/assets/cesium/Workers/Check-666ab1a0.js +290 -0
- package/dist/assets/cesium/Workers/Color-a84038cb.js +2262 -0
- package/dist/assets/cesium/Workers/ComponentDatatype-f7b11d02.js +341 -0
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-3272c1b3.js +132 -0
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-0170e093.js +498 -0
- package/dist/assets/cesium/Workers/CylinderGeometry-7c5da648.js +467 -0
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-372c07d8.js +63 -0
- package/dist/assets/cesium/Workers/EllipseGeometry-797d580e.js +1304 -0
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-2939e1dc.js +366 -0
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-8b50870f.js +443 -0
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-98c62a56.js +520 -0
- package/dist/assets/cesium/Workers/EllipsoidGeometry-21c0e3a5.js +637 -0
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-eff247c8.js +454 -0
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-19756602.js +741 -0
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-214683dc.js +373 -0
- package/dist/assets/cesium/Workers/EncodedCartesian3-81f70735.js +171 -0
- package/dist/assets/cesium/Workers/FrustumGeometry-ac42a6d9.js +2512 -0
- package/dist/assets/cesium/Workers/GeometryAttribute-7d6f1732.js +619 -0
- package/dist/assets/cesium/Workers/GeometryAttributes-f06a2792.js +91 -0
- package/dist/assets/cesium/Workers/GeometryInstance-451dc1cd.js +121 -0
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-04332ce7.js +16 -0
- package/dist/assets/cesium/Workers/GeometryPipeline-ce4339ed.js +3690 -0
- package/dist/assets/cesium/Workers/IndexDatatype-a55ceaa1.js +200 -0
- package/dist/assets/cesium/Workers/IntersectionTests-f6e6bd8a.js +1836 -0
- package/dist/assets/cesium/Workers/Math-2dbd6b93.js +1330 -0
- package/dist/assets/cesium/Workers/Matrix2-13178034.js +7086 -0
- package/dist/assets/cesium/Workers/Matrix3-315394f6.js +4283 -0
- package/dist/assets/cesium/Workers/OrientedBoundingBox-04920dc7.js +1257 -0
- package/dist/assets/cesium/Workers/Plane-900aa728.js +309 -0
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-a8680d96.js +1074 -0
- package/dist/assets/cesium/Workers/PolygonPipeline-844aab0a.js +1345 -0
- package/dist/assets/cesium/Workers/PolylinePipeline-32f36d2a.js +573 -0
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-a510d657.js +781 -0
- package/dist/assets/cesium/Workers/PrimitivePipeline-ba38434a.js +966 -0
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-bdba697e.js +280 -0
- package/dist/assets/cesium/Workers/RuntimeError-06c93819.js +68 -0
- package/dist/assets/cesium/Workers/TerrainEncoding-833187da.js +1227 -0
- package/dist/assets/cesium/Workers/Transforms-40229881.js +14696 -0
- package/dist/assets/cesium/Workers/VertexFormat-6b480673.js +312 -0
- package/dist/assets/cesium/Workers/WallGeometryLibrary-919eed92.js +211 -0
- package/dist/assets/cesium/Workers/WebGLConstants-a8cc3e8c.js +620 -0
- package/dist/assets/cesium/Workers/WebMercatorProjection-13a90d41.js +151 -0
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-c2038105.js +129 -0
- package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +1336 -4
- package/dist/assets/cesium/Workers/combine-ca22a614.js +82 -0
- package/dist/assets/cesium/Workers/combineGeometry.js +17 -25
- package/dist/assets/cesium/Workers/createBoxGeometry.js +12 -25
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +313 -25
- package/dist/assets/cesium/Workers/createCircleGeometry.js +213 -25
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +160 -25
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +586 -25
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +236 -25
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1407 -25
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +603 -25
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +12 -25
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +265 -25
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +14 -25
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +14 -25
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +12 -25
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +15 -25
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +12 -25
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +251 -25
- package/dist/assets/cesium/Workers/createGeometry.js +55 -25
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +2134 -25
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +250 -25
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +115 -25
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1420 -25
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +683 -25
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +571 -25
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +411 -25
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +301 -25
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1476 -25
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +535 -25
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +458 -25
- package/dist/assets/cesium/Workers/createSphereGeometry.js +123 -25
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +126 -25
- package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +127 -25
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +535 -25
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +445 -25
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +79 -25
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +406 -25
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +254 -25
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +640 -25
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2711 -27
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +994 -25
- package/dist/assets/cesium/Workers/createWallGeometry.js +623 -25
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +432 -25
- package/dist/assets/cesium/Workers/decodeDraco.js +381 -25
- package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +3687 -25
- package/dist/assets/cesium/Workers/decodeI3S.js +1040 -0
- package/dist/assets/cesium/Workers/defaultValue-0a909f67.js +51 -0
- package/dist/assets/cesium/Workers/package.js +2 -2
- package/dist/assets/cesium/Workers/transcodeKTX2.js +1516 -25
- package/dist/assets/cesium/Workers/transferTypedArrayTest.js +18 -2
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1023 -25
- package/dist/assets/{cesium.2f992f.js → cesium.49585c.js} +112161 -108735
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.cb0408.js → core.59d4d1.js} +1616 -1629
- package/dist/assets/core.js +1 -1
- package/dist/assets/{index.bccdf969.js → index.a3861d4e.js} +1 -1
- package/dist/assets/{ol.5e3fd0.js → ol.c1c512.js} +6992 -6972
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.80175f.css +1 -0
- package/dist/assets/{ui.08c48f.js → ui.80175f.js} +6121 -6785
- package/dist/assets/ui.js +1 -1
- package/dist/assets/{vue.228ead.js → vue.a08ab1.js} +0 -0
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.0b5039.css → vuetify.efc158.css} +0 -0
- package/dist/assets/{vuetify.0b5039.js → vuetify.efc158.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +2 -1
- package/lib/cesium.js +1 -1
- package/package.json +3 -4
- package/plugins/{simple-graph → @vcmap/simple-graph}/README.md +1 -1
- package/plugins/{simple-graph → @vcmap/simple-graph}/SimpleGraphComponent.vue +0 -0
- package/plugins/{simple-graph → @vcmap/simple-graph}/index.js +0 -0
- package/plugins/{simple-graph → @vcmap/simple-graph}/package.json +0 -0
- package/plugins/{simple-graph → @vcmap/simple-graph}/simpleGraphView.js +0 -0
- package/plugins/@vcmap-show-case/README.md +20 -0
- package/plugins/{buttonExamples/ButtonExamples.vue → @vcmap-show-case/buttons-example/ButtonsExample.vue} +1 -1
- package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
- package/plugins/{buttonExamples → @vcmap-show-case/buttons-example}/index.js +16 -8
- package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
- package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Categories.vue +7 -6
- package/plugins/{categoryTest → @vcmap-show-case/category-tester}/Category.vue +4 -3
- package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
- package/plugins/{categoryTest → @vcmap-show-case/category-tester}/index.js +12 -4
- package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
- package/plugins/{test → @vcmap-show-case/config-editor}/editor.vue +0 -0
- package/plugins/@vcmap-show-case/config-editor/index.js +47 -0
- package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
- package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
- package/plugins/@vcmap-show-case/context-menu-tester/index.js +33 -0
- package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
- package/plugins/{@vcmap/pluginExample/pluginExampleComponent.vue → @vcmap-show-case/form-inputs-example/FormInputsExample.vue} +14 -13
- package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
- package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/exampleActions.js +1 -1
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/index.js +23 -22
- package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
- package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example}/validation.js +0 -0
- package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
- package/plugins/@vcmap-show-case/icons-example/allIconsComponent.vue +51 -0
- package/plugins/@vcmap-show-case/icons-example/index.js +44 -0
- package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
- package/plugins/{test/testList.vue → @vcmap-show-case/list-example/ListExample.vue} +1 -1
- package/plugins/@vcmap-show-case/list-example/README.md +3 -0
- package/plugins/@vcmap-show-case/list-example/index.js +44 -0
- package/plugins/@vcmap-show-case/list-example/package.json +5 -0
- package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
- package/plugins/{notifier → @vcmap-show-case/notifier-tester}/index.js +11 -6
- package/plugins/{notifier → @vcmap-show-case/notifier-tester}/notifierTester.vue +0 -0
- package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
- package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
- package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/TextfieldsExample.vue} +1 -7
- package/plugins/{example → @vcmap-show-case/textfields-example}/index.js +58 -62
- package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
- package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
- package/plugins/{test/windowManagerExample.vue → @vcmap-show-case/window-tester/WindowExample.vue} +36 -20
- package/plugins/{test → @vcmap-show-case/window-tester}/emptyComponent.vue +8 -3
- package/plugins/@vcmap-show-case/window-tester/index.js +62 -0
- package/plugins/{test → @vcmap-show-case/window-tester}/myCustomHeader.vue +0 -0
- package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
- package/plugins/{test → @vcmap-show-case/window-tester}/toolbox-data.js +9 -9
- package/plugins/{test/vcsContent.vue → @vcmap-show-case/window-tester/windowExampleContent.vue} +1 -5
- package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
- package/plugins/{wizardExample → @vcmap-show-case/wizard-example}/index.js +12 -6
- package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
- package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +95 -0
- package/plugins/package.json +2 -1
- package/src/actions/actionHelper.js +1 -3
- package/src/actions/stateRefAction.js +0 -10
- package/src/application/VcsApp.vue +42 -23
- package/src/application/VcsMap.vue +9 -0
- package/src/components/buttons/VcsActionButtonList.vue +1 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +3 -1
- package/src/components/form-inputs-controls/VcsWizard.vue +17 -20
- package/src/components/form-inputs-controls/VcsWizardStep.vue +160 -0
- package/src/{icons → components/icons}/+all.js +0 -0
- package/src/{icons → components/icons}/2DAreaIcon.vue +0 -0
- package/src/{icons → components/icons}/2DDistanceIcon.vue +0 -0
- package/src/{icons → components/icons}/3DAreaIcon.vue +0 -0
- package/src/{icons → components/icons}/3DDistanceIcon.vue +0 -0
- package/src/{icons → components/icons}/3DHeightIcon.vue +0 -0
- package/src/{icons → components/icons}/AngleIcon.vue +0 -0
- package/src/{icons → components/icons}/AssociationsIcon.vue +0 -0
- package/src/{icons → components/icons}/AxisIcon.vue +0 -0
- package/src/{icons → components/icons}/BoundingBoxIcon.vue +0 -0
- package/src/{icons → components/icons}/CheckboxCheckedIcon.vue +0 -0
- package/src/{icons → components/icons}/CheckboxIcon.vue +0 -0
- package/src/{icons → components/icons}/CheckboxIndeterminateIcon.vue +0 -0
- package/src/{icons → components/icons}/CircleIcon.vue +0 -0
- package/src/{icons → components/icons}/ClippingHorizontalIcon.vue +0 -0
- package/src/{icons → components/icons}/ClippingIcon.vue +0 -0
- package/src/{icons → components/icons}/ClippingVerticalIcon.vue +0 -0
- package/src/{icons → components/icons}/ColorPickerIcon.vue +0 -0
- package/src/{icons → components/icons}/ColorSwatchIcon.vue +0 -0
- package/src/{icons → components/icons}/CommentIcon.vue +0 -0
- package/src/{icons → components/icons}/CompassIcon.vue +0 -0
- package/src/{icons → components/icons}/ComponentsIcon.vue +0 -0
- package/src/{icons → components/icons}/ConeIcon.vue +0 -0
- package/src/{icons → components/icons}/DimensionsHouseIcon.vue +0 -0
- package/src/{icons → components/icons}/EditIcon.vue +0 -0
- package/src/{icons → components/icons}/ElevationProfileIcon.vue +0 -0
- package/src/{icons → components/icons}/ExportAreaIcon.vue +0 -0
- package/src/{icons → components/icons}/ExportFlightIcon.vue +0 -0
- package/src/{icons → components/icons}/ExportIcon.vue +0 -0
- package/src/{icons → components/icons}/ExternalLinkIcon.vue +0 -0
- package/src/{icons → components/icons}/EyeIcon.vue +0 -0
- package/src/{icons → components/icons}/FastForwardIcon.vue +0 -0
- package/src/{icons → components/icons}/FilterIcon.vue +0 -0
- package/src/{icons → components/icons}/GlobalTerrainIcon.vue +0 -0
- package/src/{icons → components/icons}/GlobeNatureIcon.vue +0 -0
- package/src/{icons → components/icons}/GroundIcon.vue +0 -0
- package/src/{icons → components/icons}/HealthCareIndustriesIcon.vue +0 -0
- package/src/{icons → components/icons}/HelpIcon.vue +0 -0
- package/src/{icons → components/icons}/HideIcon.vue +0 -0
- package/src/{icons → components/icons}/HomePointIcon.vue +0 -0
- package/src/{icons → components/icons}/HospitalsIcon.vue +0 -0
- package/src/{icons → components/icons}/HouseIcon.vue +0 -0
- package/src/{icons → components/icons}/ImportIcon.vue +0 -0
- package/src/{icons → components/icons}/InfoIcon.vue +0 -0
- package/src/{icons → components/icons}/KebabIcon.vue +0 -0
- package/src/{icons → components/icons}/LabelIcon.vue +0 -0
- package/src/{icons → components/icons}/LayersIcon.vue +0 -0
- package/src/{icons → components/icons}/LegendIcon.vue +0 -0
- package/src/{icons → components/icons}/LineIcon.vue +0 -0
- package/src/{icons → components/icons}/LinkIcon.vue +0 -0
- package/src/{icons → components/icons}/LogoutIcon.vue +0 -0
- package/src/{icons → components/icons}/MapIcon.vue +0 -0
- package/src/{icons → components/icons}/MenuIcon.vue +0 -0
- package/src/{icons → components/icons}/MinusIcon.vue +0 -0
- package/src/{icons → components/icons}/ObjectAttributeIcon.vue +0 -0
- package/src/{icons → components/icons}/ObjectSelectIcon.vue +0 -0
- package/src/{icons → components/icons}/ObliqueViewIcon.vue +0 -0
- package/src/{icons → components/icons}/PdfIcon.vue +0 -0
- package/src/{icons → components/icons}/PedestrianIcon.vue +0 -0
- package/src/{icons → components/icons}/PenIcon.vue +0 -0
- package/src/{icons → components/icons}/PlayCircleIcon.vue +0 -0
- package/src/{icons → components/icons}/PlusIcon.vue +0 -0
- package/src/{icons → components/icons}/PoiIcon.vue +0 -0
- package/src/{icons → components/icons}/PointSelectIcon.vue +0 -0
- package/src/{icons → components/icons}/PolygonIcon.vue +0 -0
- package/src/{icons → components/icons}/PresentationModeIcon.vue +0 -0
- package/src/{icons → components/icons}/ProgressIcon.vue +0 -0
- package/src/{icons → components/icons}/QueryIcon.vue +0 -0
- package/src/{icons → components/icons}/RectangleIcon.vue +0 -0
- package/src/{icons → components/icons}/ReturnIcon.vue +0 -0
- package/src/{icons → components/icons}/RewindIcon.vue +0 -0
- package/src/{icons → components/icons}/RotateLeftIcon.vue +0 -0
- package/src/{icons → components/icons}/RotateRightIcon.vue +0 -0
- package/src/{icons → components/icons}/ScreenshotIcon.vue +0 -0
- package/src/{icons → components/icons}/SearchIcon.vue +0 -0
- package/src/{icons → components/icons}/ShadowIcon.vue +0 -0
- package/src/{icons → components/icons}/ShapesIcon.vue +0 -0
- package/src/{icons → components/icons}/ShareIcon.vue +0 -0
- package/src/{icons → components/icons}/SimpleCircleFilledIcon.vue +0 -0
- package/src/{icons → components/icons}/SimpleCircleHalfFilledIcon.vue +0 -0
- package/src/{icons → components/icons}/SimpleCircleOutlinedIcon.vue +0 -0
- package/src/{icons → components/icons}/SkipNextIcon.vue +0 -0
- package/src/{icons → components/icons}/SkipPreviousIcon.vue +0 -0
- package/src/{icons → components/icons}/SplitViewIcon.vue +0 -0
- package/src/{icons → components/icons}/TerrainBoxIcon.vue +0 -0
- package/src/{icons → components/icons}/TextStyleIcon.vue +0 -0
- package/src/{icons → components/icons}/ThreeDimensionsIcon.vue +0 -0
- package/src/{icons → components/icons}/ToolsIcon.vue +0 -0
- package/src/{icons → components/icons}/TouchIcon.vue +0 -0
- package/src/{icons → components/icons}/TrashCanIcon.vue +0 -0
- package/src/{icons → components/icons}/TriangleIcon.vue +0 -0
- package/src/{icons → components/icons}/TwoDimensionsIcon.vue +0 -0
- package/src/{icons → components/icons}/UploadIcon.vue +0 -0
- package/src/{icons → components/icons}/UserProfileIcon.vue +0 -0
- package/src/{icons → components/icons}/UserShareIcon.vue +0 -0
- package/src/{icons → components/icons}/VideoRecorderIcon.vue +0 -0
- package/src/{icons → components/icons}/ViewpointFlightIcon.vue +0 -0
- package/src/{icons → components/icons}/ViewpointIcon.vue +0 -0
- package/src/{icons → components/icons}/Viewshed360Icon.vue +0 -0
- package/src/{icons → components/icons}/ViewshedConeIcon.vue +0 -0
- package/src/{icons → components/icons}/ViewshedIcon.vue +0 -0
- package/src/{icons → components/icons}/WalkingIcon.vue +0 -0
- package/src/{icons → components/icons}/WallIcon.vue +0 -0
- package/src/{icons → components/icons}/WandIcon.vue +0 -0
- package/src/components/lists/VcsList.vue +21 -12
- package/src/components/lists/VcsTreeviewLeaf.vue +14 -2
- package/src/components/notification/VcsTooltip.vue +1 -1
- package/src/featureInfo/abstractFeatureInfoView.js +1 -1
- package/src/featureInfo/addressBalloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonFeatureInfoView.js +1 -1
- package/src/featureInfo/balloonHelper.js +6 -6
- package/src/featureInfo/featureInfo.js +2 -2
- package/src/i18n/de.js +2 -6
- package/src/i18n/en.js +2 -6
- package/src/legend/legendHelper.js +4 -3
- package/src/legend/vcsLegend.vue +21 -2
- package/src/manager/window/WindowComponent.vue +42 -4
- package/src/manager/window/WindowComponentHeader.vue +1 -1
- package/src/manager/window/windowHelper.js +7 -11
- package/src/manager/window/windowManager.js +15 -11
- package/src/navigation/mapNavCompass.vue +13 -7
- package/src/navigation/mapNavigation.vue +66 -4
- package/src/navigation/orientationToolsButton.vue +1 -1
- package/src/navigation/overviewMap.js +26 -10
- package/src/navigation/vcsCompass.vue +4 -73
- package/src/setup.js +1 -1
- package/src/vuePlugins/vuetify.js +1 -1
- package/dist/assets/cesium/Workers/ArcType-c9b2b290.js +0 -25
- package/dist/assets/cesium/Workers/AttributeCompression-7b0f288d.js +0 -25
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-d0c22774.js +0 -25
- package/dist/assets/cesium/Workers/BoundingRectangle-201b1a81.js +0 -25
- package/dist/assets/cesium/Workers/BoxGeometry-4985457c.js +0 -25
- package/dist/assets/cesium/Workers/Color-cc8c18b3.js +0 -25
- package/dist/assets/cesium/Workers/ComponentDatatype-0200bf8c.js +0 -25
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-4345acdf.js +0 -25
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-850a6c35.js +0 -25
- package/dist/assets/cesium/Workers/CylinderGeometry-57a1051a.js +0 -25
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-62ce5a1f.js +0 -25
- package/dist/assets/cesium/Workers/EllipseGeometry-8627398f.js +0 -25
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-e5919563.js +0 -25
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-96fd4ae1.js +0 -25
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-8bfefbff.js +0 -25
- package/dist/assets/cesium/Workers/EllipsoidGeometry-377329b9.js +0 -25
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-e6e16e49.js +0 -25
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-03528f73.js +0 -25
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-c080fd1b.js +0 -25
- package/dist/assets/cesium/Workers/EncodedCartesian3-ea0e408f.js +0 -25
- package/dist/assets/cesium/Workers/FrustumGeometry-a8b5d817.js +0 -25
- package/dist/assets/cesium/Workers/GeometryAttribute-8458a8fd.js +0 -25
- package/dist/assets/cesium/Workers/GeometryAttributes-ac0f8485.js +0 -25
- package/dist/assets/cesium/Workers/GeometryInstance-ee3aa3ba.js +0 -25
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-08ae0c50.js +0 -25
- package/dist/assets/cesium/Workers/GeometryPipeline-33ca229c.js +0 -25
- package/dist/assets/cesium/Workers/IndexDatatype-e713bfd2.js +0 -25
- package/dist/assets/cesium/Workers/IntersectionTests-eb4db8e0.js +0 -25
- package/dist/assets/cesium/Workers/Matrix2-eefef8eb.js +0 -25
- package/dist/assets/cesium/Workers/OrientedBoundingBox-5193f9a2.js +0 -25
- package/dist/assets/cesium/Workers/Plane-b0299683.js +0 -25
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-b61295f3.js +0 -25
- package/dist/assets/cesium/Workers/PolygonPipeline-eb527514.js +0 -25
- package/dist/assets/cesium/Workers/PolylinePipeline-0f23dd84.js +0 -25
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-2d903430.js +0 -25
- package/dist/assets/cesium/Workers/PrimitivePipeline-e2640413.js +0 -25
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-ae8bf8a5.js +0 -25
- package/dist/assets/cesium/Workers/RuntimeError-5baf5c66.js +0 -25
- package/dist/assets/cesium/Workers/TerrainEncoding-bc10ab54.js +0 -25
- package/dist/assets/cesium/Workers/Transforms-d2e5867e.js +0 -63
- package/dist/assets/cesium/Workers/VertexFormat-5ec0d9ff.js +0 -25
- package/dist/assets/cesium/Workers/WallGeometryLibrary-1a33e416.js +0 -25
- package/dist/assets/cesium/Workers/WebGLConstants-5b50ced1.js +0 -25
- package/dist/assets/cesium/Workers/WebMercatorProjection-cd2f30c2.js +0 -25
- package/dist/assets/cesium/Workers/_commonjsHelpers-bc29abbc.js +0 -25
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-f13aceb1.js +0 -25
- package/dist/assets/cesium/Workers/combine-7533016d.js +0 -25
- package/dist/assets/cesium/Workers/defaultValue-0c475b81.js +0 -25
- package/dist/assets/cesium/Workers/package.json +0 -1
- package/dist/assets/ui.08c48f.css +0 -1
- package/plugins/@vcmap/pluginExample/config.json +0 -6
- package/plugins/@vcmap/pluginExample/package.json +0 -7
- package/plugins/categoryTest/ItemEditor.vue +0 -13
- package/plugins/test/allIconsComponent.vue +0 -50
- package/plugins/test/index.js +0 -209
- package/plugins/wizardExample/wizardExample.vue +0 -77
- package/src/components/form-inputs-controls/VcsColorPicker.vue +0 -85
@@ -1,25 +1,1407 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
define(["./arrayRemoveDuplicates-f13aceb1","./Transforms-d2e5867e","./Matrix2-eefef8eb","./ComponentDatatype-0200bf8c","./PolylineVolumeGeometryLibrary-2d903430","./CorridorGeometryLibrary-850a6c35","./defaultValue-0c475b81","./GeometryAttribute-8458a8fd","./GeometryAttributes-ac0f8485","./GeometryOffsetAttribute-08ae0c50","./IndexDatatype-e713bfd2","./PolygonPipeline-eb527514","./VertexFormat-5ec0d9ff","./_commonjsHelpers-bc29abbc","./combine-7533016d","./RuntimeError-5baf5c66","./WebGLConstants-5b50ced1","./EllipsoidTangentPlane-c080fd1b","./AxisAlignedBoundingBox-d0c22774","./IntersectionTests-eb4db8e0","./Plane-b0299683","./PolylinePipeline-0f23dd84","./EllipsoidGeodesic-8bfefbff","./EllipsoidRhumbLine-03528f73"],(function(t,e,r,a,i,o,n,s,l,d,u,c,m,f,y,p,g,h,b,C,A,_,w,v){"use strict";const T=new r.Cartesian3,G=new r.Cartesian3,E=new r.Cartesian3,V=new r.Cartesian3,x=new r.Cartesian3,L=new r.Cartesian3,P=new r.Cartesian3,F=new r.Cartesian3;function N(t,e){for(let r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function D(t,e,a,i,n,s){const l=t.normals,d=t.tangents,u=t.bitangents,c=r.Cartesian3.normalize(r.Cartesian3.cross(a,e,P),P);s.normal&&o.CorridorGeometryLibrary.addAttribute(l,e,i,n),s.tangent&&o.CorridorGeometryLibrary.addAttribute(d,c,i,n),s.bitangent&&o.CorridorGeometryLibrary.addAttribute(u,a,i,n)}function M(t,e,i){const d=t.positions,c=t.corners,m=t.endPositions,f=t.lefts,y=t.normals,p=new l.GeometryAttributes;let g,h,b,C=0,A=0,_=0;for(h=0;h<d.length;h+=2)b=d[h].length-3,C+=b,_+=2*b,A+=d[h+1].length-3;for(C+=3,A+=3,h=0;h<c.length;h++){g=c[h];const t=c[h].leftPositions;n.defined(t)?(b=t.length,C+=b,_+=b):(b=c[h].rightPositions.length,A+=b,_+=b)}const w=n.defined(m);let v;w&&(v=m[0].length-3,C+=v,A+=v,v/=3,_+=6*v);const x=C+A,N=new Float64Array(x),M={normals:e.normal?new Float32Array(x):void 0,tangents:e.tangent?new Float32Array(x):void 0,bitangents:e.bitangent?new Float32Array(x):void 0};let O,I,S,R,k,H,z=0,B=x-1,U=T,Y=G;const W=v/2,q=u.IndexDatatype.createTypedArray(x/3,_);let j=0;if(w){H=E,k=V;const t=m[0];for(U=r.Cartesian3.fromArray(y,0,U),Y=r.Cartesian3.fromArray(f,0,Y),h=0;h<W;h++)H=r.Cartesian3.fromArray(t,3*(W-1-h),H),k=r.Cartesian3.fromArray(t,3*(W+h),k),o.CorridorGeometryLibrary.addAttribute(N,k,z),o.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}let J,K,Q=0,X=0,Z=d[Q++],$=d[Q++];for(N.set(Z,z),N.set($,B-$.length+1),Y=r.Cartesian3.fromArray(f,X,Y),b=$.length-3,h=0;h<b;h+=3)J=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(Z,h,P),P),K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,b-h,F),F),U=r.Cartesian3.normalize(r.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),I=z/3,R=I+1,O=(B-2)/3,S=O-1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;for(J=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(Z,b,P),P),K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,b,F),F),U=r.Cartesian3.normalize(r.Cartesian3.add(J,K,U),U),X+=3,h=0;h<c.length;h++){let t;g=c[h];const a=g.leftPositions,s=g.rightPositions;let l,u,m=L,p=E,C=V;if(U=r.Cartesian3.fromArray(y,X,U),n.defined(a)){for(D(M,U,Y,void 0,B,e),B-=3,l=R,u=S,t=0;t<a.length/3;t++)m=r.Cartesian3.fromArray(a,3*t,m),q[j++]=l,q[j++]=u-t-1,q[j++]=u-t,o.CorridorGeometryLibrary.addAttribute(N,m,void 0,B),p=r.Cartesian3.fromArray(N,3*(u-t-1),p),C=r.Cartesian3.fromArray(N,3*l,C),Y=r.Cartesian3.normalize(r.Cartesian3.subtract(p,C,Y),Y),D(M,U,Y,void 0,B,e),B-=3;m=r.Cartesian3.fromArray(N,3*l,m),p=r.Cartesian3.subtract(r.Cartesian3.fromArray(N,3*u,p),m,p),C=r.Cartesian3.subtract(r.Cartesian3.fromArray(N,3*(u-t),C),m,C),Y=r.Cartesian3.normalize(r.Cartesian3.add(p,C,Y),Y),D(M,U,Y,z,void 0,e),z+=3}else{for(D(M,U,Y,z,void 0,e),z+=3,l=S,u=R,t=0;t<s.length/3;t++)m=r.Cartesian3.fromArray(s,3*t,m),q[j++]=l,q[j++]=u+t,q[j++]=u+t+1,o.CorridorGeometryLibrary.addAttribute(N,m,z),p=r.Cartesian3.fromArray(N,3*l,p),C=r.Cartesian3.fromArray(N,3*(u+t),C),Y=r.Cartesian3.normalize(r.Cartesian3.subtract(p,C,Y),Y),D(M,U,Y,z,void 0,e),z+=3;m=r.Cartesian3.fromArray(N,3*l,m),p=r.Cartesian3.subtract(r.Cartesian3.fromArray(N,3*(u+t),p),m,p),C=r.Cartesian3.subtract(r.Cartesian3.fromArray(N,3*u,C),m,C),Y=r.Cartesian3.normalize(r.Cartesian3.negate(r.Cartesian3.add(C,p,Y),Y),Y),D(M,U,Y,void 0,B,e),B-=3}for(Z=d[Q++],$=d[Q++],Z.splice(0,3),$.splice($.length-3,3),N.set(Z,z),N.set($,B-$.length+1),b=$.length-3,X+=3,Y=r.Cartesian3.fromArray(f,X,Y),t=0;t<$.length;t+=3)J=i.geodeticSurfaceNormal(r.Cartesian3.fromArray(Z,t,P),P),K=i.geodeticSurfaceNormal(r.Cartesian3.fromArray($,b-t,F),F),U=r.Cartesian3.normalize(r.Cartesian3.add(J,K,U),U),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3;z-=3,B+=3}if(U=r.Cartesian3.fromArray(y,y.length-3,U),D(M,U,Y,z,B,e),w){z+=3,B-=3,H=E,k=V;const t=m[1];for(h=0;h<W;h++)H=r.Cartesian3.fromArray(t,3*(v-h-1),H),k=r.Cartesian3.fromArray(t,3*h,k),o.CorridorGeometryLibrary.addAttribute(N,H,void 0,B),o.CorridorGeometryLibrary.addAttribute(N,k,z),D(M,U,Y,z,B,e),R=z/3,I=R-1,S=(B-2)/3,O=S+1,q[j++]=O,q[j++]=I,q[j++]=S,q[j++]=S,q[j++]=I,q[j++]=R,z+=3,B-=3}if(p.position=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:N}),e.st){const t=new Float32Array(x/3*2);let e,r,i=0;if(w){C/=3,A/=3;const o=Math.PI/(v+1);let n;r=1/(C-v+1),e=1/(A-v+1);const s=v/2;for(h=s+1;h<v+1;h++)n=a.CesiumMath.PI_OVER_TWO+o*h,t[i++]=e*(1+Math.cos(n)),t[i++]=.5*(1+Math.sin(n));for(h=1;h<A-v+1;h++)t[i++]=h*e,t[i++]=0;for(h=v;h>s;h--)n=a.CesiumMath.PI_OVER_TWO-h*o,t[i++]=1-e*(1+Math.cos(n)),t[i++]=.5*(1+Math.sin(n));for(h=s;h>0;h--)n=a.CesiumMath.PI_OVER_TWO-o*h,t[i++]=1-r*(1+Math.cos(n)),t[i++]=.5*(1+Math.sin(n));for(h=C-v;h>0;h--)t[i++]=h*r,t[i++]=1;for(h=1;h<s+1;h++)n=a.CesiumMath.PI_OVER_TWO+o*h,t[i++]=r*(1+Math.cos(n)),t[i++]=.5*(1+Math.sin(n))}else{for(C/=3,A/=3,r=1/(C-1),e=1/(A-1),h=0;h<A;h++)t[i++]=h*e,t[i++]=0;for(h=C;h>0;h--)t[i++]=(h-1)*r,t[i++]=1}p.st=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}return e.normal&&(p.normal=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.normals})),e.tangent&&(p.tangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.tangents})),e.bitangent&&(p.bitangent=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M.bitangents})),{attributes:p,indices:q}}function O(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(let a=3;a<t.length;a+=3){const i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function I(t,e){const i=new m.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,f=M(o.CorridorGeometryLibrary.computePositions(t),i,l),y=t.height,p=t.extrudedHeight;let g=f.attributes;const h=f.indices;let b=g.position.values,C=b.length;const A=new Float64Array(6*C);let _=new Float64Array(C);_.set(b);let w,v=new Float64Array(4*C);b=c.PolygonPipeline.scaleToGeodeticHeight(b,y,l),v=O(b,0,v),_=c.PolygonPipeline.scaleToGeodeticHeight(_,p,l),v=O(_,2*C,v),A.set(b),A.set(_,C),A.set(v,2*C),g.position.values=A,g=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;const a=t.position.values;let i,n;(e.normal||e.bitangent)&&(i=t.normal.values,n=t.bitangent.values);const s=t.position.values.length/18,l=3*s,d=2*s,u=2*l;let c;if(e.normal||e.bitangent||e.tangent){const s=e.normal?new Float32Array(6*l):void 0,d=e.tangent?new Float32Array(6*l):void 0,m=e.bitangent?new Float32Array(6*l):void 0;let f=T,y=G,p=E,g=V,h=x,b=L,C=u;for(c=0;c<l;c+=3){const t=C+u;f=r.Cartesian3.fromArray(a,c,f),y=r.Cartesian3.fromArray(a,c+l,y),p=r.Cartesian3.fromArray(a,(c+3)%l,p),y=r.Cartesian3.subtract(y,f,y),p=r.Cartesian3.subtract(p,f,p),g=r.Cartesian3.normalize(r.Cartesian3.cross(y,p,g),g),e.normal&&(o.CorridorGeometryLibrary.addAttribute(s,g,t),o.CorridorGeometryLibrary.addAttribute(s,g,t+3),o.CorridorGeometryLibrary.addAttribute(s,g,C),o.CorridorGeometryLibrary.addAttribute(s,g,C+3)),(e.tangent||e.bitangent)&&(b=r.Cartesian3.fromArray(i,c,b),e.bitangent&&(o.CorridorGeometryLibrary.addAttribute(m,b,t),o.CorridorGeometryLibrary.addAttribute(m,b,t+3),o.CorridorGeometryLibrary.addAttribute(m,b,C),o.CorridorGeometryLibrary.addAttribute(m,b,C+3)),e.tangent&&(h=r.Cartesian3.normalize(r.Cartesian3.cross(b,g,h),h),o.CorridorGeometryLibrary.addAttribute(d,h,t),o.CorridorGeometryLibrary.addAttribute(d,h,t+3),o.CorridorGeometryLibrary.addAttribute(d,h,C),o.CorridorGeometryLibrary.addAttribute(d,h,C+3))),C+=6}if(e.normal){for(s.set(i),c=0;c<l;c+=3)s[c+l]=-i[c],s[c+l+1]=-i[c+1],s[c+l+2]=-i[c+2];t.normal.values=s}else t.normal=void 0;if(e.bitangent?(m.set(n),m.set(n,l),t.bitangent.values=m):t.bitangent=void 0,e.tangent){const e=t.tangent.values;d.set(e),d.set(e,l),t.tangent.values=d}}if(e.st){const e=t.st.values,r=new Float32Array(6*d);r.set(e),r.set(e,d);let a=2*d;for(let t=0;t<2;t++){for(r[a++]=e[0],r[a++]=e[1],c=2;c<d;c+=2){const t=e[c],i=e[c+1];r[a++]=t,r[a++]=i,r[a++]=t,r[a++]=i}r[a++]=e[0],r[a++]=e[1]}t.st.values=r}return t}(g,e);const P=C/3;if(t.shadowVolume){const t=g.normal.values;C=t.length;let r=new Float32Array(6*C);for(w=0;w<C;w++)t[w]=-t[w];r.set(t,C),r=O(t,4*C,r),g.extrudeDirection=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r}),e.normal||(g.normal=void 0)}if(n.defined(t.offsetAttribute)){let e=new Uint8Array(6*P);if(t.offsetAttribute===d.GeometryOffsetAttribute.TOP)e=e.fill(1,0,P).fill(1,2*P,4*P);else{const r=t.offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1;e=e.fill(r)}g.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}const F=h.length,N=P+P,D=u.IndexDatatype.createTypedArray(A.length/3,2*F+3*N);D.set(h);let I,S,R,k,H=F;for(w=0;w<F;w+=3){const t=h[w],e=h[w+1],r=h[w+2];D[H++]=r+P,D[H++]=e+P,D[H++]=t+P}for(w=0;w<N;w+=2)I=w+N,S=I+N,R=I+1,k=S+1,D[H++]=I,D[H++]=S,D[H++]=R,D[H++]=R,D[H++]=S,D[H++]=k;return{attributes:g,indices:D}}const S=new r.Cartesian3,R=new r.Cartesian3,k=new r.Cartographic;function H(t,e,a,i,o,n){const s=r.Cartesian3.subtract(e,t,S);r.Cartesian3.normalize(s,s);const l=a.geodeticSurfaceNormal(t,R),d=r.Cartesian3.cross(s,l,S);r.Cartesian3.multiplyByScalar(d,i,d);let u=o.latitude,c=o.longitude,m=n.latitude,f=n.longitude;r.Cartesian3.add(t,d,R),a.cartesianToCartographic(R,k);let y=k.latitude,p=k.longitude;u=Math.min(u,y),c=Math.min(c,p),m=Math.max(m,y),f=Math.max(f,p),r.Cartesian3.subtract(t,d,R),a.cartesianToCartographic(R,k),y=k.latitude,p=k.longitude,u=Math.min(u,y),c=Math.min(c,p),m=Math.max(m,y),f=Math.max(f,p),o.latitude=u,o.longitude=c,n.latitude=m,n.longitude=f}const z=new r.Cartesian3,B=new r.Cartesian3,U=new r.Cartographic,Y=new r.Cartographic;function W(e,a,o,s,l){e=N(e,a);const d=t.arrayRemoveDuplicates(e,r.Cartesian3.equalsEpsilon),u=d.length;if(u<2||o<=0)return new r.Rectangle;const c=.5*o;let m,f;if(U.latitude=Number.POSITIVE_INFINITY,U.longitude=Number.POSITIVE_INFINITY,Y.latitude=Number.NEGATIVE_INFINITY,Y.longitude=Number.NEGATIVE_INFINITY,s===i.CornerType.ROUNDED){const t=d[0];r.Cartesian3.subtract(t,d[1],z),r.Cartesian3.normalize(z,z),r.Cartesian3.multiplyByScalar(z,c,z),r.Cartesian3.add(t,z,B),a.cartesianToCartographic(B,k),m=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,m),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,m),Y.longitude=Math.max(Y.longitude,f)}for(let t=0;t<u-1;++t)H(d[t],d[t+1],a,c,U,Y);const y=d[u-1];r.Cartesian3.subtract(y,d[u-2],z),r.Cartesian3.normalize(z,z),r.Cartesian3.multiplyByScalar(z,c,z),r.Cartesian3.add(y,z,B),H(y,B,a,c,U,Y),s===i.CornerType.ROUNDED&&(a.cartesianToCartographic(B,k),m=k.latitude,f=k.longitude,U.latitude=Math.min(U.latitude,m),U.longitude=Math.min(U.longitude,f),Y.latitude=Math.max(Y.latitude,m),Y.longitude=Math.max(Y.longitude,f));const p=n.defined(l)?l:new r.Rectangle;return p.north=Y.latitude,p.south=U.latitude,p.east=Y.longitude,p.west=U.longitude,p}function q(t){const e=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,o=t.width,s=n.defaultValue(t.height,0),l=n.defaultValue(t.extrudedHeight,s);this._positions=e,this._ellipsoid=r.Ellipsoid.clone(n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84)),this._vertexFormat=m.VertexFormat.clone(n.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT)),this._width=o,this._height=Math.max(s,l),this._extrudedHeight=Math.min(s,l),this._cornerType=n.defaultValue(t.cornerType,i.CornerType.ROUNDED),this._granularity=n.defaultValue(t.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=n.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*r.Cartesian3.packedLength+r.Ellipsoid.packedLength+m.VertexFormat.packedLength+7}q.pack=function(t,e,a){a=n.defaultValue(a,0);const i=t._positions,o=i.length;e[a++]=o;for(let t=0;t<o;++t,a+=r.Cartesian3.packedLength)r.Cartesian3.pack(i[t],e,a);return r.Ellipsoid.pack(t._ellipsoid,e,a),a+=r.Ellipsoid.packedLength,m.VertexFormat.pack(t._vertexFormat,e,a),a+=m.VertexFormat.packedLength,e[a++]=t._width,e[a++]=t._height,e[a++]=t._extrudedHeight,e[a++]=t._cornerType,e[a++]=t._granularity,e[a++]=t._shadowVolume?1:0,e[a]=n.defaultValue(t._offsetAttribute,-1),e};const j=r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),J=new m.VertexFormat,K={positions:void 0,ellipsoid:j,vertexFormat:J,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return q.unpack=function(t,e,a){e=n.defaultValue(e,0);const i=t[e++],o=new Array(i);for(let a=0;a<i;++a,e+=r.Cartesian3.packedLength)o[a]=r.Cartesian3.unpack(t,e);const s=r.Ellipsoid.unpack(t,e,j);e+=r.Ellipsoid.packedLength;const l=m.VertexFormat.unpack(t,e,J);e+=m.VertexFormat.packedLength;const d=t[e++],u=t[e++],c=t[e++],f=t[e++],y=t[e++],p=1===t[e++],g=t[e];return n.defined(a)?(a._positions=o,a._ellipsoid=r.Ellipsoid.clone(s,a._ellipsoid),a._vertexFormat=m.VertexFormat.clone(l,a._vertexFormat),a._width=d,a._height=u,a._extrudedHeight=c,a._cornerType=f,a._granularity=y,a._shadowVolume=p,a._offsetAttribute=-1===g?void 0:g,a):(K.positions=o,K.width=d,K.height=u,K.extrudedHeight=c,K.cornerType=f,K.granularity=y,K.shadowVolume=p,K.offsetAttribute=-1===g?void 0:g,new q(K))},q.computeRectangle=function(t,e){const a=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).positions,o=t.width;return W(a,n.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o,n.defaultValue(t.cornerType,i.CornerType.ROUNDED),e)},q.createGeometry=function(i){let l=i._positions;const u=i._width,m=i._ellipsoid;l=N(l,m);const f=t.arrayRemoveDuplicates(l,r.Cartesian3.equalsEpsilon);if(f.length<2||u<=0)return;const y=i._height,p=i._extrudedHeight,g=!a.CesiumMath.equalsEpsilon(y,p,0,a.CesiumMath.EPSILON2),h=i._vertexFormat,b={ellipsoid:m,positions:f,width:u,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};let C;if(g)b.height=y,b.extrudedHeight=p,b.shadowVolume=i._shadowVolume,b.offsetAttribute=i._offsetAttribute,C=I(b,h);else{if(C=M(o.CorridorGeometryLibrary.computePositions(b),h,m),C.attributes.position.values=c.PolygonPipeline.scaleToGeodeticHeight(C.attributes.position.values,y,m),n.defined(i._offsetAttribute)){const t=i._offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1,e=C.attributes.position.values.length,r=new Uint8Array(e/3).fill(t);C.attributes.applyOffset=new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}}const A=C.attributes,_=e.BoundingSphere.fromVertices(A.position.values,void 0,3);return h.position||(C.attributes.position.values=void 0),new s.Geometry({attributes:A,indices:C.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:_,offsetAttribute:i._offsetAttribute})},q.createShadowVolume=function(t,e,r){const a=t._granularity,i=t._ellipsoid,o=e(a,i),n=r(a,i);return new q({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:o,height:n,vertexFormat:m.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(q.prototype,{rectangle:{get:function(){return n.defined(this._rectangle)||(this._rectangle=W(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return n.defined(e)&&(t=q.unpack(t,e)),t._ellipsoid=r.Ellipsoid.clone(t._ellipsoid),q.createGeometry(t)}}));
|
1
|
+
define(['./arrayRemoveDuplicates-c2038105', './Transforms-40229881', './Matrix3-315394f6', './Check-666ab1a0', './ComponentDatatype-f7b11d02', './PolylineVolumeGeometryLibrary-a510d657', './CorridorGeometryLibrary-0170e093', './defaultValue-0a909f67', './GeometryAttribute-7d6f1732', './GeometryAttributes-f06a2792', './GeometryOffsetAttribute-04332ce7', './IndexDatatype-a55ceaa1', './Math-2dbd6b93', './PolygonPipeline-844aab0a', './Matrix2-13178034', './VertexFormat-6b480673', './combine-ca22a614', './RuntimeError-06c93819', './WebGLConstants-a8cc3e8c', './EllipsoidTangentPlane-214683dc', './AxisAlignedBoundingBox-ff186ccc', './IntersectionTests-f6e6bd8a', './Plane-900aa728', './PolylinePipeline-32f36d2a', './EllipsoidGeodesic-98c62a56', './EllipsoidRhumbLine-19756602'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, PolylineVolumeGeometryLibrary, CorridorGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, Matrix2, VertexFormat, combine$1, RuntimeError, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
|
2
|
+
|
3
|
+
const cartesian1 = new Matrix3.Cartesian3();
|
4
|
+
const cartesian2 = new Matrix3.Cartesian3();
|
5
|
+
const cartesian3 = new Matrix3.Cartesian3();
|
6
|
+
const cartesian4 = new Matrix3.Cartesian3();
|
7
|
+
const cartesian5 = new Matrix3.Cartesian3();
|
8
|
+
const cartesian6 = new Matrix3.Cartesian3();
|
9
|
+
|
10
|
+
const scratch1 = new Matrix3.Cartesian3();
|
11
|
+
const scratch2 = new Matrix3.Cartesian3();
|
12
|
+
|
13
|
+
function scaleToSurface(positions, ellipsoid) {
|
14
|
+
for (let i = 0; i < positions.length; i++) {
|
15
|
+
positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
|
16
|
+
}
|
17
|
+
return positions;
|
18
|
+
}
|
19
|
+
|
20
|
+
function addNormals(attr, normal, left, front, back, vertexFormat) {
|
21
|
+
const normals = attr.normals;
|
22
|
+
const tangents = attr.tangents;
|
23
|
+
const bitangents = attr.bitangents;
|
24
|
+
const forward = Matrix3.Cartesian3.normalize(
|
25
|
+
Matrix3.Cartesian3.cross(left, normal, scratch1),
|
26
|
+
scratch1
|
27
|
+
);
|
28
|
+
if (vertexFormat.normal) {
|
29
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, front, back);
|
30
|
+
}
|
31
|
+
if (vertexFormat.tangent) {
|
32
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);
|
33
|
+
}
|
34
|
+
if (vertexFormat.bitangent) {
|
35
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
function combine(computedPositions, vertexFormat, ellipsoid) {
|
40
|
+
const positions = computedPositions.positions;
|
41
|
+
const corners = computedPositions.corners;
|
42
|
+
const endPositions = computedPositions.endPositions;
|
43
|
+
const computedLefts = computedPositions.lefts;
|
44
|
+
const computedNormals = computedPositions.normals;
|
45
|
+
const attributes = new GeometryAttributes.GeometryAttributes();
|
46
|
+
let corner;
|
47
|
+
let leftCount = 0;
|
48
|
+
let rightCount = 0;
|
49
|
+
let i;
|
50
|
+
let indicesLength = 0;
|
51
|
+
let length;
|
52
|
+
for (i = 0; i < positions.length; i += 2) {
|
53
|
+
length = positions[i].length - 3;
|
54
|
+
leftCount += length; //subtracting 3 to account for duplicate points at corners
|
55
|
+
indicesLength += length * 2;
|
56
|
+
rightCount += positions[i + 1].length - 3;
|
57
|
+
}
|
58
|
+
leftCount += 3; //add back count for end positions
|
59
|
+
rightCount += 3;
|
60
|
+
for (i = 0; i < corners.length; i++) {
|
61
|
+
corner = corners[i];
|
62
|
+
const leftSide = corners[i].leftPositions;
|
63
|
+
if (defaultValue.defined(leftSide)) {
|
64
|
+
length = leftSide.length;
|
65
|
+
leftCount += length;
|
66
|
+
indicesLength += length;
|
67
|
+
} else {
|
68
|
+
length = corners[i].rightPositions.length;
|
69
|
+
rightCount += length;
|
70
|
+
indicesLength += length;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
const addEndPositions = defaultValue.defined(endPositions);
|
75
|
+
let endPositionLength;
|
76
|
+
if (addEndPositions) {
|
77
|
+
endPositionLength = endPositions[0].length - 3;
|
78
|
+
leftCount += endPositionLength;
|
79
|
+
rightCount += endPositionLength;
|
80
|
+
endPositionLength /= 3;
|
81
|
+
indicesLength += endPositionLength * 6;
|
82
|
+
}
|
83
|
+
const size = leftCount + rightCount;
|
84
|
+
const finalPositions = new Float64Array(size);
|
85
|
+
const normals = vertexFormat.normal ? new Float32Array(size) : undefined;
|
86
|
+
const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
|
87
|
+
const bitangents = vertexFormat.bitangent
|
88
|
+
? new Float32Array(size)
|
89
|
+
: undefined;
|
90
|
+
const attr = {
|
91
|
+
normals: normals,
|
92
|
+
tangents: tangents,
|
93
|
+
bitangents: bitangents,
|
94
|
+
};
|
95
|
+
let front = 0;
|
96
|
+
let back = size - 1;
|
97
|
+
let UL, LL, UR, LR;
|
98
|
+
let normal = cartesian1;
|
99
|
+
let left = cartesian2;
|
100
|
+
let rightPos, leftPos;
|
101
|
+
const halfLength = endPositionLength / 2;
|
102
|
+
|
103
|
+
const indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength);
|
104
|
+
let index = 0;
|
105
|
+
if (addEndPositions) {
|
106
|
+
// add rounded end
|
107
|
+
leftPos = cartesian3;
|
108
|
+
rightPos = cartesian4;
|
109
|
+
const firstEndPositions = endPositions[0];
|
110
|
+
normal = Matrix3.Cartesian3.fromArray(computedNormals, 0, normal);
|
111
|
+
left = Matrix3.Cartesian3.fromArray(computedLefts, 0, left);
|
112
|
+
for (i = 0; i < halfLength; i++) {
|
113
|
+
leftPos = Matrix3.Cartesian3.fromArray(
|
114
|
+
firstEndPositions,
|
115
|
+
(halfLength - 1 - i) * 3,
|
116
|
+
leftPos
|
117
|
+
);
|
118
|
+
rightPos = Matrix3.Cartesian3.fromArray(
|
119
|
+
firstEndPositions,
|
120
|
+
(halfLength + i) * 3,
|
121
|
+
rightPos
|
122
|
+
);
|
123
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
|
124
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
125
|
+
finalPositions,
|
126
|
+
leftPos,
|
127
|
+
undefined,
|
128
|
+
back
|
129
|
+
);
|
130
|
+
addNormals(attr, normal, left, front, back, vertexFormat);
|
131
|
+
|
132
|
+
LL = front / 3;
|
133
|
+
LR = LL + 1;
|
134
|
+
UL = (back - 2) / 3;
|
135
|
+
UR = UL - 1;
|
136
|
+
indices[index++] = UL;
|
137
|
+
indices[index++] = LL;
|
138
|
+
indices[index++] = UR;
|
139
|
+
indices[index++] = UR;
|
140
|
+
indices[index++] = LL;
|
141
|
+
indices[index++] = LR;
|
142
|
+
|
143
|
+
front += 3;
|
144
|
+
back -= 3;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
let posIndex = 0;
|
149
|
+
let compIndex = 0;
|
150
|
+
let rightEdge = positions[posIndex++]; //add first two edges
|
151
|
+
let leftEdge = positions[posIndex++];
|
152
|
+
finalPositions.set(rightEdge, front);
|
153
|
+
finalPositions.set(leftEdge, back - leftEdge.length + 1);
|
154
|
+
|
155
|
+
left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
|
156
|
+
let rightNormal;
|
157
|
+
let leftNormal;
|
158
|
+
length = leftEdge.length - 3;
|
159
|
+
for (i = 0; i < length; i += 3) {
|
160
|
+
rightNormal = ellipsoid.geodeticSurfaceNormal(
|
161
|
+
Matrix3.Cartesian3.fromArray(rightEdge, i, scratch1),
|
162
|
+
scratch1
|
163
|
+
);
|
164
|
+
leftNormal = ellipsoid.geodeticSurfaceNormal(
|
165
|
+
Matrix3.Cartesian3.fromArray(leftEdge, length - i, scratch2),
|
166
|
+
scratch2
|
167
|
+
);
|
168
|
+
normal = Matrix3.Cartesian3.normalize(
|
169
|
+
Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
|
170
|
+
normal
|
171
|
+
);
|
172
|
+
addNormals(attr, normal, left, front, back, vertexFormat);
|
173
|
+
|
174
|
+
LL = front / 3;
|
175
|
+
LR = LL + 1;
|
176
|
+
UL = (back - 2) / 3;
|
177
|
+
UR = UL - 1;
|
178
|
+
indices[index++] = UL;
|
179
|
+
indices[index++] = LL;
|
180
|
+
indices[index++] = UR;
|
181
|
+
indices[index++] = UR;
|
182
|
+
indices[index++] = LL;
|
183
|
+
indices[index++] = LR;
|
184
|
+
|
185
|
+
front += 3;
|
186
|
+
back -= 3;
|
187
|
+
}
|
188
|
+
|
189
|
+
rightNormal = ellipsoid.geodeticSurfaceNormal(
|
190
|
+
Matrix3.Cartesian3.fromArray(rightEdge, length, scratch1),
|
191
|
+
scratch1
|
192
|
+
);
|
193
|
+
leftNormal = ellipsoid.geodeticSurfaceNormal(
|
194
|
+
Matrix3.Cartesian3.fromArray(leftEdge, length, scratch2),
|
195
|
+
scratch2
|
196
|
+
);
|
197
|
+
normal = Matrix3.Cartesian3.normalize(
|
198
|
+
Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
|
199
|
+
normal
|
200
|
+
);
|
201
|
+
compIndex += 3;
|
202
|
+
for (i = 0; i < corners.length; i++) {
|
203
|
+
let j;
|
204
|
+
corner = corners[i];
|
205
|
+
const l = corner.leftPositions;
|
206
|
+
const r = corner.rightPositions;
|
207
|
+
let pivot;
|
208
|
+
let start;
|
209
|
+
let outsidePoint = cartesian6;
|
210
|
+
let previousPoint = cartesian3;
|
211
|
+
let nextPoint = cartesian4;
|
212
|
+
normal = Matrix3.Cartesian3.fromArray(computedNormals, compIndex, normal);
|
213
|
+
if (defaultValue.defined(l)) {
|
214
|
+
addNormals(attr, normal, left, undefined, back, vertexFormat);
|
215
|
+
back -= 3;
|
216
|
+
pivot = LR;
|
217
|
+
start = UR;
|
218
|
+
for (j = 0; j < l.length / 3; j++) {
|
219
|
+
outsidePoint = Matrix3.Cartesian3.fromArray(l, j * 3, outsidePoint);
|
220
|
+
indices[index++] = pivot;
|
221
|
+
indices[index++] = start - j - 1;
|
222
|
+
indices[index++] = start - j;
|
223
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
224
|
+
finalPositions,
|
225
|
+
outsidePoint,
|
226
|
+
undefined,
|
227
|
+
back
|
228
|
+
);
|
229
|
+
previousPoint = Matrix3.Cartesian3.fromArray(
|
230
|
+
finalPositions,
|
231
|
+
(start - j - 1) * 3,
|
232
|
+
previousPoint
|
233
|
+
);
|
234
|
+
nextPoint = Matrix3.Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);
|
235
|
+
left = Matrix3.Cartesian3.normalize(
|
236
|
+
Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
|
237
|
+
left
|
238
|
+
);
|
239
|
+
addNormals(attr, normal, left, undefined, back, vertexFormat);
|
240
|
+
back -= 3;
|
241
|
+
}
|
242
|
+
outsidePoint = Matrix3.Cartesian3.fromArray(
|
243
|
+
finalPositions,
|
244
|
+
pivot * 3,
|
245
|
+
outsidePoint
|
246
|
+
);
|
247
|
+
previousPoint = Matrix3.Cartesian3.subtract(
|
248
|
+
Matrix3.Cartesian3.fromArray(finalPositions, start * 3, previousPoint),
|
249
|
+
outsidePoint,
|
250
|
+
previousPoint
|
251
|
+
);
|
252
|
+
nextPoint = Matrix3.Cartesian3.subtract(
|
253
|
+
Matrix3.Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),
|
254
|
+
outsidePoint,
|
255
|
+
nextPoint
|
256
|
+
);
|
257
|
+
left = Matrix3.Cartesian3.normalize(
|
258
|
+
Matrix3.Cartesian3.add(previousPoint, nextPoint, left),
|
259
|
+
left
|
260
|
+
);
|
261
|
+
addNormals(attr, normal, left, front, undefined, vertexFormat);
|
262
|
+
front += 3;
|
263
|
+
} else {
|
264
|
+
addNormals(attr, normal, left, front, undefined, vertexFormat);
|
265
|
+
front += 3;
|
266
|
+
pivot = UR;
|
267
|
+
start = LR;
|
268
|
+
for (j = 0; j < r.length / 3; j++) {
|
269
|
+
outsidePoint = Matrix3.Cartesian3.fromArray(r, j * 3, outsidePoint);
|
270
|
+
indices[index++] = pivot;
|
271
|
+
indices[index++] = start + j;
|
272
|
+
indices[index++] = start + j + 1;
|
273
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
274
|
+
finalPositions,
|
275
|
+
outsidePoint,
|
276
|
+
front
|
277
|
+
);
|
278
|
+
previousPoint = Matrix3.Cartesian3.fromArray(
|
279
|
+
finalPositions,
|
280
|
+
pivot * 3,
|
281
|
+
previousPoint
|
282
|
+
);
|
283
|
+
nextPoint = Matrix3.Cartesian3.fromArray(
|
284
|
+
finalPositions,
|
285
|
+
(start + j) * 3,
|
286
|
+
nextPoint
|
287
|
+
);
|
288
|
+
left = Matrix3.Cartesian3.normalize(
|
289
|
+
Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
|
290
|
+
left
|
291
|
+
);
|
292
|
+
addNormals(attr, normal, left, front, undefined, vertexFormat);
|
293
|
+
front += 3;
|
294
|
+
}
|
295
|
+
outsidePoint = Matrix3.Cartesian3.fromArray(
|
296
|
+
finalPositions,
|
297
|
+
pivot * 3,
|
298
|
+
outsidePoint
|
299
|
+
);
|
300
|
+
previousPoint = Matrix3.Cartesian3.subtract(
|
301
|
+
Matrix3.Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),
|
302
|
+
outsidePoint,
|
303
|
+
previousPoint
|
304
|
+
);
|
305
|
+
nextPoint = Matrix3.Cartesian3.subtract(
|
306
|
+
Matrix3.Cartesian3.fromArray(finalPositions, start * 3, nextPoint),
|
307
|
+
outsidePoint,
|
308
|
+
nextPoint
|
309
|
+
);
|
310
|
+
left = Matrix3.Cartesian3.normalize(
|
311
|
+
Matrix3.Cartesian3.negate(Matrix3.Cartesian3.add(nextPoint, previousPoint, left), left),
|
312
|
+
left
|
313
|
+
);
|
314
|
+
addNormals(attr, normal, left, undefined, back, vertexFormat);
|
315
|
+
back -= 3;
|
316
|
+
}
|
317
|
+
rightEdge = positions[posIndex++];
|
318
|
+
leftEdge = positions[posIndex++];
|
319
|
+
rightEdge.splice(0, 3); //remove duplicate points added by corner
|
320
|
+
leftEdge.splice(leftEdge.length - 3, 3);
|
321
|
+
finalPositions.set(rightEdge, front);
|
322
|
+
finalPositions.set(leftEdge, back - leftEdge.length + 1);
|
323
|
+
length = leftEdge.length - 3;
|
324
|
+
|
325
|
+
compIndex += 3;
|
326
|
+
left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
|
327
|
+
for (j = 0; j < leftEdge.length; j += 3) {
|
328
|
+
rightNormal = ellipsoid.geodeticSurfaceNormal(
|
329
|
+
Matrix3.Cartesian3.fromArray(rightEdge, j, scratch1),
|
330
|
+
scratch1
|
331
|
+
);
|
332
|
+
leftNormal = ellipsoid.geodeticSurfaceNormal(
|
333
|
+
Matrix3.Cartesian3.fromArray(leftEdge, length - j, scratch2),
|
334
|
+
scratch2
|
335
|
+
);
|
336
|
+
normal = Matrix3.Cartesian3.normalize(
|
337
|
+
Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
|
338
|
+
normal
|
339
|
+
);
|
340
|
+
addNormals(attr, normal, left, front, back, vertexFormat);
|
341
|
+
|
342
|
+
LR = front / 3;
|
343
|
+
LL = LR - 1;
|
344
|
+
UR = (back - 2) / 3;
|
345
|
+
UL = UR + 1;
|
346
|
+
indices[index++] = UL;
|
347
|
+
indices[index++] = LL;
|
348
|
+
indices[index++] = UR;
|
349
|
+
indices[index++] = UR;
|
350
|
+
indices[index++] = LL;
|
351
|
+
indices[index++] = LR;
|
352
|
+
|
353
|
+
front += 3;
|
354
|
+
back -= 3;
|
355
|
+
}
|
356
|
+
front -= 3;
|
357
|
+
back += 3;
|
358
|
+
}
|
359
|
+
normal = Matrix3.Cartesian3.fromArray(
|
360
|
+
computedNormals,
|
361
|
+
computedNormals.length - 3,
|
362
|
+
normal
|
363
|
+
);
|
364
|
+
addNormals(attr, normal, left, front, back, vertexFormat);
|
365
|
+
|
366
|
+
if (addEndPositions) {
|
367
|
+
// add rounded end
|
368
|
+
front += 3;
|
369
|
+
back -= 3;
|
370
|
+
leftPos = cartesian3;
|
371
|
+
rightPos = cartesian4;
|
372
|
+
const lastEndPositions = endPositions[1];
|
373
|
+
for (i = 0; i < halfLength; i++) {
|
374
|
+
leftPos = Matrix3.Cartesian3.fromArray(
|
375
|
+
lastEndPositions,
|
376
|
+
(endPositionLength - i - 1) * 3,
|
377
|
+
leftPos
|
378
|
+
);
|
379
|
+
rightPos = Matrix3.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
|
380
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
381
|
+
finalPositions,
|
382
|
+
leftPos,
|
383
|
+
undefined,
|
384
|
+
back
|
385
|
+
);
|
386
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
|
387
|
+
addNormals(attr, normal, left, front, back, vertexFormat);
|
388
|
+
|
389
|
+
LR = front / 3;
|
390
|
+
LL = LR - 1;
|
391
|
+
UR = (back - 2) / 3;
|
392
|
+
UL = UR + 1;
|
393
|
+
indices[index++] = UL;
|
394
|
+
indices[index++] = LL;
|
395
|
+
indices[index++] = UR;
|
396
|
+
indices[index++] = UR;
|
397
|
+
indices[index++] = LL;
|
398
|
+
indices[index++] = LR;
|
399
|
+
|
400
|
+
front += 3;
|
401
|
+
back -= 3;
|
402
|
+
}
|
403
|
+
}
|
404
|
+
|
405
|
+
attributes.position = new GeometryAttribute.GeometryAttribute({
|
406
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
|
407
|
+
componentsPerAttribute: 3,
|
408
|
+
values: finalPositions,
|
409
|
+
});
|
410
|
+
|
411
|
+
if (vertexFormat.st) {
|
412
|
+
const st = new Float32Array((size / 3) * 2);
|
413
|
+
let rightSt;
|
414
|
+
let leftSt;
|
415
|
+
let stIndex = 0;
|
416
|
+
if (addEndPositions) {
|
417
|
+
leftCount /= 3;
|
418
|
+
rightCount /= 3;
|
419
|
+
const theta = Math.PI / (endPositionLength + 1);
|
420
|
+
leftSt = 1 / (leftCount - endPositionLength + 1);
|
421
|
+
rightSt = 1 / (rightCount - endPositionLength + 1);
|
422
|
+
let a;
|
423
|
+
const halfEndPos = endPositionLength / 2;
|
424
|
+
for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
|
425
|
+
// lower left rounded end
|
426
|
+
a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
|
427
|
+
st[stIndex++] = rightSt * (1 + Math.cos(a));
|
428
|
+
st[stIndex++] = 0.5 * (1 + Math.sin(a));
|
429
|
+
}
|
430
|
+
for (i = 1; i < rightCount - endPositionLength + 1; i++) {
|
431
|
+
// bottom edge
|
432
|
+
st[stIndex++] = i * rightSt;
|
433
|
+
st[stIndex++] = 0;
|
434
|
+
}
|
435
|
+
for (i = endPositionLength; i > halfEndPos; i--) {
|
436
|
+
// lower right rounded end
|
437
|
+
a = Math$1.CesiumMath.PI_OVER_TWO - i * theta;
|
438
|
+
st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
|
439
|
+
st[stIndex++] = 0.5 * (1 + Math.sin(a));
|
440
|
+
}
|
441
|
+
for (i = halfEndPos; i > 0; i--) {
|
442
|
+
// upper right rounded end
|
443
|
+
a = Math$1.CesiumMath.PI_OVER_TWO - theta * i;
|
444
|
+
st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
|
445
|
+
st[stIndex++] = 0.5 * (1 + Math.sin(a));
|
446
|
+
}
|
447
|
+
for (i = leftCount - endPositionLength; i > 0; i--) {
|
448
|
+
// top edge
|
449
|
+
st[stIndex++] = i * leftSt;
|
450
|
+
st[stIndex++] = 1;
|
451
|
+
}
|
452
|
+
for (i = 1; i < halfEndPos + 1; i++) {
|
453
|
+
// upper left rounded end
|
454
|
+
a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
|
455
|
+
st[stIndex++] = leftSt * (1 + Math.cos(a));
|
456
|
+
st[stIndex++] = 0.5 * (1 + Math.sin(a));
|
457
|
+
}
|
458
|
+
} else {
|
459
|
+
leftCount /= 3;
|
460
|
+
rightCount /= 3;
|
461
|
+
leftSt = 1 / (leftCount - 1);
|
462
|
+
rightSt = 1 / (rightCount - 1);
|
463
|
+
for (i = 0; i < rightCount; i++) {
|
464
|
+
// bottom edge
|
465
|
+
st[stIndex++] = i * rightSt;
|
466
|
+
st[stIndex++] = 0;
|
467
|
+
}
|
468
|
+
for (i = leftCount; i > 0; i--) {
|
469
|
+
// top edge
|
470
|
+
st[stIndex++] = (i - 1) * leftSt;
|
471
|
+
st[stIndex++] = 1;
|
472
|
+
}
|
473
|
+
}
|
474
|
+
|
475
|
+
attributes.st = new GeometryAttribute.GeometryAttribute({
|
476
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
477
|
+
componentsPerAttribute: 2,
|
478
|
+
values: st,
|
479
|
+
});
|
480
|
+
}
|
481
|
+
|
482
|
+
if (vertexFormat.normal) {
|
483
|
+
attributes.normal = new GeometryAttribute.GeometryAttribute({
|
484
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
485
|
+
componentsPerAttribute: 3,
|
486
|
+
values: attr.normals,
|
487
|
+
});
|
488
|
+
}
|
489
|
+
|
490
|
+
if (vertexFormat.tangent) {
|
491
|
+
attributes.tangent = new GeometryAttribute.GeometryAttribute({
|
492
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
493
|
+
componentsPerAttribute: 3,
|
494
|
+
values: attr.tangents,
|
495
|
+
});
|
496
|
+
}
|
497
|
+
|
498
|
+
if (vertexFormat.bitangent) {
|
499
|
+
attributes.bitangent = new GeometryAttribute.GeometryAttribute({
|
500
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
501
|
+
componentsPerAttribute: 3,
|
502
|
+
values: attr.bitangents,
|
503
|
+
});
|
504
|
+
}
|
505
|
+
|
506
|
+
return {
|
507
|
+
attributes: attributes,
|
508
|
+
indices: indices,
|
509
|
+
};
|
510
|
+
}
|
511
|
+
|
512
|
+
function extrudedAttributes(attributes, vertexFormat) {
|
513
|
+
if (
|
514
|
+
!vertexFormat.normal &&
|
515
|
+
!vertexFormat.tangent &&
|
516
|
+
!vertexFormat.bitangent &&
|
517
|
+
!vertexFormat.st
|
518
|
+
) {
|
519
|
+
return attributes;
|
520
|
+
}
|
521
|
+
const positions = attributes.position.values;
|
522
|
+
let topNormals;
|
523
|
+
let topBitangents;
|
524
|
+
if (vertexFormat.normal || vertexFormat.bitangent) {
|
525
|
+
topNormals = attributes.normal.values;
|
526
|
+
topBitangents = attributes.bitangent.values;
|
527
|
+
}
|
528
|
+
const size = attributes.position.values.length / 18;
|
529
|
+
const threeSize = size * 3;
|
530
|
+
const twoSize = size * 2;
|
531
|
+
const sixSize = threeSize * 2;
|
532
|
+
let i;
|
533
|
+
if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
|
534
|
+
const normals = vertexFormat.normal
|
535
|
+
? new Float32Array(threeSize * 6)
|
536
|
+
: undefined;
|
537
|
+
const tangents = vertexFormat.tangent
|
538
|
+
? new Float32Array(threeSize * 6)
|
539
|
+
: undefined;
|
540
|
+
const bitangents = vertexFormat.bitangent
|
541
|
+
? new Float32Array(threeSize * 6)
|
542
|
+
: undefined;
|
543
|
+
let topPosition = cartesian1;
|
544
|
+
let bottomPosition = cartesian2;
|
545
|
+
let previousPosition = cartesian3;
|
546
|
+
let normal = cartesian4;
|
547
|
+
let tangent = cartesian5;
|
548
|
+
let bitangent = cartesian6;
|
549
|
+
let attrIndex = sixSize;
|
550
|
+
for (i = 0; i < threeSize; i += 3) {
|
551
|
+
const attrIndexOffset = attrIndex + sixSize;
|
552
|
+
topPosition = Matrix3.Cartesian3.fromArray(positions, i, topPosition);
|
553
|
+
bottomPosition = Matrix3.Cartesian3.fromArray(
|
554
|
+
positions,
|
555
|
+
i + threeSize,
|
556
|
+
bottomPosition
|
557
|
+
);
|
558
|
+
previousPosition = Matrix3.Cartesian3.fromArray(
|
559
|
+
positions,
|
560
|
+
(i + 3) % threeSize,
|
561
|
+
previousPosition
|
562
|
+
);
|
563
|
+
bottomPosition = Matrix3.Cartesian3.subtract(
|
564
|
+
bottomPosition,
|
565
|
+
topPosition,
|
566
|
+
bottomPosition
|
567
|
+
);
|
568
|
+
previousPosition = Matrix3.Cartesian3.subtract(
|
569
|
+
previousPosition,
|
570
|
+
topPosition,
|
571
|
+
previousPosition
|
572
|
+
);
|
573
|
+
normal = Matrix3.Cartesian3.normalize(
|
574
|
+
Matrix3.Cartesian3.cross(bottomPosition, previousPosition, normal),
|
575
|
+
normal
|
576
|
+
);
|
577
|
+
if (vertexFormat.normal) {
|
578
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);
|
579
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
580
|
+
normals,
|
581
|
+
normal,
|
582
|
+
attrIndexOffset + 3
|
583
|
+
);
|
584
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);
|
585
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);
|
586
|
+
}
|
587
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
588
|
+
bitangent = Matrix3.Cartesian3.fromArray(topNormals, i, bitangent);
|
589
|
+
if (vertexFormat.bitangent) {
|
590
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
591
|
+
bitangents,
|
592
|
+
bitangent,
|
593
|
+
attrIndexOffset
|
594
|
+
);
|
595
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
596
|
+
bitangents,
|
597
|
+
bitangent,
|
598
|
+
attrIndexOffset + 3
|
599
|
+
);
|
600
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
601
|
+
bitangents,
|
602
|
+
bitangent,
|
603
|
+
attrIndex
|
604
|
+
);
|
605
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
606
|
+
bitangents,
|
607
|
+
bitangent,
|
608
|
+
attrIndex + 3
|
609
|
+
);
|
610
|
+
}
|
611
|
+
|
612
|
+
if (vertexFormat.tangent) {
|
613
|
+
tangent = Matrix3.Cartesian3.normalize(
|
614
|
+
Matrix3.Cartesian3.cross(bitangent, normal, tangent),
|
615
|
+
tangent
|
616
|
+
);
|
617
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
618
|
+
tangents,
|
619
|
+
tangent,
|
620
|
+
attrIndexOffset
|
621
|
+
);
|
622
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
623
|
+
tangents,
|
624
|
+
tangent,
|
625
|
+
attrIndexOffset + 3
|
626
|
+
);
|
627
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);
|
628
|
+
CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
|
629
|
+
tangents,
|
630
|
+
tangent,
|
631
|
+
attrIndex + 3
|
632
|
+
);
|
633
|
+
}
|
634
|
+
}
|
635
|
+
attrIndex += 6;
|
636
|
+
}
|
637
|
+
|
638
|
+
if (vertexFormat.normal) {
|
639
|
+
normals.set(topNormals); //top
|
640
|
+
for (i = 0; i < threeSize; i += 3) {
|
641
|
+
//bottom normals
|
642
|
+
normals[i + threeSize] = -topNormals[i];
|
643
|
+
normals[i + threeSize + 1] = -topNormals[i + 1];
|
644
|
+
normals[i + threeSize + 2] = -topNormals[i + 2];
|
645
|
+
}
|
646
|
+
attributes.normal.values = normals;
|
647
|
+
} else {
|
648
|
+
attributes.normal = undefined;
|
649
|
+
}
|
650
|
+
|
651
|
+
if (vertexFormat.bitangent) {
|
652
|
+
bitangents.set(topBitangents); //top
|
653
|
+
bitangents.set(topBitangents, threeSize); //bottom
|
654
|
+
attributes.bitangent.values = bitangents;
|
655
|
+
} else {
|
656
|
+
attributes.bitangent = undefined;
|
657
|
+
}
|
658
|
+
|
659
|
+
if (vertexFormat.tangent) {
|
660
|
+
const topTangents = attributes.tangent.values;
|
661
|
+
tangents.set(topTangents); //top
|
662
|
+
tangents.set(topTangents, threeSize); //bottom
|
663
|
+
attributes.tangent.values = tangents;
|
664
|
+
}
|
665
|
+
}
|
666
|
+
if (vertexFormat.st) {
|
667
|
+
const topSt = attributes.st.values;
|
668
|
+
const st = new Float32Array(twoSize * 6);
|
669
|
+
st.set(topSt); //top
|
670
|
+
st.set(topSt, twoSize); //bottom
|
671
|
+
let index = twoSize * 2;
|
672
|
+
|
673
|
+
for (let j = 0; j < 2; j++) {
|
674
|
+
st[index++] = topSt[0];
|
675
|
+
st[index++] = topSt[1];
|
676
|
+
for (i = 2; i < twoSize; i += 2) {
|
677
|
+
const s = topSt[i];
|
678
|
+
const t = topSt[i + 1];
|
679
|
+
st[index++] = s;
|
680
|
+
st[index++] = t;
|
681
|
+
st[index++] = s;
|
682
|
+
st[index++] = t;
|
683
|
+
}
|
684
|
+
st[index++] = topSt[0];
|
685
|
+
st[index++] = topSt[1];
|
686
|
+
}
|
687
|
+
attributes.st.values = st;
|
688
|
+
}
|
689
|
+
|
690
|
+
return attributes;
|
691
|
+
}
|
692
|
+
|
693
|
+
function addWallPositions(positions, index, wallPositions) {
|
694
|
+
wallPositions[index++] = positions[0];
|
695
|
+
wallPositions[index++] = positions[1];
|
696
|
+
wallPositions[index++] = positions[2];
|
697
|
+
for (let i = 3; i < positions.length; i += 3) {
|
698
|
+
const x = positions[i];
|
699
|
+
const y = positions[i + 1];
|
700
|
+
const z = positions[i + 2];
|
701
|
+
wallPositions[index++] = x;
|
702
|
+
wallPositions[index++] = y;
|
703
|
+
wallPositions[index++] = z;
|
704
|
+
wallPositions[index++] = x;
|
705
|
+
wallPositions[index++] = y;
|
706
|
+
wallPositions[index++] = z;
|
707
|
+
}
|
708
|
+
wallPositions[index++] = positions[0];
|
709
|
+
wallPositions[index++] = positions[1];
|
710
|
+
wallPositions[index++] = positions[2];
|
711
|
+
|
712
|
+
return wallPositions;
|
713
|
+
}
|
714
|
+
|
715
|
+
function computePositionsExtruded(params, vertexFormat) {
|
716
|
+
const topVertexFormat = new VertexFormat.VertexFormat({
|
717
|
+
position: vertexFormat.position,
|
718
|
+
normal:
|
719
|
+
vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
|
720
|
+
tangent: vertexFormat.tangent,
|
721
|
+
bitangent: vertexFormat.normal || vertexFormat.bitangent,
|
722
|
+
st: vertexFormat.st,
|
723
|
+
});
|
724
|
+
const ellipsoid = params.ellipsoid;
|
725
|
+
const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
|
726
|
+
const attr = combine(computedPositions, topVertexFormat, ellipsoid);
|
727
|
+
const height = params.height;
|
728
|
+
const extrudedHeight = params.extrudedHeight;
|
729
|
+
let attributes = attr.attributes;
|
730
|
+
const indices = attr.indices;
|
731
|
+
let positions = attributes.position.values;
|
732
|
+
let length = positions.length;
|
733
|
+
const newPositions = new Float64Array(length * 6);
|
734
|
+
let extrudedPositions = new Float64Array(length);
|
735
|
+
extrudedPositions.set(positions);
|
736
|
+
let wallPositions = new Float64Array(length * 4);
|
737
|
+
|
738
|
+
positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
739
|
+
positions,
|
740
|
+
height,
|
741
|
+
ellipsoid
|
742
|
+
);
|
743
|
+
wallPositions = addWallPositions(positions, 0, wallPositions);
|
744
|
+
extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
745
|
+
extrudedPositions,
|
746
|
+
extrudedHeight,
|
747
|
+
ellipsoid
|
748
|
+
);
|
749
|
+
wallPositions = addWallPositions(
|
750
|
+
extrudedPositions,
|
751
|
+
length * 2,
|
752
|
+
wallPositions
|
753
|
+
);
|
754
|
+
newPositions.set(positions);
|
755
|
+
newPositions.set(extrudedPositions, length);
|
756
|
+
newPositions.set(wallPositions, length * 2);
|
757
|
+
attributes.position.values = newPositions;
|
758
|
+
|
759
|
+
attributes = extrudedAttributes(attributes, vertexFormat);
|
760
|
+
let i;
|
761
|
+
const size = length / 3;
|
762
|
+
if (params.shadowVolume) {
|
763
|
+
const topNormals = attributes.normal.values;
|
764
|
+
length = topNormals.length;
|
765
|
+
|
766
|
+
let extrudeNormals = new Float32Array(length * 6);
|
767
|
+
for (i = 0; i < length; i++) {
|
768
|
+
topNormals[i] = -topNormals[i];
|
769
|
+
}
|
770
|
+
//only get normals for bottom layer that's going to be pushed down
|
771
|
+
extrudeNormals.set(topNormals, length); //bottom face
|
772
|
+
extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall
|
773
|
+
attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
|
774
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
775
|
+
componentsPerAttribute: 3,
|
776
|
+
values: extrudeNormals,
|
777
|
+
});
|
778
|
+
if (!vertexFormat.normal) {
|
779
|
+
attributes.normal = undefined;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
if (defaultValue.defined(params.offsetAttribute)) {
|
783
|
+
let applyOffset = new Uint8Array(size * 6);
|
784
|
+
if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
|
785
|
+
applyOffset = applyOffset
|
786
|
+
.fill(1, 0, size) // top face
|
787
|
+
.fill(1, size * 2, size * 4); // top wall
|
788
|
+
} else {
|
789
|
+
const applyOffsetValue =
|
790
|
+
params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
|
791
|
+
applyOffset = applyOffset.fill(applyOffsetValue);
|
792
|
+
}
|
793
|
+
attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
|
794
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
|
795
|
+
componentsPerAttribute: 1,
|
796
|
+
values: applyOffset,
|
797
|
+
});
|
798
|
+
}
|
799
|
+
|
800
|
+
const iLength = indices.length;
|
801
|
+
const twoSize = size + size;
|
802
|
+
const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
|
803
|
+
newPositions.length / 3,
|
804
|
+
iLength * 2 + twoSize * 3
|
805
|
+
);
|
806
|
+
newIndices.set(indices);
|
807
|
+
let index = iLength;
|
808
|
+
for (i = 0; i < iLength; i += 3) {
|
809
|
+
// bottom indices
|
810
|
+
const v0 = indices[i];
|
811
|
+
const v1 = indices[i + 1];
|
812
|
+
const v2 = indices[i + 2];
|
813
|
+
newIndices[index++] = v2 + size;
|
814
|
+
newIndices[index++] = v1 + size;
|
815
|
+
newIndices[index++] = v0 + size;
|
816
|
+
}
|
817
|
+
|
818
|
+
let UL, LL, UR, LR;
|
819
|
+
|
820
|
+
for (i = 0; i < twoSize; i += 2) {
|
821
|
+
//wall indices
|
822
|
+
UL = i + twoSize;
|
823
|
+
LL = UL + twoSize;
|
824
|
+
UR = UL + 1;
|
825
|
+
LR = LL + 1;
|
826
|
+
newIndices[index++] = UL;
|
827
|
+
newIndices[index++] = LL;
|
828
|
+
newIndices[index++] = UR;
|
829
|
+
newIndices[index++] = UR;
|
830
|
+
newIndices[index++] = LL;
|
831
|
+
newIndices[index++] = LR;
|
832
|
+
}
|
833
|
+
|
834
|
+
return {
|
835
|
+
attributes: attributes,
|
836
|
+
indices: newIndices,
|
837
|
+
};
|
838
|
+
}
|
839
|
+
|
840
|
+
const scratchCartesian1 = new Matrix3.Cartesian3();
|
841
|
+
const scratchCartesian2 = new Matrix3.Cartesian3();
|
842
|
+
const scratchCartographic = new Matrix3.Cartographic();
|
843
|
+
|
844
|
+
function computeOffsetPoints(
|
845
|
+
position1,
|
846
|
+
position2,
|
847
|
+
ellipsoid,
|
848
|
+
halfWidth,
|
849
|
+
min,
|
850
|
+
max
|
851
|
+
) {
|
852
|
+
// Compute direction of offset the point
|
853
|
+
const direction = Matrix3.Cartesian3.subtract(
|
854
|
+
position2,
|
855
|
+
position1,
|
856
|
+
scratchCartesian1
|
857
|
+
);
|
858
|
+
Matrix3.Cartesian3.normalize(direction, direction);
|
859
|
+
const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
|
860
|
+
const offsetDirection = Matrix3.Cartesian3.cross(
|
861
|
+
direction,
|
862
|
+
normal,
|
863
|
+
scratchCartesian1
|
864
|
+
);
|
865
|
+
Matrix3.Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
|
866
|
+
|
867
|
+
let minLat = min.latitude;
|
868
|
+
let minLon = min.longitude;
|
869
|
+
let maxLat = max.latitude;
|
870
|
+
let maxLon = max.longitude;
|
871
|
+
|
872
|
+
// Compute 2 offset points
|
873
|
+
Matrix3.Cartesian3.add(position1, offsetDirection, scratchCartesian2);
|
874
|
+
ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
|
875
|
+
|
876
|
+
let lat = scratchCartographic.latitude;
|
877
|
+
let lon = scratchCartographic.longitude;
|
878
|
+
minLat = Math.min(minLat, lat);
|
879
|
+
minLon = Math.min(minLon, lon);
|
880
|
+
maxLat = Math.max(maxLat, lat);
|
881
|
+
maxLon = Math.max(maxLon, lon);
|
882
|
+
|
883
|
+
Matrix3.Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);
|
884
|
+
ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
|
885
|
+
|
886
|
+
lat = scratchCartographic.latitude;
|
887
|
+
lon = scratchCartographic.longitude;
|
888
|
+
minLat = Math.min(minLat, lat);
|
889
|
+
minLon = Math.min(minLon, lon);
|
890
|
+
maxLat = Math.max(maxLat, lat);
|
891
|
+
maxLon = Math.max(maxLon, lon);
|
892
|
+
|
893
|
+
min.latitude = minLat;
|
894
|
+
min.longitude = minLon;
|
895
|
+
max.latitude = maxLat;
|
896
|
+
max.longitude = maxLon;
|
897
|
+
}
|
898
|
+
|
899
|
+
const scratchCartesianOffset = new Matrix3.Cartesian3();
|
900
|
+
const scratchCartesianEnds = new Matrix3.Cartesian3();
|
901
|
+
const scratchCartographicMin = new Matrix3.Cartographic();
|
902
|
+
const scratchCartographicMax = new Matrix3.Cartographic();
|
903
|
+
|
904
|
+
function computeRectangle(positions, ellipsoid, width, cornerType, result) {
|
905
|
+
positions = scaleToSurface(positions, ellipsoid);
|
906
|
+
const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
|
907
|
+
positions,
|
908
|
+
Matrix3.Cartesian3.equalsEpsilon
|
909
|
+
);
|
910
|
+
const length = cleanPositions.length;
|
911
|
+
if (length < 2 || width <= 0) {
|
912
|
+
return new Matrix2.Rectangle();
|
913
|
+
}
|
914
|
+
const halfWidth = width * 0.5;
|
915
|
+
|
916
|
+
scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
|
917
|
+
scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
|
918
|
+
scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
|
919
|
+
scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
|
920
|
+
|
921
|
+
let lat, lon;
|
922
|
+
if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
|
923
|
+
// Compute start cap
|
924
|
+
const first = cleanPositions[0];
|
925
|
+
Matrix3.Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);
|
926
|
+
Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
|
927
|
+
Matrix3.Cartesian3.multiplyByScalar(
|
928
|
+
scratchCartesianOffset,
|
929
|
+
halfWidth,
|
930
|
+
scratchCartesianOffset
|
931
|
+
);
|
932
|
+
Matrix3.Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);
|
933
|
+
|
934
|
+
ellipsoid.cartesianToCartographic(
|
935
|
+
scratchCartesianEnds,
|
936
|
+
scratchCartographic
|
937
|
+
);
|
938
|
+
lat = scratchCartographic.latitude;
|
939
|
+
lon = scratchCartographic.longitude;
|
940
|
+
scratchCartographicMin.latitude = Math.min(
|
941
|
+
scratchCartographicMin.latitude,
|
942
|
+
lat
|
943
|
+
);
|
944
|
+
scratchCartographicMin.longitude = Math.min(
|
945
|
+
scratchCartographicMin.longitude,
|
946
|
+
lon
|
947
|
+
);
|
948
|
+
scratchCartographicMax.latitude = Math.max(
|
949
|
+
scratchCartographicMax.latitude,
|
950
|
+
lat
|
951
|
+
);
|
952
|
+
scratchCartographicMax.longitude = Math.max(
|
953
|
+
scratchCartographicMax.longitude,
|
954
|
+
lon
|
955
|
+
);
|
956
|
+
}
|
957
|
+
|
958
|
+
// Compute the rest
|
959
|
+
for (let i = 0; i < length - 1; ++i) {
|
960
|
+
computeOffsetPoints(
|
961
|
+
cleanPositions[i],
|
962
|
+
cleanPositions[i + 1],
|
963
|
+
ellipsoid,
|
964
|
+
halfWidth,
|
965
|
+
scratchCartographicMin,
|
966
|
+
scratchCartographicMax
|
967
|
+
);
|
968
|
+
}
|
969
|
+
|
970
|
+
// Compute ending point
|
971
|
+
const last = cleanPositions[length - 1];
|
972
|
+
Matrix3.Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
|
973
|
+
Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
|
974
|
+
Matrix3.Cartesian3.multiplyByScalar(
|
975
|
+
scratchCartesianOffset,
|
976
|
+
halfWidth,
|
977
|
+
scratchCartesianOffset
|
978
|
+
);
|
979
|
+
Matrix3.Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);
|
980
|
+
computeOffsetPoints(
|
981
|
+
last,
|
982
|
+
scratchCartesianEnds,
|
983
|
+
ellipsoid,
|
984
|
+
halfWidth,
|
985
|
+
scratchCartographicMin,
|
986
|
+
scratchCartographicMax
|
987
|
+
);
|
988
|
+
|
989
|
+
if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
|
990
|
+
// Compute end cap
|
991
|
+
ellipsoid.cartesianToCartographic(
|
992
|
+
scratchCartesianEnds,
|
993
|
+
scratchCartographic
|
994
|
+
);
|
995
|
+
lat = scratchCartographic.latitude;
|
996
|
+
lon = scratchCartographic.longitude;
|
997
|
+
scratchCartographicMin.latitude = Math.min(
|
998
|
+
scratchCartographicMin.latitude,
|
999
|
+
lat
|
1000
|
+
);
|
1001
|
+
scratchCartographicMin.longitude = Math.min(
|
1002
|
+
scratchCartographicMin.longitude,
|
1003
|
+
lon
|
1004
|
+
);
|
1005
|
+
scratchCartographicMax.latitude = Math.max(
|
1006
|
+
scratchCartographicMax.latitude,
|
1007
|
+
lat
|
1008
|
+
);
|
1009
|
+
scratchCartographicMax.longitude = Math.max(
|
1010
|
+
scratchCartographicMax.longitude,
|
1011
|
+
lon
|
1012
|
+
);
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
const rectangle = defaultValue.defined(result) ? result : new Matrix2.Rectangle();
|
1016
|
+
rectangle.north = scratchCartographicMax.latitude;
|
1017
|
+
rectangle.south = scratchCartographicMin.latitude;
|
1018
|
+
rectangle.east = scratchCartographicMax.longitude;
|
1019
|
+
rectangle.west = scratchCartographicMin.longitude;
|
1020
|
+
|
1021
|
+
return rectangle;
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
/**
|
1025
|
+
* A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
|
1026
|
+
*
|
1027
|
+
* @alias CorridorGeometry
|
1028
|
+
* @constructor
|
1029
|
+
*
|
1030
|
+
* @param {Object} options Object with the following properties:
|
1031
|
+
* @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
|
1032
|
+
* @param {Number} options.width The distance between the edges of the corridor in meters.
|
1033
|
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
1034
|
+
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
|
1035
|
+
* @param {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.
|
1036
|
+
* @param {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.
|
1037
|
+
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
|
1038
|
+
* @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
|
1039
|
+
*
|
1040
|
+
* @see CorridorGeometry.createGeometry
|
1041
|
+
* @see Packable
|
1042
|
+
*
|
1043
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}
|
1044
|
+
*
|
1045
|
+
* @example
|
1046
|
+
* const corridor = new Cesium.CorridorGeometry({
|
1047
|
+
* vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
|
1048
|
+
* positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
|
1049
|
+
* width : 100000
|
1050
|
+
* });
|
1051
|
+
*/
|
1052
|
+
function CorridorGeometry(options) {
|
1053
|
+
options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
|
1054
|
+
const positions = options.positions;
|
1055
|
+
const width = options.width;
|
1056
|
+
|
1057
|
+
//>>includeStart('debug', pragmas.debug);
|
1058
|
+
Check.Check.defined("options.positions", positions);
|
1059
|
+
Check.Check.defined("options.width", width);
|
1060
|
+
//>>includeEnd('debug');
|
1061
|
+
|
1062
|
+
const height = defaultValue.defaultValue(options.height, 0.0);
|
1063
|
+
const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
|
1064
|
+
|
1065
|
+
this._positions = positions;
|
1066
|
+
this._ellipsoid = Matrix3.Ellipsoid.clone(
|
1067
|
+
defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
|
1068
|
+
);
|
1069
|
+
this._vertexFormat = VertexFormat.VertexFormat.clone(
|
1070
|
+
defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
|
1071
|
+
);
|
1072
|
+
this._width = width;
|
1073
|
+
this._height = Math.max(height, extrudedHeight);
|
1074
|
+
this._extrudedHeight = Math.min(height, extrudedHeight);
|
1075
|
+
this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
|
1076
|
+
this._granularity = defaultValue.defaultValue(
|
1077
|
+
options.granularity,
|
1078
|
+
Math$1.CesiumMath.RADIANS_PER_DEGREE
|
1079
|
+
);
|
1080
|
+
this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
|
1081
|
+
this._workerName = "createCorridorGeometry";
|
1082
|
+
this._offsetAttribute = options.offsetAttribute;
|
1083
|
+
this._rectangle = undefined;
|
1084
|
+
|
1085
|
+
/**
|
1086
|
+
* The number of elements used to pack the object into an array.
|
1087
|
+
* @type {Number}
|
1088
|
+
*/
|
1089
|
+
this.packedLength =
|
1090
|
+
1 +
|
1091
|
+
positions.length * Matrix3.Cartesian3.packedLength +
|
1092
|
+
Matrix3.Ellipsoid.packedLength +
|
1093
|
+
VertexFormat.VertexFormat.packedLength +
|
1094
|
+
7;
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
/**
|
1098
|
+
* Stores the provided instance into the provided array.
|
1099
|
+
*
|
1100
|
+
* @param {CorridorGeometry} value The value to pack.
|
1101
|
+
* @param {Number[]} array The array to pack into.
|
1102
|
+
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
|
1103
|
+
*
|
1104
|
+
* @returns {Number[]} The array that was packed into
|
1105
|
+
*/
|
1106
|
+
CorridorGeometry.pack = function (value, array, startingIndex) {
|
1107
|
+
//>>includeStart('debug', pragmas.debug);
|
1108
|
+
Check.Check.defined("value", value);
|
1109
|
+
Check.Check.defined("array", array);
|
1110
|
+
//>>includeEnd('debug');
|
1111
|
+
|
1112
|
+
startingIndex = defaultValue.defaultValue(startingIndex, 0);
|
1113
|
+
|
1114
|
+
const positions = value._positions;
|
1115
|
+
const length = positions.length;
|
1116
|
+
array[startingIndex++] = length;
|
1117
|
+
|
1118
|
+
for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
|
1119
|
+
Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
|
1123
|
+
startingIndex += Matrix3.Ellipsoid.packedLength;
|
1124
|
+
|
1125
|
+
VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
|
1126
|
+
startingIndex += VertexFormat.VertexFormat.packedLength;
|
1127
|
+
|
1128
|
+
array[startingIndex++] = value._width;
|
1129
|
+
array[startingIndex++] = value._height;
|
1130
|
+
array[startingIndex++] = value._extrudedHeight;
|
1131
|
+
array[startingIndex++] = value._cornerType;
|
1132
|
+
array[startingIndex++] = value._granularity;
|
1133
|
+
array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
|
1134
|
+
array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
|
1135
|
+
|
1136
|
+
return array;
|
1137
|
+
};
|
1138
|
+
|
1139
|
+
const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
|
1140
|
+
const scratchVertexFormat = new VertexFormat.VertexFormat();
|
1141
|
+
const scratchOptions = {
|
1142
|
+
positions: undefined,
|
1143
|
+
ellipsoid: scratchEllipsoid,
|
1144
|
+
vertexFormat: scratchVertexFormat,
|
1145
|
+
width: undefined,
|
1146
|
+
height: undefined,
|
1147
|
+
extrudedHeight: undefined,
|
1148
|
+
cornerType: undefined,
|
1149
|
+
granularity: undefined,
|
1150
|
+
shadowVolume: undefined,
|
1151
|
+
offsetAttribute: undefined,
|
1152
|
+
};
|
1153
|
+
|
1154
|
+
/**
|
1155
|
+
* Retrieves an instance from a packed array.
|
1156
|
+
*
|
1157
|
+
* @param {Number[]} array The packed array.
|
1158
|
+
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
|
1159
|
+
* @param {CorridorGeometry} [result] The object into which to store the result.
|
1160
|
+
* @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.
|
1161
|
+
*/
|
1162
|
+
CorridorGeometry.unpack = function (array, startingIndex, result) {
|
1163
|
+
//>>includeStart('debug', pragmas.debug);
|
1164
|
+
Check.Check.defined("array", array);
|
1165
|
+
//>>includeEnd('debug');
|
1166
|
+
|
1167
|
+
startingIndex = defaultValue.defaultValue(startingIndex, 0);
|
1168
|
+
|
1169
|
+
const length = array[startingIndex++];
|
1170
|
+
const positions = new Array(length);
|
1171
|
+
|
1172
|
+
for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
|
1173
|
+
positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
|
1177
|
+
startingIndex += Matrix3.Ellipsoid.packedLength;
|
1178
|
+
|
1179
|
+
const vertexFormat = VertexFormat.VertexFormat.unpack(
|
1180
|
+
array,
|
1181
|
+
startingIndex,
|
1182
|
+
scratchVertexFormat
|
1183
|
+
);
|
1184
|
+
startingIndex += VertexFormat.VertexFormat.packedLength;
|
1185
|
+
|
1186
|
+
const width = array[startingIndex++];
|
1187
|
+
const height = array[startingIndex++];
|
1188
|
+
const extrudedHeight = array[startingIndex++];
|
1189
|
+
const cornerType = array[startingIndex++];
|
1190
|
+
const granularity = array[startingIndex++];
|
1191
|
+
const shadowVolume = array[startingIndex++] === 1.0;
|
1192
|
+
const offsetAttribute = array[startingIndex];
|
1193
|
+
|
1194
|
+
if (!defaultValue.defined(result)) {
|
1195
|
+
scratchOptions.positions = positions;
|
1196
|
+
scratchOptions.width = width;
|
1197
|
+
scratchOptions.height = height;
|
1198
|
+
scratchOptions.extrudedHeight = extrudedHeight;
|
1199
|
+
scratchOptions.cornerType = cornerType;
|
1200
|
+
scratchOptions.granularity = granularity;
|
1201
|
+
scratchOptions.shadowVolume = shadowVolume;
|
1202
|
+
scratchOptions.offsetAttribute =
|
1203
|
+
offsetAttribute === -1 ? undefined : offsetAttribute;
|
1204
|
+
|
1205
|
+
return new CorridorGeometry(scratchOptions);
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
result._positions = positions;
|
1209
|
+
result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
|
1210
|
+
result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
|
1211
|
+
result._width = width;
|
1212
|
+
result._height = height;
|
1213
|
+
result._extrudedHeight = extrudedHeight;
|
1214
|
+
result._cornerType = cornerType;
|
1215
|
+
result._granularity = granularity;
|
1216
|
+
result._shadowVolume = shadowVolume;
|
1217
|
+
result._offsetAttribute =
|
1218
|
+
offsetAttribute === -1 ? undefined : offsetAttribute;
|
1219
|
+
|
1220
|
+
return result;
|
1221
|
+
};
|
1222
|
+
|
1223
|
+
/**
|
1224
|
+
* Computes the bounding rectangle given the provided options
|
1225
|
+
*
|
1226
|
+
* @param {Object} options Object with the following properties:
|
1227
|
+
* @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
|
1228
|
+
* @param {Number} options.width The distance between the edges of the corridor in meters.
|
1229
|
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
1230
|
+
* @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
|
1231
|
+
* @param {Rectangle} [result] An object in which to store the result.
|
1232
|
+
*
|
1233
|
+
* @returns {Rectangle} The result rectangle.
|
1234
|
+
*/
|
1235
|
+
CorridorGeometry.computeRectangle = function (options, result) {
|
1236
|
+
options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
|
1237
|
+
const positions = options.positions;
|
1238
|
+
const width = options.width;
|
1239
|
+
|
1240
|
+
//>>includeStart('debug', pragmas.debug);
|
1241
|
+
Check.Check.defined("options.positions", positions);
|
1242
|
+
Check.Check.defined("options.width", width);
|
1243
|
+
//>>includeEnd('debug');
|
1244
|
+
|
1245
|
+
const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
|
1246
|
+
const cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
|
1247
|
+
|
1248
|
+
return computeRectangle(positions, ellipsoid, width, cornerType, result);
|
1249
|
+
};
|
1250
|
+
|
1251
|
+
/**
|
1252
|
+
* Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
|
1253
|
+
*
|
1254
|
+
* @param {CorridorGeometry} corridorGeometry A description of the corridor.
|
1255
|
+
* @returns {Geometry|undefined} The computed vertices and indices.
|
1256
|
+
*/
|
1257
|
+
CorridorGeometry.createGeometry = function (corridorGeometry) {
|
1258
|
+
let positions = corridorGeometry._positions;
|
1259
|
+
const width = corridorGeometry._width;
|
1260
|
+
const ellipsoid = corridorGeometry._ellipsoid;
|
1261
|
+
|
1262
|
+
positions = scaleToSurface(positions, ellipsoid);
|
1263
|
+
const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
|
1264
|
+
positions,
|
1265
|
+
Matrix3.Cartesian3.equalsEpsilon
|
1266
|
+
);
|
1267
|
+
|
1268
|
+
if (cleanPositions.length < 2 || width <= 0) {
|
1269
|
+
return;
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
const height = corridorGeometry._height;
|
1273
|
+
const extrudedHeight = corridorGeometry._extrudedHeight;
|
1274
|
+
const extrude = !Math$1.CesiumMath.equalsEpsilon(
|
1275
|
+
height,
|
1276
|
+
extrudedHeight,
|
1277
|
+
0,
|
1278
|
+
Math$1.CesiumMath.EPSILON2
|
1279
|
+
);
|
1280
|
+
|
1281
|
+
const vertexFormat = corridorGeometry._vertexFormat;
|
1282
|
+
const params = {
|
1283
|
+
ellipsoid: ellipsoid,
|
1284
|
+
positions: cleanPositions,
|
1285
|
+
width: width,
|
1286
|
+
cornerType: corridorGeometry._cornerType,
|
1287
|
+
granularity: corridorGeometry._granularity,
|
1288
|
+
saveAttributes: true,
|
1289
|
+
};
|
1290
|
+
let attr;
|
1291
|
+
if (extrude) {
|
1292
|
+
params.height = height;
|
1293
|
+
params.extrudedHeight = extrudedHeight;
|
1294
|
+
params.shadowVolume = corridorGeometry._shadowVolume;
|
1295
|
+
params.offsetAttribute = corridorGeometry._offsetAttribute;
|
1296
|
+
attr = computePositionsExtruded(params, vertexFormat);
|
1297
|
+
} else {
|
1298
|
+
const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
|
1299
|
+
attr = combine(computedPositions, vertexFormat, ellipsoid);
|
1300
|
+
attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
1301
|
+
attr.attributes.position.values,
|
1302
|
+
height,
|
1303
|
+
ellipsoid
|
1304
|
+
);
|
1305
|
+
|
1306
|
+
if (defaultValue.defined(corridorGeometry._offsetAttribute)) {
|
1307
|
+
const applyOffsetValue =
|
1308
|
+
corridorGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
|
1309
|
+
? 0
|
1310
|
+
: 1;
|
1311
|
+
const length = attr.attributes.position.values.length;
|
1312
|
+
const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
|
1313
|
+
attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
|
1314
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
|
1315
|
+
componentsPerAttribute: 1,
|
1316
|
+
values: applyOffset,
|
1317
|
+
});
|
1318
|
+
}
|
1319
|
+
}
|
1320
|
+
const attributes = attr.attributes;
|
1321
|
+
const boundingSphere = Transforms.BoundingSphere.fromVertices(
|
1322
|
+
attributes.position.values,
|
1323
|
+
undefined,
|
1324
|
+
3
|
1325
|
+
);
|
1326
|
+
if (!vertexFormat.position) {
|
1327
|
+
attr.attributes.position.values = undefined;
|
1328
|
+
}
|
1329
|
+
|
1330
|
+
return new GeometryAttribute.Geometry({
|
1331
|
+
attributes: attributes,
|
1332
|
+
indices: attr.indices,
|
1333
|
+
primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
|
1334
|
+
boundingSphere: boundingSphere,
|
1335
|
+
offsetAttribute: corridorGeometry._offsetAttribute,
|
1336
|
+
});
|
1337
|
+
};
|
1338
|
+
|
1339
|
+
/**
|
1340
|
+
* @private
|
1341
|
+
*/
|
1342
|
+
CorridorGeometry.createShadowVolume = function (
|
1343
|
+
corridorGeometry,
|
1344
|
+
minHeightFunc,
|
1345
|
+
maxHeightFunc
|
1346
|
+
) {
|
1347
|
+
const granularity = corridorGeometry._granularity;
|
1348
|
+
const ellipsoid = corridorGeometry._ellipsoid;
|
1349
|
+
|
1350
|
+
const minHeight = minHeightFunc(granularity, ellipsoid);
|
1351
|
+
const maxHeight = maxHeightFunc(granularity, ellipsoid);
|
1352
|
+
|
1353
|
+
return new CorridorGeometry({
|
1354
|
+
positions: corridorGeometry._positions,
|
1355
|
+
width: corridorGeometry._width,
|
1356
|
+
cornerType: corridorGeometry._cornerType,
|
1357
|
+
ellipsoid: ellipsoid,
|
1358
|
+
granularity: granularity,
|
1359
|
+
extrudedHeight: minHeight,
|
1360
|
+
height: maxHeight,
|
1361
|
+
vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
|
1362
|
+
shadowVolume: true,
|
1363
|
+
});
|
1364
|
+
};
|
1365
|
+
|
1366
|
+
Object.defineProperties(CorridorGeometry.prototype, {
|
1367
|
+
/**
|
1368
|
+
* @private
|
1369
|
+
*/
|
1370
|
+
rectangle: {
|
1371
|
+
get: function () {
|
1372
|
+
if (!defaultValue.defined(this._rectangle)) {
|
1373
|
+
this._rectangle = computeRectangle(
|
1374
|
+
this._positions,
|
1375
|
+
this._ellipsoid,
|
1376
|
+
this._width,
|
1377
|
+
this._cornerType
|
1378
|
+
);
|
1379
|
+
}
|
1380
|
+
return this._rectangle;
|
1381
|
+
},
|
1382
|
+
},
|
1383
|
+
/**
|
1384
|
+
* For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
|
1385
|
+
*
|
1386
|
+
* Corridors don't support stRotation,
|
1387
|
+
* so just return the corners of the original system.
|
1388
|
+
* @private
|
1389
|
+
*/
|
1390
|
+
textureCoordinateRotationPoints: {
|
1391
|
+
get: function () {
|
1392
|
+
return [0, 0, 0, 1, 1, 0];
|
1393
|
+
},
|
1394
|
+
},
|
1395
|
+
});
|
1396
|
+
|
1397
|
+
function createCorridorGeometry(corridorGeometry, offset) {
|
1398
|
+
if (defaultValue.defined(offset)) {
|
1399
|
+
corridorGeometry = CorridorGeometry.unpack(corridorGeometry, offset);
|
1400
|
+
}
|
1401
|
+
corridorGeometry._ellipsoid = Matrix3.Ellipsoid.clone(corridorGeometry._ellipsoid);
|
1402
|
+
return CorridorGeometry.createGeometry(corridorGeometry);
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
return createCorridorGeometry;
|
1406
|
+
|
1407
|
+
}));
|