Skip to content

Commit db4f112

Browse files
committed
Clipping restored via signals
1 parent 36c97a8 commit db4f112

File tree

8 files changed

+39
-207
lines changed

8 files changed

+39
-207
lines changed

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ def main():
179179

180180
# Next steps depend on mode
181181
mode = args.mode[0] if args.mode else ""
182-
if mode in ["all", "build_ng", "build-ng"]:
182+
if mode in ["all", "ng", "build_ng", "build-ng"]:
183183
build_ng(is_dry_run=args.dry_run)
184184

185185
if mode in ["all", "test"]:
186186
test_all(is_dry_run=args.dry_run)
187187

188-
if mode in ["test_frontend", "test-frontend"]:
188+
if mode in ["test_frontend", "ng", "test-frontend"]:
189189
test_frontend(is_dry_run=args.dry_run)
190190

191191
if mode in ["test_backend", "test-backend"]:

firebird-ng/src/app/components/object-clipping/geometry-clipping.component.html renamed to firebird-ng/src/app/components/geometry-clipping/geometry-clipping.component.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
>
2020
<mat-checkbox
2121
#clippingCheckbox
22-
[checked]="clippingEnabled"
22+
[checked]="clippingEnabled()"
2323
(click)="$event.stopPropagation()"
2424
(change)="toggleClipping($event)"
2525
>
@@ -30,7 +30,7 @@
3030
<div class="angle-presets">
3131
<button mat-icon-button style="box-shadow: var(--mat-sys-level2);"
3232
(click)="changeStartClippingAngle(0); changeOpeningClippingAngle(180)"
33-
[disabled]="!clippingEnabled"
33+
[disabled]="!clippingEnabled()"
3434
matTooltip="Half Horizontal (0°-180°)">
3535
<svg viewBox="0 0 24 24" style="width:24px;height:24px">
3636
<circle cx="12" cy="12" r="10" fill="#f0f0f0" stroke="#cccccc" stroke-width="1"/>
@@ -40,7 +40,7 @@
4040
</button>
4141
<button mat-icon-button style="box-shadow: var(--mat-sys-level2);"
4242
(click)=" changeStartClippingAngle(90); changeOpeningClippingAngle(180)"
43-
[disabled]="!clippingEnabled"
43+
[disabled]="!clippingEnabled()"
4444
matTooltip="Half Vertical (90°-180°)">
4545
<svg viewBox="0 0 24 24" style="width:24px;height:24px">
4646
<circle cx="12" cy="12" r="10" fill="#bec2ff" stroke="#cccccc" stroke-width="1"/>
@@ -49,7 +49,7 @@
4949
</button>
5050
<button mat-icon-button style="box-shadow: var(--mat-sys-level2);"
5151
(click)="changeStartClippingAngle(90); changeOpeningClippingAngle(90)"
52-
[disabled]="!clippingEnabled"
52+
[disabled]="!clippingEnabled()"
5353
matTooltip="Three Quarters (90°-90°)">
5454
<svg viewBox="0 0 24 24" style="width:24px;height:24px">
5555
<circle cx="12" cy="12" r="10" fill="#bec2ff" stroke="#cccccc" stroke-width="1"/>
@@ -63,12 +63,12 @@
6363
<button
6464
class="slider-btn"
6565
mat-menu-item
66-
[disabled]="!clippingEnabled"
66+
[disabled]="!clippingEnabled()"
6767
>
6868
<mat-slider min="0" max="360" step="1">
6969
<input
7070
matSliderThumb
71-
[value]="openingAngle"
71+
[value]="openingAngle()"
7272
(input)="onSliderInput($event, 'opening')"
7373
(valueChange)="changeOpeningClippingAngle($event)"
7474
/>
@@ -79,28 +79,28 @@
7979
<input
8080
class="angle-value-input"
8181
type="number"
82-
[value]="openingAngle"
83-
[disabled]="!clippingEnabled"
82+
[value]="openingAngle()"
83+
[disabled]="!clippingEnabled()"
8484
(input)="openingAngle = $any($event.target).valueAsNumber"
8585
(change)="changeOpeningClippingAngle(openingAngle())"
8686
/>
8787
</button>
8888

