|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Component, OnInit, ElementRef, ViewChild, AfterViewInit, Input } from '@angular/core'; |
|
|
|
import { Component, OnInit, ElementRef, ViewChild, AfterViewInit, Input, OnDestroy } from '@angular/core'; |
|
|
|
import * as PIXI from 'pixi.js'; |
|
|
|
import * as PIXI from 'pixi.js'; |
|
|
|
import { EventEmitter } from 'events'; |
|
|
|
import { EventEmitter } from 'events'; |
|
|
|
import { EventManager } from '@angular/platform-browser'; |
|
|
|
import { EventManager } from '@angular/platform-browser'; |
|
|
@ -32,7 +32,7 @@ import { EVENT_SELECTION_CHANGED } from './model/events'; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 工作区 |
|
|
|
* 工作区 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterViewInit { |
|
|
|
export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterViewInit,OnDestroy { |
|
|
|
|
|
|
|
|
|
|
|
constructor(private eventManager: EventManager, public canvasData: CanvasShareDataService) { |
|
|
|
constructor(private eventManager: EventManager, public canvasData: CanvasShareDataService) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
@ -87,7 +87,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 选择器 |
|
|
|
* 选择器 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public readonly selection: AxSelection = new AxSelection(); |
|
|
|
public selection: AxSelection = new AxSelection(); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 当前鼠标的点 |
|
|
|
* 当前鼠标的点 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -157,7 +157,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
* RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 |
|
|
|
* RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。 |
|
|
|
* Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 |
|
|
|
* Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public VERSION = '1.0.16.20210203_beta'; |
|
|
|
public VERSION = '1.0.17.20210204_beta'; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 数据初始化 |
|
|
|
* 数据初始化 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -165,18 +165,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
PIXI.utils.skipHello(); |
|
|
|
PIXI.utils.skipHello(); |
|
|
|
this.sayHello(); |
|
|
|
this.sayHello(); |
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
// event.stopPropagation();
|
|
|
|
|
|
|
|
// if (event.keyCode === 17) {
|
|
|
|
|
|
|
|
// this.isCtrlKeyClicked = true;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => { |
|
|
|
this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => { |
|
|
|
// event.stopPropagation();
|
|
|
|
|
|
|
|
// if (event.keyCode === 17) {
|
|
|
|
|
|
|
|
// this.isCtrlKeyClicked = false;
|
|
|
|
|
|
|
|
// this.rectToolGraphics.visible = false;
|
|
|
|
|
|
|
|
// this.rectToolGraphics.clear();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 按Del键删除选中的图标
|
|
|
|
// 按Del键删除选中的图标
|
|
|
|
if (event.keyCode === 46) { |
|
|
|
if (event.keyCode === 46) { |
|
|
|
this.deleteSelectedShape(); |
|
|
|
this.deleteSelectedShape(); |
|
|
@ -184,6 +175,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
ngOnDestroy(): void { |
|
|
|
ngOnDestroy(): void { |
|
|
|
|
|
|
|
this.selection.clear(); |
|
|
|
this.camera2D.destroy(); |
|
|
|
this.camera2D.destroy(); |
|
|
|
this.app.destroy(); |
|
|
|
this.app.destroy(); |
|
|
|
} |
|
|
|
} |
|
|
@ -506,11 +498,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
* 创建图标事件(数据处理) |
|
|
|
* 创建图标事件(数据处理) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
this.on('createIcon', (axShape: AxShape) => { |
|
|
|
this.on('createIcon', (axShape: AxShape) => { |
|
|
|
console.log('新增图标:' + axShape.assetData.Name); |
|
|
|
|
|
|
|
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
|
|
|
|
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
|
|
|
|
// 添加楼层数据
|
|
|
|
// 添加楼层数据
|
|
|
|
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
console.log(this.canvasData.originaleveryStoreyData); |
|
|
|
|
|
|
|
// 添加建筑数据
|
|
|
|
// 添加建筑数据
|
|
|
|
this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id] = axShape.assetData; |
|
|
|
} else if (axShape.assetData.GameMode === GameMode.Assignment) { // 处置预案
|
|
|
|
} else if (axShape.assetData.GameMode === GameMode.Assignment) { // 处置预案
|
|
|
@ -592,7 +582,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public refreshIcon(id: string): void { |
|
|
|
public refreshIcon(id: string): void { |
|
|
|
const icon = this.backgroundImage.children.find(item => item.name === id); |
|
|
|
const icon = this.backgroundImage.children.find(item => item.name === id); |
|
|
|
// console.log(icon);
|
|
|
|
|
|
|
|
if (icon instanceof AxImageShape) { |
|
|
|
if (icon instanceof AxImageShape) { |
|
|
|
icon.refresh(); |
|
|
|
icon.refresh(); |
|
|
|
} else if (icon instanceof MultipointIcon) { |
|
|
|
} else if (icon instanceof MultipointIcon) { |
|
|
@ -731,7 +720,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
this.backgroundImage |
|
|
|
this.backgroundImage |
|
|
|
.on('pointerdown', event => { |
|
|
|
.on('pointerdown', event => { |
|
|
|
if (event.data.button !== 0) { return; } |
|
|
|
if (event.data.button !== 0) { return; } |
|
|
|
// console.log(this.backgroundImage.toLocal(this.mousePosition));
|
|
|
|
|
|
|
|
if (this.isCtrlKeyClicked === false) { |
|
|
|
if (this.isCtrlKeyClicked === false) { |
|
|
|
switch (this.paintMode) { |
|
|
|
switch (this.paintMode) { |
|
|
|
case PaintMode.endPaint: |
|
|
|
case PaintMode.endPaint: |
|
|
@ -1250,7 +1238,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
* 开始绘制 |
|
|
|
* 开始绘制 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public beginPaint() { |
|
|
|
public beginPaint() { |
|
|
|
console.log(this.canvasData.selectTemplateData); |
|
|
|
|
|
|
|
this.deselectAll(); |
|
|
|
this.deselectAll(); |
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
this.setPaintMode(PaintMode.endPaint); |
|
|
|
this.setPaintMode(this.canvasData.selectTemplateData.interactiveMode); |
|
|
|
this.setPaintMode(this.canvasData.selectTemplateData.interactiveMode); |
|
|
@ -1342,7 +1329,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV |
|
|
|
private enterPaint(): void { |
|
|
|
private enterPaint(): void { |
|
|
|
this.previewLineSegment.visible = false; |
|
|
|
this.previewLineSegment.visible = false; |
|
|
|
this.enterPaintEndButton.visible = false; |
|
|
|
this.enterPaintEndButton.visible = false; |
|
|
|
console.log(this.paintMode); |
|
|
|
|
|
|
|
switch (this.paintMode) { |
|
|
|
switch (this.paintMode) { |
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
case PaintMode.singlePointIcon: |
|
|
|
break; |
|
|
|
break; |
|
|
|