5269c0897c
- Split main.py refactor
62 lines
1.5 KiB
Python
62 lines
1.5 KiB
Python
"""Fluency CAD - Main entry point.
|
||
|
||
This module is intentionally thin. The actual UI lives in the
|
||
``fluency.ui`` package:
|
||
|
||
ui.dialogs – 4 modal dialogs (Extrude, Revolve, Offset, WorkplaneOrientation)
|
||
ui.viewer_widget – Viewer3DWidget (3D canvas)
|
||
ui.sketch_widget – Sketch2DWidget (2D sketcher + constraint solver)
|
||
ui.main_window – MainWindow (application shell)
|
||
|
||
The public classes are re-exported here so that existing call sites
|
||
that do ``from fluency.main import MainWindow`` (notably
|
||
``tests/test_geometry.py``) keep working.
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import logging
|
||
import sys
|
||
|
||
from PySide6.QtWidgets import QApplication
|
||
|
||
from fluency.ui.dialogs import (
|
||
ExtrudeDialog,
|
||
OffsetDialog,
|
||
RevolveDialog,
|
||
WorkplaneOrientationDialog,
|
||
)
|
||
from fluency.ui.main_window import MainWindow
|
||
from fluency.ui.sketch_widget import Sketch2DWidget
|
||
from fluency.ui.viewer_widget import Viewer3DWidget
|
||
|
||
__all__ = [
|
||
"MainWindow",
|
||
"Sketch2DWidget",
|
||
"Viewer3DWidget",
|
||
"ExtrudeDialog",
|
||
"RevolveDialog",
|
||
"OffsetDialog",
|
||
"WorkplaneOrientationDialog",
|
||
"main",
|
||
]
|
||
|
||
|
||
def main() -> int:
|
||
"""Launch the Fluency CAD application.
|
||
|
||
Returns the ``QApplication.exec()`` exit code so that the console-script
|
||
entry point declared in ``pyproject.toml`` can forward it.
|
||
"""
|
||
app = QApplication(sys.argv)
|
||
app.setStyle("Fusion")
|
||
|
||
window = MainWindow()
|
||
window.show()
|
||
|
||
return app.exec()
|
||
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(main())
|