Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gen ifc #63

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ifc/ifc4_gen/IfcActor.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ export class IfcActor extends IfcObject {

public get TheActor() : IfcOrganization | IfcPerson | IfcPersonAndOrganization {
if ( this.TheActor_ === void 0 ) {
this.TheActor_ = this.extractLambda( 5, (buffer, cursor, endCursor) => {

const value : StepEntityBase< EntityTypesIfc > | undefined =
this.extractBufferReference( buffer, cursor, endCursor )

const value : StepEntityBase< EntityTypesIfc > =
this.extractReference( 5, false )

if ( !( value instanceof IfcOrganization ) && !( value instanceof IfcPerson ) && !( value instanceof IfcPersonAndOrganization ) ) {
return ( void 0 )
throw new Error( 'Value in STEP was incorrectly typed for field' )
}
return value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)
}, false )

this.TheActor_ = value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)

}

return this.TheActor_ as IfcOrganization | IfcPerson | IfcPersonAndOrganization
Expand Down
41 changes: 24 additions & 17 deletions src/ifc/ifc4_gen/IfcAdvancedBrepWithVoids.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { IfcAdvancedBrep } from "./index"
import { IfcClosedShell } from "./index"
import {
stepExtractArray,
stepExtractArrayToken,
stepExtractArrayBegin,
skipValue,
} from '../../step/parsing/step_deserialization_functions'

/* This is generated code, don't modify */
Expand All @@ -21,23 +23,28 @@ export class IfcAdvancedBrepWithVoids extends IfcAdvancedBrep {

public get Voids() : Array<IfcClosedShell> {
if ( this.Voids_ === void 0 ) {
this.Voids_ = this.extractLambda( 1, (buffer, cursor, endCursor) => {

let value : Array<IfcClosedShell> = [];

for ( let address of stepExtractArray( buffer, cursor, endCursor ) ) {
value.push( (() => {
const cursor = address
let value = this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcClosedShell ) ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}

return value
})() )

let cursor = this.getOffsetCursor( 1 )
const buffer = this.buffer
const endCursor = buffer.length

const value : Array<IfcClosedShell> = []

let signedCursor0 = stepExtractArrayBegin( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )

while ( signedCursor0 >= 0 ) {
const value1 = this.extractBufferElement( buffer, cursor, endCursor, IfcClosedShell )
if ( value1 === void 0 ) {
throw new Error( 'Value in STEP was incorrectly typed' )
}
cursor = skipValue( buffer, cursor, endCursor )
value.push( value1 )
signedCursor0 = stepExtractArrayToken( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )
}
return value }, false )

this.Voids_ = value
}

return this.Voids_ as Array<IfcClosedShell>
Expand Down
37 changes: 22 additions & 15 deletions src/ifc/ifc4_gen/IfcAnnotationFillArea.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { IfcGeometricRepresentationItem } from "./index"
import { IfcCurve } from "./index"
import {
stepExtractOptional,
stepExtractArray,
stepExtractArrayToken,
stepExtractArrayBegin,
skipValue,
} from '../../step/parsing/step_deserialization_functions'

/* This is generated code, don't modify */
Expand Down Expand Up @@ -31,27 +33,32 @@ export class IfcAnnotationFillArea extends IfcGeometricRepresentationItem {

public get InnerBoundaries() : Array<IfcCurve> | null {
if ( this.InnerBoundaries_ === void 0 ) {
this.InnerBoundaries_ = this.extractLambda( 1, (buffer, cursor, endCursor) => {

let cursor = this.getOffsetCursor( 1 )
const buffer = this.buffer
const endCursor = buffer.length

if ( stepExtractOptional( buffer, cursor, endCursor ) === null ) {
return null
}

let value : Array<IfcCurve> = [];
const value : Array<IfcCurve> = []

for ( let address of stepExtractArray( buffer, cursor, endCursor ) ) {
value.push( (() => {
const cursor = address
let value = this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcCurve ) ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}

return value
})() )
let signedCursor0 = stepExtractArrayBegin( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )

while ( signedCursor0 >= 0 ) {
const value1 = this.extractBufferElement( buffer, cursor, endCursor, IfcCurve )
if ( value1 === void 0 ) {
throw new Error( 'Value in STEP was incorrectly typed' )
}
cursor = skipValue( buffer, cursor, endCursor )
value.push( value1 )
signedCursor0 = stepExtractArrayToken( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )
}
return value }, true )

this.InnerBoundaries_ = value
}

return this.InnerBoundaries_ as Array<IfcCurve> | null
Expand Down
55 changes: 31 additions & 24 deletions src/ifc/ifc4_gen/IfcAppliedValue.gen.ts

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions src/ifc/ifc4_gen/IfcApproval.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,33 @@ export class IfcApproval extends StepEntityBase< EntityTypesIfc > {

public get RequestingApproval() : IfcOrganization | IfcPerson | IfcPersonAndOrganization | null {
if ( this.RequestingApproval_ === void 0 ) {
this.RequestingApproval_ = this.extractLambda( 7, (buffer, cursor, endCursor) => {

const value : StepEntityBase< EntityTypesIfc >| null =
this.extractReference( 7, true )

const value : StepEntityBase< EntityTypesIfc > | undefined =
this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcOrganization ) && !( value instanceof IfcPerson ) && !( value instanceof IfcPersonAndOrganization ) ) {
return ( void 0 )
if ( !( value instanceof IfcOrganization ) && !( value instanceof IfcPerson ) && !( value instanceof IfcPersonAndOrganization ) && value !== null ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}
return value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)
}, true )

this.RequestingApproval_ = value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)

}

return this.RequestingApproval_ as IfcOrganization | IfcPerson | IfcPersonAndOrganization | null
}

