刘向辉 3 years ago
parent
commit
ccb2d0d2d3
  1. 4
      src/app/babylon/model/info/model/model-info.ts
  2. 3
      src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts
  3. 10
      src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

4
src/app/babylon/model/info/model/model-info.ts

@ -10,13 +10,10 @@ import {
} from '@babylonjs/core'; } from '@babylonjs/core';
import { Button, Rectangle, Vector2WithInfo } from '@babylonjs/gui'; import { Button, Rectangle, Vector2WithInfo } from '@babylonjs/gui';
import { classToClass } from 'class-transformer'; import { classToClass } from 'class-transformer';
import { SceneManager } from 'src/app/babylon/controller/scene-manager';
import { UIManager } from 'src/app/babylon/controller/ui-manager'; import { UIManager } from 'src/app/babylon/controller/ui-manager';
import { BabylonTool } from 'src/app/babylon/tool/babylon-tool'; import { BabylonTool } from 'src/app/babylon/tool/babylon-tool';
import { BabylonUIStyleTool } from 'src/app/babylon/tool/babylon-ui-style-tool';
import { GizmoTool } from 'src/app/babylon/tool/gizmo-tool'; import { GizmoTool } from 'src/app/babylon/tool/gizmo-tool';
import { TsTool } from 'src/app/babylon/tool/ts-tool'; import { TsTool } from 'src/app/babylon/tool/ts-tool';
import { isRegularExpressionLiteral } from 'typescript';
import { ModelData } from '../../data/model-data/model-data'; import { ModelData } from '../../data/model-data/model-data';
@ -316,6 +313,7 @@ export class ModelInfo {
getHeadUIPos() { getHeadUIPos() {
let result: Vector2 = null; let result: Vector2 = null;
if (this.uiFollowRoot != null) { if (this.uiFollowRoot != null) {
result = new Vector2();
result.x = this.uiFollowRoot.leftInPixels; result.x = this.uiFollowRoot.leftInPixels;
result.y = this.uiFollowRoot.topInPixels; result.y = this.uiFollowRoot.topInPixels;
} }

3
src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts

@ -1,4 +1,5 @@
import { Vector2 } from "@babylonjs/core";
import { SceneManager } from "../../controller/scene-manager"; import { SceneManager } from "../../controller/scene-manager";
import { PropertyData_Base } from "../../model/data/institution/facility/property-data/property-data-base"; import { PropertyData_Base } from "../../model/data/institution/facility/property-data/property-data-base";
import { FacilityType, ModelData_facility } from "../../model/data/model-data/model-data-facility"; import { FacilityType, ModelData_facility } from "../../model/data/model-data/model-data-facility";
@ -137,7 +138,7 @@ export class FacilityInfoUIItem {
/** /**
* UI的位置 * UI的位置
*/ */
getHeadUIPos() { getHeadUIPos(): Vector2 {
if (this.modelInfo != null) { if (this.modelInfo != null) {
return this.modelInfo.getHeadUIPos(); return this.modelInfo.getHeadUIPos();
} }

10
src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

@ -466,7 +466,9 @@ export class FacilityInfoInSceneWindow extends UIBase {
selectJYJFrom3D(pickInfo: PickingInfo) { selectJYJFrom3D(pickInfo: PickingInfo) {
if (this.currentSelectJYJInfo != null) { if (this.currentSelectJYJInfo != null) {
this.playJYJSelectEffect(false, this.currentSelectJYJInfo); let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(this.currentSelectJYJInfo);
facilityItem.onSelect(false);
// this.playJYJSelectEffect(false, this.currentSelectJYJInfo);
this.currentSelectJYJInfo = null; this.currentSelectJYJInfo = null;
} }
@ -511,10 +513,12 @@ export class FacilityInfoInSceneWindow extends UIBase {
if (result != null) { if (result != null) {
this.playJYJSelectEffect(true, result); //this.playJYJSelectEffect(true, result);
let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(result); let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(result);
console.log("场景中选中设备", facilityItem); //通知前端 console.log("场景中选中设备", facilityItem); //通知前端
FacilityInfoInSceneWindow.instance.selectFacilityItemToThree([facilityItem], true); facilityItem.onSelect(true);
//FacilityInfoInSceneWindow.instance.selectFacilityItemToThree([facilityItem], true);
//console.log(facilityItem.getHeadUIPos());
} }
} }

Loading…
Cancel
Save