8989

90-
<div class="preset-buttons" [class.disabled]="!clippingEnabled">
90+
<div class="preset-buttons" [class.disabled]="!clippingEnabled()">
9191
<button mat-menu-item
9292
(click)="changeOpeningClippingAngle(90)"
93-
[disabled]="!clippingEnabled">
93+
[disabled]="!clippingEnabled()">
9494
90°
9595
</button>
9696
<button mat-menu-item
9797
(click)="changeOpeningClippingAngle(180)"
98-
[disabled]="!clippingEnabled">
98+
[disabled]="!clippingEnabled()">
9999
180°
100100
</button>
101101
<button mat-menu-item
102102
(click)="changeOpeningClippingAngle(270)"
103-
[disabled]="!clippingEnabled">
103+
[disabled]="!clippingEnabled()">
104104
270°
105105
</button>
106106
</div>
@@ -111,12 +111,12 @@
111111
<button
112112
class="slider-btn"
113113
mat-menu-item
114-
[disabled]="!clippingEnabled"
114+
[disabled]="!clippingEnabled()"
115115
>
116116
<mat-slider min="0" max="360" step="1">
117117
<input
118118
matSliderThumb
119-
[value]="startAngle"
119+
[value]="startAngle()"
120120
(input)="onSliderInput($event, 'start')"
121121
(valueChange)="changeStartClippingAngle($event)"
122122
/>
@@ -127,33 +127,33 @@
127127
<input
128128
class="angle-value-input"
129129
type="number"
130-
[value]="startAngle"
131-
[disabled]="!clippingEnabled"
130+
[value]="startAngle()"
131+
[disabled]="!clippingEnabled()"
132132
(input)="startAngle = $any($event.target).valueAsNumber"
133133
(change)="changeStartClippingAngle(startAngle())"
134134
/>
135135
</button>
136136

137137

138-
<div class="preset-buttons" [class.disabled]="!clippingEnabled">
138+
<div class="preset-buttons" [class.disabled]="!clippingEnabled()">
139139
<button mat-menu-item
140140
(click)="changeStartClippingAngle(0)"
141-
[disabled]="!clippingEnabled">
141+
[disabled]="!clippingEnabled()">
142142
143143
</button>
144144
<button mat-menu-item
145145
(click)="changeStartClippingAngle(90)"
146-
[disabled]="!clippingEnabled">
146+
[disabled]="!clippingEnabled()">
147147
90°
148148
</button>
149149
<button mat-menu-item
150150
(click)="changeStartClippingAngle(180)"
151-
[disabled]="!clippingEnabled">
151+
[disabled]="!clippingEnabled()">
152152
180°
153153
</button>
154154
<button mat-menu-item
155155
(click)="changeStartClippingAngle(270)"
156-
[disabled]="!clippingEnabled">
156+
[disabled]="!clippingEnabled()">
157157
270°
158158
</button>
159159
</div>

firebird-ng/src/app/components/object-clipping/geometry-clipping.component.ts renamed to firebird-ng/src/app/components/geometry-clipping/geometry-clipping.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {FormsModule} from "@angular/forms";
2828

2929

