@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,1420 @@
|
|
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(["./defaultValue-0c475b81","./Matrix2-eefef8eb","./ArcType-c9b2b290","./BoundingRectangle-201b1a81","./Transforms-d2e5867e","./ComponentDatatype-0200bf8c","./EllipsoidGeodesic-8bfefbff","./EllipsoidTangentPlane-c080fd1b","./GeometryAttribute-8458a8fd","./GeometryInstance-ee3aa3ba","./GeometryOffsetAttribute-08ae0c50","./GeometryPipeline-33ca229c","./IndexDatatype-e713bfd2","./PolygonGeometryLibrary-b61295f3","./PolygonPipeline-eb527514","./VertexFormat-5ec0d9ff","./RuntimeError-5baf5c66","./_commonjsHelpers-bc29abbc","./combine-7533016d","./WebGLConstants-5b50ced1","./AxisAlignedBoundingBox-d0c22774","./IntersectionTests-eb4db8e0","./Plane-b0299683","./AttributeCompression-7b0f288d","./EncodedCartesian3-ea0e408f","./arrayRemoveDuplicates-f13aceb1","./EllipsoidRhumbLine-03528f73","./GeometryAttributes-ac0f8485"],(function(e,t,o,r,i,n,a,s,l,c,u,p,d,y,m,g,h,f,b,_,P,C,x,w,T,I,A,v){"use strict";const E=new t.Cartographic,G=new t.Cartographic;function O(e,t,o,r){const i=r.cartesianToCartographic(e,E).height,n=r.cartesianToCartographic(t,G);n.height=i,r.cartographicToCartesian(n,t);const a=r.cartesianToCartographic(o,G);a.height=i-100,r.cartographicToCartesian(a,o)}const L=new r.BoundingRectangle,V=new t.Cartesian3,H=new t.Cartesian3,D=new t.Cartesian3,N=new t.Cartesian3,F=new t.Cartesian3,R=new t.Cartesian3;let M=new t.Cartesian3,S=new t.Cartesian3,B=new t.Cartesian3;const k=new t.Cartesian2,z=new t.Cartesian2,W=new t.Cartesian3,Y=new i.Quaternion,U=new t.Matrix3,j=new t.Matrix3;function Q(o){const r=o.vertexFormat,a=o.geometry,s=o.shadowVolume,c=a.attributes.position.values,p=e.defined(a.attributes.st)?a.attributes.st.values:void 0;let d=c.length;const y=o.wall,m=o.top||y,g=o.bottom||y;if(r.st||r.normal||r.tangent||r.bitangent||s){const u=o.boundingRectangle,h=o.tangentPlane,f=o.ellipsoid,b=o.stRotation,_=o.perPositionHeight,P=k;P.x=u.x,P.y=u.y;const C=r.st?new Float32Array(d/3*2):void 0;let x;r.normal&&(x=_&&m&&!y?a.attributes.normal.values:new Float32Array(d));const w=r.tangent?new Float32Array(d):void 0,T=r.bitangent?new Float32Array(d):void 0,I=s?new Float32Array(d):void 0;let A=0,v=0,E=H,G=D,L=N,Q=!0,q=U,K=j;if(0!==b){let e=i.Quaternion.fromAxisAngle(h._plane.normal,b,Y);q=t.Matrix3.fromQuaternion(e,q),e=i.Quaternion.fromAxisAngle(h._plane.normal,-b,Y),K=t.Matrix3.fromQuaternion(e,K)}else q=t.Matrix3.clone(t.Matrix3.IDENTITY,q),K=t.Matrix3.clone(t.Matrix3.IDENTITY,K);let Z=0,J=0;m&&g&&(Z=d/2,J=d/3,d/=2);for(let i=0;i<d;i+=3){const a=t.Cartesian3.fromArray(c,i,W);if(r.st&&!e.defined(p)){let e=t.Matrix3.multiplyByVector(q,a,V);e=f.scaleToGeodeticSurface(e,e);const o=h.projectPointOntoPlane(e,z);t.Cartesian2.subtract(o,P,o);const r=n.CesiumMath.clamp(o.x/u.width,0,1),i=n.CesiumMath.clamp(o.y/u.height,0,1);g&&(C[A+J]=r,C[A+1+J]=i),m&&(C[A]=r,C[A+1]=i),A+=2}if(r.normal||r.tangent||r.bitangent||s){const e=v+1,l=v+2;if(y){if(i+3<d){const e=t.Cartesian3.fromArray(c,i+3,F);if(Q){const o=t.Cartesian3.fromArray(c,i+d,R);_&&O(a,e,o,f),t.Cartesian3.subtract(e,a,e),t.Cartesian3.subtract(o,a,o),E=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,E),E),Q=!1}t.Cartesian3.equalsEpsilon(e,a,n.CesiumMath.EPSILON10)&&(Q=!0)}(r.tangent||r.bitangent)&&(L=f.geodeticSurfaceNormal(a,L),r.tangent&&(G=t.Cartesian3.normalize(t.Cartesian3.cross(L,E,G),G)))}else E=f.geodeticSurfaceNormal(a,E),(r.tangent||r.bitangent)&&(_&&(M=t.Cartesian3.fromArray(x,v,M),S=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,S),S=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,S,S),S),r.bitangent&&(B=t.Cartesian3.normalize(t.Cartesian3.cross(M,S,B),B))),G=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,E,G),G=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,G,G),G),r.bitangent&&(L=t.Cartesian3.normalize(t.Cartesian3.cross(E,G,L),L)));r.normal&&(o.wall?(x[v+Z]=E.x,x[e+Z]=E.y,x[l+Z]=E.z):g&&(x[v+Z]=-E.x,x[e+Z]=-E.y,x[l+Z]=-E.z),(m&&!_||y)&&(x[v]=E.x,x[e]=E.y,x[l]=E.z)),s&&(y&&(E=f.geodeticSurfaceNormal(a,E)),I[v+Z]=-E.x,I[e+Z]=-E.y,I[l+Z]=-E.z),r.tangent&&(o.wall?(w[v+Z]=G.x,w[e+Z]=G.y,w[l+Z]=G.z):g&&(w[v+Z]=-G.x,w[e+Z]=-G.y,w[l+Z]=-G.z),m&&(_?(w[v]=S.x,w[e]=S.y,w[l]=S.z):(w[v]=G.x,w[e]=G.y,w[l]=G.z))),r.bitangent&&(g&&(T[v+Z]=L.x,T[e+Z]=L.y,T[l+Z]=L.z),m&&(_?(T[v]=B.x,T[e]=B.y,T[l]=B.z):(T[v]=L.x,T[e]=L.y,T[l]=L.z))),v+=3}}r.st&&!e.defined(p)&&(a.attributes.st=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:C})),r.normal&&(a.attributes.normal=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x})),r.tangent&&(a.attributes.tangent=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),r.bitangent&&(a.attributes.bitangent=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),s&&(a.attributes.extrudeDirection=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:I}))}if(o.extrude&&e.defined(o.offsetAttribute)){const e=c.length/3;let t=new Uint8Array(e);if(o.offsetAttribute===u.GeometryOffsetAttribute.TOP)m&&g||y?t=t.fill(1,0,e/2):m&&(t=t.fill(1));else{const e=o.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}a.attributes.applyOffset=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return a}const q=new t.Cartographic,K=new t.Cartographic,Z={westOverIDL:0,eastOverIDL:0};let J=new a.EllipsoidGeodesic;function X(r,i,s,l,c){if(c=e.defaultValue(c,new t.Rectangle),!e.defined(r)||r.length<3)return c.west=0,c.north=0,c.south=0,c.east=0,c;if(s===o.ArcType.RHUMB)return t.Rectangle.fromCartesianArray(r,i,c);J.ellipsoid.equals(i)||(J=new a.EllipsoidGeodesic(void 0,void 0,i)),c.west=Number.POSITIVE_INFINITY,c.east=Number.NEGATIVE_INFINITY,c.south=Number.POSITIVE_INFINITY,c.north=Number.NEGATIVE_INFINITY,Z.westOverIDL=Number.POSITIVE_INFINITY,Z.eastOverIDL=Number.NEGATIVE_INFINITY;const u=1/n.CesiumMath.chordLength(l,i.maximumRadius),p=r.length;let d,y=i.cartesianToCartographic(r[0],K),m=q;for(let e=1;e<p;e++)d=m,m=y,y=i.cartesianToCartographic(r[e],d),J.setEndPoints(m,y),ee(J,u,c,Z);return d=m,m=y,y=i.cartesianToCartographic(r[0],d),J.setEndPoints(m,y),ee(J,u,c,Z),c.east-c.west>Z.eastOverIDL-Z.westOverIDL&&(c.west=Z.westOverIDL,c.east=Z.eastOverIDL,c.east>n.CesiumMath.PI&&(c.east=c.east-n.CesiumMath.TWO_PI),c.west>n.CesiumMath.PI&&(c.west=c.west-n.CesiumMath.TWO_PI)),c}const $=new t.Cartographic;function ee(e,t,o,r){const i=e.surfaceDistance,a=Math.ceil(i*t),s=a>0?i/(a-1):Number.POSITIVE_INFINITY;let l=0;for(let t=0;t<a;t++){const t=e.interpolateUsingSurfaceDistance(l,$);l+=s;const i=t.longitude,a=t.latitude;o.west=Math.min(o.west,i),o.east=Math.max(o.east,i),o.south=Math.min(o.south,a),o.north=Math.max(o.north,a);const c=i>=0?i:i+n.CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,c),r.eastOverIDL=Math.max(r.eastOverIDL,c)}}const te=[];function oe(t,o,r,i,n,a,l,u,p,g){const h={walls:[]};let f;if(l||u){const n=y.PolygonGeometryLibrary.createGeometryFromPositions(t,o,r,i,a,p,g),s=n.attributes.position.values,m=n.indices;let b,_;if(l&&u){const t=s.concat(s);b=t.length/3,_=d.IndexDatatype.createTypedArray(b,2*m.length),_.set(m);const o=m.length,i=b/2;for(f=0;f<o;f+=3){const e=_[f]+i,t=_[f+1]+i,r=_[f+2]+i;_[f+o]=r,_[f+1+o]=t,_[f+2+o]=e}if(n.attributes.position.values=t,a&&p.normal){const e=n.attributes.normal.values;n.attributes.normal.values=new Float32Array(t.length),n.attributes.normal.values.set(e)}if(p.st&&e.defined(r)){const e=n.attributes.st.values;n.attributes.st.values=new Float32Array(2*b),n.attributes.st.values=e.concat(e)}n.indices=_}else if(u){for(b=s.length/3,_=d.IndexDatatype.createTypedArray(b,m.length),f=0;f<m.length;f+=3)_[f]=m[f+2],_[f+1]=m[f+1],_[f+2]=m[f];n.indices=_}h.topAndBottom=new c.GeometryInstance({geometry:n})}let b=n.outerRing,_=s.EllipsoidTangentPlane.fromPoints(b,t),P=_.projectPointsOntoPlane(b,te),C=m.PolygonPipeline.computeWindingOrder2D(P);C===m.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());let x=y.PolygonGeometryLibrary.computeWallGeometry(b,r,t,i,a,g);h.walls.push(new c.GeometryInstance({geometry:x}));const w=n.holes;for(f=0;f<w.length;f++){let e=w[f];_=s.EllipsoidTangentPlane.fromPoints(e,t),P=_.projectPointsOntoPlane(e,te),C=m.PolygonPipeline.computeWindingOrder2D(P),C===m.WindingOrder.COUNTER_CLOCKWISE&&(e=e.slice().reverse()),x=y.PolygonGeometryLibrary.computeWallGeometry(e,r,t,i,a,g),h.walls.push(new c.GeometryInstance({geometry:x}))}return h}function re(r){const i=r.polygonHierarchy,a=e.defaultValue(r.vertexFormat,g.VertexFormat.DEFAULT),s=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(r.granularity,n.CesiumMath.RADIANS_PER_DEGREE),c=e.defaultValue(r.stRotation,0),u=r.textureCoordinates,p=e.defaultValue(r.perPositionHeight,!1),d=p&&e.defined(r.extrudedHeight);let m=e.defaultValue(r.height,0),h=e.defaultValue(r.extrudedHeight,m);if(!d){const e=Math.max(m,h);h=Math.min(m,h),m=e}this._vertexFormat=g.VertexFormat.clone(a),this._ellipsoid=t.Ellipsoid.clone(s),this._granularity=l,this._stRotation=c,this._height=m,this._extrudedHeight=h,this._closeTop=e.defaultValue(r.closeTop,!0),this._closeBottom=e.defaultValue(r.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=p,this._perPositionHeightExtrude=d,this._shadowVolume=e.defaultValue(r.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=r.offsetAttribute,this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=u,this.packedLength=y.PolygonGeometryLibrary.computeHierarchyPackedLength(i,t.Cartesian3)+t.Ellipsoid.packedLength+g.VertexFormat.packedLength+(u?y.PolygonGeometryLibrary.computeHierarchyPackedLength(u,t.Cartesian2):1)+12}re.fromPositions=function(t){return new re({polygonHierarchy:{positions:(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates})},re.pack=function(o,r,i){return i=e.defaultValue(i,0),i=y.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,r,i,t.Cartesian3),t.Ellipsoid.pack(o._ellipsoid,r,i),i+=t.Ellipsoid.packedLength,g.VertexFormat.pack(o._vertexFormat,r,i),i+=g.VertexFormat.packedLength,r[i++]=o._height,r[i++]=o._extrudedHeight,r[i++]=o._granularity,r[i++]=o._stRotation,r[i++]=o._perPositionHeightExtrude?1:0,r[i++]=o._perPositionHeight?1:0,r[i++]=o._closeTop?1:0,r[i++]=o._closeBottom?1:0,r[i++]=o._shadowVolume?1:0,r[i++]=e.defaultValue(o._offsetAttribute,-1),r[i++]=o._arcType,e.defined(o._textureCoordinates)?i=y.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,r,i,t.Cartesian2):r[i++]=-1,r[i++]=o.packedLength,r};const ie=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),ne=new g.VertexFormat,ae={polygonHierarchy:{}};return re.unpack=function(o,r,i){r=e.defaultValue(r,0);const n=y.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian3);r=n.startingIndex,delete n.startingIndex;const a=t.Ellipsoid.unpack(o,r,ie);r+=t.Ellipsoid.packedLength;const s=g.VertexFormat.unpack(o,r,ne);r+=g.VertexFormat.packedLength;const l=o[r++],c=o[r++],u=o[r++],p=o[r++],d=1===o[r++],m=1===o[r++],h=1===o[r++],f=1===o[r++],b=1===o[r++],_=o[r++],P=o[r++],C=-1===o[r]?void 0:y.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian2);e.defined(C)?(r=C.startingIndex,delete C.startingIndex):r++;const x=o[r++];return e.defined(i)||(i=new re(ae)),i._polygonHierarchy=n,i._ellipsoid=t.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=g.VertexFormat.clone(s,i._vertexFormat),i._height=l,i._extrudedHeight=c,i._granularity=u,i._stRotation=p,i._perPositionHeightExtrude=d,i._perPositionHeight=m,i._closeTop=h,i._closeBottom=f,i._shadowVolume=b,i._offsetAttribute=-1===_?void 0:_,i._arcType=P,i._textureCoordinates=C,i.packedLength=x,i},re.computeRectangle=function(r,i){const a=e.defaultValue(r.granularity,n.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(r.arcType,o.ArcType.GEODESIC),l=r.polygonHierarchy,c=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84);return X(l.positions,c,s,a,i)},re.createGeometry=function(t){const o=t._vertexFormat,r=t._ellipsoid,a=t._granularity,g=t._stRotation,h=t._polygonHierarchy,f=t._perPositionHeight,b=t._closeTop,_=t._closeBottom,P=t._arcType,C=t._textureCoordinates,x=e.defined(C);let w=h.positions;if(w.length<3)return;const T=s.EllipsoidTangentPlane.fromPoints(w,r),I=y.PolygonGeometryLibrary.polygonsFromHierarchy(h,x,T.projectPointsOntoPlane.bind(T),!f,r),A=I.hierarchy,v=I.polygons,E=x?y.PolygonGeometryLibrary.polygonsFromHierarchy(C,!0,(function(e){return e}),!1).polygons:void 0;if(0===A.length)return;w=A[0].outerRing;const G=y.PolygonGeometryLibrary.computeBoundingRectangle(T.plane.normal,T.projectPointOntoPlane.bind(T),w,g,L),O=[],V=t._height,H=t._extrudedHeight,D={perPositionHeight:f,vertexFormat:o,geometry:void 0,tangentPlane:T,boundingRectangle:G,ellipsoid:r,stRotation:g,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:P};let N;if(t._perPositionHeightExtrude||!n.CesiumMath.equalsEpsilon(V,H,0,n.CesiumMath.EPSILON2))for(D.extrude=!0,D.top=b,D.bottom=_,D.shadowVolume=t._shadowVolume,D.offsetAttribute=t._offsetAttribute,N=0;N<v.length;N++){const e=oe(r,v[N],x?E[N]:void 0,a,A[N],f,b,_,o,P);let t;b&&_?(t=e.topAndBottom,D.geometry=y.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,H,r,f)):b?(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,V,r,!f),D.geometry=t.geometry):_&&(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,H,r,!0),D.geometry=t.geometry),(b||_)&&(D.wall=!1,t.geometry=Q(D),O.push(t));const i=e.walls;D.wall=!0;for(let e=0;e<i.length;e++){const t=i[e];D.geometry=y.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,H,r,f),t.geometry=Q(D),O.push(t)}}else for(N=0;N<v.length;N++){const i=new c.GeometryInstance({geometry:y.PolygonGeometryLibrary.createGeometryFromPositions(r,v[N],x?E[N]:void 0,a,f,o,P)});if(i.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(i.geometry.attributes.position.values,V,r,!f),D.geometry=i.geometry,i.geometry=Q(D),e.defined(t._offsetAttribute)){const e=i.geometry.attributes.position.values.length,o=t._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(o);i.geometry.attributes.applyOffset=new l.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}O.push(i)}const F=p.GeometryPipeline.combineInstances(O)[0];F.attributes.position.values=new Float64Array(F.attributes.position.values),F.indices=d.IndexDatatype.createTypedArray(F.attributes.position.values.length/3,F.indices);const R=F.attributes,M=i.BoundingSphere.fromVertices(R.position.values);return o.position||delete R.position,new l.Geometry({attributes:R,indices:F.indices,primitiveType:F.primitiveType,boundingSphere:M,offsetAttribute:t._offsetAttribute})},re.createShadowVolume=function(e,t,o){const r=e._granularity,i=e._ellipsoid,n=t(r,i),a=o(r,i);return new re({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:g.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(re.prototype,{rectangle:{get:function(){if(!e.defined(this._rectangle)){const e=this._polygonHierarchy.positions;this._rectangle=X(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const o=e._ellipsoid,r=e._polygonHierarchy.positions,i=e.rectangle;return l.Geometry._textureCoordinateRotationPoints(r,t,o,i)}(this)),this._textureCoordinateRotationPoints}}}),function(o,r){return e.defined(r)&&(o=re.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),re.createGeometry(o)}}));
|
1
|
+
define(['./defaultValue-0a909f67', './Matrix3-315394f6', './ArcType-ce2e50ab', './BoundingRectangle-be5924f4', './Transforms-40229881', './Matrix2-13178034', './Check-666ab1a0', './ComponentDatatype-f7b11d02', './EllipsoidGeodesic-98c62a56', './EllipsoidTangentPlane-214683dc', './GeometryAttribute-7d6f1732', './GeometryInstance-451dc1cd', './GeometryOffsetAttribute-04332ce7', './GeometryPipeline-ce4339ed', './IndexDatatype-a55ceaa1', './Math-2dbd6b93', './PolygonGeometryLibrary-a8680d96', './PolygonPipeline-844aab0a', './VertexFormat-6b480673', './combine-ca22a614', './RuntimeError-06c93819', './WebGLConstants-a8cc3e8c', './AxisAlignedBoundingBox-ff186ccc', './IntersectionTests-f6e6bd8a', './Plane-900aa728', './AttributeCompression-b646d393', './EncodedCartesian3-81f70735', './arrayRemoveDuplicates-c2038105', './EllipsoidRhumbLine-19756602', './GeometryAttributes-f06a2792'], (function (defaultValue, Matrix3, ArcType, BoundingRectangle, Transforms, Matrix2, Check, ComponentDatatype, EllipsoidGeodesic, EllipsoidTangentPlane, GeometryAttribute, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonGeometryLibrary, PolygonPipeline, VertexFormat, combine, RuntimeError, WebGLConstants, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, arrayRemoveDuplicates, EllipsoidRhumbLine, GeometryAttributes) { 'use strict';
|
2
|
+
|
3
|
+
const scratchCarto1 = new Matrix3.Cartographic();
|
4
|
+
const scratchCarto2 = new Matrix3.Cartographic();
|
5
|
+
function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
|
6
|
+
const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
|
7
|
+
const height = carto1.height;
|
8
|
+
const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
|
9
|
+
p1Carto.height = height;
|
10
|
+
ellipsoid.cartographicToCartesian(p1Carto, p1);
|
11
|
+
|
12
|
+
const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
|
13
|
+
p2Carto.height = height - 100;
|
14
|
+
ellipsoid.cartographicToCartesian(p2Carto, p2);
|
15
|
+
}
|
16
|
+
|
17
|
+
const scratchBoundingRectangle = new BoundingRectangle.BoundingRectangle();
|
18
|
+
const scratchPosition = new Matrix3.Cartesian3();
|
19
|
+
const scratchNormal = new Matrix3.Cartesian3();
|
20
|
+
const scratchTangent = new Matrix3.Cartesian3();
|
21
|
+
const scratchBitangent = new Matrix3.Cartesian3();
|
22
|
+
const p1Scratch = new Matrix3.Cartesian3();
|
23
|
+
const p2Scratch = new Matrix3.Cartesian3();
|
24
|
+
let scratchPerPosNormal = new Matrix3.Cartesian3();
|
25
|
+
let scratchPerPosTangent = new Matrix3.Cartesian3();
|
26
|
+
let scratchPerPosBitangent = new Matrix3.Cartesian3();
|
27
|
+
|
28
|
+
const appendTextureCoordinatesOrigin = new Matrix2.Cartesian2();
|
29
|
+
const appendTextureCoordinatesCartesian2 = new Matrix2.Cartesian2();
|
30
|
+
const appendTextureCoordinatesCartesian3 = new Matrix3.Cartesian3();
|
31
|
+
const appendTextureCoordinatesQuaternion = new Transforms.Quaternion();
|
32
|
+
const appendTextureCoordinatesMatrix3 = new Matrix3.Matrix3();
|
33
|
+
const tangentMatrixScratch = new Matrix3.Matrix3();
|
34
|
+
|
35
|
+
function computeAttributes(options) {
|
36
|
+
const vertexFormat = options.vertexFormat;
|
37
|
+
const geometry = options.geometry;
|
38
|
+
const shadowVolume = options.shadowVolume;
|
39
|
+
const flatPositions = geometry.attributes.position.values;
|
40
|
+
const flatTexcoords = defaultValue.defined(geometry.attributes.st)
|
41
|
+
? geometry.attributes.st.values
|
42
|
+
: undefined;
|
43
|
+
|
44
|
+
let length = flatPositions.length;
|
45
|
+
const wall = options.wall;
|
46
|
+
const top = options.top || wall;
|
47
|
+
const bottom = options.bottom || wall;
|
48
|
+
if (
|
49
|
+
vertexFormat.st ||
|
50
|
+
vertexFormat.normal ||
|
51
|
+
vertexFormat.tangent ||
|
52
|
+
vertexFormat.bitangent ||
|
53
|
+
shadowVolume
|
54
|
+
) {
|
55
|
+
// PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.
|
56
|
+
// PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.
|
57
|
+
const boundingRectangle = options.boundingRectangle;
|
58
|
+
const tangentPlane = options.tangentPlane;
|
59
|
+
const ellipsoid = options.ellipsoid;
|
60
|
+
const stRotation = options.stRotation;
|
61
|
+
const perPositionHeight = options.perPositionHeight;
|
62
|
+
|
63
|
+
const origin = appendTextureCoordinatesOrigin;
|
64
|
+
origin.x = boundingRectangle.x;
|
65
|
+
origin.y = boundingRectangle.y;
|
66
|
+
|
67
|
+
const textureCoordinates = vertexFormat.st
|
68
|
+
? new Float32Array(2 * (length / 3))
|
69
|
+
: undefined;
|
70
|
+
let normals;
|
71
|
+
if (vertexFormat.normal) {
|
72
|
+
if (perPositionHeight && top && !wall) {
|
73
|
+
normals = geometry.attributes.normal.values;
|
74
|
+
} else {
|
75
|
+
normals = new Float32Array(length);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
const tangents = vertexFormat.tangent
|
79
|
+
? new Float32Array(length)
|
80
|
+
: undefined;
|
81
|
+
const bitangents = vertexFormat.bitangent
|
82
|
+
? new Float32Array(length)
|
83
|
+
: undefined;
|
84
|
+
const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;
|
85
|
+
|
86
|
+
let textureCoordIndex = 0;
|
87
|
+
let attrIndex = 0;
|
88
|
+
|
89
|
+
let normal = scratchNormal;
|
90
|
+
let tangent = scratchTangent;
|
91
|
+
let bitangent = scratchBitangent;
|
92
|
+
let recomputeNormal = true;
|
93
|
+
|
94
|
+
let textureMatrix = appendTextureCoordinatesMatrix3;
|
95
|
+
let tangentRotationMatrix = tangentMatrixScratch;
|
96
|
+
if (stRotation !== 0.0) {
|
97
|
+
let rotation = Transforms.Quaternion.fromAxisAngle(
|
98
|
+
tangentPlane._plane.normal,
|
99
|
+
stRotation,
|
100
|
+
appendTextureCoordinatesQuaternion
|
101
|
+
);
|
102
|
+
textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrix);
|
103
|
+
|
104
|
+
rotation = Transforms.Quaternion.fromAxisAngle(
|
105
|
+
tangentPlane._plane.normal,
|
106
|
+
-stRotation,
|
107
|
+
appendTextureCoordinatesQuaternion
|
108
|
+
);
|
109
|
+
tangentRotationMatrix = Matrix3.Matrix3.fromQuaternion(
|
110
|
+
rotation,
|
111
|
+
tangentRotationMatrix
|
112
|
+
);
|
113
|
+
} else {
|
114
|
+
textureMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, textureMatrix);
|
115
|
+
tangentRotationMatrix = Matrix3.Matrix3.clone(
|
116
|
+
Matrix3.Matrix3.IDENTITY,
|
117
|
+
tangentRotationMatrix
|
118
|
+
);
|
119
|
+
}
|
120
|
+
|
121
|
+
let bottomOffset = 0;
|
122
|
+
let bottomOffset2 = 0;
|
123
|
+
|
124
|
+
if (top && bottom) {
|
125
|
+
bottomOffset = length / 2;
|
126
|
+
bottomOffset2 = length / 3;
|
127
|
+
|
128
|
+
length /= 2;
|
129
|
+
}
|
130
|
+
|
131
|
+
for (let i = 0; i < length; i += 3) {
|
132
|
+
const position = Matrix3.Cartesian3.fromArray(
|
133
|
+
flatPositions,
|
134
|
+
i,
|
135
|
+
appendTextureCoordinatesCartesian3
|
136
|
+
);
|
137
|
+
|
138
|
+
if (vertexFormat.st) {
|
139
|
+
if (!defaultValue.defined(flatTexcoords)) {
|
140
|
+
let p = Matrix3.Matrix3.multiplyByVector(
|
141
|
+
textureMatrix,
|
142
|
+
position,
|
143
|
+
scratchPosition
|
144
|
+
);
|
145
|
+
p = ellipsoid.scaleToGeodeticSurface(p, p);
|
146
|
+
const st = tangentPlane.projectPointOntoPlane(
|
147
|
+
p,
|
148
|
+
appendTextureCoordinatesCartesian2
|
149
|
+
);
|
150
|
+
Matrix2.Cartesian2.subtract(st, origin, st);
|
151
|
+
|
152
|
+
const stx = Math$1.CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
|
153
|
+
const sty = Math$1.CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);
|
154
|
+
if (bottom) {
|
155
|
+
textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
|
156
|
+
textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
|
157
|
+
}
|
158
|
+
if (top) {
|
159
|
+
textureCoordinates[textureCoordIndex] = stx;
|
160
|
+
textureCoordinates[textureCoordIndex + 1] = sty;
|
161
|
+
}
|
162
|
+
|
163
|
+
textureCoordIndex += 2;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
if (
|
168
|
+
vertexFormat.normal ||
|
169
|
+
vertexFormat.tangent ||
|
170
|
+
vertexFormat.bitangent ||
|
171
|
+
shadowVolume
|
172
|
+
) {
|
173
|
+
const attrIndex1 = attrIndex + 1;
|
174
|
+
const attrIndex2 = attrIndex + 2;
|
175
|
+
|
176
|
+
if (wall) {
|
177
|
+
if (i + 3 < length) {
|
178
|
+
const p1 = Matrix3.Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);
|
179
|
+
|
180
|
+
if (recomputeNormal) {
|
181
|
+
const p2 = Matrix3.Cartesian3.fromArray(
|
182
|
+
flatPositions,
|
183
|
+
i + length,
|
184
|
+
p2Scratch
|
185
|
+
);
|
186
|
+
if (perPositionHeight) {
|
187
|
+
adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
|
188
|
+
}
|
189
|
+
Matrix3.Cartesian3.subtract(p1, position, p1);
|
190
|
+
Matrix3.Cartesian3.subtract(p2, position, p2);
|
191
|
+
normal = Matrix3.Cartesian3.normalize(
|
192
|
+
Matrix3.Cartesian3.cross(p2, p1, normal),
|
193
|
+
normal
|
194
|
+
);
|
195
|
+
recomputeNormal = false;
|
196
|
+
}
|
197
|
+
|
198
|
+
if (Matrix3.Cartesian3.equalsEpsilon(p1, position, Math$1.CesiumMath.EPSILON10)) {
|
199
|
+
// if we've reached a corner
|
200
|
+
recomputeNormal = true;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
205
|
+
bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
|
206
|
+
if (vertexFormat.tangent) {
|
207
|
+
tangent = Matrix3.Cartesian3.normalize(
|
208
|
+
Matrix3.Cartesian3.cross(bitangent, normal, tangent),
|
209
|
+
tangent
|
210
|
+
);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
} else {
|
214
|
+
normal = ellipsoid.geodeticSurfaceNormal(position, normal);
|
215
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
216
|
+
if (perPositionHeight) {
|
217
|
+
scratchPerPosNormal = Matrix3.Cartesian3.fromArray(
|
218
|
+
normals,
|
219
|
+
attrIndex,
|
220
|
+
scratchPerPosNormal
|
221
|
+
);
|
222
|
+
scratchPerPosTangent = Matrix3.Cartesian3.cross(
|
223
|
+
Matrix3.Cartesian3.UNIT_Z,
|
224
|
+
scratchPerPosNormal,
|
225
|
+
scratchPerPosTangent
|
226
|
+
);
|
227
|
+
scratchPerPosTangent = Matrix3.Cartesian3.normalize(
|
228
|
+
Matrix3.Matrix3.multiplyByVector(
|
229
|
+
tangentRotationMatrix,
|
230
|
+
scratchPerPosTangent,
|
231
|
+
scratchPerPosTangent
|
232
|
+
),
|
233
|
+
scratchPerPosTangent
|
234
|
+
);
|
235
|
+
if (vertexFormat.bitangent) {
|
236
|
+
scratchPerPosBitangent = Matrix3.Cartesian3.normalize(
|
237
|
+
Matrix3.Cartesian3.cross(
|
238
|
+
scratchPerPosNormal,
|
239
|
+
scratchPerPosTangent,
|
240
|
+
scratchPerPosBitangent
|
241
|
+
),
|
242
|
+
scratchPerPosBitangent
|
243
|
+
);
|
244
|
+
}
|
245
|
+
}
|
246
|
+
|
247
|
+
tangent = Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent);
|
248
|
+
tangent = Matrix3.Cartesian3.normalize(
|
249
|
+
Matrix3.Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),
|
250
|
+
tangent
|
251
|
+
);
|
252
|
+
if (vertexFormat.bitangent) {
|
253
|
+
bitangent = Matrix3.Cartesian3.normalize(
|
254
|
+
Matrix3.Cartesian3.cross(normal, tangent, bitangent),
|
255
|
+
bitangent
|
256
|
+
);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
if (vertexFormat.normal) {
|
262
|
+
if (options.wall) {
|
263
|
+
normals[attrIndex + bottomOffset] = normal.x;
|
264
|
+
normals[attrIndex1 + bottomOffset] = normal.y;
|
265
|
+
normals[attrIndex2 + bottomOffset] = normal.z;
|
266
|
+
} else if (bottom) {
|
267
|
+
normals[attrIndex + bottomOffset] = -normal.x;
|
268
|
+
normals[attrIndex1 + bottomOffset] = -normal.y;
|
269
|
+
normals[attrIndex2 + bottomOffset] = -normal.z;
|
270
|
+
}
|
271
|
+
|
272
|
+
if ((top && !perPositionHeight) || wall) {
|
273
|
+
normals[attrIndex] = normal.x;
|
274
|
+
normals[attrIndex1] = normal.y;
|
275
|
+
normals[attrIndex2] = normal.z;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
if (shadowVolume) {
|
280
|
+
if (wall) {
|
281
|
+
normal = ellipsoid.geodeticSurfaceNormal(position, normal);
|
282
|
+
}
|
283
|
+
extrudeNormals[attrIndex + bottomOffset] = -normal.x;
|
284
|
+
extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
|
285
|
+
extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
|
286
|
+
}
|
287
|
+
|
288
|
+
if (vertexFormat.tangent) {
|
289
|
+
if (options.wall) {
|
290
|
+
tangents[attrIndex + bottomOffset] = tangent.x;
|
291
|
+
tangents[attrIndex1 + bottomOffset] = tangent.y;
|
292
|
+
tangents[attrIndex2 + bottomOffset] = tangent.z;
|
293
|
+
} else if (bottom) {
|
294
|
+
tangents[attrIndex + bottomOffset] = -tangent.x;
|
295
|
+
tangents[attrIndex1 + bottomOffset] = -tangent.y;
|
296
|
+
tangents[attrIndex2 + bottomOffset] = -tangent.z;
|
297
|
+
}
|
298
|
+
|
299
|
+
if (top) {
|
300
|
+
if (perPositionHeight) {
|
301
|
+
tangents[attrIndex] = scratchPerPosTangent.x;
|
302
|
+
tangents[attrIndex1] = scratchPerPosTangent.y;
|
303
|
+
tangents[attrIndex2] = scratchPerPosTangent.z;
|
304
|
+
} else {
|
305
|
+
tangents[attrIndex] = tangent.x;
|
306
|
+
tangents[attrIndex1] = tangent.y;
|
307
|
+
tangents[attrIndex2] = tangent.z;
|
308
|
+
}
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
if (vertexFormat.bitangent) {
|
313
|
+
if (bottom) {
|
314
|
+
bitangents[attrIndex + bottomOffset] = bitangent.x;
|
315
|
+
bitangents[attrIndex1 + bottomOffset] = bitangent.y;
|
316
|
+
bitangents[attrIndex2 + bottomOffset] = bitangent.z;
|
317
|
+
}
|
318
|
+
if (top) {
|
319
|
+
if (perPositionHeight) {
|
320
|
+
bitangents[attrIndex] = scratchPerPosBitangent.x;
|
321
|
+
bitangents[attrIndex1] = scratchPerPosBitangent.y;
|
322
|
+
bitangents[attrIndex2] = scratchPerPosBitangent.z;
|
323
|
+
} else {
|
324
|
+
bitangents[attrIndex] = bitangent.x;
|
325
|
+
bitangents[attrIndex1] = bitangent.y;
|
326
|
+
bitangents[attrIndex2] = bitangent.z;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
attrIndex += 3;
|
331
|
+
}
|
332
|
+
}
|
333
|
+
|
334
|
+
if (vertexFormat.st && !defaultValue.defined(flatTexcoords)) {
|
335
|
+
geometry.attributes.st = new GeometryAttribute.GeometryAttribute({
|
336
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
337
|
+
componentsPerAttribute: 2,
|
338
|
+
values: textureCoordinates,
|
339
|
+
});
|
340
|
+
}
|
341
|
+
|
342
|
+
if (vertexFormat.normal) {
|
343
|
+
geometry.attributes.normal = new GeometryAttribute.GeometryAttribute({
|
344
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
345
|
+
componentsPerAttribute: 3,
|
346
|
+
values: normals,
|
347
|
+
});
|
348
|
+
}
|
349
|
+
|
350
|
+
if (vertexFormat.tangent) {
|
351
|
+
geometry.attributes.tangent = new GeometryAttribute.GeometryAttribute({
|
352
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
353
|
+
componentsPerAttribute: 3,
|
354
|
+
values: tangents,
|
355
|
+
});
|
356
|
+
}
|
357
|
+
|
358
|
+
if (vertexFormat.bitangent) {
|
359
|
+
geometry.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
|
360
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
361
|
+
componentsPerAttribute: 3,
|
362
|
+
values: bitangents,
|
363
|
+
});
|
364
|
+
}
|
365
|
+
|
366
|
+
if (shadowVolume) {
|
367
|
+
geometry.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
|
368
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
|
369
|
+
componentsPerAttribute: 3,
|
370
|
+
values: extrudeNormals,
|
371
|
+
});
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
if (options.extrude && defaultValue.defined(options.offsetAttribute)) {
|
376
|
+
const size = flatPositions.length / 3;
|
377
|
+
let offsetAttribute = new Uint8Array(size);
|
378
|
+
|
379
|
+
if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
|
380
|
+
if ((top && bottom) || wall) {
|
381
|
+
offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
|
382
|
+
} else if (top) {
|
383
|
+
offsetAttribute = offsetAttribute.fill(1);
|
384
|
+
}
|
385
|
+
} else {
|
386
|
+
const offsetValue =
|
387
|
+
options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
|
388
|
+
offsetAttribute = offsetAttribute.fill(offsetValue);
|
389
|
+
}
|
390
|
+
|
391
|
+
geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
|
392
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
|
393
|
+
componentsPerAttribute: 1,
|
394
|
+
values: offsetAttribute,
|
395
|
+
});
|
396
|
+
}
|
397
|
+
|
398
|
+
return geometry;
|
399
|
+
}
|
400
|
+
|
401
|
+
const startCartographicScratch = new Matrix3.Cartographic();
|
402
|
+
const endCartographicScratch = new Matrix3.Cartographic();
|
403
|
+
const idlCross = {
|
404
|
+
westOverIDL: 0.0,
|
405
|
+
eastOverIDL: 0.0,
|
406
|
+
};
|
407
|
+
let ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic();
|
408
|
+
function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
|
409
|
+
result = defaultValue.defaultValue(result, new Matrix2.Rectangle());
|
410
|
+
if (!defaultValue.defined(positions) || positions.length < 3) {
|
411
|
+
result.west = 0.0;
|
412
|
+
result.north = 0.0;
|
413
|
+
result.south = 0.0;
|
414
|
+
result.east = 0.0;
|
415
|
+
return result;
|
416
|
+
}
|
417
|
+
|
418
|
+
if (arcType === ArcType.ArcType.RHUMB) {
|
419
|
+
return Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
|
420
|
+
}
|
421
|
+
|
422
|
+
if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
|
423
|
+
ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic(undefined, undefined, ellipsoid);
|
424
|
+
}
|
425
|
+
|
426
|
+
result.west = Number.POSITIVE_INFINITY;
|
427
|
+
result.east = Number.NEGATIVE_INFINITY;
|
428
|
+
result.south = Number.POSITIVE_INFINITY;
|
429
|
+
result.north = Number.NEGATIVE_INFINITY;
|
430
|
+
|
431
|
+
idlCross.westOverIDL = Number.POSITIVE_INFINITY;
|
432
|
+
idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
|
433
|
+
|
434
|
+
const inverseChordLength =
|
435
|
+
1.0 / Math$1.CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
|
436
|
+
const positionsLength = positions.length;
|
437
|
+
let endCartographic = ellipsoid.cartesianToCartographic(
|
438
|
+
positions[0],
|
439
|
+
endCartographicScratch
|
440
|
+
);
|
441
|
+
let startCartographic = startCartographicScratch;
|
442
|
+
let swap;
|
443
|
+
|
444
|
+
for (let i = 1; i < positionsLength; i++) {
|
445
|
+
swap = startCartographic;
|
446
|
+
startCartographic = endCartographic;
|
447
|
+
endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
|
448
|
+
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
449
|
+
interpolateAndGrowRectangle(
|
450
|
+
ellipsoidGeodesic,
|
451
|
+
inverseChordLength,
|
452
|
+
result,
|
453
|
+
idlCross
|
454
|
+
);
|
455
|
+
}
|
456
|
+
|
457
|
+
swap = startCartographic;
|
458
|
+
startCartographic = endCartographic;
|
459
|
+
endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
|
460
|
+
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
461
|
+
interpolateAndGrowRectangle(
|
462
|
+
ellipsoidGeodesic,
|
463
|
+
inverseChordLength,
|
464
|
+
result,
|
465
|
+
idlCross
|
466
|
+
);
|
467
|
+
|
468
|
+
if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
|
469
|
+
result.west = idlCross.westOverIDL;
|
470
|
+
result.east = idlCross.eastOverIDL;
|
471
|
+
|
472
|
+
if (result.east > Math$1.CesiumMath.PI) {
|
473
|
+
result.east = result.east - Math$1.CesiumMath.TWO_PI;
|
474
|
+
}
|
475
|
+
if (result.west > Math$1.CesiumMath.PI) {
|
476
|
+
result.west = result.west - Math$1.CesiumMath.TWO_PI;
|
477
|
+
}
|
478
|
+
}
|
479
|
+
|
480
|
+
return result;
|
481
|
+
}
|
482
|
+
|
483
|
+
const interpolatedCartographicScratch = new Matrix3.Cartographic();
|
484
|
+
function interpolateAndGrowRectangle(
|
485
|
+
ellipsoidGeodesic,
|
486
|
+
inverseChordLength,
|
487
|
+
result,
|
488
|
+
idlCross
|
489
|
+
) {
|
490
|
+
const segmentLength = ellipsoidGeodesic.surfaceDistance;
|
491
|
+
|
492
|
+
const numPoints = Math.ceil(segmentLength * inverseChordLength);
|
493
|
+
const subsegmentDistance =
|
494
|
+
numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
|
495
|
+
let interpolationDistance = 0.0;
|
496
|
+
|
497
|
+
for (let i = 0; i < numPoints; i++) {
|
498
|
+
const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
|
499
|
+
interpolationDistance,
|
500
|
+
interpolatedCartographicScratch
|
501
|
+
);
|
502
|
+
interpolationDistance += subsegmentDistance;
|
503
|
+
const longitude = interpolatedCartographic.longitude;
|
504
|
+
const latitude = interpolatedCartographic.latitude;
|
505
|
+
|
506
|
+
result.west = Math.min(result.west, longitude);
|
507
|
+
result.east = Math.max(result.east, longitude);
|
508
|
+
result.south = Math.min(result.south, latitude);
|
509
|
+
result.north = Math.max(result.north, latitude);
|
510
|
+
|
511
|
+
const lonAdjusted =
|
512
|
+
longitude >= 0 ? longitude : longitude + Math$1.CesiumMath.TWO_PI;
|
513
|
+
idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);
|
514
|
+
idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);
|
515
|
+
}
|
516
|
+
}
|
517
|
+
|
518
|
+
const createGeometryFromPositionsExtrudedPositions = [];
|
519
|
+
|
520
|
+
function createGeometryFromPositionsExtruded(
|
521
|
+
ellipsoid,
|
522
|
+
polygon,
|
523
|
+
textureCoordinates,
|
524
|
+
granularity,
|
525
|
+
hierarchy,
|
526
|
+
perPositionHeight,
|
527
|
+
closeTop,
|
528
|
+
closeBottom,
|
529
|
+
vertexFormat,
|
530
|
+
arcType
|
531
|
+
) {
|
532
|
+
const geos = {
|
533
|
+
walls: [],
|
534
|
+
};
|
535
|
+
let i;
|
536
|
+
|
537
|
+
if (closeTop || closeBottom) {
|
538
|
+
const topGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
|
539
|
+
ellipsoid,
|
540
|
+
polygon,
|
541
|
+
textureCoordinates,
|
542
|
+
granularity,
|
543
|
+
perPositionHeight,
|
544
|
+
vertexFormat,
|
545
|
+
arcType
|
546
|
+
);
|
547
|
+
|
548
|
+
const edgePoints = topGeo.attributes.position.values;
|
549
|
+
const indices = topGeo.indices;
|
550
|
+
let numPositions;
|
551
|
+
let newIndices;
|
552
|
+
|
553
|
+
if (closeTop && closeBottom) {
|
554
|
+
const topBottomPositions = edgePoints.concat(edgePoints);
|
555
|
+
|
556
|
+
numPositions = topBottomPositions.length / 3;
|
557
|
+
|
558
|
+
newIndices = IndexDatatype.IndexDatatype.createTypedArray(
|
559
|
+
numPositions,
|
560
|
+
indices.length * 2
|
561
|
+
);
|
562
|
+
newIndices.set(indices);
|
563
|
+
const ilength = indices.length;
|
564
|
+
|
565
|
+
const length = numPositions / 2;
|
566
|
+
|
567
|
+
for (i = 0; i < ilength; i += 3) {
|
568
|
+
const i0 = newIndices[i] + length;
|
569
|
+
const i1 = newIndices[i + 1] + length;
|
570
|
+
const i2 = newIndices[i + 2] + length;
|
571
|
+
|
572
|
+
newIndices[i + ilength] = i2;
|
573
|
+
newIndices[i + 1 + ilength] = i1;
|
574
|
+
newIndices[i + 2 + ilength] = i0;
|
575
|
+
}
|
576
|
+
|
577
|
+
topGeo.attributes.position.values = topBottomPositions;
|
578
|
+
if (perPositionHeight && vertexFormat.normal) {
|
579
|
+
const normals = topGeo.attributes.normal.values;
|
580
|
+
topGeo.attributes.normal.values = new Float32Array(
|
581
|
+
topBottomPositions.length
|
582
|
+
);
|
583
|
+
topGeo.attributes.normal.values.set(normals);
|
584
|
+
}
|
585
|
+
|
586
|
+
if (vertexFormat.st && defaultValue.defined(textureCoordinates)) {
|
587
|
+
const texcoords = topGeo.attributes.st.values;
|
588
|
+
topGeo.attributes.st.values = new Float32Array(numPositions * 2);
|
589
|
+
topGeo.attributes.st.values = texcoords.concat(texcoords);
|
590
|
+
}
|
591
|
+
|
592
|
+
topGeo.indices = newIndices;
|
593
|
+
} else if (closeBottom) {
|
594
|
+
numPositions = edgePoints.length / 3;
|
595
|
+
newIndices = IndexDatatype.IndexDatatype.createTypedArray(numPositions, indices.length);
|
596
|
+
|
597
|
+
for (i = 0; i < indices.length; i += 3) {
|
598
|
+
newIndices[i] = indices[i + 2];
|
599
|
+
newIndices[i + 1] = indices[i + 1];
|
600
|
+
newIndices[i + 2] = indices[i];
|
601
|
+
}
|
602
|
+
|
603
|
+
topGeo.indices = newIndices;
|
604
|
+
}
|
605
|
+
|
606
|
+
geos.topAndBottom = new GeometryInstance.GeometryInstance({
|
607
|
+
geometry: topGeo,
|
608
|
+
});
|
609
|
+
}
|
610
|
+
|
611
|
+
let outerRing = hierarchy.outerRing;
|
612
|
+
let tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);
|
613
|
+
let positions2D = tangentPlane.projectPointsOntoPlane(
|
614
|
+
outerRing,
|
615
|
+
createGeometryFromPositionsExtrudedPositions
|
616
|
+
);
|
617
|
+
|
618
|
+
let windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
|
619
|
+
if (windingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
|
620
|
+
outerRing = outerRing.slice().reverse();
|
621
|
+
}
|
622
|
+
|
623
|
+
let wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
|
624
|
+
outerRing,
|
625
|
+
textureCoordinates,
|
626
|
+
ellipsoid,
|
627
|
+
granularity,
|
628
|
+
perPositionHeight,
|
629
|
+
arcType
|
630
|
+
);
|
631
|
+
geos.walls.push(
|
632
|
+
new GeometryInstance.GeometryInstance({
|
633
|
+
geometry: wallGeo,
|
634
|
+
})
|
635
|
+
);
|
636
|
+
|
637
|
+
const holes = hierarchy.holes;
|
638
|
+
for (i = 0; i < holes.length; i++) {
|
639
|
+
let hole = holes[i];
|
640
|
+
|
641
|
+
tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(hole, ellipsoid);
|
642
|
+
positions2D = tangentPlane.projectPointsOntoPlane(
|
643
|
+
hole,
|
644
|
+
createGeometryFromPositionsExtrudedPositions
|
645
|
+
);
|
646
|
+
|
647
|
+
windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
|
648
|
+
if (windingOrder === PolygonPipeline.WindingOrder.COUNTER_CLOCKWISE) {
|
649
|
+
hole = hole.slice().reverse();
|
650
|
+
}
|
651
|
+
|
652
|
+
wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
|
653
|
+
hole,
|
654
|
+
textureCoordinates,
|
655
|
+
ellipsoid,
|
656
|
+
granularity,
|
657
|
+
perPositionHeight,
|
658
|
+
arcType
|
659
|
+
);
|
660
|
+
geos.walls.push(
|
661
|
+
new GeometryInstance.GeometryInstance({
|
662
|
+
geometry: wallGeo,
|
663
|
+
})
|
664
|
+
);
|
665
|
+
}
|
666
|
+
|
667
|
+
return geos;
|
668
|
+
}
|
669
|
+
|
670
|
+
/**
|
671
|
+
* A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
|
672
|
+
*
|
673
|
+
* @alias PolygonGeometry
|
674
|
+
* @constructor
|
675
|
+
*
|
676
|
+
* @param {Object} options Object with the following properties:
|
677
|
+
* @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
|
678
|
+
* @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.
|
679
|
+
* @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.
|
680
|
+
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
|
681
|
+
* @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
|
682
|
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
683
|
+
* @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.
|
684
|
+
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
|
685
|
+
* @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
|
686
|
+
* @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
|
687
|
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
|
688
|
+
* @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
|
689
|
+
*
|
690
|
+
* @see PolygonGeometry#createGeometry
|
691
|
+
* @see PolygonGeometry#fromPositions
|
692
|
+
*
|
693
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}
|
694
|
+
*
|
695
|
+
* @example
|
696
|
+
* // 1. create a polygon from points
|
697
|
+
* const polygon = new Cesium.PolygonGeometry({
|
698
|
+
* polygonHierarchy : new Cesium.PolygonHierarchy(
|
699
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
700
|
+
* -72.0, 40.0,
|
701
|
+
* -70.0, 35.0,
|
702
|
+
* -75.0, 30.0,
|
703
|
+
* -70.0, 30.0,
|
704
|
+
* -68.0, 40.0
|
705
|
+
* ])
|
706
|
+
* )
|
707
|
+
* });
|
708
|
+
* const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
|
709
|
+
*
|
710
|
+
* // 2. create a nested polygon with holes
|
711
|
+
* const polygonWithHole = new Cesium.PolygonGeometry({
|
712
|
+
* polygonHierarchy : new Cesium.PolygonHierarchy(
|
713
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
714
|
+
* -109.0, 30.0,
|
715
|
+
* -95.0, 30.0,
|
716
|
+
* -95.0, 40.0,
|
717
|
+
* -109.0, 40.0
|
718
|
+
* ]),
|
719
|
+
* [new Cesium.PolygonHierarchy(
|
720
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
721
|
+
* -107.0, 31.0,
|
722
|
+
* -107.0, 39.0,
|
723
|
+
* -97.0, 39.0,
|
724
|
+
* -97.0, 31.0
|
725
|
+
* ]),
|
726
|
+
* [new Cesium.PolygonHierarchy(
|
727
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
728
|
+
* -105.0, 33.0,
|
729
|
+
* -99.0, 33.0,
|
730
|
+
* -99.0, 37.0,
|
731
|
+
* -105.0, 37.0
|
732
|
+
* ]),
|
733
|
+
* [new Cesium.PolygonHierarchy(
|
734
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
735
|
+
* -103.0, 34.0,
|
736
|
+
* -101.0, 34.0,
|
737
|
+
* -101.0, 36.0,
|
738
|
+
* -103.0, 36.0
|
739
|
+
* ])
|
740
|
+
* )]
|
741
|
+
* )]
|
742
|
+
* )]
|
743
|
+
* )
|
744
|
+
* });
|
745
|
+
* const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
|
746
|
+
*
|
747
|
+
* // 3. create extruded polygon
|
748
|
+
* const extrudedPolygon = new Cesium.PolygonGeometry({
|
749
|
+
* polygonHierarchy : new Cesium.PolygonHierarchy(
|
750
|
+
* Cesium.Cartesian3.fromDegreesArray([
|
751
|
+
* -72.0, 40.0,
|
752
|
+
* -70.0, 35.0,
|
753
|
+
* -75.0, 30.0,
|
754
|
+
* -70.0, 30.0,
|
755
|
+
* -68.0, 40.0
|
756
|
+
* ])
|
757
|
+
* ),
|
758
|
+
* extrudedHeight: 300000
|
759
|
+
* });
|
760
|
+
* const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
|
761
|
+
*/
|
762
|
+
function PolygonGeometry(options) {
|
763
|
+
//>>includeStart('debug', pragmas.debug);
|
764
|
+
Check.Check.typeOf.object("options", options);
|
765
|
+
Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
766
|
+
if (
|
767
|
+
defaultValue.defined(options.perPositionHeight) &&
|
768
|
+
options.perPositionHeight &&
|
769
|
+
defaultValue.defined(options.height)
|
770
|
+
) {
|
771
|
+
throw new Check.DeveloperError(
|
772
|
+
"Cannot use both options.perPositionHeight and options.height"
|
773
|
+
);
|
774
|
+
}
|
775
|
+
if (
|
776
|
+
defaultValue.defined(options.arcType) &&
|
777
|
+
options.arcType !== ArcType.ArcType.GEODESIC &&
|
778
|
+
options.arcType !== ArcType.ArcType.RHUMB
|
779
|
+
) {
|
780
|
+
throw new Check.DeveloperError(
|
781
|
+
"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
|
782
|
+
);
|
783
|
+
}
|
784
|
+
//>>includeEnd('debug');
|
785
|
+
|
786
|
+
const polygonHierarchy = options.polygonHierarchy;
|
787
|
+
const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
|
788
|
+
const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
|
789
|
+
const granularity = defaultValue.defaultValue(
|
790
|
+
options.granularity,
|
791
|
+
Math$1.CesiumMath.RADIANS_PER_DEGREE
|
792
|
+
);
|
793
|
+
const stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
|
794
|
+
const textureCoordinates = options.textureCoordinates;
|
795
|
+
const perPositionHeight = defaultValue.defaultValue(options.perPositionHeight, false);
|
796
|
+
const perPositionHeightExtrude =
|
797
|
+
perPositionHeight && defaultValue.defined(options.extrudedHeight);
|
798
|
+
let height = defaultValue.defaultValue(options.height, 0.0);
|
799
|
+
let extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
|
800
|
+
|
801
|
+
if (!perPositionHeightExtrude) {
|
802
|
+
const h = Math.max(height, extrudedHeight);
|
803
|
+
extrudedHeight = Math.min(height, extrudedHeight);
|
804
|
+
height = h;
|
805
|
+
}
|
806
|
+
|
807
|
+
this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
|
808
|
+
this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
|
809
|
+
this._granularity = granularity;
|
810
|
+
this._stRotation = stRotation;
|
811
|
+
this._height = height;
|
812
|
+
this._extrudedHeight = extrudedHeight;
|
813
|
+
this._closeTop = defaultValue.defaultValue(options.closeTop, true);
|
814
|
+
this._closeBottom = defaultValue.defaultValue(options.closeBottom, true);
|
815
|
+
this._polygonHierarchy = polygonHierarchy;
|
816
|
+
this._perPositionHeight = perPositionHeight;
|
817
|
+
this._perPositionHeightExtrude = perPositionHeightExtrude;
|
818
|
+
this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
|
819
|
+
this._workerName = "createPolygonGeometry";
|
820
|
+
this._offsetAttribute = options.offsetAttribute;
|
821
|
+
this._arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
|
822
|
+
|
823
|
+
this._rectangle = undefined;
|
824
|
+
this._textureCoordinateRotationPoints = undefined;
|
825
|
+
this._textureCoordinates = textureCoordinates;
|
826
|
+
|
827
|
+
/**
|
828
|
+
* The number of elements used to pack the object into an array.
|
829
|
+
* @type {Number}
|
830
|
+
*/
|
831
|
+
this.packedLength =
|
832
|
+
PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
|
833
|
+
polygonHierarchy,
|
834
|
+
Matrix3.Cartesian3
|
835
|
+
) +
|
836
|
+
Matrix3.Ellipsoid.packedLength +
|
837
|
+
VertexFormat.VertexFormat.packedLength +
|
838
|
+
(textureCoordinates
|
839
|
+
? PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
|
840
|
+
textureCoordinates,
|
841
|
+
Matrix2.Cartesian2
|
842
|
+
)
|
843
|
+
: 1) +
|
844
|
+
12;
|
845
|
+
}
|
846
|
+
|
847
|
+
/**
|
848
|
+
* A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
|
849
|
+
*
|
850
|
+
* @param {Object} options Object with the following properties:
|
851
|
+
* @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
|
852
|
+
* @param {Number} [options.height=0.0] The height of the polygon.
|
853
|
+
* @param {Number} [options.extrudedHeight] The height of the polygon extrusion.
|
854
|
+
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
|
855
|
+
* @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
|
856
|
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
857
|
+
* @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.
|
858
|
+
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
|
859
|
+
* @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
|
860
|
+
* @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
|
861
|
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
|
862
|
+
* @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
|
863
|
+
* @returns {PolygonGeometry}
|
864
|
+
*
|
865
|
+
* @example
|
866
|
+
* // create a polygon from points
|
867
|
+
* const polygon = Cesium.PolygonGeometry.fromPositions({
|
868
|
+
* positions : Cesium.Cartesian3.fromDegreesArray([
|
869
|
+
* -72.0, 40.0,
|
870
|
+
* -70.0, 35.0,
|
871
|
+
* -75.0, 30.0,
|
872
|
+
* -70.0, 30.0,
|
873
|
+
* -68.0, 40.0
|
874
|
+
* ])
|
875
|
+
* });
|
876
|
+
* const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
|
877
|
+
*
|
878
|
+
* @see PolygonGeometry#createGeometry
|
879
|
+
*/
|
880
|
+
PolygonGeometry.fromPositions = function (options) {
|
881
|
+
options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
|
882
|
+
|
883
|
+
//>>includeStart('debug', pragmas.debug);
|
884
|
+
Check.Check.defined("options.positions", options.positions);
|
885
|
+
//>>includeEnd('debug');
|
886
|
+
|
887
|
+
const newOptions = {
|
888
|
+
polygonHierarchy: {
|
889
|
+
positions: options.positions,
|
890
|
+
},
|
891
|
+
height: options.height,
|
892
|
+
extrudedHeight: options.extrudedHeight,
|
893
|
+
vertexFormat: options.vertexFormat,
|
894
|
+
stRotation: options.stRotation,
|
895
|
+
ellipsoid: options.ellipsoid,
|
896
|
+
granularity: options.granularity,
|
897
|
+
perPositionHeight: options.perPositionHeight,
|
898
|
+
closeTop: options.closeTop,
|
899
|
+
closeBottom: options.closeBottom,
|
900
|
+
offsetAttribute: options.offsetAttribute,
|
901
|
+
arcType: options.arcType,
|
902
|
+
textureCoordinates: options.textureCoordinates,
|
903
|
+
};
|
904
|
+
return new PolygonGeometry(newOptions);
|
905
|
+
};
|
906
|
+
|
907
|
+
/**
|
908
|
+
* Stores the provided instance into the provided array.
|
909
|
+
*
|
910
|
+
* @param {PolygonGeometry} value The value to pack.
|
911
|
+
* @param {Number[]} array The array to pack into.
|
912
|
+
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
|
913
|
+
*
|
914
|
+
* @returns {Number[]} The array that was packed into
|
915
|
+
*/
|
916
|
+
PolygonGeometry.pack = function (value, array, startingIndex) {
|
917
|
+
//>>includeStart('debug', pragmas.debug);
|
918
|
+
Check.Check.typeOf.object("value", value);
|
919
|
+
Check.Check.defined("array", array);
|
920
|
+
//>>includeEnd('debug');
|
921
|
+
|
922
|
+
startingIndex = defaultValue.defaultValue(startingIndex, 0);
|
923
|
+
|
924
|
+
startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
|
925
|
+
value._polygonHierarchy,
|
926
|
+
array,
|
927
|
+
startingIndex,
|
928
|
+
Matrix3.Cartesian3
|
929
|
+
);
|
930
|
+
|
931
|
+
Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
|
932
|
+
startingIndex += Matrix3.Ellipsoid.packedLength;
|
933
|
+
|
934
|
+
VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
|
935
|
+
startingIndex += VertexFormat.VertexFormat.packedLength;
|
936
|
+
|
937
|
+
array[startingIndex++] = value._height;
|
938
|
+
array[startingIndex++] = value._extrudedHeight;
|
939
|
+
array[startingIndex++] = value._granularity;
|
940
|
+
array[startingIndex++] = value._stRotation;
|
941
|
+
array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;
|
942
|
+
array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;
|
943
|
+
array[startingIndex++] = value._closeTop ? 1.0 : 0.0;
|
944
|
+
array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;
|
945
|
+
array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
|
946
|
+
array[startingIndex++] = defaultValue.defaultValue(value._offsetAttribute, -1);
|
947
|
+
array[startingIndex++] = value._arcType;
|
948
|
+
if (defaultValue.defined(value._textureCoordinates)) {
|
949
|
+
startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
|
950
|
+
value._textureCoordinates,
|
951
|
+
array,
|
952
|
+
startingIndex,
|
953
|
+
Matrix2.Cartesian2
|
954
|
+
);
|
955
|
+
} else {
|
956
|
+
array[startingIndex++] = -1.0;
|
957
|
+
}
|
958
|
+
array[startingIndex++] = value.packedLength;
|
959
|
+
return array;
|
960
|
+
};
|
961
|
+
|
962
|
+
const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
|
963
|
+
const scratchVertexFormat = new VertexFormat.VertexFormat();
|
964
|
+
|
965
|
+
//Only used to avoid inability to default construct.
|
966
|
+
const dummyOptions = {
|
967
|
+
polygonHierarchy: {},
|
968
|
+
};
|
969
|
+
|
970
|
+
/**
|
971
|
+
* Retrieves an instance from a packed array.
|
972
|
+
*
|
973
|
+
* @param {Number[]} array The packed array.
|
974
|
+
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
|
975
|
+
* @param {PolygonGeometry} [result] The object into which to store the result.
|
976
|
+
*/
|
977
|
+
PolygonGeometry.unpack = function (array, startingIndex, result) {
|
978
|
+
//>>includeStart('debug', pragmas.debug);
|
979
|
+
Check.Check.defined("array", array);
|
980
|
+
//>>includeEnd('debug');
|
981
|
+
|
982
|
+
startingIndex = defaultValue.defaultValue(startingIndex, 0);
|
983
|
+
|
984
|
+
const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
|
985
|
+
array,
|
986
|
+
startingIndex,
|
987
|
+
Matrix3.Cartesian3
|
988
|
+
);
|
989
|
+
startingIndex = polygonHierarchy.startingIndex;
|
990
|
+
delete polygonHierarchy.startingIndex;
|
991
|
+
|
992
|
+
const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
|
993
|
+
startingIndex += Matrix3.Ellipsoid.packedLength;
|
994
|
+
|
995
|
+
const vertexFormat = VertexFormat.VertexFormat.unpack(
|
996
|
+
array,
|
997
|
+
startingIndex,
|
998
|
+
scratchVertexFormat
|
999
|
+
);
|
1000
|
+
startingIndex += VertexFormat.VertexFormat.packedLength;
|
1001
|
+
|
1002
|
+
const height = array[startingIndex++];
|
1003
|
+
const extrudedHeight = array[startingIndex++];
|
1004
|
+
const granularity = array[startingIndex++];
|
1005
|
+
const stRotation = array[startingIndex++];
|
1006
|
+
const perPositionHeightExtrude = array[startingIndex++] === 1.0;
|
1007
|
+
const perPositionHeight = array[startingIndex++] === 1.0;
|
1008
|
+
const closeTop = array[startingIndex++] === 1.0;
|
1009
|
+
const closeBottom = array[startingIndex++] === 1.0;
|
1010
|
+
const shadowVolume = array[startingIndex++] === 1.0;
|
1011
|
+
const offsetAttribute = array[startingIndex++];
|
1012
|
+
const arcType = array[startingIndex++];
|
1013
|
+
const textureCoordinates =
|
1014
|
+
array[startingIndex] === -1.0
|
1015
|
+
? undefined
|
1016
|
+
: PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
|
1017
|
+
array,
|
1018
|
+
startingIndex,
|
1019
|
+
Matrix2.Cartesian2
|
1020
|
+
);
|
1021
|
+
if (defaultValue.defined(textureCoordinates)) {
|
1022
|
+
startingIndex = textureCoordinates.startingIndex;
|
1023
|
+
delete textureCoordinates.startingIndex;
|
1024
|
+
} else {
|
1025
|
+
startingIndex++;
|
1026
|
+
}
|
1027
|
+
const packedLength = array[startingIndex++];
|
1028
|
+
|
1029
|
+
if (!defaultValue.defined(result)) {
|
1030
|
+
result = new PolygonGeometry(dummyOptions);
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
result._polygonHierarchy = polygonHierarchy;
|
1034
|
+
result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
|
1035
|
+
result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
|
1036
|
+
result._height = height;
|
1037
|
+
result._extrudedHeight = extrudedHeight;
|
1038
|
+
result._granularity = granularity;
|
1039
|
+
result._stRotation = stRotation;
|
1040
|
+
result._perPositionHeightExtrude = perPositionHeightExtrude;
|
1041
|
+
result._perPositionHeight = perPositionHeight;
|
1042
|
+
result._closeTop = closeTop;
|
1043
|
+
result._closeBottom = closeBottom;
|
1044
|
+
result._shadowVolume = shadowVolume;
|
1045
|
+
result._offsetAttribute =
|
1046
|
+
offsetAttribute === -1 ? undefined : offsetAttribute;
|
1047
|
+
result._arcType = arcType;
|
1048
|
+
result._textureCoordinates = textureCoordinates;
|
1049
|
+
result.packedLength = packedLength;
|
1050
|
+
|
1051
|
+
return result;
|
1052
|
+
};
|
1053
|
+
|
1054
|
+
/**
|
1055
|
+
* Returns the bounding rectangle given the provided options
|
1056
|
+
*
|
1057
|
+
* @param {Object} options Object with the following properties:
|
1058
|
+
* @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
|
1059
|
+
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
|
1060
|
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
|
1061
|
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
1062
|
+
* @param {Rectangle} [result] An object in which to store the result.
|
1063
|
+
*
|
1064
|
+
* @returns {Rectangle} The result rectangle
|
1065
|
+
*/
|
1066
|
+
PolygonGeometry.computeRectangle = function (options, result) {
|
1067
|
+
//>>includeStart('debug', pragmas.debug);
|
1068
|
+
Check.Check.typeOf.object("options", options);
|
1069
|
+
Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
1070
|
+
//>>includeEnd('debug');
|
1071
|
+
|
1072
|
+
const granularity = defaultValue.defaultValue(
|
1073
|
+
options.granularity,
|
1074
|
+
Math$1.CesiumMath.RADIANS_PER_DEGREE
|
1075
|
+
);
|
1076
|
+
const arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
|
1077
|
+
//>>includeStart('debug', pragmas.debug);
|
1078
|
+
if (arcType !== ArcType.ArcType.GEODESIC && arcType !== ArcType.ArcType.RHUMB) {
|
1079
|
+
throw new Check.DeveloperError(
|
1080
|
+
"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
|
1081
|
+
);
|
1082
|
+
}
|
1083
|
+
//>>includeEnd('debug');
|
1084
|
+
|
1085
|
+
const polygonHierarchy = options.polygonHierarchy;
|
1086
|
+
const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
|
1087
|
+
|
1088
|
+
return computeRectangle(
|
1089
|
+
polygonHierarchy.positions,
|
1090
|
+
ellipsoid,
|
1091
|
+
arcType,
|
1092
|
+
granularity,
|
1093
|
+
result
|
1094
|
+
);
|
1095
|
+
};
|
1096
|
+
|
1097
|
+
/**
|
1098
|
+
* Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
|
1099
|
+
*
|
1100
|
+
* @param {PolygonGeometry} polygonGeometry A description of the polygon.
|
1101
|
+
* @returns {Geometry|undefined} The computed vertices and indices.
|
1102
|
+
*/
|
1103
|
+
PolygonGeometry.createGeometry = function (polygonGeometry) {
|
1104
|
+
const vertexFormat = polygonGeometry._vertexFormat;
|
1105
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
1106
|
+
const granularity = polygonGeometry._granularity;
|
1107
|
+
const stRotation = polygonGeometry._stRotation;
|
1108
|
+
const polygonHierarchy = polygonGeometry._polygonHierarchy;
|
1109
|
+
const perPositionHeight = polygonGeometry._perPositionHeight;
|
1110
|
+
const closeTop = polygonGeometry._closeTop;
|
1111
|
+
const closeBottom = polygonGeometry._closeBottom;
|
1112
|
+
const arcType = polygonGeometry._arcType;
|
1113
|
+
const textureCoordinates = polygonGeometry._textureCoordinates;
|
1114
|
+
|
1115
|
+
const hasTextureCoordinates = defaultValue.defined(textureCoordinates);
|
1116
|
+
|
1117
|
+
let outerPositions = polygonHierarchy.positions;
|
1118
|
+
if (outerPositions.length < 3) {
|
1119
|
+
return;
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
const tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(
|
1123
|
+
outerPositions,
|
1124
|
+
ellipsoid
|
1125
|
+
);
|
1126
|
+
|
1127
|
+
const results = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
|
1128
|
+
polygonHierarchy,
|
1129
|
+
hasTextureCoordinates,
|
1130
|
+
tangentPlane.projectPointsOntoPlane.bind(tangentPlane),
|
1131
|
+
!perPositionHeight,
|
1132
|
+
ellipsoid
|
1133
|
+
);
|
1134
|
+
|
1135
|
+
const hierarchy = results.hierarchy;
|
1136
|
+
const polygons = results.polygons;
|
1137
|
+
|
1138
|
+
const dummyFunction = function (identity) {
|
1139
|
+
return identity;
|
1140
|
+
};
|
1141
|
+
|
1142
|
+
const textureCoordinatePolygons = hasTextureCoordinates
|
1143
|
+
? PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
|
1144
|
+
textureCoordinates,
|
1145
|
+
true,
|
1146
|
+
dummyFunction,
|
1147
|
+
false
|
1148
|
+
).polygons
|
1149
|
+
: undefined;
|
1150
|
+
|
1151
|
+
if (hierarchy.length === 0) {
|
1152
|
+
return;
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
outerPositions = hierarchy[0].outerRing;
|
1156
|
+
const boundingRectangle = PolygonGeometryLibrary.PolygonGeometryLibrary.computeBoundingRectangle(
|
1157
|
+
tangentPlane.plane.normal,
|
1158
|
+
tangentPlane.projectPointOntoPlane.bind(tangentPlane),
|
1159
|
+
outerPositions,
|
1160
|
+
stRotation,
|
1161
|
+
scratchBoundingRectangle
|
1162
|
+
);
|
1163
|
+
|
1164
|
+
const geometries = [];
|
1165
|
+
|
1166
|
+
const height = polygonGeometry._height;
|
1167
|
+
const extrudedHeight = polygonGeometry._extrudedHeight;
|
1168
|
+
const extrude =
|
1169
|
+
polygonGeometry._perPositionHeightExtrude ||
|
1170
|
+
!Math$1.CesiumMath.equalsEpsilon(height, extrudedHeight, 0, Math$1.CesiumMath.EPSILON2);
|
1171
|
+
|
1172
|
+
const options = {
|
1173
|
+
perPositionHeight: perPositionHeight,
|
1174
|
+
vertexFormat: vertexFormat,
|
1175
|
+
geometry: undefined,
|
1176
|
+
tangentPlane: tangentPlane,
|
1177
|
+
boundingRectangle: boundingRectangle,
|
1178
|
+
ellipsoid: ellipsoid,
|
1179
|
+
stRotation: stRotation,
|
1180
|
+
textureCoordinates: undefined,
|
1181
|
+
bottom: false,
|
1182
|
+
top: true,
|
1183
|
+
wall: false,
|
1184
|
+
extrude: false,
|
1185
|
+
arcType: arcType,
|
1186
|
+
};
|
1187
|
+
|
1188
|
+
let i;
|
1189
|
+
|
1190
|
+
if (extrude) {
|
1191
|
+
options.extrude = true;
|
1192
|
+
options.top = closeTop;
|
1193
|
+
options.bottom = closeBottom;
|
1194
|
+
options.shadowVolume = polygonGeometry._shadowVolume;
|
1195
|
+
options.offsetAttribute = polygonGeometry._offsetAttribute;
|
1196
|
+
for (i = 0; i < polygons.length; i++) {
|
1197
|
+
const splitGeometry = createGeometryFromPositionsExtruded(
|
1198
|
+
ellipsoid,
|
1199
|
+
polygons[i],
|
1200
|
+
hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
|
1201
|
+
granularity,
|
1202
|
+
hierarchy[i],
|
1203
|
+
perPositionHeight,
|
1204
|
+
closeTop,
|
1205
|
+
closeBottom,
|
1206
|
+
vertexFormat,
|
1207
|
+
arcType
|
1208
|
+
);
|
1209
|
+
|
1210
|
+
let topAndBottom;
|
1211
|
+
if (closeTop && closeBottom) {
|
1212
|
+
topAndBottom = splitGeometry.topAndBottom;
|
1213
|
+
options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
|
1214
|
+
topAndBottom.geometry,
|
1215
|
+
height,
|
1216
|
+
extrudedHeight,
|
1217
|
+
ellipsoid,
|
1218
|
+
perPositionHeight
|
1219
|
+
);
|
1220
|
+
} else if (closeTop) {
|
1221
|
+
topAndBottom = splitGeometry.topAndBottom;
|
1222
|
+
topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
1223
|
+
topAndBottom.geometry.attributes.position.values,
|
1224
|
+
height,
|
1225
|
+
ellipsoid,
|
1226
|
+
!perPositionHeight
|
1227
|
+
);
|
1228
|
+
options.geometry = topAndBottom.geometry;
|
1229
|
+
} else if (closeBottom) {
|
1230
|
+
topAndBottom = splitGeometry.topAndBottom;
|
1231
|
+
topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
1232
|
+
topAndBottom.geometry.attributes.position.values,
|
1233
|
+
extrudedHeight,
|
1234
|
+
ellipsoid,
|
1235
|
+
true
|
1236
|
+
);
|
1237
|
+
options.geometry = topAndBottom.geometry;
|
1238
|
+
}
|
1239
|
+
if (closeTop || closeBottom) {
|
1240
|
+
options.wall = false;
|
1241
|
+
topAndBottom.geometry = computeAttributes(options);
|
1242
|
+
geometries.push(topAndBottom);
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
const walls = splitGeometry.walls;
|
1246
|
+
options.wall = true;
|
1247
|
+
for (let k = 0; k < walls.length; k++) {
|
1248
|
+
const wall = walls[k];
|
1249
|
+
options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
|
1250
|
+
wall.geometry,
|
1251
|
+
height,
|
1252
|
+
extrudedHeight,
|
1253
|
+
ellipsoid,
|
1254
|
+
perPositionHeight
|
1255
|
+
);
|
1256
|
+
wall.geometry = computeAttributes(options);
|
1257
|
+
geometries.push(wall);
|
1258
|
+
}
|
1259
|
+
}
|
1260
|
+
} else {
|
1261
|
+
for (i = 0; i < polygons.length; i++) {
|
1262
|
+
const geometryInstance = new GeometryInstance.GeometryInstance({
|
1263
|
+
geometry: PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
|
1264
|
+
ellipsoid,
|
1265
|
+
polygons[i],
|
1266
|
+
hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
|
1267
|
+
granularity,
|
1268
|
+
perPositionHeight,
|
1269
|
+
vertexFormat,
|
1270
|
+
arcType
|
1271
|
+
),
|
1272
|
+
});
|
1273
|
+
geometryInstance.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
|
1274
|
+
geometryInstance.geometry.attributes.position.values,
|
1275
|
+
height,
|
1276
|
+
ellipsoid,
|
1277
|
+
!perPositionHeight
|
1278
|
+
);
|
1279
|
+
options.geometry = geometryInstance.geometry;
|
1280
|
+
|
1281
|
+
geometryInstance.geometry = computeAttributes(options);
|
1282
|
+
|
1283
|
+
if (defaultValue.defined(polygonGeometry._offsetAttribute)) {
|
1284
|
+
const length =
|
1285
|
+
geometryInstance.geometry.attributes.position.values.length;
|
1286
|
+
const offsetValue =
|
1287
|
+
polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
|
1288
|
+
? 0
|
1289
|
+
: 1;
|
1290
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
1291
|
+
geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute(
|
1292
|
+
{
|
1293
|
+
componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
|
1294
|
+
componentsPerAttribute: 1,
|
1295
|
+
values: applyOffset,
|
1296
|
+
}
|
1297
|
+
);
|
1298
|
+
}
|
1299
|
+
|
1300
|
+
geometries.push(geometryInstance);
|
1301
|
+
}
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
|
1305
|
+
geometry.attributes.position.values = new Float64Array(
|
1306
|
+
geometry.attributes.position.values
|
1307
|
+
);
|
1308
|
+
geometry.indices = IndexDatatype.IndexDatatype.createTypedArray(
|
1309
|
+
geometry.attributes.position.values.length / 3,
|
1310
|
+
geometry.indices
|
1311
|
+
);
|
1312
|
+
|
1313
|
+
const attributes = geometry.attributes;
|
1314
|
+
const boundingSphere = Transforms.BoundingSphere.fromVertices(
|
1315
|
+
attributes.position.values
|
1316
|
+
);
|
1317
|
+
|
1318
|
+
if (!vertexFormat.position) {
|
1319
|
+
delete attributes.position;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
return new GeometryAttribute.Geometry({
|
1323
|
+
attributes: attributes,
|
1324
|
+
indices: geometry.indices,
|
1325
|
+
primitiveType: geometry.primitiveType,
|
1326
|
+
boundingSphere: boundingSphere,
|
1327
|
+
offsetAttribute: polygonGeometry._offsetAttribute,
|
1328
|
+
});
|
1329
|
+
};
|
1330
|
+
|
1331
|
+
/**
|
1332
|
+
* @private
|
1333
|
+
*/
|
1334
|
+
PolygonGeometry.createShadowVolume = function (
|
1335
|
+
polygonGeometry,
|
1336
|
+
minHeightFunc,
|
1337
|
+
maxHeightFunc
|
1338
|
+
) {
|
1339
|
+
const granularity = polygonGeometry._granularity;
|
1340
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
1341
|
+
|
1342
|
+
const minHeight = minHeightFunc(granularity, ellipsoid);
|
1343
|
+
const maxHeight = maxHeightFunc(granularity, ellipsoid);
|
1344
|
+
|
1345
|
+
return new PolygonGeometry({
|
1346
|
+
polygonHierarchy: polygonGeometry._polygonHierarchy,
|
1347
|
+
ellipsoid: ellipsoid,
|
1348
|
+
stRotation: polygonGeometry._stRotation,
|
1349
|
+
granularity: granularity,
|
1350
|
+
perPositionHeight: false,
|
1351
|
+
extrudedHeight: minHeight,
|
1352
|
+
height: maxHeight,
|
1353
|
+
vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
|
1354
|
+
shadowVolume: true,
|
1355
|
+
arcType: polygonGeometry._arcType,
|
1356
|
+
});
|
1357
|
+
};
|
1358
|
+
|
1359
|
+
function textureCoordinateRotationPoints(polygonGeometry) {
|
1360
|
+
const stRotation = -polygonGeometry._stRotation;
|
1361
|
+
if (stRotation === 0.0) {
|
1362
|
+
return [0, 0, 0, 1, 1, 0];
|
1363
|
+
}
|
1364
|
+
const ellipsoid = polygonGeometry._ellipsoid;
|
1365
|
+
const positions = polygonGeometry._polygonHierarchy.positions;
|
1366
|
+
const boundingRectangle = polygonGeometry.rectangle;
|
1367
|
+
return GeometryAttribute.Geometry._textureCoordinateRotationPoints(
|
1368
|
+
positions,
|
1369
|
+
stRotation,
|
1370
|
+
ellipsoid,
|
1371
|
+
boundingRectangle
|
1372
|
+
);
|
1373
|
+
}
|
1374
|
+
|
1375
|
+
Object.defineProperties(PolygonGeometry.prototype, {
|
1376
|
+
/**
|
1377
|
+
* @private
|
1378
|
+
*/
|
1379
|
+
rectangle: {
|
1380
|
+
get: function () {
|
1381
|
+
if (!defaultValue.defined(this._rectangle)) {
|
1382
|
+
const positions = this._polygonHierarchy.positions;
|
1383
|
+
this._rectangle = computeRectangle(
|
1384
|
+
positions,
|
1385
|
+
this._ellipsoid,
|
1386
|
+
this._arcType,
|
1387
|
+
this._granularity
|
1388
|
+
);
|
1389
|
+
}
|
1390
|
+
|
1391
|
+
return this._rectangle;
|
1392
|
+
},
|
1393
|
+
},
|
1394
|
+
/**
|
1395
|
+
* For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
|
1396
|
+
* @private
|
1397
|
+
*/
|
1398
|
+
textureCoordinateRotationPoints: {
|
1399
|
+
get: function () {
|
1400
|
+
if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
|
1401
|
+
this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
|
1402
|
+
this
|
1403
|
+
);
|
1404
|
+
}
|
1405
|
+
return this._textureCoordinateRotationPoints;
|
1406
|
+
},
|
1407
|
+
},
|
1408
|
+
});
|
1409
|
+
|
1410
|
+
function createPolygonGeometry(polygonGeometry, offset) {
|
1411
|
+
if (defaultValue.defined(offset)) {
|
1412
|
+
polygonGeometry = PolygonGeometry.unpack(polygonGeometry, offset);
|
1413
|
+
}
|
1414
|
+
polygonGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polygonGeometry._ellipsoid);
|
1415
|
+
return PolygonGeometry.createGeometry(polygonGeometry);
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
return createPolygonGeometry;
|
1419
|
+
|
1420
|
+
}));
|