修改
This commit is contained in:
@ -2,7 +2,7 @@ import Tools from "../../../Tools";
|
||||
class Section extends Tools {
|
||||
/**
|
||||
* @constructor 剖切
|
||||
* @param sdk
|
||||
* @param sdk
|
||||
* @param tiles3d {object} 3dtiles对象
|
||||
* @param {Array.<object>} options.positions 经纬度[{lon,lat,alt},...]
|
||||
* @param options.regionsType=false 裁剪类型 false:裁剪内部,true:裁剪外部
|
||||
@ -17,6 +17,7 @@ class Section extends Tools {
|
||||
this.options.regionsType = this.options.regionsType || false
|
||||
YJ.Analysis.SectionResults.push(this)
|
||||
this.Planes = []
|
||||
this.tools = new Tools();
|
||||
Section.start(this)
|
||||
}
|
||||
|
||||
@ -33,12 +34,13 @@ class Section extends Tools {
|
||||
|
||||
static start(that) {
|
||||
let positions = that.options.positions || []
|
||||
if(!that.isConvex(positions)) {
|
||||
window.ELEMENT && window.ELEMENT.Message({
|
||||
message: '不支持凹多边形',
|
||||
type: 'warning',
|
||||
duration: 1500
|
||||
});
|
||||
if (!that.isConvex(positions)) {
|
||||
// window.ELEMENT && window.ELEMENT.Message({
|
||||
// message: '不支持凹多边形',
|
||||
// type: 'warning',
|
||||
// duration: 1500
|
||||
// });
|
||||
that.tools.message({ type: 'warning', text: '不支持凹多边形' })
|
||||
console.log('不支持凹多边形')
|
||||
return
|
||||
}
|
||||
@ -87,13 +89,13 @@ class Section extends Tools {
|
||||
}
|
||||
}
|
||||
|
||||
if(that.tiles3d.clippingPlanes) {
|
||||
if (that.tiles3d.clippingPlanes) {
|
||||
that.tiles3d.clippingPlanes.removeAll()
|
||||
for(let i=0;i<that.Planes.length;i++) {
|
||||
for (let i = 0; i < that.Planes.length; i++) {
|
||||
that.tiles3d.clippingPlanes.add(that.Planes[i])
|
||||
}
|
||||
that.tiles3d.clippingPlanes.enabled = true
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
const PlaneCollection = new Cesium.ClippingPlaneCollection({
|
||||
@ -135,11 +137,11 @@ class Section extends Tools {
|
||||
destroy() {
|
||||
this.Planes = []
|
||||
// this.tiles3d.clippingPlanes = new Cesium.ClippingPlaneCollection()
|
||||
if(this.tiles3d.clippingPlanes) {
|
||||
if (this.tiles3d.clippingPlanes) {
|
||||
this.tiles3d.clippingPlanes.enabled = false
|
||||
this.tiles3d.clippingPlanes.removeAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Section;
|
||||
export default Section;
|
||||
|
||||
@ -158,7 +158,8 @@ class TerrainExcavation extends Tools {
|
||||
return
|
||||
}
|
||||
if (!this.isConvex(positions)) {
|
||||
this.tools.message({ type: 'warning', text: '至少拥有三个坐标位置!' })
|
||||
// this.tools.message({ type: 'warning', text: '至少拥有三个坐标位置!' })
|
||||
this.tools.message({ type: 'warning', text: '不支持凹多边形' })
|
||||
console.log('不支持凹多边形')
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user