3030
@Component({
31-
selector: 'app-custom-object-clipping',
31+
selector: 'app-geometry-clipping',
3232
templateUrl: './geometry-clipping.component.html',
3333
styleUrls: ['./geometry-clipping.component.scss'],
3434
imports: [

firebird-ng/src/app/pages/main-display/main-display.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<app-custom-event-selector></app-custom-event-selector>
2525

2626
<!-- Toggle for clipping geometries -->
27-
<app-custom-object-clipping></app-custom-object-clipping>
27+
<app-geometry-clipping></app-geometry-clipping>
2828

2929
<app-object-raycast></app-object-raycast>
3030

firebird-ng/src/app/pages/main-display/main-display.component.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {SceneTreeComponent} from '../../components/scene-tree/scene-tree.compone
1414
import {ShellComponent} from '../../components/shell/shell.component';
1515
import {ToolPanelComponent} from '../../components/tool-panel/tool-panel.component';
1616
import {EventSelectorComponent} from '../../components/event-selector/event-selector.component';
17-
import {GeometryClippingComponent} from '../../components/object-clipping/geometry-clipping.component';
17+
import {GeometryClippingComponent} from '../../components/geometry-clipping/geometry-clipping.component';
1818
import {PhoenixThreeFacade} from "../../utils/phoenix-three-facade";
1919

2020
import {MatSnackBar} from '@angular/material/snack-bar';
@@ -127,15 +127,15 @@ export class MainDisplayComponent implements OnInit, AfterViewInit, OnDestroy {
127127
private controller: GameControllerService,
128128
private snackBar: MatSnackBar,
129129
public eventDisplay: EventDisplayService,
130-
private userConfig: ConfigService,
130+
private config: ConfigService,
131131
private serverConfig: ServerConfigService,
132132
) {
133-
userConfig.addConfig(this.geometryUrl);
134-
userConfig.addConfig(this.geometryFastAndUgly);
135-
userConfig.addConfig(this.geometryCutListName);
136-
userConfig.addConfig(this.dexJsonEventSource);
137-
userConfig.addConfig(this.rootEventSource);
138-
userConfig.addConfig(this.rootEventRange);
133+
config.addConfig(this.geometryUrl);
134+
config.addConfig(this.geometryFastAndUgly);
135+
config.addConfig(this.geometryCutListName);
136+
config.addConfig(this.dexJsonEventSource);
137+
config.addConfig(this.rootEventSource);
138+
config.addConfig(this.rootEventRange);
139139
}
140140

141141

@@ -355,7 +355,7 @@ export class MainDisplayComponent implements OnInit, AfterViewInit, OnDestroy {
355355
// We set loadingDex=false to be safe
356356
this.loadingDex.set(false);
357357

358-
let dexUrl = this.userConfig.getConfig<string>('events.dexEventsSource')?.value;
358+
let dexUrl = this.config.getConfig<string>('events.dexEventsSource')?.value;
359359

360360
if (!dexUrl || dexUrl.trim().length === 0) {
361361
console.log("[main-display]: No event data source specified. Skip loadDexData.");
@@ -383,13 +383,13 @@ export class MainDisplayComponent implements OnInit, AfterViewInit, OnDestroy {
383383

384384
private initRootData() {
385385
let url = (
386-
this.userConfig.getConfig<string>('events.rootEventSource')
387-
?? this.userConfig.createConfig('events.rootEventSource', '')
386+
this.config.getConfig<string>('events.rootEventSource')
387+
?? this.config.createConfig('events.rootEventSource', '')
388388
).subject.getValue();
389389

390390
let eventRange = (
391-
this.userConfig.getConfig<string>('events.rootEventRange')
392-
?? this.userConfig.createConfig('events.rootEventRange', '')
391+
this.config.getConfig<string>('events.rootEventRange')
392+
?? this.config.createConfig('events.rootEventRange', '')
393393
).subject.getValue();
394394

395395

@@ -429,10 +429,7 @@ export class MainDisplayComponent implements OnInit, AfterViewInit, OnDestroy {
429429

430430

431431
private initGeometry() {
432-
const url = (
433-
this.userConfig.getConfig<string>('geometry.selectedGeometry')
434-
?? this.userConfig.createConfig('geometry.selectedGeometry', '')
435-
).value;
432+
const url = (this.config.getConfigOrCreate<string>('geometry.selectedGeometry', '')).value;
436433

437434
if (!url || url.trim().length === 0) {
438435
console.log("[main-display]: No geometry specified. Skip loadGeometry ");

0 commit comments

Comments
 (0)