# Class BimIfcObject

This class contains the structure of an IFC Object

#### Hierarchy (View Summary)

- BimIfcObject
  - BimIfcSpace
  - BimIfcBuildingStorey
  - BimIfcDoor

#### Implements

- ModelProduct

##### Index

### Constructors

constructor

### Properties

class
computedPropertySets
enclosingFloor?
entityLabelInIfc
hasGeometry
ifcLoaderElement
parents
propertySets
quantitySets
rawProduct
visible

### Accessors

aggregates
bbox
building
childCount
children
className
contains
data
description
discipline
facility
facilityPart
gid
globalId
hasStructuredRelationships
ifc
localId
meshes
name
parent
productMeshes
project
site
type

### Methods

aabb
applyColor
boundingInfo
computeObjectBboxInWorldSpace
copyColorsTo
copyColorTo
defaultColor
deleteComputedPropertySet
entries
foreach
geometricallyIntersects
getColorComponent
ghostOutline
highlight
isOnGpu
mesh
meshDescriptor
remove
setColor
setColors
setComputedPropertySet
style
transform
vertexData
create
createGeometryFrom
createGeometryFromAsync

## Constructors

### `Protected` constructor

- new BimIfcObject(
  entityLabelInIfc: string,
  ifcLoaderElement: IBimIfcLoaderElement,
  rawProduct: MutableShallow<BimProduct>,
  parents: BimIfcObject[],
  enclosingFloor?: BimIfcBuildingStorey,
  ): BimIfcObject

  #### Parameters

  - entityLabelInIfc: string
  - ifcLoaderElement: IBimIfcLoaderElement
  - rawProduct: MutableShallow<BimProduct>
  - parents: BimIfcObject[]
  - `Optional` enclosingFloor: BimIfcBuildingStorey

  #### Returns BimIfcObject

## Properties

### `Readonly` class

class: ModelProductClass

Returns the class object for IFC-product

Implementation of ModelProduct.class

### `Readonly` computedPropertySets

computedPropertySets: Record<string, T8PropertySet<T8Unit>> = emptyRecord

Computed property sets added by Twinfinity processing.

Implementation of ModelProduct.computedPropertySets

### `Optional` `Readonly` enclosingFloor

enclosingFloor?: BimIfcBuildingStorey

### `Readonly` entityLabelInIfc

entityLabelInIfc: string

### `Readonly` hasGeometry

hasGeometry: boolean

True if this product has at least one mesh with geometry data.

Implementation of ModelProduct.hasGeometry

### `Readonly` ifcLoaderElement

ifcLoaderElement: IBimIfcLoaderElement

### `Readonly` parents

parents: BimIfcObject[]

### `Readonly` propertySets

propertySets: Record<string, T8PropertySet<T8Unit>> = emptyRecord

IFC property sets (e.g. `Pset_WallCommon`).

Implementation of ModelProduct.propertySets

### `Readonly` quantitySets

quantitySets: Record<string, T8QuantitySet<T8Unit>> = emptyRecord

IFC quantity sets (e.g. `Qto_WallBaseQuantities`).

Implementation of ModelProduct.quantitySets

### `Readonly` rawProduct

rawProduct: BimProduct

### `Readonly` visible

visible: (visible?: boolean, meshes?: BimProductMesh[]) => boolean

Returns true if object is visible

## Accessors

### aggregates

- get aggregates(): readonly BimIfcObject[]

  Products related via `IfcRelAggregates` (decomposition). Empty when hasStructuredRelationships is false.

  #### Returns readonly BimIfcObject[]

  Implementation of ModelProduct.aggregates

### bbox

- get bbox(): SimpleBoundingBox

  #### Returns SimpleBoundingBox

  #### Deprecated

  Use boundingInfo or aabb.

### building

- get building(): undefined | BimIfcObject

  #### Returns undefined | BimIfcObject

### childCount

- get childCount(): number

  #### Returns number

### children

- get children(): BimIfcObject[]

  All children IFC objects.

  #### Returns BimIfcObject[]

  Implementation of ModelProduct.children

### className

