@@ -9,21 +9,36 @@ export class IfcManager {
99 private caster : IFCRaycaster ;
1010 private scene : THREE . Scene ;
1111 private preselection : IfcSelection ;
12- // private selection: IfcSelection;
12+ private selection : IfcSelection ;
13+
1314 private preselectMat = new THREE . MeshLambertMaterial ( {
1415 color : 0xffccff ,
1516 transparent : true ,
1617 opacity : 0.5 ,
17- depthTest : false
18- } ) ;
18+ depthTest : false ,
19+ side : THREE . DoubleSide
20+ } ) ;
21+
22+ private selectMat = new THREE . MeshLambertMaterial ( {
23+ color : 0xff33ff ,
24+ transparent : true ,
25+ opacity : 0.3 ,
26+ depthTest : false ,
27+ side : THREE . DoubleSide
28+ } ) ;
1929
20- constructor ( ifc_objects : THREE . Object3D [ ] , scene : THREE . Scene , camera : THREE . PerspectiveCamera , mouse : THREE . Vector2 ) {
30+ constructor (
31+ ifc_objects : THREE . Object3D [ ] ,
32+ scene : THREE . Scene ,
33+ camera : THREE . PerspectiveCamera ,
34+ mouse : THREE . Vector2
35+ ) {
2136 this . loader = new IFCLoader ( ) ;
2237 this . models = ifc_objects ;
2338 this . scene = scene ;
2439 this . caster = new IFCRaycaster ( this . models , camera , mouse ) ;
2540 this . preselection = new IfcSelection ( this . loader , this . scene , this . preselectMat ) ;
26- // this.selection = new IfcSelection(this.loader, this.models );
41+ this . selection = new IfcSelection ( this . loader , this . scene , this . selectMat ) ;
2742 }
2843
2944 async loadIfc ( file : File , scene : THREE . Scene ) {
@@ -43,6 +58,7 @@ export class IfcManager {
4358 this . caster . castRay ( event , this . preselection . select ) ;
4459 }
4560
46-
47- setModelDisplay ( ) { }
61+ select ( event : any ) {
62+ this . caster . castRay ( event , this . selection . selectProps ) ;
63+ }
4864}
0 commit comments