| | |
| | | Nowheight: 5, |
| | | Nowrotate: 0, |
| | | beginBOXTailoring: function (pro) { |
| | | console.log(`${this.name}--kaishi`); |
| | | // console.log(`${this.name}--kaishi`); |
| | | $("#beginBOXTailoringG").unbind("click"); |
| | | $("#customBOXTailoring").unbind("click"); |
| | | $("#clearboxBOXTailoring").unbind("click"); |
| | | var that = this; |
| | | |
| | | var heardsname = $('#namebarBOXTailoring'); |
| | | heardsname.empty(); |
| | | heardsname.append(pro.ZName); |
| | | heardsname = $('#heardbarBOXTailoring'); |
| | | heardsname.attr("title", pro.ZName);; |
| | | |
| | | var promise = window.mySanweiShujuOpens[pro.id]; |
| | | // var promise = window.mySanweiShujuOpens; |
| | | // console.log(pro.ZName); |
| | |
| | | , Nowheight = that.Nowheight |
| | | , Nowrotate = that.Nowrotate; |
| | | var tooltip = window.MYcreateTooltip(document.body); |
| | | var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); |
| | | that.handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); |
| | | var isBegin = false;//设置不重复添加盒子 |
| | | |
| | | $('#beginBOXTailoringG').click(() => { |
| | |
| | | |
| | | |
| | | |
| | | handler.setInputAction(function (evt) { |
| | | that.handler.setInputAction(function (evt) { |
| | | tooltip.showAt(evt.endPosition, '<p>点击模型,添加裁剪盒子</p>'); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | |
| | | handler.setInputAction(function (evt) { |
| | | that.handler.setInputAction(function (evt) { |
| | | var clipMode = $clipMode.val(); |
| | | var length = Number(Nowlength); |
| | | var width = Number(Nowwidth); |
| | |
| | | }); |
| | | setAllLayersClipOptions(boxOption); |
| | | tooltip.setVisible(false); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | |
| | | }) |
| | |
| | | if (!boxEntity) { |
| | | return; |
| | | } |
| | | // console.log(135.4135) |
| | | if (!isBegin) { |
| | | layer.tips('请先添加盒子', '#beginBOXTailoringG', { |
| | | tips: [3, 'red'] |
| | | }); |
| | | return false; |
| | | } |
| | | handler.setInputAction( |
| | | that.handler.setInputAction( |
| | | function (movement) { |
| | | tooltip.showAt(movement.endPosition, '<p>点击模型,移动裁剪盒子</p>'); |
| | | var cartesian = viewer.scene.pickPosition(movement.startPosition); |
| | | boxEntity.position = cartesian; |
| | | handler.setInputAction(function (evt) { |
| | | that.handler.setInputAction(function (evt) { |
| | | setClipBox(); |
| | | tooltip.setVisible(false); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE |
| | | ); |
| | |
| | | that.closesBOXTailoring(); |
| | | }); |
| | | |
| | | handler.setInputAction(function () { |
| | | that.handler.setInputAction(function () { |
| | | setClipBox(); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK); |
| | | }, Cesium.ScreenSpaceEventType.RIGHT_CLICK); |
| | | $clipMode.change(function () { |
| | | setClipBox(); |
| | |
| | | |
| | | }, |
| | | promise: 'null', |
| | | handler: 'null', |
| | | closesBOXTailoring: function (froms) { |
| | | console.log(`${this.name}--guanbi`); |
| | | // console.log(`${this.name}--guanbi`); |
| | | var that = this; |
| | | if (that.promise != 'null') { |
| | | Cesium.when(that.promise, function (layers) { |
| | |
| | | that.defaultLayui(); |
| | | }) |
| | | } |
| | | if (that.handler != 'null') { |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | that.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK); |
| | | } |
| | | |
| | | }, |
| | | onOpen: function () { |