Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/firebird-ng/src/app/components/object-clipping/object-clipping.component.ts is written in an unsupported language. File is not indexed.

0001 import { Component } from '@angular/core';
0002 import {MatCheckbox, MatCheckboxChange} from '@angular/material/checkbox';
0003 import {EventDisplayService} from "phoenix-ui-components";
0004 import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu";
0005 import {MatSlider, MatSliderThumb} from "@angular/material/slider";
0006 import {MenuToggleComponent} from "../menu-toggle/menu-toggle.component";
0007 
0008 @Component({
0009   selector: 'app-custom-object-clipping',
0010   templateUrl: './object-clipping.component.html',
0011   styleUrls: ['./object-clipping.component.scss'],
0012   imports: [
0013     MatMenu,
0014     MatCheckbox,
0015     MatMenuItem,
0016     MatSlider,
0017     MatSliderThumb,
0018     MenuToggleComponent,
0019     MatMenuTrigger
0020   ],
0021   standalone: true
0022 })
0023 export class ObjectClippingComponent {
0024   clippingEnabled!: boolean;
0025   startClippingAngle!: number;
0026   openingClippingAngle!: number;
0027 
0028   constructor(private eventDisplay: EventDisplayService) {
0029     const stateManager = this.eventDisplay.getStateManager();
0030     stateManager.clippingEnabled.onUpdate(
0031       (clippingValue) => (this.clippingEnabled = clippingValue),
0032     );
0033     stateManager.startClippingAngle.onUpdate(
0034       (value) => (this.startClippingAngle = value),
0035     );
0036     stateManager.openingClippingAngle.onUpdate(
0037       (value) => (this.openingClippingAngle = value),
0038     );
0039   }
0040 
0041   changeStartClippingAngle(startingAngle: number) {
0042     this.eventDisplay.getUIManager().rotateStartAngleClipping(startingAngle);
0043   }
0044 
0045   changeOpeningClippingAngle(openingAngle: number) {
0046     this.eventDisplay.getUIManager().rotateOpeningAngleClipping(openingAngle);
0047   }
0048 
0049   toggleClipping(change: MatCheckboxChange) {
0050     const value = change.checked;
0051     this.eventDisplay.getUIManager().setClipping(value);
0052     this.clippingEnabled = value;
0053   }
0054 }