|
@@ -1,33 +1,97 @@
|
|
<template>
|
|
<template>
|
|
<div class="sm-function-module-content">
|
|
<div class="sm-function-module-content">
|
|
- <label class="sm-function-module-sub-section-setting"> 分析结果 </label>
|
|
|
|
<el-form :model="form" ref="ruleForm" label-width="100px">
|
|
<el-form :model="form" ref="ruleForm" label-width="100px">
|
|
- <el-form-item label="剖面范围:" prop="xzmj">
|
|
|
|
- <range type="clip" :keys="['hx']" class="range" ref="range" />
|
|
|
|
|
|
+ <el-form-item label="裁剪区域宽度:" prop="width">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="1"
|
|
|
|
+ :max="500"
|
|
|
|
+ :step="1"
|
|
|
|
+ v-model="form.width"
|
|
|
|
+ @input="changewh()"
|
|
|
|
+ ></el-slider>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="裁剪区域高度:" prop="height">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="1"
|
|
|
|
+ :max="500"
|
|
|
|
+ :step="1"
|
|
|
|
+ v-model="form.height"
|
|
|
|
+ @input="changewh()"
|
|
|
|
+ ></el-slider>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="绕X轴旋转:" prop="pitch">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="360"
|
|
|
|
+ :step="1"
|
|
|
|
+ v-model="form.pitch"
|
|
|
|
+ @input="changehpr()"
|
|
|
|
+ ></el-slider>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="绕Y轴旋转:" prop="roll">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="360"
|
|
|
|
+ :step="1"
|
|
|
|
+ v-model="form.roll"
|
|
|
|
+ @input="changehpr()"
|
|
|
|
+ ></el-slider>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="绕Z轴旋转:" prop="heading">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="360"
|
|
|
|
+ :step="1"
|
|
|
|
+ v-model="form.heading"
|
|
|
|
+ @input="changehpr()"
|
|
|
|
+ ></el-slider>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="拉伸高度:" prop="extrudeDistance">
|
|
|
|
+ <el-slider
|
|
|
|
+ class="inputwidth"
|
|
|
|
+ :min="0.01"
|
|
|
|
+ :max="100"
|
|
|
|
+ :step="0.02"
|
|
|
|
+ v-model="form.extrudeDistance"
|
|
|
|
+ @input="analysis"
|
|
|
|
+ ></el-slider>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <!-- <el-form-item label="模型名称:" prop="mxmc">
|
|
|
|
- <el-input
|
|
|
|
- v-model="form.mxmc"
|
|
|
|
- size="mini"
|
|
|
|
- placeholder="请输入模型名称"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item> -->
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<div class="boxchild">
|
|
<div class="boxchild">
|
|
- <el-button type="primary" size="mini" @click="analysis">分析</el-button>
|
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="clickPoint"
|
|
|
|
+ >点击选择点位</el-button
|
|
|
|
+ >
|
|
<el-button type="primary" size="mini" @click="clear">清除</el-button>
|
|
<el-button type="primary" size="mini" @click="clear">清除</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { moveHandler, pickPoint } from "@/utils/MapHelper/help.js";
|
|
|
|
+let pos = {};
|
|
|
|
+let box = null;
|
|
|
|
+let startClip = false;
|
|
|
|
+let boxPosition = {};
|
|
|
|
+let layers = null;
|
|
export default {
|
|
export default {
|
|
name: "ClippingPlanes",
|
|
name: "ClippingPlanes",
|
|
props: {},
|
|
props: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
form: {
|
|
form: {
|
|
- geom: "",
|
|
|
|
|
|
+ width: 100,
|
|
|
|
+ height: 100,
|
|
|
|
+ heading: 0,
|
|
|
|
+ pitch: 0,
|
|
|
|
+ roll: 0,
|
|
|
|
+ // 裁剪区域中心点拉伸距离,单位:米,
|
|
|
|
+ extrudeDistance: 0.01,
|
|
|
|
+ isMoving: false,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -35,20 +99,122 @@ export default {
|
|
|
|
|
|
beforeDestroy() {},
|
|
beforeDestroy() {},
|
|
mounted() {
|
|
mounted() {
|
|
- // this.init();
|
|
|
|
|
|
+ layers = store.state.tempLatData[0][0];
|
|
|
|
+ viewer.flyTo(layers);
|
|
|
|
+ this.addEntity();
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ clickPoint() {
|
|
|
|
+ // startClip = true;
|
|
|
|
+ if (!box) this.addEntity();
|
|
|
|
+ box.show = true;
|
|
|
|
+ moveHandler((position) => {
|
|
|
|
+ boxPosition = position;
|
|
|
|
+ this.setBox();
|
|
|
|
+ });
|
|
|
|
+ pickPoint(false, (position, handler) => {
|
|
|
|
+ pos = position;
|
|
|
|
+ // this.form.extrudeDistance = 100 - hei;
|
|
|
|
+ // this.changehpr(pos);
|
|
|
|
+ box.show = false;
|
|
|
|
+ this.analysis();
|
|
|
|
+ handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ changewh() {
|
|
|
|
+ this.setBox();
|
|
|
|
+ this.analysis();
|
|
|
|
+ },
|
|
|
|
+ changehpr(pos) {
|
|
|
|
+ if (!box) return;
|
|
|
|
+ var hpr = new Cesium.HeadingPitchRoll(
|
|
|
|
+ Cesium.Math.toRadians(this.form.heading),
|
|
|
|
+ Cesium.Math.toRadians(this.form.pitch),
|
|
|
|
+ Cesium.Math.toRadians(this.form.roll)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ box.orientation = Cesium.Transforms.headingPitchRollQuaternion(
|
|
|
|
+ pos || boxPosition,
|
|
|
|
+ hpr
|
|
|
|
+ );
|
|
|
|
+ this.analysis();
|
|
|
|
+ },
|
|
|
|
+
|
|
analysis() {
|
|
analysis() {
|
|
- // viewer.flyTo(this.sceneLayers[obj.title][0][0]);
|
|
|
|
|
|
+ if (!pos.x) return;
|
|
|
|
+ // this.vectorlayerlist.push(obj);
|
|
// store.state.sceneLayerlist[obj.title];
|
|
// store.state.sceneLayerlist[obj.title];
|
|
// this.layerparams.forEach(laitem => {
|
|
// this.layerparams.forEach(laitem => {
|
|
- // BIMLayer.setCustomClipPlane(positions[0],positions[1],positions[2]);
|
|
|
|
- // });
|
|
|
|
|
|
+ // this.addEntity();
|
|
|
|
+ this.updateClip();
|
|
|
|
+ },
|
|
|
|
+ // addEntity() {
|
|
|
|
+ // viewer.entities.removeAll();
|
|
|
|
+ // let js = 0.0000095;
|
|
|
|
+ // // 计算矩形的边界坐标;
|
|
|
|
+ // var minX = pos.lon - (this.form.width / 2) * js;
|
|
|
|
+ // var maxX = pos.lon + (this.form.width / 2) * js;
|
|
|
|
+ // var minY = pos.lat - (this.form.height / 2) * js;
|
|
|
|
+ // var maxY = pos.lat + (this.form.height / 2) * js;
|
|
|
|
+ // // 创建一个长方形实体
|
|
|
|
+ // viewer.entities.add({
|
|
|
|
+ // rectangle: {
|
|
|
|
+ // coordinates: Cesium.Rectangle.fromDegrees(minX, minY, maxX, maxY),
|
|
|
|
+ // material: new Cesium.Color.BLUE.withAlpha(0.5),
|
|
|
|
+ // outline: true,
|
|
|
|
+ // outlineColor: Cesium.Color.BLACK,
|
|
|
|
+ // height: this.form.extrudeDistance,
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
+ addEntity() {
|
|
|
|
+ box = viewer.entities.add({
|
|
|
|
+ // 标识盒
|
|
|
|
+ position: Cesium.Cartesian3.fromDegrees(0, 0, 0),
|
|
|
|
+ show: false,
|
|
|
|
+ box: {
|
|
|
|
+ dimensions: new Cesium.Cartesian3(5, 5, 0.1),
|
|
|
|
+ fill: false,
|
|
|
|
+ outline: true,
|
|
|
|
+ outlineColor: Cesium.Color.RED,
|
|
|
|
+ outlineWidth: 5.0,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ this.setBox();
|
|
|
|
+ this.changehpr();
|
|
|
|
+ },
|
|
|
|
+ setBox() {
|
|
|
|
+ if (!box) return;
|
|
|
|
+ box.box.dimensions = new Cesium.Cartesian3(
|
|
|
|
+ this.form.width,
|
|
|
|
+ this.form.height,
|
|
|
|
+ 0.1
|
|
|
|
+ );
|
|
|
|
+ box.position = boxPosition;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ updateClip() {
|
|
|
|
+ console.log(layers, "llll");
|
|
|
|
+ // layers.setCustomClipPlane(pos[0], pos[1], pos[2]);
|
|
|
|
+ layers.setCustomClipCross({
|
|
|
|
+ position: pos,
|
|
|
|
+ dimensions: new Cesium.Cartesian3(
|
|
|
|
+ this.form.width,
|
|
|
|
+ this.form.height,
|
|
|
|
+ this.form.extrudeDistance
|
|
|
|
+ ),
|
|
|
|
+ heading: this.form.heading,
|
|
|
|
+ pitch: this.form.pitch,
|
|
|
|
+ roll: this.form.roll,
|
|
|
|
+ extrudeDistance: this.form.extrudeDistance,
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- getBuffer() {},
|
|
|
|
clear() {
|
|
clear() {
|
|
- // BIMLayer.clearCustomClipBox();
|
|
|
|
|
|
+ if (box) box.show = false;
|
|
|
|
+ // layers.clearCustomClipBox();
|
|
|
|
+ layers.clearCustomClipBox();
|
|
|
|
+ // viewer.entities.removeAll();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
@@ -56,4 +222,7 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+.inputwidth {
|
|
|
|
+ width: calc(100% - 10px);
|
|
|
|
+}
|
|
</style>
|
|
</style>
|