From bd40fa403f4d4a908e9044f37b048c11157a05f2 Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Tue, 30 Aug 2022 16:43:37 +0200 Subject: [PATCH] Sketcher/BackEdit: makes view orientation factor accessible to coin managers --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 4 ++++ src/Mod/Sketcher/Gui/ViewProviderSketch.h | 2 ++ src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index e08d0d3178..487e1e8c8a 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -3581,6 +3581,10 @@ int ViewProviderSketch::getApplicationLogicalDPIX() const { return QApplication::desktop()->logicalDpiX(); } +int ViewProviderSketch::getViewOrientationFactor() const { + return viewOrientationFactor; +} + double ViewProviderSketch::getRotation(SbVec3f pos0, SbVec3f pos1) const { double x0,y0,x1,y1; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index f688003d67..5a98133d85 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -685,6 +685,8 @@ private: int getApplicationLogicalDPIX() const; + int getViewOrientationFactor() const; + double getRotation(SbVec3f pos0, SbVec3f pos1) const; bool isSketchInvalid() const; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h b/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h index a4f1fbc1db..28a51e1867 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketchCoinAttorney.h @@ -88,6 +88,7 @@ private: static inline double getRotation(const ViewProviderSketch & vp, SbVec3f pos0, SbVec3f pos1); static inline int defaultApplicationFontSizePixels(const ViewProviderSketch & vp); static inline int getApplicationLogicalDPIX(const ViewProviderSketch & vp); + static inline int getViewOrientationFactor(const ViewProviderSketch & vp); static inline bool isSketchInvalid(const ViewProviderSketch & vp); static inline bool isSketchFullyConstrained(const ViewProviderSketch & vp); @@ -183,6 +184,11 @@ inline int ViewProviderSketchCoinAttorney::getApplicationLogicalDPIX(const ViewP return vp.getApplicationLogicalDPIX(); } +inline int ViewProviderSketchCoinAttorney::getViewOrientationFactor(const ViewProviderSketch & vp) +{ + return vp.getViewOrientationFactor(); +} + inline bool ViewProviderSketchCoinAttorney::isSketchInvalid(const ViewProviderSketch & vp) { return vp.isSketchInvalid();