public get GivingApproval() : IfcOrganization | IfcPerson | IfcPersonAndOrganization | null {
if ( this.GivingApproval_ === void 0 ) {
this.GivingApproval_ = this.extractLambda( 8, (buffer, cursor, endCursor) => {

const value : StepEntityBase< EntityTypesIfc >| null =
this.extractReference( 8, true )

const value : StepEntityBase< EntityTypesIfc > | undefined =
this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcOrganization ) && !( value instanceof IfcPerson ) && !( value instanceof IfcPersonAndOrganization ) ) {
return ( void 0 )
if ( !( value instanceof IfcOrganization ) && !( value instanceof IfcPerson ) && !( value instanceof IfcPersonAndOrganization ) && value !== null ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}
return value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)
}, true )

this.GivingApproval_ = value as (IfcOrganization | IfcPerson | IfcPersonAndOrganization)

}

return this.GivingApproval_ as IfcOrganization | IfcPerson | IfcPersonAndOrganization | null
Expand Down
37 changes: 22 additions & 15 deletions src/ifc/ifc4_gen/IfcApprovalRelationship.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { IfcResourceLevelRelationship } from "./index"
import { IfcApproval } from "./index"
import {
stepExtractArray,
stepExtractArrayToken,
stepExtractArrayBegin,
skipValue,
} from '../../step/parsing/step_deserialization_functions'

