Add -DSLIC3R_CAD compile-time gate for the Design/CAD tab

Gate the entire parametric Design/CAD subsystem behind a single CMake
option so the fork can be built with or without it. With SLIC3R_CAD OFF
the build is behaviour-neutral against upstream OrcaSlicer; this is the
"parallel build" for upstream integration discussion.

Gated surface:
- option(SLIC3R_CAD) + add_definitions(-DSLIC3R_CAD)
- deps/OCCT/OCCT.cmake: BUILD_MODULE_ModelingAlgorithms=${SLIC3R_CAD}
  (OFF matches upstream OCCT exactly; ON adds only TKFillet + TKOffset)
- TKFillet/TKOffset link, add_subdirectory(slvs) + libslvs
- CAD kernel + GUI sources, GLGizmoPrimitive (needs GeometryEngine),
  CAD Catch2 tests
- 11 upstream C++ hook sites (GLCanvas3D, MainFrame, GLGizmosManager)
- TabPosition and gizmo EType enums switched to implicit numbering so
  OFF reproduces upstream indices exactly

Verified on behemoth both ways: OFF and ON link snapmaker-orca +
libslic3r_tests (exit 0); ON shows the Design tab and passes 8 [design]
+ 1 [Deviation] tests, OFF omits them and shows upstream's tab layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q
This commit is contained in:
Tommaso Bianchi
2026-07-10 18:12:53 +02:00
co-authored by Claude Opus 4.8
parent 546cef5f42
commit c618965a4c
11 changed files with 131 additions and 44 deletions
+17 -9
View File
@@ -50,7 +50,9 @@ namespace GUI
class Tab;
class PrintHostQueueDialog;
class Plater;
#ifdef SLIC3R_CAD
class DesignPanel;
#endif
class MainFrame;
class ParamsDialog;
#ifdef __WXGTK__
@@ -216,18 +218,22 @@ public:
bool get_mac_full_screen() { return m_mac_fullscreen; }
#endif
//BBS GUI refactor
// Implicitly numbered: with SLIC3R_CAD off, tpDesign vanishes and every later tab
// falls back to the index it has upstream. Do not reintroduce explicit values.
enum TabPosition
{
tpHome = 0,
tpDesign = 1,
tp3DEditor = 2,
tpPreview = 3,
tpMonitor = 4,
tpMultiDevice = 5,
tpProject = 6,
tpCalibration = 7,
tpAuxiliary = 8,
toDebugTool = 9,
#ifdef SLIC3R_CAD
tpDesign,
#endif
tp3DEditor,
tpPreview,
tpMonitor,
tpMultiDevice,
tpProject,
tpCalibration,
tpAuxiliary,
toDebugTool,
};
//BBS: add slice&&print status update logic
@@ -377,7 +383,9 @@ public:
BBLTopbar* m_topbar{ nullptr };
PrintHostQueueDialog* printhost_queue_dlg() { return m_printhost_queue_dlg; }
Plater* m_plater { nullptr };
#ifdef SLIC3R_CAD
DesignPanel* m_design_panel { nullptr };
#endif
//BBS: GUI refactor
MonitorPanel* m_monitor{ nullptr };