File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bim-fragment" ,
3
- "version" : " 1.3.20 " ,
3
+ "version" : " 1.3.22 " ,
4
4
"description" : " 3D BIM Geometry API" ,
5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -7516,6 +7516,28 @@ class FragmentsGroup extends THREE.Group {
7516
7516
this . items = [ ] ;
7517
7517
this . ifcCivil = undefined ;
7518
7518
}
7519
+ setProperties ( properties ) {
7520
+ this . _properties = properties ;
7521
+ }
7522
+ getAllIDs ( ) {
7523
+ if ( this . _properties ) {
7524
+ return Object . keys ( this . _properties ) . map ( ( id ) => parseInt ( id , 10 ) ) ;
7525
+ }
7526
+ return Array . from ( this . streamSettings . ids . keys ( ) ) ;
7527
+ }
7528
+ getAllTypes ( ) {
7529
+ if ( this . _properties ) {
7530
+ const types = new Set ( ) ;
7531
+ for ( const id in this . _properties ) {
7532
+ const property = this . _properties [ id ] ;
7533
+ if ( property . type !== undefined ) {
7534
+ types . add ( property . type ) ;
7535
+ }
7536
+ }
7537
+ return Array . from ( types ) ;
7538
+ }
7539
+ return Array . from ( this . streamSettings . types . keys ( ) ) ;
7540
+ }
7519
7541
getProperties ( id ) {
7520
7542
if ( ! this . _properties ) {
7521
7543
throw new Error ( "Properties not initialized!" ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,31 @@ export class FragmentsGroup extends THREE.Group {
77
77
this . ifcCivil = undefined ;
78
78
}
79
79
80
+ setProperties ( properties : IfcProperties ) {
81
+ this . _properties = properties ;
82
+ }
83
+
84
+ getAllIDs ( ) {
85
+ if ( this . _properties ) {
86
+ return Object . keys ( this . _properties ) . map ( ( id ) => parseInt ( id , 10 ) ) ;
87
+ }
88
+ return Array . from ( this . streamSettings . ids . keys ( ) ) ;
89
+ }
90
+
91
+ getAllTypes ( ) {
92
+ if ( this . _properties ) {
93
+ const types = new Set < number > ( ) ;
94
+ for ( const id in this . _properties ) {
95
+ const property = this . _properties [ id ] ;
96
+ if ( property . type !== undefined ) {
97
+ types . add ( property . type ) ;
98
+ }
99
+ }
100
+ return Array . from ( types ) ;
101
+ }
102
+ return Array . from ( this . streamSettings . types . keys ( ) ) ;
103
+ }
104
+
80
105
getProperties ( id : number ) : IfcProperties | null {
81
106
if ( ! this . _properties ) {
82
107
throw new Error ( "Properties not initialized!" ) ;
You can’t perform that action at this time.
0 commit comments