import { BaseProductMeshesGroupRenderInfo } from './BaseProductMeshesGroupRenderInfo';
/**
 * Class to record render property statistics for a collection of merged IFC product meshes.
 */
export class MergedIfcProductMeshesRenderInfo extends BaseProductMeshesGroupRenderInfo {
    parent;
    /**
     * Constructor.
     * @param parent - The parent render info object.
     */
    constructor(parent) {
        super(parent);
        this.parent = parent;
    }
    /**
     * Assign the render properties to the given IFC product and meshes.
     * @param ifcProductAndMeshes - The IFC product and meshes to assign the render properties to.
     */
    assign(ifcProductAndMeshes) {
        for (const productMeshes of ifcProductAndMeshes.values()) {
            for (const productMesh of productMeshes) {
                productMesh._renderPropertyInfo = this;
                this._state.count++;
                // Using type coercion to convert boolean to number for performance optimization
                this._state.visibleCount += 0 + productMesh.visible;
                this._state.outlinedCount += 0 + productMesh.outline;
                this._state.ghostOutlineCount += 0 + productMesh.ghostOutline;
                this._state.ignoreClipPlanesCount += 0 + productMesh.ignoreClipPlanes;
            }
        }
    }
    /**
     * Detach the render properties from the given IFC product and meshes.
     * @param ifcProductAndMeshes - The IFC product and meshes to detach the render properties from.
     */
    detach(ifcProductAndMeshes) {
        for (const productMeshes of ifcProductAndMeshes.values()) {
            for (const productMesh of productMeshes) {
                productMesh._renderPropertyInfo = undefined;
            }
        }
        this.clearState();
    }
}
//# sourceMappingURL=MergedIfcProductMeshesRenderInfo.js.map