Warning, /firebird/firebird-ng/src/app/components/legend-window/legend-window.component.ts is written in an unsupported language. File is not indexed.
0001 import {Component, OnInit, OnDestroy, ViewChild, TemplateRef} from '@angular/core';
0002 import {MatCheckbox, MatCheckboxChange} from '@angular/material/checkbox';
0003 import { Subscription } from 'rxjs';
0004
0005 import { ThreeService } from '../../services/three.service';
0006 import { UserConfigService } from '../../services/user-config.service';
0007 import {MatMenuItem} from "@angular/material/menu";
0008 import {MatSlider, MatSliderThumb} from "@angular/material/slider";
0009
0010 import {MatButton, MatIconButton} from "@angular/material/button";
0011
0012 import {MatDialog, MatDialogClose, MatDialogRef} from "@angular/material/dialog";
0013 import {MatIcon} from "@angular/material/icon";
0014 import {MatTooltip} from "@angular/material/tooltip";
0015
0016 @Component({
0017 selector: 'app-legend-window',
0018 templateUrl: './legend-window.component.html',
0019 styleUrls: ['./legend-window.component.scss'],
0020 imports: [
0021 MatSlider,
0022 MatMenuItem,
0023 MatSliderThumb,
0024 MatCheckbox,
0025 MatIcon,
0026 MatDialogClose,
0027 MatIconButton,
0028 MatTooltip
0029 ]
0030 })
0031 export class LegendWindowComponent implements OnInit, OnDestroy {
0032 /** Local copies that reflect the config property values. */
0033 clippingEnabled = false;
0034
0035
0036
0037
0038 @ViewChild('dialogTemplate') dialogTemplate!: TemplateRef<any>;
0039 dialogRef: MatDialogRef<any> | null = null;
0040
0041 constructor(
0042 private threeService: ThreeService,
0043 private config: UserConfigService,
0044 private dialog: MatDialog
0045 ) {}
0046
0047 ngOnInit(): void {
0048
0049 }
0050
0051 ngOnDestroy(): void {
0052
0053 }
0054
0055
0056
0057 openDialog(): void {
0058 if (this.dialogRef) {
0059 this.dialogRef.close();
0060 } else {
0061 this.dialogRef = this.dialog.open(this.dialogTemplate, {
0062 position: {
0063 top: '63px',
0064 left: '600px'
0065 },
0066 disableClose: true,
0067 hasBackdrop: false
0068 });
0069
0070 this.dialogRef.afterClosed().subscribe(() => {
0071 this.dialogRef = null;
0072 });
0073 }
0074 }
0075
0076 toggleRaycast() {
0077 this.threeService.toggleRaycast();
0078 }
0079
0080 get isRaycastEnabled(): boolean {
0081 return this.threeService.isRaycastEnabledState();
0082 }
0083
0084 }