/* This is generated code, don't modify */
Expand Down Expand Up @@ -30,23 +32,28 @@ export class IfcApprovalRelationship extends IfcResourceLevelRelationship {

public get RelatedApprovals() : Array<IfcApproval> {
if ( this.RelatedApprovals_ === void 0 ) {
this.RelatedApprovals_ = this.extractLambda( 3, (buffer, cursor, endCursor) => {

let cursor = this.getOffsetCursor( 3 )
const buffer = this.buffer
const endCursor = buffer.length

let value : Array<IfcApproval> = [];
const value : Array<IfcApproval> = []

for ( let address of stepExtractArray( buffer, cursor, endCursor ) ) {
value.push( (() => {
const cursor = address
let value = this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcApproval ) ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}

return value
})() )
let signedCursor0 = stepExtractArrayBegin( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )

while ( signedCursor0 >= 0 ) {
const value1 = this.extractBufferElement( buffer, cursor, endCursor, IfcApproval )
if ( value1 === void 0 ) {
throw new Error( 'Value in STEP was incorrectly typed' )
}
cursor = skipValue( buffer, cursor, endCursor )
value.push( value1 )
signedCursor0 = stepExtractArrayToken( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )
}
return value }, false )

this.RelatedApprovals_ = value
}

return this.RelatedApprovals_ as Array<IfcApproval>
Expand Down
41 changes: 24 additions & 17 deletions src/ifc/ifc4_gen/IfcArbitraryProfileDefWithVoids.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { IfcArbitraryClosedProfileDef } from "./index"
import { IfcCurve } from "./index"
import {
stepExtractArray,
stepExtractArrayToken,
stepExtractArrayBegin,
skipValue,
} from '../../step/parsing/step_deserialization_functions'

/* This is generated code, don't modify */
Expand All @@ -21,23 +23,28 @@ export class IfcArbitraryProfileDefWithVoids extends IfcArbitraryClosedProfileD

public get InnerCurves() : Array<IfcCurve> {
if ( this.InnerCurves_ === void 0 ) {
this.InnerCurves_ = this.extractLambda( 3, (buffer, cursor, endCursor) => {

let value : Array<IfcCurve> = [];

for ( let address of stepExtractArray( buffer, cursor, endCursor ) ) {
value.push( (() => {
const cursor = address
let value = this.extractBufferReference( buffer, cursor, endCursor )

if ( !( value instanceof IfcCurve ) ) {
throw new Error( 'Value in STEP was incorrectly typed for field' )
}

return value
})() )

let cursor = this.getOffsetCursor( 3 )
const buffer = this.buffer
const endCursor = buffer.length

const value : Array<IfcCurve> = []

let signedCursor0 = stepExtractArrayBegin( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )

while ( signedCursor0 >= 0 ) {
const value1 = this.extractBufferElement( buffer, cursor, endCursor, IfcCurve )
if ( value1 === void 0 ) {
throw new Error( 'Value in STEP was incorrectly typed' )
}
cursor = skipValue( buffer, cursor, endCursor )
value.push( value1 )
signedCursor0 = stepExtractArrayToken( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )
}
return value }, false )

this.InnerCurves_ = value
}

return this.InnerCurves_ as Array<IfcCurve>
Expand Down
42 changes: 25 additions & 17 deletions src/ifc/ifc4_gen/IfcArcIndex.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
/* This is generated code, don't alter */
import {
stepExtractNumber,
stepExtractArray,
stepExtractArrayToken,
stepExtractArrayBegin,
skipValue,
} from '../../step/parsing/step_deserialization_functions'
import { IfcPositiveInteger } from './index'
import EntityTypesIfc from './entity_types_ifc.gen'
Expand All @@ -22,23 +24,29 @@ export class IfcArcIndex extends StepEntityBase< EntityTypesIfc > {

public get Value() : Array< number > {
if ( this.Value_ === void 0 ) {
this.Value_ = this.extractLambda( 0, (buffer, cursor, endCursor) => {

let value : Array<number> = [];

for ( let address of stepExtractArray( buffer, cursor, endCursor ) ) {
value.push( (() => {
const cursor = address
const value = stepExtractNumber( buffer, cursor, endCursor )

if ( value === void 0 ) {
throw new Error( 'Value needs to be defined in encapsulating context' )
}

return value
})() )

let cursor = this.getOffsetCursor( 0 )
const buffer = this.buffer
const endCursor = buffer.length

const value : Array<number> = []

let signedCursor0 = stepExtractArrayBegin( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )

while ( signedCursor0 >= 0 ) {
const value1 = stepExtractNumber( buffer, cursor, endCursor )

if ( value1 === void 0 ) {
throw new Error( 'Value in STEP was incorrectly typed' )
}
cursor = skipValue( buffer, cursor, endCursor )
value.push( value1 )
signedCursor0 = stepExtractArrayToken( buffer, cursor, endCursor )
cursor = Math.abs( signedCursor0 )
}
return value }, false )

this.Value_ = value
}

return this.Value_ as Array< number >
Expand Down
Loading