From 80d4cf9f40117e7563b7160af3d4cb2f8134f99a Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Mon, 24 Feb 2025 21:16:27 +0000 Subject: [PATCH] Gui: Remove `QtOpenGL.h`. --- src/Gui/Document.cpp | 1 + src/Gui/GLPainter.cpp | 2 ++ src/Gui/GLPainter.h | 18 ++++++++---- src/Gui/MainWindow.cpp | 1 + src/Gui/ManualAlignment.cpp | 1 + src/Gui/MouseSelection.cpp | 1 + src/Gui/NaviCube.cpp | 4 ++- src/Gui/Quarter/QuarterWidget.cpp | 1 + src/Gui/Quarter/QuarterWidget.h | 4 ++- src/Gui/Quarter/QuarterWidgetP.cpp | 2 ++ src/Gui/Quarter/QuarterWidgetP.h | 2 +- src/Gui/Quarter/SoQTQuarterAdaptor.cpp | 11 +++++-- src/Gui/Quarter/SoQTQuarterAdaptor.h | 3 ++ src/Gui/Selection/SoFCUnifiedSelection.cpp | 2 ++ src/Gui/SoFCOffscreenRenderer.cpp | 2 ++ src/Gui/SoFCOffscreenRenderer.h | 11 ++++++- src/Gui/SoTextLabel.cpp | 2 -- src/Gui/SplitView3DInventor.cpp | 1 + src/Gui/View3DInventor.h | 2 +- src/Gui/View3DInventorViewer.cpp | 3 ++ src/Gui/View3DInventorViewer.h | 12 ++++++++ src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp | 3 +- src/Mod/Sandbox/Gui/Overlay.cpp | 4 +-- src/Mod/Sandbox/Gui/Overlay.h | 1 - src/Mod/Sandbox/Gui/Workbench.cpp | 2 -- src/Mod/TechDraw/Gui/QGVPage.cpp | 1 + src/QtOpenGL.h | 34 ---------------------- 27 files changed, 73 insertions(+), 58 deletions(-) delete mode 100644 src/QtOpenGL.h diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 6c4ce52bec..18b71de9c9 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -36,6 +36,7 @@ # include # include # include +# include # include # include # include diff --git a/src/Gui/GLPainter.cpp b/src/Gui/GLPainter.cpp index a8b4ded3e3..600d2afb71 100644 --- a/src/Gui/GLPainter.cpp +++ b/src/Gui/GLPainter.cpp @@ -25,6 +25,8 @@ #ifndef _PreComp_ #endif +#include + #include "GLPainter.h" #include "View3DInventorViewer.h" diff --git a/src/Gui/GLPainter.h b/src/Gui/GLPainter.h index 228a4ae3cc..cae84007e0 100644 --- a/src/Gui/GLPainter.h +++ b/src/Gui/GLPainter.h @@ -24,6 +24,18 @@ #ifndef GUI_GLPAINTER_H #define GUI_GLPAINTER_H +#ifdef FC_OS_WIN32 +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include +#endif +#ifdef FC_OS_MACOSX +#include +#else +#include +#endif + #include #include #include @@ -31,12 +43,6 @@ class QPaintDevice; class QOpenGLWidget; -using GLenum = unsigned int; -using GLint = int; -using GLushort = unsigned short; -using GLfloat = float; -using GLdouble = double; - namespace Gui { class View3DInventorViewer; class GuiExport GLPainter diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index c02f15cdf6..f9efd1ed51 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -40,6 +40,7 @@ # include # include # include +# include # include # include # include diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index 224436aa09..10d54bf429 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -30,6 +30,7 @@ # include # include # include +# include # include # include # include diff --git a/src/Gui/MouseSelection.cpp b/src/Gui/MouseSelection.cpp index db87e3cffa..bf90a4054a 100644 --- a/src/Gui/MouseSelection.cpp +++ b/src/Gui/MouseSelection.cpp @@ -23,6 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #include #include diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index 7dbf88abb4..75826d7ec4 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -41,7 +41,9 @@ # include # include # include +# include # include +# include # include #endif @@ -705,7 +707,7 @@ void NaviCubeImplementation::prepare() delete m_PickingFramebuffer; m_PickingFramebuffer = new QOpenGLFramebufferObject(2 * m_CubeWidgetSize, 2 * m_CubeWidgetSize, - QOpenGLFramebufferObject::CombinedDepthStencil); + QOpenGLFramebufferObject::CombinedDepthStencil); m_View3DInventorViewer->getSoRenderManager()->scheduleRedraw(); } diff --git a/src/Gui/Quarter/QuarterWidget.cpp b/src/Gui/Quarter/QuarterWidget.cpp index 91ab6e6436..bcc76dd297 100644 --- a/src/Gui/Quarter/QuarterWidget.cpp +++ b/src/Gui/Quarter/QuarterWidget.cpp @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Gui/Quarter/QuarterWidget.h b/src/Gui/Quarter/QuarterWidget.h index c002cbd853..0e9b806745 100644 --- a/src/Gui/Quarter/QuarterWidget.h +++ b/src/Gui/Quarter/QuarterWidget.h @@ -39,10 +39,12 @@ #include #include #include -#include #include "Basic.h" +class QOpenGLContext; +class QOpenGLWidget; +class QSurfaceFormat; class QMenu; class SoNode; diff --git a/src/Gui/Quarter/QuarterWidgetP.cpp b/src/Gui/Quarter/QuarterWidgetP.cpp index fe83f6c061..bdfb46cdd5 100644 --- a/src/Gui/Quarter/QuarterWidgetP.cpp +++ b/src/Gui/Quarter/QuarterWidgetP.cpp @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/Gui/Quarter/QuarterWidgetP.h b/src/Gui/Quarter/QuarterWidgetP.h index 6cdab776cb..80f16fd2a8 100644 --- a/src/Gui/Quarter/QuarterWidgetP.h +++ b/src/Gui/Quarter/QuarterWidgetP.h @@ -36,8 +36,8 @@ #include #include #include -#include +class QOpenGLWidget; class SoNode; class SoCamera; diff --git a/src/Gui/Quarter/SoQTQuarterAdaptor.cpp b/src/Gui/Quarter/SoQTQuarterAdaptor.cpp index d585842c18..08486cde5a 100644 --- a/src/Gui/Quarter/SoQTQuarterAdaptor.cpp +++ b/src/Gui/Quarter/SoQTQuarterAdaptor.cpp @@ -34,11 +34,16 @@ #include #include -#if !defined(FC_OS_MACOSX) +# ifdef FC_OS_WIN32 +# include +# endif +# ifdef FC_OS_MACOSX +# include +# else # include -# include # include -#endif +# include +# endif #include "SoQTQuarterAdaptor.h" diff --git a/src/Gui/Quarter/SoQTQuarterAdaptor.h b/src/Gui/Quarter/SoQTQuarterAdaptor.h index b9af2b3c32..27187c5c07 100644 --- a/src/Gui/Quarter/SoQTQuarterAdaptor.h +++ b/src/Gui/Quarter/SoQTQuarterAdaptor.h @@ -31,6 +31,9 @@ #include "QuarterWidget.h" +class QOpenGLContext; +class QOpenGLWidget; +class QSurfaceFormat; class SbViewportRegion; class SoCamera; diff --git a/src/Gui/Selection/SoFCUnifiedSelection.cpp b/src/Gui/Selection/SoFCUnifiedSelection.cpp index cfea8bc4e3..1bf440887a 100644 --- a/src/Gui/Selection/SoFCUnifiedSelection.cpp +++ b/src/Gui/Selection/SoFCUnifiedSelection.cpp @@ -70,6 +70,8 @@ # include #endif +#include + #include #include #include diff --git a/src/Gui/SoFCOffscreenRenderer.cpp b/src/Gui/SoFCOffscreenRenderer.cpp index 522b0986df..91164936d1 100644 --- a/src/Gui/SoFCOffscreenRenderer.cpp +++ b/src/Gui/SoFCOffscreenRenderer.cpp @@ -43,6 +43,8 @@ # include #endif +#include +#include #include #include diff --git a/src/Gui/SoFCOffscreenRenderer.h b/src/Gui/SoFCOffscreenRenderer.h index 0d8e73a77a..3134cb71ea 100644 --- a/src/Gui/SoFCOffscreenRenderer.h +++ b/src/Gui/SoFCOffscreenRenderer.h @@ -27,12 +27,21 @@ #include #include +#ifdef FC_OS_MACOSX +# include +#else +# ifdef FC_OS_WIN32 +# include +# endif // FC_OS_WIN32 +# include +#endif // FC_OS_MACOSX + #include #include -#include #include +class QOpenGLFramebufferObject; namespace Gui { diff --git a/src/Gui/SoTextLabel.cpp b/src/Gui/SoTextLabel.cpp index 16ceb94de0..6e533bea98 100644 --- a/src/Gui/SoTextLabel.cpp +++ b/src/Gui/SoTextLabel.cpp @@ -58,8 +58,6 @@ #include #endif -#include - #include "SoTextLabel.h" #include "SoFCInteractiveElement.h" #include "Tools.h" diff --git a/src/Gui/SplitView3DInventor.cpp b/src/Gui/SplitView3DInventor.cpp index acc2792155..027da10e26 100644 --- a/src/Gui/SplitView3DInventor.cpp +++ b/src/Gui/SplitView3DInventor.cpp @@ -24,6 +24,7 @@ #ifndef _PreComp_ # include +# include # include # include # include diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index 9aeff252fa..efa6416844 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -26,7 +26,6 @@ #include #include #include -#include #include @@ -35,6 +34,7 @@ #include "Base/Vector3D.h" class QPrinter; +class QOpenGLWidget; class QStackedWidget; namespace Gui { diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index f3d8a59c05..e62e39c8a0 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -81,6 +81,9 @@ # include # include # include +# include +# include +# include # include # include # include diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index f025be8a65..fff99a082b 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -37,6 +37,15 @@ #include #include +#ifdef FC_OS_MACOSX +# include +#else +# ifdef FC_OS_WIN32 +# include +# endif // FC_OS_WIN32 +# include +#endif // FC_OS_MACOSX + #include #include "Namespace.h" @@ -49,6 +58,9 @@ #include #include +class QOpenGLFramebufferObject; +class QOpenGLWidget; +class QSurfaceFormat; class SoTranslation; class SoTransform; diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index fc7d8296f8..080e0584b2 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -411,10 +411,9 @@ bool MeshRenderer::matchMaterial(SoState* state) const return p->pcolors == pcolors; } -bool MeshRenderer::shouldRenderDirectly(bool direct) +bool MeshRenderer::shouldRenderDirectly([[maybe_unused]] bool direct) { #ifdef RENDER_GL_VAO - (void)direct; return false; #else return direct; diff --git a/src/Mod/Sandbox/Gui/Overlay.cpp b/src/Mod/Sandbox/Gui/Overlay.cpp index 71ecc5678c..a41b128e61 100644 --- a/src/Mod/Sandbox/Gui/Overlay.cpp +++ b/src/Mod/Sandbox/Gui/Overlay.cpp @@ -30,8 +30,6 @@ # include #endif -#include - #include #include #include @@ -107,7 +105,7 @@ Teapots(Gui::View3DInventorViewer* v) :view(v) rubberBandIsShown = false; fbObject = new QOpenGLFramebufferObject(size[0],size[1], - QOpenGLFramebufferObject::Depth); + QOpenGLFramebufferObject::Depth); resizeGL(size[0],size[1]); rubberBandIsShown = true; diff --git a/src/Mod/Sandbox/Gui/Overlay.h b/src/Mod/Sandbox/Gui/Overlay.h index c91d650cf0..814f0f3269 100644 --- a/src/Mod/Sandbox/Gui/Overlay.h +++ b/src/Mod/Sandbox/Gui/Overlay.h @@ -24,7 +24,6 @@ #ifndef SANDBOXGUI_OVERLAY_H #define SANDBOXGUI_OVERLAY_H -#include #include #include #include diff --git a/src/Mod/Sandbox/Gui/Workbench.cpp b/src/Mod/Sandbox/Gui/Workbench.cpp index 2db48a096a..2041262465 100644 --- a/src/Mod/Sandbox/Gui/Workbench.cpp +++ b/src/Mod/Sandbox/Gui/Workbench.cpp @@ -34,8 +34,6 @@ # include #endif -#include - #include "Workbench.h" #include #include diff --git a/src/Mod/TechDraw/Gui/QGVPage.cpp b/src/Mod/TechDraw/Gui/QGVPage.cpp index 840deaa174..f6065b775e 100644 --- a/src/Mod/TechDraw/Gui/QGVPage.cpp +++ b/src/Mod/TechDraw/Gui/QGVPage.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/src/QtOpenGL.h b/src/QtOpenGL.h deleted file mode 100644 index 24473f41cd..0000000000 --- a/src/QtOpenGL.h +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2017 Werner Mayer * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - - -#ifndef QUARTER_QTOPENGL_H -#define QUARTER_QTOPENGL_H - -#include -#include -#include -#include -#include -#include - -#endif //QUARTER_QTOPENGL_H