- get className(): string

  Full IFC class name including prefix (e.g. `'IfcWall'`, `'IfcDoor'`).

  #### Returns string

  Implementation of ModelProduct.className

### contains

- get contains(): readonly BimIfcObject[]

  Products related via `IfcRelContainedInSpatialStructure` (spatial containment). Empty when hasStructuredRelationships is false.

  #### Returns readonly BimIfcObject[]

  Implementation of ModelProduct.contains

### data

- get data(): Record<string, boolean | number | string>

  Product-level scalar data values (e.g. operationType, objectPlacement).

  #### Returns Record<string, boolean | number | string>

  Implementation of ModelProduct.data

### description

- get description(): string

  #### Returns string

  Implementation of ModelProduct.description

### discipline

- get discipline(): Discipline

  Returns the discipline class for this IFC-product

  #### Returns Discipline

### facility

- get facility(): undefined | BimIfcObject

  The `IfcBuilding` (or `IfcFacility`) ancestor of this product.

  #### Returns undefined | BimIfcObject

  Implementation of ModelProduct.facility

### facilityPart

- get facilityPart(): undefined | BimIfcBuildingStorey

  The `IfcBuildingStorey` (or `IfcFacilityPart`) ancestor of this product.

  #### Returns undefined | BimIfcBuildingStorey

  Implementation of ModelProduct.facilityPart

### gid

- get gid(): string

  #### Returns string

### globalId

- get globalId(): string

  IFC GlobalId (GUID), unique across all models.

  #### Returns string

  Implementation of ModelProduct.globalId

### hasStructuredRelationships

- get hasStructuredRelationships(): boolean

  True when aggregates and contains carry structured IFC relationship data (`IfcRelAggregates` / `IfcRelContainedInSpatialStructure`). When false, only children is populated.

  #### Returns boolean

  Implementation of ModelProduct.hasStructuredRelationships

### ifc

- get ifc(): BimChangeIfc

  #### Returns BimChangeIfc

### localId

- get localId(): number

  Numerical identifier, unique within a single model.

  #### Returns number

  Implementation of ModelProduct.localId

### meshes

- get meshes(): readonly BimProductMesh[]

  Geometry meshes belonging to this product.

  #### Returns readonly BimProductMesh[]

  Implementation of ModelProduct.meshes

### name

- get name(): string

  Returns name of IFC-product

  #### Returns string

  Implementation of ModelProduct.name

### parent

- get parent(): undefined | BimIfcObject

  Get the closest parent in the IFC hiearchy. Equivalent of

  #### Returns undefined | BimIfcObject

  #### Example

      const parent = bimIfcObject.parents[bimIfcObjects.parents.length -1];

  Implementation of ModelProduct.parent

### productMeshes

- get productMeshes(): BimProductMesh[]

  #### Returns BimProductMesh[]

### project

- get project(): BimIfcObject

  #### Returns BimIfcObject

### site

- get site(): undefined | BimIfcObject

  The `IfcSite` ancestor of this product.

  #### Returns undefined | BimIfcObject

  Implementation of ModelProduct.site

### type

- get type(): undefined | BimTypeObject

  The entity type definition this product is an instance of (e.g. an `IfcWallType`).

  #### Returns undefined | BimTypeObject

  Implementation of ModelProduct.type

## Methods

### aabb

- aabb(
  min: Vector3,
  max: Vector3,
  predicate?: (
  o: BimIfcObject,
  recursionOptions: BimIfcObjectRecursionOptions,
  ) => unknown,
  noCache?: boolean,
  ): void

  Calculates the min and max value in the coordinate system.

  #### Parameters

  - min: Vector3

    Minimum bounding vector3

  - max: Vector3

    Maximum bounding vector3

  - predicate: (o: BimIfcObject, recursionOptions: BimIfcObjectRecursionOptions) => unknown = DefaultBimIfcObjectForEachPredicate

    ?

  - noCache: boolean = true

    If `true`, transform caches will not be used.

  #### Returns void

### applyColor

- applyColor(): void

  #### Returns void

  #### Deprecated

  No longer does anything.

### boundingInfo

