"""
Visual Inspection Script — launches the GPU renderer with cached data.
No API calls needed. Run this and visually inspect the 3D visualization.

Run: python test/test_visual_inspection.py

What to inspect:
  1. Particle flow animation — particles should follow flow field
  2. Cluster coloring — smooth IDW blending between cluster colors
  3. Path rendering — straight lines between data points (default)
  4. Spline path — check "Spline Path" checkbox for smooth curves
  5. Probe sliders — move X/Y/Z sliders and watch info overlay
  6. Blob spawning — particles should spawn near paths (press D to see blob debug)
  7. Axis labels — should be large, format "X: Numerical focus"
  8. Ball flow — check "Drag probe by the flow" and watch ball follow flow
"""

import sys
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from tracescope.models.analysis import AnalysisResult
from tracescope import launch_renderer

CACHE_PATH = os.path.join(os.path.dirname(__file__), "..", "cache", "prm_demo_40paths_flow.json")


def main():
    print("Loading cached result...")
    result = AnalysisResult.load_result(CACHE_PATH)
    print(f"Loaded: {result.n_entries} entries, {result.clusters.n_clusters} clusters")
    print(f"Axis labels: {result.axis_info.labels}")
    print(f"Cluster labels: {result.cluster_labels}")
    print()
    print("Launching renderer — visually inspect the following:")
    print("  1. Flow particles animate smoothly")
    print("  2. Cluster colors blend smoothly (IDW, no hard boundaries)")
    print("  3. Straight path lines between data points")
    print("  4. Axis labels are large and readable (X: label, Y: label, Z: label)")
    print("  5. Probe info overlay shows sections (Probe Location, Distance to Clusters)")
    print("  6. Press D to toggle blob debug visualization")
    print()

    launch_renderer(result)


if __name__ == "__main__":
    main()
