docs: Describe MVC architecture in CONTEXT.md

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-13 17:38:11 -07:00
parent d5fcfc8428
commit 2a51808303

View File

@@ -8,7 +8,19 @@ Don't ask for unrelated files to be added to the chat.
## Architecture
...
The application is structured using a Model-View-Controller (MVC) architecture to ensure a clear separation of concerns, making the codebase easier to maintain and extend.
* **Model:** This layer represents the application's data and business logic. It knows nothing about the user interface.
* `Document`: Manages the collection of all features.
* `Feature`, `SketchFeature`: Represent individual components or operations in the CAD model.
* **View:** This layer is responsible for displaying the data from the Model and capturing user input. It should be as "dumb" as possible, delegating all actions to the Controller.
* `MainWindow`: The main application window, toolbars, and menus.
* `ViewportWidget`: The 3D OpenGL viewport for rendering the model.
* `FeatureBrowser`: The UI component that lists the features in the document.
* **Controller:** This layer acts as the intermediary between the Model and the View. It contains the application's core logic.
* `ApplicationController`: The "brains" of the application. It is created in `main()` and passed to the UI. It responds to user actions from the View, manipulates the Model, and uses signals and slots to notify the View of any state changes.
## Development Log