- boundingInfo(
  bI?: BoundingInfo,
  predicate?: (
  o: BimIfcObject,
  recursionOptions: BimIfcObjectRecursionOptions,
  ) => unknown,
  noCache?: boolean,
  ): BoundingInfo

  #### Parameters

  - `Optional` bI: BoundingInfo
  - predicate: (o: BimIfcObject, recursionOptions: BimIfcObjectRecursionOptions) => unknown = DefaultBimIfcObjectForEachPredicate
  - noCache: boolean = true

  #### Returns BoundingInfo

### computeObjectBboxInWorldSpace

- computeObjectBboxInWorldSpace(): SimpleBoundingBox
  `Alpha`

  Aggregates a bbox from current objects meshes. This does not include related children. This is alpha. Expect changes. Will probably be replaced by one of the other bounding info functions.

  #### Returns SimpleBoundingBox

  #### Deprecated

  Use boundingInfo or aabb.

### copyColorsTo

- copyColorsTo(
  dst: Pick<
  Map<BimProductMesh, Writeable<ArrayLike<number>>>,
  "get" | "set",
  >,
  ): void

  #### Parameters

  - dst: Pick<Map<BimProductMesh, Writeable<ArrayLike<number>>>, "get" | "set">

  #### Returns void

### copyColorTo

- copyColorTo(
  m: BimProductMesh,
  dst: Writeable<ArrayLike<number>>,
  dstOffset?: number,
  ): void

  #### Parameters

  - m: BimProductMesh
  - dst: Writeable<ArrayLike<number>>
  - dstOffset: number = 0

  #### Returns void

### defaultColor

- defaultColor(meshes?: BimProductMesh[]): boolean

  #### Parameters

  - `Optional` meshes: BimProductMesh[]

  #### Returns boolean

### deleteComputedPropertySet

- deleteComputedPropertySet(name: string): boolean

  #### Parameters

  - name: string

  #### Returns boolean

### entries

- entries(): IterableIterator<BimIfcObject>

  Gets a iterator for all Ifc products currently loaded.

  #### Returns IterableIterator<BimIfcObject>

### foreach

- foreach(action: BimIfcObjectForEachAction): void

  #### Parameters

  - action: BimIfcObjectForEachAction

  #### Returns void

### geometricallyIntersects

- geometricallyIntersects(
  objects: BimIfcObject[],
  includeEnclosedObjects?: boolean,
  includeIntersectingObjects?: boolean,
  ): BimIfcObject[]

  Checks intersections of an object (containing object) against an array of other objects.

  #### Parameters

  - objects: BimIfcObject[]

    Array of objects to test intersection against.

  - includeEnclosedObjects: boolean = true

    Default is true, it includes geometries completely geometrically on the inside, in the returned result.

  - includeIntersectingObjects: boolean = true

    Default is true, it includes geometries that intersects on border surface, in the returned result. If both enclosedObjects and intersectingObjects are false, the function will make a quick rough test based on bbox and return all objects intersecting and enclosing on bounding box level.

  #### Returns BimIfcObject[]

### getColorComponent

- getColorComponent(m: BimProductMesh, colorComponent: RgbaComponent): number

  #### Parameters

  - m: BimProductMesh
  - colorComponent: RgbaComponent

  #### Returns number

### ghostOutline

- ghostOutline(enabled: boolean, meshes?: BimProductMesh[]): boolean

  Makes the object give an ghosty outline when either SSAO or line outlines are enabled. It does this by making the object invisible but also flag it to still write to the depth buffer used by the lines and SSAO

  #### Parameters

  - enabled: boolean

    If true the object will be hidden but will also be set to still write to the depth buffer

  - `Optional` meshes: BimProductMesh[]

    The specific meshes of the object to apply this method on

  #### Returns boolean

  A bool indicating if any of the objects meshes was changed as a result of this method call

### highlight

