diff --git a/src/App/Range.h b/src/App/Range.h index 554a02057a..86872a4436 100644 --- a/src/App/Range.h +++ b/src/App/Range.h @@ -24,9 +24,6 @@ #define RANGE_H #include -#ifndef FC_GLOBAL_H -#include -#endif namespace App { diff --git a/src/Base/Builder3D.h b/src/Base/Builder3D.h index 927e0880d9..239f56e5a2 100644 --- a/src/Base/Builder3D.h +++ b/src/Base/Builder3D.h @@ -29,9 +29,6 @@ #include #include #include "Vector3D.h" -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/Debugger.h b/src/Base/Debugger.h index 503b3fba3a..114b7e38b0 100644 --- a/src/Base/Debugger.h +++ b/src/Base/Debugger.h @@ -26,9 +26,6 @@ #include #include -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { /** diff --git a/src/Base/Factory.h b/src/Base/Factory.h index 92699083cf..06b51322cc 100644 --- a/src/Base/Factory.h +++ b/src/Base/Factory.h @@ -25,13 +25,11 @@ #ifndef BASE_FACTORY_H #define BASE_FACTORY_H -#include -#include -#include -#include -#ifndef FC_GLOBAL_H -#include -#endif +#include +#include +#include +#include +#include"../FCConfig.h" namespace Base diff --git a/src/Base/FileTemplate.h b/src/Base/FileTemplate.h index c18e633f60..42b90a19fa 100644 --- a/src/Base/FileTemplate.h +++ b/src/Base/FileTemplate.h @@ -27,9 +27,6 @@ // Std. configurations #include -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/Handle.h b/src/Base/Handle.h index 7ca41f4466..539704ca43 100644 --- a/src/Base/Handle.h +++ b/src/Base/Handle.h @@ -30,9 +30,6 @@ #include #include #include -#ifndef FC_GLOBAL_H -#include -#endif class QAtomicInt; diff --git a/src/Base/InputSource.h b/src/Base/InputSource.h index 856c5fd849..8178a130fe 100644 --- a/src/Base/InputSource.h +++ b/src/Base/InputSource.h @@ -32,9 +32,6 @@ #include #include #include -#ifndef FC_GLOBAL_H -#include -#endif XERCES_CPP_NAMESPACE_BEGIN diff --git a/src/Base/Matrix.h b/src/Base/Matrix.h index f87b626b05..dd2bbe2e13 100644 --- a/src/Base/Matrix.h +++ b/src/Base/Matrix.h @@ -25,15 +25,12 @@ #define BASE_MATRIX_H #include -#include #include #include #include #include "Vector3D.h" -#ifndef FC_GLOBAL_H -#include -#endif +#include namespace Base { diff --git a/src/Base/MemDebug.h b/src/Base/MemDebug.h index 4ef8ce5f43..1b3d980f5a 100644 --- a/src/Base/MemDebug.h +++ b/src/Base/MemDebug.h @@ -22,34 +22,30 @@ #ifndef BASE_MEMDEBUG_H #define BASE_MEMDEBUG_H -#ifndef FC_GLOBAL_H -#include -#include -#endif namespace Base { - + // Std. configurations -#if defined(_MSC_VER) -class BaseExport MemCheck -{ -public: - MemCheck(); - ~MemCheck(); - - void setNextCheckpoint(); - static bool checkMemory(); - static bool dumpLeaks(); - static bool isValidHeapPointer(const void*); - -private: - _CrtMemState s1, s2, s3; -}; +#if defined(_MSC_VER) +class BaseExport MemCheck +{ +public: + MemCheck(); + ~MemCheck(); + + void setNextCheckpoint(); + static bool checkMemory(); + static bool dumpLeaks(); + static bool isValidHeapPointer(const void*); + +private: + _CrtMemState s1, s2, s3; +}; #endif - + } //namespace Base #endif // BASE_MEMDEBUG_H diff --git a/src/Base/PyTools.h b/src/Base/PyTools.h index 13a7c0774c..bc1d4c43bc 100644 --- a/src/Base/PyTools.h +++ b/src/Base/PyTools.h @@ -73,9 +73,6 @@ extern "C" { /* a C library, but callable from C++ */ # undef _POSIX_C_SOURCE #endif // (re-)defined in pyconfig.h #include -#ifndef FC_GLOBAL_H -#include -#endif extern int PP_RELOAD; /* 1=reload py modules when attributes referenced */ extern int PP_DEBUG; /* 1=start debugger when string/function/member run */ diff --git a/src/Base/Rotation.h b/src/Base/Rotation.h index f6236abcfb..f334ce2aca 100644 --- a/src/Base/Rotation.h +++ b/src/Base/Rotation.h @@ -25,9 +25,6 @@ #define BASE_ROTATION_H #include "Vector3D.h" -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/StackWalker.h b/src/Base/StackWalker.h index 6e80971dc5..788c818223 100644 --- a/src/Base/StackWalker.h +++ b/src/Base/StackWalker.h @@ -36,10 +36,7 @@ // so we need not to check the version (because we only support _MSC_VER >= 1100)! #pragma once -#include -#ifndef FC_GLOBAL_H -#include -#endif +#include // special defines for VC5/6 (if no actual PSDK is installed): #if _MSC_VER < 1300 diff --git a/src/Base/Tools.h b/src/Base/Tools.h index 62aea2f933..e0f007f1fa 100644 --- a/src/Base/Tools.h +++ b/src/Base/Tools.h @@ -24,9 +24,6 @@ #ifndef BASE_TOOLS_H #define BASE_TOOLS_H -#ifndef FC_GLOBAL_H -#include -#endif #include #include #include diff --git a/src/Base/Tools2D.h b/src/Base/Tools2D.h index 7656557a70..cb228d10fe 100644 --- a/src/Base/Tools2D.h +++ b/src/Base/Tools2D.h @@ -28,14 +28,11 @@ #include #include #include -#include +#include #include #include #include "Vector3D.h" -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/Translate.h b/src/Base/Translate.h index 1b75a2fe26..c77a7b28c0 100644 --- a/src/Base/Translate.h +++ b/src/Base/Translate.h @@ -26,9 +26,6 @@ #include #include -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/Type.h b/src/Base/Type.h index f77390cf56..866cdd3694 100644 --- a/src/Base/Type.h +++ b/src/Base/Type.h @@ -30,9 +30,6 @@ #include #include #include -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/Base/Uuid.h b/src/Base/Uuid.h index 93e7d1986e..e8b8c01729 100644 --- a/src/Base/Uuid.h +++ b/src/Base/Uuid.h @@ -27,9 +27,6 @@ // Std. configurations #include -#ifndef FC_GLOBAL_H -#include -#endif namespace Base { diff --git a/src/FCConfig.h b/src/FCConfig.h index a9addc0321..aeb476b061 100644 --- a/src/FCConfig.h +++ b/src/FCConfig.h @@ -304,7 +304,39 @@ typedef unsigned __int64 uint64_t; //************************************************************************** // Windows import export DLL defines -#include +#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN) +# ifdef FCApp +# define AppExport __declspec(dllexport) +# define DataExport __declspec(dllexport) +# else +# define AppExport __declspec(dllimport) +# define DataExport __declspec(dllimport) +# endif +# ifdef FCBase +# define BaseExport __declspec(dllexport) +# else +# define BaseExport __declspec(dllimport) +# endif +# ifdef FCGui +# define GuiExport __declspec(dllexport) +# else +# define GuiExport __declspec(dllimport) +# endif +#else +# ifndef BaseExport +# define BaseExport +# endif +# ifndef GuiExport +# define GuiExport +# endif +# ifndef AppExport +# define AppExport +# endif +# ifndef DataExport +# define DataExport +# endif +#endif + //************************************************************************** // here get the warnings of too long specifiers disabled (needed for VC6) diff --git a/src/FCGlobal.h b/src/FCGlobal.h deleted file mode 100644 index 6e0e5ccf54..0000000000 --- a/src/FCGlobal.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2019 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 * - * * - ***************************************************************************/ -/** \file FCGlobal.h - * \brief Include export or import macros. - */ - - -#ifndef FC_GLOBAL_H -#define FC_GLOBAL_H - - -#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || defined(__CYGWIN__) -# define FREECAD_DECL_EXPORT __declspec(dllexport) -# define FREECAD_DECL_IMPORT __declspec(dllimport) -#else -# define FREECAD_DECL_EXPORT -# define FREECAD_DECL_IMPORT -#endif - -// FreeCADBase -#ifdef FreeCADBase_EXPORTS -# define BaseExport FREECAD_DECL_EXPORT -#else -# define BaseExport FREECAD_DECL_IMPORT -#endif - -// FreeCADApp -#ifdef FreeCADApp_EXPORTS -# define AppExport FREECAD_DECL_EXPORT -# define DataExport FREECAD_DECL_EXPORT -#else -# define AppExport FREECAD_DECL_IMPORT -# define DataExport FREECAD_DECL_IMPORT -#endif - -// FreeCADGui -#ifdef FreeCADGui_EXPORTS -# define GuiExport FREECAD_DECL_EXPORT -#else -# define GuiExport FREECAD_DECL_IMPORT -#endif - -#endif //FC_GLOBAL_H diff --git a/src/Mod/Image/App/ImageBase.h b/src/Mod/Image/App/ImageBase.h index bb013316be..144699c717 100644 --- a/src/Mod/Image/App/ImageBase.h +++ b/src/Mod/Image/App/ImageBase.h @@ -18,8 +18,6 @@ #ifndef IMAGEBASE_H #define IMAGEBASE_H -#include - namespace Image { diff --git a/src/Mod/Image/App/ImagePlane.h b/src/Mod/Image/App/ImagePlane.h index 22a462f840..a2633e155d 100644 --- a/src/Mod/Image/App/ImagePlane.h +++ b/src/Mod/Image/App/ImagePlane.h @@ -27,7 +27,6 @@ #include #include #include -#include namespace Image { diff --git a/src/Mod/Image/Gui/ImageView.h b/src/Mod/Image/Gui/ImageView.h index 7bc34f8e21..c66ef7c847 100644 --- a/src/Mod/Image/Gui/ImageView.h +++ b/src/Mod/Image/Gui/ImageView.h @@ -25,7 +25,6 @@ #else #include "GLImageBox.h" #endif -#include class QSlider; class QAction; diff --git a/src/Mod/Image/Gui/ViewProviderImagePlane.h b/src/Mod/Image/Gui/ViewProviderImagePlane.h index c4e3bba7f6..d676fe8096 100644 --- a/src/Mod/Image/Gui/ViewProviderImagePlane.h +++ b/src/Mod/Image/Gui/ViewProviderImagePlane.h @@ -25,7 +25,6 @@ #define IMAGE_ViewProviderImagePlane_H #include -#include class SoCoordinate3; class SoDrawStyle; @@ -49,12 +48,12 @@ public: void attach(App::DocumentObject *pcObject); void setDisplayMode(const char* ModeName); std::vector getDisplayModes() const; - void updateData(const App::Property*); - -private: - bool loadSvg(const char*, float x, float y, QImage& img); - -protected: + void updateData(const App::Property*); + +private: + bool loadSvg(const char*, float x, float y, QImage& img); + +protected: SoCoordinate3 * pcCoords; SoTexture2 * texture; }; diff --git a/src/Mod/Image/Gui/Workbench.h b/src/Mod/Image/Gui/Workbench.h index 16f8eb2dde..d8533ff3ac 100644 --- a/src/Mod/Image/Gui/Workbench.h +++ b/src/Mod/Image/Gui/Workbench.h @@ -25,7 +25,6 @@ #define IMAGE_WORKBENCH_H #include -#include namespace ImageGui { diff --git a/src/Mod/Image/ImageGlobal.h b/src/Mod/Image/ImageGlobal.h deleted file mode 100644 index 26cca10062..0000000000 --- a/src/Mod/Image/ImageGlobal.h +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (c) Imetric 4D Imaging Sarl * - * * - * Author: Werner Mayer * - * * - ***************************************************************************/ - -#include - -#ifndef IMAGE_GLOBAL_H -#define IMAGE_GLOBAL_H - - -// Image -#ifndef ImageExport -#ifdef Image_EXPORTS -# define ImageExport FREECAD_DECL_EXPORT -#else -# define ImageExport FREECAD_DECL_IMPORT -#endif -#endif - -// ImageGui -#ifndef ImageGuiExport -#ifdef ImageGui_EXPORTS -# define ImageGuiExport FREECAD_DECL_EXPORT -#else -# define ImageGuiExport FREECAD_DECL_IMPORT -#endif -#endif - -#endif //IMAGE_GLOBAL_H diff --git a/src/Mod/Mesh/App/Core/Approximation.h b/src/Mod/Mesh/App/Core/Approximation.h index cd71e568fb..db61724d3c 100644 --- a/src/Mod/Mesh/App/Core/Approximation.h +++ b/src/Mod/Mesh/App/Core/Approximation.h @@ -28,9 +28,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif #include #include #include diff --git a/src/Mod/Mesh/App/Core/Definitions.h b/src/Mod/Mesh/App/Core/Definitions.h index 0aadd101db..454ffb6081 100644 --- a/src/Mod/Mesh/App/Core/Definitions.h +++ b/src/Mod/Mesh/App/Core/Definitions.h @@ -24,10 +24,6 @@ #ifndef MESH_DEFINITIONS_H #define MESH_DEFINITIONS_H -#ifndef MESH_GLOBAL_H -#include -#endif - // default values #define MESH_MIN_PT_DIST 1.0e-6f #define MESH_MIN_EDGE_LEN 1.0e-3f diff --git a/src/Mod/Mesh/App/Core/Visitor.h b/src/Mod/Mesh/App/Core/Visitor.h index bac568451e..52594dad98 100644 --- a/src/Mod/Mesh/App/Core/Visitor.h +++ b/src/Mod/Mesh/App/Core/Visitor.h @@ -24,10 +24,6 @@ #ifndef VISITOR_H #define VISITOR_H -#ifndef MESH_GLOBAL_H -#include -#endif - namespace MeshCore { class MeshFacet; diff --git a/src/Mod/Mesh/App/FeatureMeshExport.h b/src/Mod/Mesh/App/FeatureMeshExport.h index 0c5bf479c3..fcb380a6af 100644 --- a/src/Mod/Mesh/App/FeatureMeshExport.h +++ b/src/Mod/Mesh/App/FeatureMeshExport.h @@ -27,9 +27,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif namespace Mesh { diff --git a/src/Mod/Mesh/App/MeshPoint.h b/src/Mod/Mesh/App/MeshPoint.h index beaf2f6017..c06e4c30a5 100644 --- a/src/Mod/Mesh/App/MeshPoint.h +++ b/src/Mod/Mesh/App/MeshPoint.h @@ -24,13 +24,10 @@ #ifndef MESH_MESHPOINT_H #define MESH_MESHPOINT_H -#include #include #include -#include -#ifndef MESH_GLOBAL_H -#include -#endif + +#include "Mesh.h" using Base::Vector3d; @@ -62,4 +59,4 @@ public: } // namespace Mesh -#endif // MESH_MESHPOINT_H +#endif // MESH_MESH_H diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h index 68b5f8e99c..9939ec7bcc 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h +++ b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h @@ -24,9 +24,6 @@ #ifndef MESHGUI_DLGSETTINGSIMPORTEXPORTIMP_H #define MESHGUI_DLGSETTINGSIMPORTEXPORTIMP_H -#ifndef MESH_GLOBAL_H -#include -#endif #include namespace MeshGui { diff --git a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h index 2e567094a2..4157d10ab6 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h +++ b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h @@ -24,9 +24,6 @@ #ifndef MESHGUI_DLGSETTINGSMESHVIEW_H #define MESHGUI_DLGSETTINGSMESHVIEW_H -#ifndef MESH_GLOBAL_H -#include -#endif #include #include diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.h b/src/Mod/Mesh/Gui/DlgSmoothing.h index 05e37c08bf..49b8047cad 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.h +++ b/src/Mod/Mesh/Gui/DlgSmoothing.h @@ -27,9 +27,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif class QButtonGroup; diff --git a/src/Mod/Mesh/Gui/MeshSelection.h b/src/Mod/Mesh/Gui/MeshSelection.h index f3af6c48b5..53bcef99b7 100644 --- a/src/Mod/Mesh/Gui/MeshSelection.h +++ b/src/Mod/Mesh/Gui/MeshSelection.h @@ -30,9 +30,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif namespace Gui { class View3DInventorViewer; diff --git a/src/Mod/Mesh/Gui/PropertyEditorMesh.h b/src/Mod/Mesh/Gui/PropertyEditorMesh.h index c08228a580..f8311fdf6f 100644 --- a/src/Mod/Mesh/Gui/PropertyEditorMesh.h +++ b/src/Mod/Mesh/Gui/PropertyEditorMesh.h @@ -24,9 +24,6 @@ #define MESHGUI_PROPERTYEDITOR_MESH_H #include -#ifndef MESH_GLOBAL_H -#include -#endif namespace MeshGui { diff --git a/src/Mod/Mesh/Gui/Segmentation.h b/src/Mod/Mesh/Gui/Segmentation.h index 17a1d32f61..fd9755ffe8 100644 --- a/src/Mod/Mesh/Gui/Segmentation.h +++ b/src/Mod/Mesh/Gui/Segmentation.h @@ -27,9 +27,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif // forward declarations namespace Mesh { class Feature; } diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.h b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.h index cbd54ef8b4..2f85b74d18 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.h +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.h @@ -28,9 +28,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif class SoGLCoordinateElement; class SoTextureCoordinateBundle; diff --git a/src/Mod/Mesh/Gui/SoPolygon.h b/src/Mod/Mesh/Gui/SoPolygon.h index 265d17242a..df418c200a 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.h +++ b/src/Mod/Mesh/Gui/SoPolygon.h @@ -30,9 +30,6 @@ #include #include #include -#ifndef MESH_GLOBAL_H -#include -#endif namespace MeshGui { diff --git a/src/Mod/Mesh/Gui/Workbench.h b/src/Mod/Mesh/Gui/Workbench.h index ce10c46dc3..fba985f949 100644 --- a/src/Mod/Mesh/Gui/Workbench.h +++ b/src/Mod/Mesh/Gui/Workbench.h @@ -24,9 +24,6 @@ #ifndef MESH_WORKBENCH_H #define MESH_WORKBENCH_H -#ifndef MESH_GLOBAL_H -#include -#endif #include namespace MeshGui { diff --git a/src/Mod/Mesh/MeshGlobal.h b/src/Mod/Mesh/MeshGlobal.h deleted file mode 100644 index bf8d4d3589..0000000000 --- a/src/Mod/Mesh/MeshGlobal.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2019 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 * - * * - ***************************************************************************/ - -#include - -#ifndef MESH_GLOBAL_H -#define MESH_GLOBAL_H - - -// Mesh -#ifndef MeshExport -#ifdef Mesh_EXPORTS -# define MeshExport FREECAD_DECL_EXPORT -#else -# define MeshExport FREECAD_DECL_IMPORT -#endif -#endif - -// MeshGui -#ifndef MeshGuiExport -#ifdef MeshGui_EXPORTS -# define MeshGuiExport FREECAD_DECL_EXPORT -#else -# define MeshGuiExport FREECAD_DECL_IMPORT -#endif -#endif - -#endif //MESH_GLOBAL_H diff --git a/src/Mod/PartDesign/App/Feature.h b/src/Mod/PartDesign/App/Feature.h index cb430ee80d..99c763d325 100644 --- a/src/Mod/PartDesign/App/Feature.h +++ b/src/Mod/PartDesign/App/Feature.h @@ -26,7 +26,6 @@ #include #include -#include class gp_Pnt; class gp_Pln; diff --git a/src/Mod/PartDesign/App/ShapeBinder.cpp b/src/Mod/PartDesign/App/ShapeBinder.cpp index 6fd3f5c4a4..b1db1349bc 100644 --- a/src/Mod/PartDesign/App/ShapeBinder.cpp +++ b/src/Mod/PartDesign/App/ShapeBinder.cpp @@ -70,11 +70,6 @@ ShapeBinder::~ShapeBinder() this->connectDocumentChangedObject.disconnect(); } -void ShapeBinder::onChanged(const App::Property* prop) -{ - Feature::onChanged(prop); -} - short int ShapeBinder::mustExecute(void) const { if (Support.isTouched()) @@ -85,45 +80,29 @@ short int ShapeBinder::mustExecute(void) const { return Part::Feature::mustExecute(); } -Part::TopoShape ShapeBinder::updatedShape() const -{ - Part::TopoShape shape; - App::GeoFeature* obj = nullptr; - std::vector subs; - - ShapeBinder::getFilteredReferences(&Support, obj, subs); - - //if we have a link we rebuild the shape, but we change nothing if we are a simple copy - if (obj) { - shape = ShapeBinder::buildShapeFromReferences(obj, subs); - //now, shape is in object's CS, and includes local Placement of obj but nothing else. - - if (TraceSupport.getValue()) { - //compute the transform, and apply it to the shape. - Base::Placement sourceCS = //full placement of container of obj - obj->globalPlacement() * obj->Placement.getValue().inverse(); - Base::Placement targetCS = //full placement of container of this shapebinder - this->globalPlacement() * this->Placement.getValue().inverse(); - Base::Placement transform = targetCS.inverse() * sourceCS; - shape.setPlacement(transform * shape.getPlacement()); - } - } - - return shape; -} - -bool ShapeBinder::hasPlacementChanged() const -{ - Part::TopoShape shape(updatedShape()); - Base::Placement placement(shape.getTransform()); - return this->Placement.getValue() != placement; -} - App::DocumentObjectExecReturn* ShapeBinder::execute(void) { if (!this->isRestoring()) { - Part::TopoShape shape(updatedShape()); - if (!shape.isNull()) { + App::GeoFeature* obj = nullptr; + std::vector subs; + + ShapeBinder::getFilteredReferences(&Support, obj, subs); + + //if we have a link we rebuild the shape, but we change nothing if we are a simple copy + if (obj) { + Part::TopoShape shape(ShapeBinder::buildShapeFromReferences(obj, subs)); + //now, shape is in object's CS, and includes local Placement of obj but nothing else. + + if (TraceSupport.getValue()) { + //compute the transform, and apply it to the shape. + Base::Placement sourceCS = //full placement of container of obj + obj->globalPlacement() * obj->Placement.getValue().inverse(); + Base::Placement targetCS = //full placement of container of this shapebinder + this->globalPlacement() * this->Placement.getValue().inverse(); + Base::Placement transform = targetCS.inverse() * sourceCS; + shape.setPlacement(transform * shape.getPlacement()); + } + this->Placement.setValue(shape.getTransform()); this->Shape.setValue(shape); } @@ -132,8 +111,7 @@ App::DocumentObjectExecReturn* ShapeBinder::execute(void) { return Part::Feature::execute(); } -void ShapeBinder::getFilteredReferences(const App::PropertyLinkSubList* prop, - App::GeoFeature*& obj, +void ShapeBinder::getFilteredReferences(App::PropertyLinkSubList* prop, App::GeoFeature*& obj, std::vector< std::string >& subobjects) { obj = nullptr; @@ -275,8 +253,7 @@ void ShapeBinder::slotChangedObject(const App::DocumentObject& Obj, const App::P if (obj) { if (obj == &Obj) { // the directly referenced object has changed - if (hasPlacementChanged()) - enforceRecompute(); + enforceRecompute(); } else if (Obj.hasExtension(App::GroupExtension::getExtensionClassTypeId())) { // check if the changed property belongs to a group-like object @@ -289,8 +266,7 @@ void ShapeBinder::slotChangedObject(const App::DocumentObject& Obj, const App::P auto it = std::find(chain.begin(), chain.end(), &Obj); if (it != chain.end()) { - if (hasPlacementChanged()) - enforceRecompute(); + enforceRecompute(); } } } diff --git a/src/Mod/PartDesign/App/ShapeBinder.h b/src/Mod/PartDesign/App/ShapeBinder.h index 01500701fe..ba7c548cd4 100644 --- a/src/Mod/PartDesign/App/ShapeBinder.h +++ b/src/Mod/PartDesign/App/ShapeBinder.h @@ -28,7 +28,6 @@ #include #include #include -#include namespace PartDesign { @@ -52,7 +51,7 @@ public: App::PropertyLinkSubListGlobal Support; App::PropertyBool TraceSupport; - static void getFilteredReferences(const App::PropertyLinkSubList* prop, App::GeoFeature*& object, std::vector< std::string >& subobjects); + static void getFilteredReferences(App::PropertyLinkSubList* prop, App::GeoFeature*& object, std::vector< std::string >& subobjects); static Part::TopoShape buildShapeFromReferences(App::GeoFeature* obj, std::vector< std::string > subs); const char* getViewProviderName(void) const override { @@ -60,12 +59,9 @@ public: } protected: - Part::TopoShape updatedShape() const; - bool hasPlacementChanged() const; virtual void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop) override; virtual short int mustExecute(void) const override; virtual App::DocumentObjectExecReturn* execute(void) override; - virtual void onChanged(const App::Property* prop) override; private: void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop); diff --git a/src/Mod/PartDesign/PartDesignGlobal.h b/src/Mod/PartDesign/PartDesignGlobal.h deleted file mode 100644 index 521ff7f231..0000000000 --- a/src/Mod/PartDesign/PartDesignGlobal.h +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2021 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 PARTDESIGN_GLOBAL_H -#define PARTDESIGN_GLOBAL_H - -#include - - -// PartDesign -#ifndef PartDesignExport -#ifdef PartDesign_EXPORTS -# define PartDesignExport FREECAD_DECL_EXPORT -#else -# define PartDesignExport FREECAD_DECL_IMPORT -#endif -#endif - -// PartDesignGui -#ifndef PartDesignGuiExport -#ifdef PartDesignGui_EXPORTS -# define PartDesignGuiExport FREECAD_DECL_EXPORT -#else -# define PartDesignGuiExport FREECAD_DECL_IMPORT -#endif -#endif - -#endif //PARTDESIGN_GLOBAL_H diff --git a/src/Mod/Points/App/Points.h b/src/Mod/Points/App/Points.h index 67fa6e57a8..643e3ea99e 100644 --- a/src/Mod/Points/App/Points.h +++ b/src/Mod/Points/App/Points.h @@ -34,7 +34,6 @@ #include #include -#include namespace Points { diff --git a/src/Mod/Points/Gui/ViewProvider.h b/src/Mod/Points/Gui/ViewProvider.h index 47cc7f7e78..926fa7f900 100644 --- a/src/Mod/Points/Gui/ViewProvider.h +++ b/src/Mod/Points/Gui/ViewProvider.h @@ -28,7 +28,6 @@ #include #include #include -#include class SoSwitch; diff --git a/src/Mod/Points/Gui/Workbench.h b/src/Mod/Points/Gui/Workbench.h index 99753fc1c3..ebb4c6dbde 100644 --- a/src/Mod/Points/Gui/Workbench.h +++ b/src/Mod/Points/Gui/Workbench.h @@ -25,7 +25,6 @@ #define POINTS_WORKBENCH_H #include -#include namespace PointsGui { diff --git a/src/Mod/Points/PointsGlobal.h b/src/Mod/Points/PointsGlobal.h deleted file mode 100644 index 5ba83d6b96..0000000000 --- a/src/Mod/Points/PointsGlobal.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2019 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 * - * * - ***************************************************************************/ - -#include - -#ifndef POINTS_GLOBAL_H -#define POINTS_GLOBAL_H - - -// Points -#ifndef PointsExport -#ifdef Points_EXPORTS -# define PointsExport FREECAD_DECL_EXPORT -#else -# define PointsExport FREECAD_DECL_IMPORT -#endif -#endif - -// PointsGui -#ifndef PointsGuiExport -#ifdef PointsGui_EXPORTS -# define PointsGuiExport FREECAD_DECL_EXPORT -#else -# define PointsGuiExport FREECAD_DECL_IMPORT -#endif -#endif - -#endif //POINTS_GLOBAL_H