From 271e3bec4a6956f70fe1fc50c5f0a201c0fadf17 Mon Sep 17 00:00:00 2001 From: Paddle Date: Fri, 7 Apr 2023 10:06:01 +0200 Subject: [PATCH] Move SoDatumLabel from Sketcher to Core so that it can be reused anywhere. --- src/Gui/CMakeLists.txt | 2 ++ src/{Mod/Sketcher => }/Gui/SoDatumLabel.cpp | 2 +- src/{Mod/Sketcher => }/Gui/SoDatumLabel.h | 12 ++++++------ src/Gui/SoFCDB.cpp | 2 ++ src/Mod/Sketcher/Gui/AppSketcherGui.cpp | 2 -- src/Mod/Sketcher/Gui/CMakeLists.txt | 2 -- .../Sketcher/Gui/EditModeConstraintCoinManager.cpp | 3 ++- 7 files changed, 13 insertions(+), 12 deletions(-) rename src/{Mod/Sketcher => }/Gui/SoDatumLabel.cpp (99%) rename src/{Mod/Sketcher => }/Gui/SoDatumLabel.h (93%) diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index b795387fa8..fd7adbde1b 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -968,6 +968,7 @@ SET(Inventor_CPP_SRCS SoNavigationDragger.cpp SoAxisCrossKit.cpp SoTextLabel.cpp + SoDatumLabel.cpp SoTouchEvents.cpp SoMouseWheelEvent.cpp SoFCCSysDragger.cpp @@ -995,6 +996,7 @@ SET(Inventor_SRCS SoNavigationDragger.h SoAxisCrossKit.h SoTextLabel.h + SoDatumLabel.h SoTouchEvents.h SoMouseWheelEvent.h SoFCCSysDragger.h diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp similarity index 99% rename from src/Mod/Sketcher/Gui/SoDatumLabel.cpp rename to src/Gui/SoDatumLabel.cpp index 1c5c4add8d..9ab80a1f4b 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -55,7 +55,7 @@ #define ZCONSTR 0.006f -using namespace SketcherGui; +using namespace Gui; // ------------------------------------------------------ diff --git a/src/Mod/Sketcher/Gui/SoDatumLabel.h b/src/Gui/SoDatumLabel.h similarity index 93% rename from src/Mod/Sketcher/Gui/SoDatumLabel.h rename to src/Gui/SoDatumLabel.h index 766979d1e3..f4eb5685d3 100644 --- a/src/Mod/Sketcher/Gui/SoDatumLabel.h +++ b/src/Gui/SoDatumLabel.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef SKETCHERGUI_SODATUMLABEL_H -#define SKETCHERGUI_SODATUMLABEL_H +#ifndef GUI_SODATUMLABEL_H +#define GUI_SODATUMLABEL_H #include #include @@ -35,12 +35,12 @@ #include #include -#include +#include -namespace SketcherGui { +namespace Gui { -class SketcherGuiExport SoDatumLabel : public SoShape { +class GuiExport SoDatumLabel : public SoShape { using inherited = SoShape; SO_NODE_HEADER(SoDatumLabel); @@ -99,4 +99,4 @@ private: } -#endif // SKETCHERGUI_SODATUMLABEL_H +#endif // GUI_SODATUMLABEL_H diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index 1fb8002705..08598a269b 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -69,6 +69,7 @@ #include "SoMouseWheelEvent.h" #include "SoNavigationDragger.h" #include "SoTextLabel.h" +#include "SoDatumLabel.h" #include "Inventor/MarkerBitmaps.h" #include "Inventor/SmSwitchboard.h" #include "Inventor/SoAutoZoomTranslation.h" @@ -124,6 +125,7 @@ void Gui::SoFCDB::init() SoVRMLAction ::initClass(); SoSkipBoundingGroup ::initClass(); SoTextLabel ::initClass(); + SoDatumLabel ::initClass(); SoColorBarLabel ::initClass(); SoStringLabel ::initClass(); SoFrameLabel ::initClass(); diff --git a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp index 5400376a45..37d62d793c 100644 --- a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp +++ b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp @@ -32,7 +32,6 @@ #include "PropertyConstraintListItem.h" #include "SketcherSettings.h" -#include "SoDatumLabel.h" #include "SoZoomTranslation.h" #include "ViewProviderPython.h" #include "ViewProviderSketch.h" @@ -125,7 +124,6 @@ PyMOD_INIT_FUNC(SketcherGui) SketcherGui::ViewProviderPython ::init(); SketcherGui::ViewProviderCustom ::init(); SketcherGui::ViewProviderCustomPython ::init(); - SketcherGui::SoDatumLabel ::initClass(); SketcherGui::SoZoomTranslation ::initClass(); SketcherGui::PropertyConstraintListItem ::init(); SketcherGui::ViewProviderSketchGeometryExtension ::init(); diff --git a/src/Mod/Sketcher/Gui/CMakeLists.txt b/src/Mod/Sketcher/Gui/CMakeLists.txt index 74f4fdedbf..bf24df36fc 100644 --- a/src/Mod/Sketcher/Gui/CMakeLists.txt +++ b/src/Mod/Sketcher/Gui/CMakeLists.txt @@ -87,8 +87,6 @@ SET(SketcherGui_SRCS PreCompiled.h SoZoomTranslation.cpp SoZoomTranslation.h - SoDatumLabel.cpp - SoDatumLabel.h PropertyConstraintListItem.h PropertyConstraintListItem.cpp TaskSketcherConstraints.ui diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp index ffeb8283ee..3f62f61884 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -58,13 +59,13 @@ #include #include "EditModeConstraintCoinManager.h" -#include "SoDatumLabel.h" #include "SoZoomTranslation.h" #include "ViewProviderSketch.h" #include "ViewProviderSketchCoinAttorney.h" #include "Utils.h" +using namespace Gui; using namespace SketcherGui; using namespace Sketcher;