leiting-bim 2.1.164 → 2.1.165

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.
@@ -95,7 +95,7 @@
95
95
  from { transform: rotate(0deg); }
96
96
  to { transform: rotate(360deg); }
97
97
  }
98
- `;di=document.createElement("style"),di.textContent=n,document.head.appendChild(di)}function by(){if(ll)return;Ey(),Ce=document.createElement("div"),Ce.className="tech-alert-wrapper",(Fs||document.body).appendChild(Ce);const e={setup(){return()=>ve.visible?o.h(ie.Alert,{class:`tech-alert tech-alert-${ve.type}`,message:ve.title,description:ve.description,showIcon:ve.showIcon,closable:ve.closable,onClose:()=>{ve.visible=!1}},{icon:()=>ve.type==="loading"?o.h(qt.LoadingOutlined):ve.type==="success"?o.h(qt.CheckCircleOutlined):ve.type==="error"?o.h(qt.CloseCircleOutlined):ve.type==="warning"?o.h(qt.ExclamationCircleOutlined):o.h(qt.InfoCircleOutlined)}):null}};al=o.createVNode(e),o.render(al,Ce),ll=!0}function Cn(n){by(),Ns&&clearTimeout(Ns),ve.type=n.type||"info",ve.title=n.title||"",ve.description=n.description||"",ve.closable=n.closable??!1,ve.showIcon=n.showIcon??!0,ve.visible=!0;const e=n.container||Fs;Ce&&(e?(Ce.parentNode!==e&&e.appendChild(Ce),Ce.style.position="absolute",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"):(Ce.parentNode!==document.body&&document.body.appendChild(Ce),Ce.style.position="fixed",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"));const t=n.duration??(ve.type==="loading"?0:3);t>0&&(Ns=setTimeout(()=>{ve.visible=!1},t*1e3))}const ce={setContainer:n=>{Fs=n,Ce&&n&&Ce.parentNode!==n&&(n.appendChild(Ce),Ce.style.position="absolute")},info:(n,e,t,i)=>Cn({type:"info",title:n,description:e,duration:t,container:i}),success:(n,e,t,i)=>Cn({type:"success",title:n,description:e,duration:t,container:i}),error:(n,e,t,i)=>Cn({type:"error",title:n,description:e,duration:t,container:i}),warning:(n,e,t,i)=>Cn({type:"warning",title:n,description:e,duration:t,container:i}),loading:(n,e,t)=>Cn({type:"loading",title:n,description:e,duration:0,container:t}),close:()=>{ve.visible=!1}};class wy{cesium;viewer;events=new jn;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const i=this.cesium.Color.fromCssColorString(e);i?(this.viewer.scene.backgroundColor=i,this.viewer.scene.globe.baseColor=i):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),i=new Promise((s,r)=>setTimeout(()=>r(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,i])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(i){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",i),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const i=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),i.enableZoomInertia=!1,i.enableTilt=!1,i.enableLook=!1,i.enableCollisionDetection=!1,i.inertiaSpin=0,i.inertiaZoom=0,i.inertiaTranslate=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null),this.viewer.resolutionScale=1,this.viewer.scene.postProcessStages&&this.viewer.scene.postProcessStages.fxaa&&(this.viewer.scene.postProcessStages.fxaa.enabled=!1),this.viewer.scene.highDynamicRange=!1,this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const i=Date.now();this.lastBaseMapRequestId=i;const s=this.viewer.imageryLayers,r=[];if(e==="tianditu"){const a=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",c=t?.layerType||"img_w",l=c.split("_"),d=l[0]||"img",h=l[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const p=f?`${f}_${h}`:"";r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${c}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&p&&r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${p}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const a=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const c=this.cesium.ArcGisMapServerImageryProvider.fromUrl(a,{enablePickFeatures:!1}),l=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([c,l]);r.push(d)}else r.push(new this.cesium.ArcGisMapServerImageryProvider({url:a,enablePickFeatures:!1}))}catch(c){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",c),r.push(new this.cesium.UrlTemplateImageryProvider({url:`${a}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==i){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),r.forEach(a=>s.addImageryProvider(a))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),r=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,a=await fetch(r);if(!a.ok)throw new Error(`HTTP ${a.status}`);return await a.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const i=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=i}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,i=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,r=e.contrast!==void 0?e.contrast:1,a=e.saturation!==void 0?e.saturation:1,c=t.scene.primitives,l=c.length,d=!!i.CustomShader;for(let h=0;h<l;++h){const f=c.get(h);if(f instanceof i.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",r),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",a);else{const p=new i.CustomShader({uniforms:{u_brightness:{type:i.UniformType.FLOAT,value:s},u_contrast:{type:i.UniformType.FLOAT,value:r},u_saturation:{type:i.UniformType.FLOAT,value:a}},fragmentShaderText:`
98
+ `;di=document.createElement("style"),di.textContent=n,document.head.appendChild(di)}function by(){if(ll)return;Ey(),Ce=document.createElement("div"),Ce.className="tech-alert-wrapper",(Fs||document.body).appendChild(Ce);const e={setup(){return()=>ve.visible?o.h(ie.Alert,{class:`tech-alert tech-alert-${ve.type}`,message:ve.title,description:ve.description,showIcon:ve.showIcon,closable:ve.closable,onClose:()=>{ve.visible=!1}},{icon:()=>ve.type==="loading"?o.h(qt.LoadingOutlined):ve.type==="success"?o.h(qt.CheckCircleOutlined):ve.type==="error"?o.h(qt.CloseCircleOutlined):ve.type==="warning"?o.h(qt.ExclamationCircleOutlined):o.h(qt.InfoCircleOutlined)}):null}};al=o.createVNode(e),o.render(al,Ce),ll=!0}function Cn(n){by(),Ns&&clearTimeout(Ns),ve.type=n.type||"info",ve.title=n.title||"",ve.description=n.description||"",ve.closable=n.closable??!1,ve.showIcon=n.showIcon??!0,ve.visible=!0;const e=n.container||Fs;Ce&&(e?(Ce.parentNode!==e&&e.appendChild(Ce),Ce.style.position="absolute",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"):(Ce.parentNode!==document.body&&document.body.appendChild(Ce),Ce.style.position="fixed",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"));const t=n.duration??(ve.type==="loading"?0:3);t>0&&(Ns=setTimeout(()=>{ve.visible=!1},t*1e3))}const ce={setContainer:n=>{Fs=n,Ce&&n&&Ce.parentNode!==n&&(n.appendChild(Ce),Ce.style.position="absolute")},info:(n,e,t,i)=>Cn({type:"info",title:n,description:e,duration:t,container:i}),success:(n,e,t,i)=>Cn({type:"success",title:n,description:e,duration:t,container:i}),error:(n,e,t,i)=>Cn({type:"error",title:n,description:e,duration:t,container:i}),warning:(n,e,t,i)=>Cn({type:"warning",title:n,description:e,duration:t,container:i}),loading:(n,e,t)=>Cn({type:"loading",title:n,description:e,duration:0,container:t}),close:()=>{ve.visible=!1}};class wy{cesium;viewer;events=new jn;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const i=this.cesium.Color.fromCssColorString(e);i?(this.viewer.scene.backgroundColor=i,this.viewer.scene.globe.baseColor=i):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),i=new Promise((s,r)=>setTimeout(()=>r(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,i])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(i){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",i),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const i=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),i.enableZoomInertia=!1,i.enableTilt=!1,i.enableLook=!1,i.enableCollisionDetection=!1,i.inertiaSpin=0,i.inertiaZoom=0,i.inertiaTranslate=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null),this.viewer.resolutionScale=1,this.viewer.scene.postProcessStages&&this.viewer.scene.postProcessStages.fxaa&&(this.viewer.scene.postProcessStages.fxaa.enabled=!1);let s=window.devicePixelRatio;this.viewer.resolutionScale=s,this.viewer.scene.postProcessStages.fxaa.enabled=!1,this.viewer.scene.highDynamicRange=!1,this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const i=Date.now();this.lastBaseMapRequestId=i;const s=this.viewer.imageryLayers,r=[];if(e==="tianditu"){const a=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",c=t?.layerType||"img_w",l=c.split("_"),d=l[0]||"img",h=l[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const p=f?`${f}_${h}`:"";r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${c}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&p&&r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${p}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const a=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const c=this.cesium.ArcGisMapServerImageryProvider.fromUrl(a,{enablePickFeatures:!1}),l=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([c,l]);r.push(d)}else r.push(new this.cesium.ArcGisMapServerImageryProvider({url:a,enablePickFeatures:!1}))}catch(c){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",c),r.push(new this.cesium.UrlTemplateImageryProvider({url:`${a}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==i){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),r.forEach(a=>s.addImageryProvider(a))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),r=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,a=await fetch(r);if(!a.ok)throw new Error(`HTTP ${a.status}`);return await a.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const i=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=i}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,i=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,r=e.contrast!==void 0?e.contrast:1,a=e.saturation!==void 0?e.saturation:1,c=t.scene.primitives,l=c.length,d=!!i.CustomShader;for(let h=0;h<l;++h){const f=c.get(h);if(f instanceof i.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",r),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",a);else{const p=new i.CustomShader({uniforms:{u_brightness:{type:i.UniformType.FLOAT,value:s},u_contrast:{type:i.UniformType.FLOAT,value:r},u_saturation:{type:i.UniformType.FLOAT,value:a}},fragmentShaderText:`
99
99
  void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
100
100
  // 1. 亮度 (Brightness) - RGB 乘法
101
101
  material.diffuse *= u_brightness;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "leiting-bim",
3
3
  "private": false,
4
- "version": "2.1.164",
4
+ "version": "2.1.165",
5
5
  "type": "module",
6
6
  "main": "./leiting-bim.umd.js",
7
7
  "module": "./leiting-bim.es.js",