# Class BimTransformsRepository

Represents a repository for calculating and caching transforms for a IFC file.

##### Index

### Constructors

constructor

### Methods

clear
convertBimTransformToMatrixToRef
getMatrix
getTransform

## Constructors

### constructor

- new BimTransformsRepository(
  _loaderElement: IBimIfcLoaderElement,
  ): BimTransformsRepository

  Constructs a new instance of the BimTransformsRepository class.

  #### Parameters

  - _loaderElement: IBimIfcLoaderElement

    The IBimIfcLoaderElement used for loading IFC data.

  #### Returns BimTransformsRepository

## Methods

### clear

- clear(): void

  Clears the transforms repository by removing all cached transforms.

  #### Returns void

### convertBimTransformToMatrixToRef

- convertBimTransformToMatrixToRef(wt: BimTransform, outMatrix: Matrix): Matrix

  Converts a BimTransform to a Matrix and assigns the result to the provided outMatrix.

  #### Parameters

  - wt: BimTransform

    The BimTransform to convert.

  - outMatrix: Matrix

    The Matrix to assign the converted result to.

  #### Returns Matrix

  The converted Matrix. Same as `outMatrix`.

### getMatrix

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

  Retrieves the matrix associated with the given BimProductMesh. If the matrix is already cached, it is returned directly. Otherwise, the matrix is calculated, cached, and returned.

  #### Parameters

  - m: BimProductMesh

    The BimProductMesh for which to retrieve the matrix.

  - noCache: boolean = true

    If `true`, the calculated matrix will be not be cached for future use. Defaults to `true`. Call clear to remove cached matrices.

  #### Returns Matrix

  The matrix associated with the given BimProductMesh.

### getTransform

- getTransform(m: BimProductMesh, noCache?: boolean): FastTransform

  Retrieves the FastTransform for the given BimProductMesh. If the FastTransform is already cached, it is returned directly. Otherwise, a new FastTransform is created, cached, and returned.

  #### Parameters

  - m: BimProductMesh

    The BimProductMesh for which to retrieve the FastTransform.

  - noCache: boolean = false

    If `true`, the created FastTransform will not be cached for future use. Defaults to `true`. Call clear to remove cached transforms.

  #### Returns FastTransform

  The FastTransform for the given BimProductMesh.