diff --git a/firebird-ng/src/app/geometry-tree/geometry-tree.component.ts b/firebird-ng/src/app/geometry-tree/geometry-tree.component.ts index b7a3f6a..e70bdc5 100644 --- a/firebird-ng/src/app/geometry-tree/geometry-tree.component.ts +++ b/firebird-ng/src/app/geometry-tree/geometry-tree.component.ts @@ -14,6 +14,12 @@ import {MatIcon, MatIconModule} from '@angular/material/icon'; import {MatButtonModule, MatIconButton} from '@angular/material/button'; import {GeometryService} from "../geometry.service"; import {Object3D} from "three"; +import {EventDisplayService} from "phoenix-ui-components"; +import {GameControllerService} from "../game-controller.service"; +import {ActivatedRoute} from "@angular/router"; +import {UserConfigService} from "../user-config.service"; +import {MatSnackBar} from "@angular/material/snack-bar"; +import {PhoenixThreeFacade} from "../utils/phoenix-three-facade"; /** * Food data with nested structure. @@ -100,24 +106,34 @@ export class GeometryTreeComponent implements OnInit{ hasChild = (_: number, node: ExampleFlatNode) => node.expandable; + private threeFacade: PhoenixThreeFacade; + + constructor(private geomService: GeometryService, + private eventDisplay: EventDisplayService) { + //this.dataSource.data = TREE_DATA; + this.threeFacade = new PhoenixThreeFacade(this.eventDisplay); + - constructor(private geomService: GeometryService) { - //this.dataSource.data = TREE_DATA; } ngOnInit(): void { - if(!this.geomService.geometry) this.geomService.loadGeometry().then(result => { - if(result.threeGeometry) { - this.dataSource.data = result.threeGeometry.children; - } - else { - console.error("this.geomService.loadGeometry() ! result.threeGeometry"); - } - }).catch(reason=>{ - console.error("ERROR LOADING GEOMETRY"); - console.log(reason); - }); - } + + // if (!this.geomService.geometry) { + // this.geomService.loadGeometry() + // .then(result => { + // if (result.threeGeometry) { + // this.dataSource.data = result.threeGeometry.children; + // } else { + // console.error("this.geomService.loadGeometry() ! result.threeGeometry"); + // } + // }) + // .catch(reason => { + // console.error("ERROR LOADING GEOMETRY"); + // console.log(reason); + // }); + // } + this.dataSource.data = this.threeFacade.scene.children; + } toggleVisibility(node: ExampleFlatNode) { this.geomService.toggleVisibility(node.object3D);