Add tank catalog with USDZ models and tank selection
Introduce TankDefinition/TankCatalog loaded from Tanks.json, bundle the Drachengas USDZ tank models, add tank selection and preview views, and update the AR experience, editor and project views to use the catalog. Includes tests for catalog loading and model selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -14,6 +14,7 @@ struct ARExperienceView: View {
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@AppStorage(SettingsKeys.lidarFeaturesEnabled) private var lidarEnabled = false
|
||||
@AppStorage(SettingsKeys.arExposure) private var arExposure = 1.0
|
||||
|
||||
let project: Project
|
||||
|
||||
@ -41,6 +42,9 @@ struct ARExperienceView: View {
|
||||
if controller.pipeRoutingPhase == .placing {
|
||||
pipeRoutingOverlay(controller: controller)
|
||||
}
|
||||
if controller.selectedPipeSegmentIndex != nil {
|
||||
pipeSegmentRemovalOverlay(controller: controller)
|
||||
}
|
||||
Color.white
|
||||
.opacity(flashOpacity)
|
||||
.ignoresSafeArea()
|
||||
@ -51,8 +55,22 @@ struct ARExperienceView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle(project.customerName)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.overlay(alignment: .topLeading) {
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
Image(systemName: "arrow.left")
|
||||
.font(.title2.weight(.semibold))
|
||||
.frame(width: 44, height: 44)
|
||||
.contentShape(.rect)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.foregroundStyle(.white)
|
||||
.shadow(radius: 3)
|
||||
.accessibilityLabel("Zurück")
|
||||
.padding(.leading, 12)
|
||||
.safeAreaPadding(.top)
|
||||
}
|
||||
.sheet(isPresented: $showMeasurements) {
|
||||
if let controller {
|
||||
MeasurementListView(controller: controller) {
|
||||
@ -77,7 +95,11 @@ struct ARExperienceView: View {
|
||||
.task {
|
||||
guard controller == nil else { return }
|
||||
let persistence = ProjectPersistenceAdapter(project: project, modelContext: modelContext)
|
||||
controller = ARSessionController(persistence: persistence, useLiDAR: lidarEnabled)
|
||||
controller = ARSessionController(
|
||||
persistence: persistence,
|
||||
useLiDAR: lidarEnabled,
|
||||
arExposure: arExposure
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,6 +207,32 @@ struct ARExperienceView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func pipeSegmentRemovalOverlay(controller: ARSessionController) -> some View {
|
||||
VStack {
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 12) {
|
||||
Text("Verbindung entfernen?")
|
||||
.font(.subheadline.weight(.medium))
|
||||
|
||||
Button("Abbrechen") {
|
||||
controller.cancelPipeSegmentRemoval()
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
|
||||
Button("Entfernen", role: .destructive) {
|
||||
controller.confirmPipeSegmentRemoval()
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 10)
|
||||
.background(.ultraThinMaterial, in: .capsule)
|
||||
}
|
||||
.padding()
|
||||
.transition(.move(edge: .bottom).combined(with: .opacity))
|
||||
}
|
||||
|
||||
// MARK: - Rohrführung-Overlay
|
||||
|
||||
/// Overlay für die Rohrführung: pinkes Fadenkreuz (Vollbild-Mitte), Info-Banner oben,
|
||||
|
||||
Reference in New Issue
Block a user