@ -12,6 +12,8 @@ import { BuildingStatus } from 'src/app/babylon/controller/status/building-statu
import { BuildingUIItem } from 'src/app/babylon/view/building-window/building-ui-item' ;
import { BuildingType } from 'src/app/babylon/model/data/institution/building/building-data' ;
import { BuildingWindow } from 'src/app/babylon/view/building-window/building-window' ;
import { FacilityUIItem } from 'src/app/babylon/view/facility-window/facility-ui-item' ;
import { FacilityWindow } from 'src/app/babylon/view/facility-window/facility-window' ;
@ -124,6 +126,12 @@ export class PlanComponent implements OnInit {
this . editBuildingPop = e ; //打开弹窗
}
//聚焦 建筑
positionModelBuilding ( event , e : BuildingUIItem ) {
event . stopPropagation ( )
e . lookAt ( )
}
//删除建筑
deleteModelBuilding ( event , e : BuildingUIItem ) {
event . stopPropagation ( )
@ -136,6 +144,79 @@ export class PlanComponent implements OnInit {
}
}
allFacilityUIItemes : FacilityUIItem [ ] = [ ] ; //底部所有 图标
beforeOneIcon : string = null ; //当前选择 图标
// 获取 底部图标栏list
getAllIcons ( e : FacilityWindow ) {
this . allFacilityUIItemes = e . allFacilityUIItemes
this . beforeOneIcon = null
}
//选择底部图标
selectBottomIcon ( e : FacilityUIItem ) {
if ( this . beforeOneIcon != e . getIconID ( ) ) {
this . beforeOneIcon = e . getIconID ( )
e . select ( )
} else {
this . beforeOneIcon = null
e . unSelect ( )
}
}
//取消选择 底部图标
unSelectBottomIcon() {
if ( this . beforeOneIcon ) {
let e : FacilityUIItem = this . allFacilityUIItemes . find ( item = > { return item . getIconID ( ) === this . beforeOneIcon } )
e ? e . unSelect ( ) : null
this . beforeOneIcon = null
}
}
//底部图标栏 滚动条
bottomScroll ( e ) {
let bootomDiv = this . element . nativeElement . querySelector ( '#bottomCenter' )
e == 0 ? bootomDiv . scrollLeft = bootomDiv . scrollLeft + 50 : bootomDiv.scrollLeft = bootomDiv . scrollLeft - 50
}
selectRightTopFast : number = 0 ; //当前选择功能 快捷栏
selectAdsorb : boolean = false ; //吸附状态
topLevelView : boolean = false ; //顶视图状态
//平移
translation() {
this . selectRightTopFast = 0
ToolbarWindow . instance . changeGizmoType_position ( ) ;
}
//旋转
revolve() {
this . selectRightTopFast = 1
ToolbarWindow . instance . changeGizmoType_Rotation ( ) ;
}
//缩放
scale() {
this . selectRightTopFast = 2
ToolbarWindow . instance . changeGizmoType_Scale ( ) ;
}
//吸附
adsorb() {
ToolbarWindow . instance . changeMeshAdsorbY ( ) ;
}
//获取吸附的状态
updateSelectAdsorb() {
this . selectAdsorb = ToolbarWindow . instance . isMeshAdsorb ;
}
//切换至顶视图
toggleTopLevelView() {
this . topLevelView = ! this . topLevelView
ToolbarWindow . instance . changeTopView ( this . topLevelView )
}
//保存
preserve() {
ToolbarWindow . instance . onBtnSave ( ) ;