- highlight(
  highlightIndex?: IfcMaterialHighlightIndex,
  meshes?: BimProductMesh[],
  ): boolean

  Highlights the object

  #### Parameters

  - highlightIndex: IfcMaterialHighlightIndex = IfcMaterialHighlightIndex.One

    The highlight color index to use, setting it to zero means the mesh will not be highlighted

  - `Optional` meshes: BimProductMesh[]

    The meshes to highlight

  #### Returns boolean

  a boolean indicating if the object was changed from the highlighting

### isOnGpu

- isOnGpu(meshes?: BimProductMesh[]): boolean

  #### Parameters

  - `Optional` meshes: BimProductMesh[]

  #### Returns boolean

### mesh

- mesh(m: BimProductMesh, noCache?: boolean): BimIfcMesh

  #### Parameters

  - m: BimProductMesh
  - noCache: boolean = true

  #### Returns BimIfcMesh

### meshDescriptor

- meshDescriptor(pM: BimProductMesh): BimProductMeshDescriptor

  #### Parameters

  - pM: BimProductMesh

  #### Returns BimProductMeshDescriptor

### remove

- remove(): void

  Remove the IFC object and its children from the IFC hiearchy.

  #### Returns void

### setColor

- setColor(color: ArrayLike<number>, meshes?: BimProductMesh[]): boolean

  #### Parameters

  - color: ArrayLike<number>
  - `Optional` meshes: BimProductMesh[]

  #### Returns boolean

### setColors

- setColors(src: Iterable<[BimProductMesh, ArrayLike<number>]>): boolean

  #### Parameters

  - src: Iterable<[BimProductMesh, ArrayLike<number>]>

  #### Returns boolean

### setComputedPropertySet

- setComputedPropertySet(name: string, set: T8PropertySet<T8Unit>): void

  #### Parameters

  - name: string
  - set: T8PropertySet<T8Unit>

  #### Returns void

### style

- style(m: BimProductMesh): BimIfcStyle

  #### Parameters

  - m: BimProductMesh

  #### Returns BimIfcStyle

### transform

- transform(m: BimProductMesh, noCache?: boolean): Matrix

  #### Parameters

  - m: BimProductMesh
  - noCache: boolean = true

  #### Returns Matrix

### vertexData

- vertexData(m: BimProductMesh): BimVertexData

  #### Parameters

  - m: BimProductMesh

  #### Returns BimVertexData

### `Static` create

- create(ifcLoaderElement: IBimIfcLoaderElement): BimIfcObject

  #### Parameters

  - ifcLoaderElement: IBimIfcLoaderElement

  #### Returns BimIfcObject

### `Static` createGeometryFrom

- createGeometryFrom(
  items: (
  BimIfcObject
  | { ifcObject: BimIfcObject; meshes: BimProductMesh[] }
  )[],
  ): Geometry3d

  Creates a geometry consisting of all specified IFC objects (or specific meshes.).

  #### Parameters

  - items: (BimIfcObject | { ifcObject: BimIfcObject; meshes: BimProductMesh[] })[]

    All objects that will be combined. It is possible to optionally specify exactly which BimProductMesh that are to be used on each IFC object. If none is specified, then all meshes in the IFC objects are used. Geom. Items where BimIfcObject.isOnGpu === `false` will not be included in the final Geometry3d.

  #### Returns Geometry3d

  A Geometry3d instance that represents all geometry. Note that the geometry is in IFC space and not BabylonJS worldspace.

### `Static` createGeometryFromAsync

- createGeometryFromAsync(
  items: (
  BimIfcObject
  | { ifcObject: BimIfcObject; meshes: BimProductMesh[] }
  )[],
  ): Promise<Geometry3d>

  Creates a geometry consisting of all specified IFC objects (or specific meshes.).

  #### Parameters

  - items: (BimIfcObject | { ifcObject: BimIfcObject; meshes: BimProductMesh[] })[]

    All objects that will be combined. It is possible to specify multiple BimProductMesh to be used on each IFC object. If none are specified, then all meshes in the IFC objects are used. When BimIfcObject.isOnGpu === `false`, the geometry will automatically be loaded and included in the final Geometry3d.

  #### Returns Promise<Geometry3d>

  A Geometry3d instance that represents all geometry. Note that the geometry is in IFC space and not BabylonJS worldspace.