"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Rendering
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstancedGraphicParams = exports.InstancedGraphicProps = void 0;
const core_geometry_1 = require("@itwin/core-geometry");
/** @public */
var InstancedGraphicProps;
(function (InstancedGraphicProps) {
    /** Add all [Transferable objects](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects) from `props`
     * into `xfers`.
     */
    function collectTransferables(xfers, props) {
        xfers.add(props.transforms.buffer);
        if (props.featureIds) {
            xfers.add(props.featureIds.buffer);
        }
        if (props.symbologyOverrides) {
            xfers.add(props.symbologyOverrides.buffer);
        }
    }
    InstancedGraphicProps.collectTransferables = collectTransferables;
})(InstancedGraphicProps || (exports.InstancedGraphicProps = InstancedGraphicProps = {}));
/** @public */
var InstancedGraphicParams;
(function (InstancedGraphicParams) {
    /** Convert `params` to a representation that can be copied using [structured cloning](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone). */
    function toProps(params) {
        const props = {
            ...params,
            transformCenter: {
                x: params.transformCenter.x,
                y: params.transformCenter.y,
                z: params.transformCenter.z,
            },
        };
        if (params.range) {
            props.range = {
                low: {
                    x: params.range.low.x,
                    y: params.range.low.y,
                    z: params.range.low.z,
                },
                high: {
                    x: params.range.high.x,
                    y: params.range.high.y,
                    z: params.range.high.z,
                },
            };
        }
        return props;
    }
    InstancedGraphicParams.toProps = toProps;
    /** Create an [[InstancedGraphicParams]] from an [[InstancedGraphicProps]]. */
    function fromProps(props) {
        return {
            ...props,
            transformCenter: core_geometry_1.Point3d.fromJSON(props.transformCenter),
            range: props.range ? core_geometry_1.Range3d.fromJSON(props.range) : undefined,
        };
    }
    InstancedGraphicParams.fromProps = fromProps;
})(InstancedGraphicParams || (exports.InstancedGraphicParams = InstancedGraphicParams = {}));
//# sourceMappingURL=InstancedGraphicParams.js.map