/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
/**
 * The `CrossSectioner` class is here.
 */
export class CrossSectioner {
    constructor(stream, data) {
        this.stream = stream;
        this.data = data;
    }
    /**
     * Performs request on the stream to update the cross sectioning config.
     *
     * @example
     * ```typescript
     * const viewer = document.querySelector("vertex-viewer");
     * const scene = await viewer.scene();
     * const crossSectioner = scene.crossSectioning();
     *
     * await scene.crossSectioning().update({
     *   sectionPlanes: [
     *     {
     *       normal: {
     *         x: 1,
     *         y: 0,
     *         z: 0,
     *       },
     *       offset: 0,
     *     },
     *   ],
     *   highlightColor: Color.fromHexString("#ff0000"),
     *   lineWidth: 0.5,
     * });
     * ```
     *
     * @see {@link SectionPlane} for more information on the section planes.
     *
     * @see {@link CrossSectioning} for more information on the highlight color and
     * line width.
     *
     * @param crossSectioning The new cross sectioning.
     */
    async update(crossSectioning) {
        const res = await this.stream.updateCrossSectioning({
            crossSectioning: {
                sectionPlanes: crossSectioning.sectionPlanes,
                highlightColor: crossSectioning.highlightColor,
                lineWidth: (crossSectioning === null || crossSectioning === void 0 ? void 0 : crossSectioning.lineWidth) != null
                    ? { value: crossSectioning.lineWidth }
                    : null,
            },
        }, true);
        return res.updateCrossSectioning || undefined;
    }
    current() {
        return this.data;
    }
}
//# sourceMappingURL=crossSectioner.js.map
