Initial commit for first version of project

This commit is contained in:
Dennis Nemec
2026-09-02 20:54:36 +02:00
parent 3d9f1ab6bc
commit 992bb32025
56 changed files with 5139 additions and 31 deletions

View File

@ -0,0 +1,83 @@
//
// ARControlOverlay.swift
// GasTankAR
//
// Created by Dennis Nemec on 27.08.26.
//
import SwiftUI
/// Runde Werkzeug-Buttons oben rechts über der AR-View. Untereinander angeordnet;
/// weitere Funktionen lassen sich als zusätzliche `roundButton` ergänzen.
struct ARControlOverlay: View {
let controller: ARSessionController
/// Öffnet die Strecken-Liste (Ausmessen).
let onMeasure: () -> Void
var body: some View {
VStack {
HStack {
Spacer()
VStack(spacing: 12) {
roundButton(
systemImage: "shield.lefthalf.filled",
isActive: controller.showSafetyZones,
label: "Sicherheitsabstand"
) {
controller.toggleSafetyZones()
}
roundButton(
systemImage: "ruler",
isActive: controller.measurementPhase != .idle,
label: "Ausmessen"
) {
onMeasure()
}
roundButton(
systemImage: "point.3.connected.trianglepath.dotted",
isActive: controller.pipeRoutingPhase != .idle,
label: "Rohrführung"
) {
if controller.pipeRoutingPhase == .idle {
controller.startPipeRouting()
}
}
roundButton(
systemImage: "camera.fill",
isActive: false,
label: "Foto aufnehmen"
) {
controller.captureSnapshot()
}
}
}
Spacer()
}
.padding()
}
private func roundButton(
systemImage: String,
isActive: Bool,
label: String,
action: @escaping () -> Void
) -> some View {
Button(action: action) {
Image(systemName: systemImage)
.font(.title3)
.frame(width: 52, height: 52)
.foregroundStyle(isActive ? Color.white : Color.primary)
.background(
isActive ? AnyShapeStyle(Color.accentColor) : AnyShapeStyle(.ultraThinMaterial),
in: .circle
)
.shadow(radius: 3)
}
.buttonStyle(.plain)
.accessibilityLabel(label)
.accessibilityAddTraits(isActive ? .isSelected : [])
}
}