管道基础大数据平台系统开发-【前端】-新系統界面
584911253@qq.com
2023-03-28 c3c23814c1802121af66feecdf4238f1d60c4651
模型剖切修改
已修改2个文件
33 ■■■■ 文件已修改
src/views/Synthesis/LeftMenu.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/LayerTree.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue
@@ -1835,7 +1835,12 @@
      //   }
      // }
      window.model.clippingPlanes = clippingPlanes;
      if (window.modelHeight && window.modelHeight != 0){
        // console.log("window.modelHeight---",window.modelHeight)
        window.model.clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(
            new Cesium.Cartesian3(0.0, 0.0, window.modelHeight)
        );
      }
      // 绑定上移动事件
      const downHandler = new Cesium.ScreenSpaceEventHandler(
        Viewer.scene.canvas
src/views/Tools/LayerTree.vue
@@ -704,7 +704,7 @@
      // if (checked.checkedKeys) {
      //   for (var i in result) {
      //
      //
      //   }
      // } else {
@@ -875,9 +875,29 @@
          tileset.id = res.cnName;
          tileset.layerId = res.id;
          tileset.pubid = res.pubid;
          // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等
          // 整个根节点模型矩阵,该tileSet=>世界坐标系
          // 单位矩阵,对角线值为1.0的4*4矩阵
          if (!Cesium.Matrix4.equals(tileset.root.transform,Cesium.Matrix4.IDENTITY)) {
            // 获取模型的世界坐标(笛卡尔)
            // Cesium.Matrix4.getTranslation 通过仿射变换矩阵获取该tileSet的世界坐标
            const transformCenter = Cesium.Matrix4.getTranslation(
                tileset.root.transform,
                new Cesium.Cartesian3()
            );
            // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的)
            const transformCartographic = Cesium.Cartographic.fromCartesian(
                transformCenter
            );
            // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的)
            const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(
                tileset.boundingSphere.center
            );
            const height = boundingSphereCartographic.height - transformCartographic.height;
            // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的)
            window.modelHeight = height;
          }else window.modelHeight = 0;
          this.getTilesetArgs(tileset, res);
        });
        this.$store.state.setAlphaList.push({
          name: res.cnName,