Warning, /firebird/packages/epic/src/epic-geometry-post-processors.ts is written in an unsupported language. File is not indexed.
0001 /**
0002 * The ePIC geometry post-processors, registered by `withEpic()` through
0003 * dynamic imports: both pull three.js.
0004 */
0005
0006 import { Injectable } from '@angular/core';
0007 import type { GeometryPostProcessContext, GeometryPostProcessor } from '@dexvis/firebird-ng';
0008 import { prettify } from './epic-geometry-prettifier';
0009 import { arrangeEpicDetectors } from './epic-geometry-arranger';
0010
0011 /**
0012 * Reflective dRICH mirrors under a procedural studio environment
0013 * (`scene.environment`). Skipped when the user chose fast materials.
0014 */
0015 @Injectable()
0016 export class EpicGeometryPrettifier implements GeometryPostProcessor {
0017 async process(context: GeometryPostProcessContext): Promise<void> {
0018 if (context.fastMaterials) return;
0019 await prettify(context.geometry, {
0020 renderer: context.renderer,
0021 sceneGeometry: context.sceneGeometry,
0022 scene: context.scene,
0023 clippingPlanes: context.clippingPlanes,
0024 });
0025 }
0026 }
0027
0028 /**
0029 * Groups the top-level ePIC detectors into Forward, Central (with
0030 * Calorimeters, Tracking, PID, Magnets, support subgroups) and Backward
0031 * nodes, which the scene tree shows and the quad view's geometry copy keeps.
0032 */
0033 @Injectable()
0034 export class EpicDetectorArranger implements GeometryPostProcessor {
0035 process(context: GeometryPostProcessContext): void {
0036 arrangeEpicDetectors(context.sceneGeometry);
0037 }
0038 }