Move C++ feature code to src/Mod/Create/App and src/Mod/Create/Gui #251

Closed
opened 2026-02-16 17:13:09 +00:00 by forbes · 0 comments
Owner

Summary

Establish src/Mod/Create/ as the home for all Kindred-specific C++ features. Currently the Create module is pure Python (bootstrap loader). A CMakeLists.txt exists for installing the Python files and deploying addons, but no C++ targets are defined. C++ features like the planned FlipPocket should compile as part of a Create module library rather than living in mods/ (which stays pure Python).

Motivation

Clear separation of concerns:

  • mods/ = pure Python addons, versioned independently as submodules
  • src/Mod/Create/ = Kindred C++ module compiled with the application, may expose Python bindings
  • src/Gui/ = C++ platform infrastructure (EditingContext, FileOrigin, BreadcrumbToolBar) that enables addons

This prevents the need for addons to ship compiled C++ and keeps the build system simple.

Proposed structure

src/Mod/Create/
├── App/
│   ├── CMakeLists.txt
│   ├── CreateModule.cpp          # Module registration
│   ├── FeatureFlipPocket.cpp/.h  # Enhanced pocket (Phase 2 from INTEGRATION_PLAN)
│   └── ...                       # Future C++ features
├── Gui/
│   ├── CMakeLists.txt
│   ├── TaskFlipPocket.cpp/.h     # Task panel
│   ├── ViewProviderFlipPocket.cpp/.h
│   └── ...
├── Init.py                       # Existing bootstrap loader
├── InitGui.py                    # Existing GUI bootstrap
├── CMakeLists.txt                # Top-level, builds App + Gui libs
├── update_checker.py
└── version.py.in

Phase 1 (this issue)

  • Set up CMakeLists.txt scaffolding for src/Mod/Create/App/ and src/Mod/Create/Gui/
  • Create empty CreateModule.cpp that registers the module with FreeCAD's type system
  • Verify the module compiles and loads alongside the existing Python Init.py/InitGui.py
  • No features yet — just the build infrastructure

Phase 2 (future issue)

  • Implement Create::FlipPocket as described in INTEGRATION_PLAN.md Phase 2
  • Update ZTools_EnhancedPocket command to create Create::FlipPocket instead of the boolean workaround

Affected files

  • src/Mod/Create/CMakeLists.txt — updated to add C++ targets alongside existing Python install rules
  • src/Mod/Create/App/CMakeLists.txt — new
  • src/Mod/Create/Gui/CMakeLists.txt — new
  • src/Mod/Create/App/CreateModule.cpp — new
  • CMakeLists.txt (root) — add Create module to build

Acceptance criteria

  • src/Mod/Create/App/ and src/Mod/Create/Gui/ build as shared libraries
  • Create module registers with FreeCAD's type system at startup
  • Existing Python bootstrap (Init.py, InitGui.py) continues to work alongside C++ module
  • pixi run build succeeds with new CMake targets
  • No C++ features implemented yet — scaffold only

Dependencies

None (can proceed in parallel with SDK work)

Notes

This mirrors FreeCAD's pattern for other modules like PartDesign, Assembly, and Sketcher which all have App/ and Gui/ subdirectories with CMake targets. The Create module follows the same convention.

## Summary Establish `src/Mod/Create/` as the home for all Kindred-specific C++ features. Currently the Create module is pure Python (bootstrap loader). A `CMakeLists.txt` exists for installing the Python files and deploying addons, but no C++ targets are defined. C++ features like the planned FlipPocket should compile as part of a `Create` module library rather than living in `mods/` (which stays pure Python). ## Motivation Clear separation of concerns: - `mods/` = pure Python addons, versioned independently as submodules - `src/Mod/Create/` = Kindred C++ module compiled with the application, may expose Python bindings - `src/Gui/` = C++ platform infrastructure (EditingContext, FileOrigin, BreadcrumbToolBar) that enables addons This prevents the need for addons to ship compiled C++ and keeps the build system simple. ## Proposed structure ``` src/Mod/Create/ ├── App/ │ ├── CMakeLists.txt │ ├── CreateModule.cpp # Module registration │ ├── FeatureFlipPocket.cpp/.h # Enhanced pocket (Phase 2 from INTEGRATION_PLAN) │ └── ... # Future C++ features ├── Gui/ │ ├── CMakeLists.txt │ ├── TaskFlipPocket.cpp/.h # Task panel │ ├── ViewProviderFlipPocket.cpp/.h │ └── ... ├── Init.py # Existing bootstrap loader ├── InitGui.py # Existing GUI bootstrap ├── CMakeLists.txt # Top-level, builds App + Gui libs ├── update_checker.py └── version.py.in ``` ## Phase 1 (this issue) - Set up `CMakeLists.txt` scaffolding for `src/Mod/Create/App/` and `src/Mod/Create/Gui/` - Create empty `CreateModule.cpp` that registers the module with FreeCAD's type system - Verify the module compiles and loads alongside the existing Python Init.py/InitGui.py - No features yet — just the build infrastructure ## Phase 2 (future issue) - Implement `Create::FlipPocket` as described in INTEGRATION_PLAN.md Phase 2 - Update `ZTools_EnhancedPocket` command to create `Create::FlipPocket` instead of the boolean workaround ## Affected files - `src/Mod/Create/CMakeLists.txt` — updated to add C++ targets alongside existing Python install rules - `src/Mod/Create/App/CMakeLists.txt` — new - `src/Mod/Create/Gui/CMakeLists.txt` — new - `src/Mod/Create/App/CreateModule.cpp` — new - `CMakeLists.txt` (root) — add Create module to build ## Acceptance criteria - [ ] `src/Mod/Create/App/` and `src/Mod/Create/Gui/` build as shared libraries - [ ] Create module registers with FreeCAD's type system at startup - [ ] Existing Python bootstrap (Init.py, InitGui.py) continues to work alongside C++ module - [ ] pixi run build succeeds with new CMake targets - [ ] No C++ features implemented yet — scaffold only ## Dependencies None (can proceed in parallel with SDK work) ## Notes This mirrors FreeCAD's pattern for other modules like PartDesign, Assembly, and Sketcher which all have App/ and Gui/ subdirectories with CMake targets. The Create module follows the same convention.
forbes added the enhancement label 2026-02-16 17:13:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#251