This commit is contained in:
luvtofish
2022-12-08 08:53:55 -06:00
104 changed files with 1363 additions and 1454 deletions

View File

@@ -7,7 +7,8 @@
# Maintainers: keep this list of plugins up to date
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here
%global plugins Fem FreeCAD Image Import Inspection Mesh MeshPart Part Points QtUnit Raytracing ReverseEngineering Robot Sketcher Start Web PartDesignGui _PartDesign Path PathGui Spreadsheet SpreadsheetGui area DraftUtils DraftUtils libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers Measure TechDraw TechDrawGui libarea-native Surface SurfaceGui PathSimulator
%global plugins Fem FreeCAD PathApp Image Import Inspection Mesh MeshPart Part Points Raytracing ReverseEngineering Robot Sketcher Start Web PartDesignGui _PartDesign Path PathGui Spreadsheet SpreadsheetGui area DraftUtils DraftUtils libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers Measure TechDraw TechDrawGui libarea-native Surface SurfaceGui PathSimulator
# Some configuration options for other environments
# rpmbuild --with=bundled_zipios: use bundled version of zipios++
@@ -17,6 +18,9 @@
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
#Hack to force zipios
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
# Prevent RPM from doing its magical 'build' directory for now
%global __cmake_in_source_build 0
@@ -67,7 +71,11 @@ BuildRequires: libglvnd-devel
BuildRequires: libicu-devel
BuildRequires: libkdtree++-devel
BuildRequires: libspnav-devel
%if 0%{?fedora} < 37
BuildRequires: libusb-devel
%else
BuildRequires: libusb1-devel
%endif
BuildRequires: med-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: mesa-libGLU-devel
@@ -86,6 +94,7 @@ BuildRequires: python3-pycxx-devel
%endif
BuildRequires: python3-pyside2-devel
BuildRequires: python3-shiboken2-devel
BuildRequires: qt5-qtwebengine-devel
BuildRequires: qt5-qtwebkit-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-static
@@ -222,6 +231,7 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
%endif
-DPACKAGE_WCREF="%{release} (Git)" \
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git master" \
-DBUILD_TEST=FALSE \
../
make fc_version
@@ -272,6 +282,9 @@ rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html
#No longer present?
#rm -f %{buildroot}%{_docdir}/freecad/ThirdPartyLibraries.html
# Remove header from external library that's erroneously installed
rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h
# Bug maintainers to keep %%{plugins} macro up to date.
#
# Make sure there are no plugins that need to be added to plugins macro
@@ -329,7 +342,6 @@ fi
%{_metainfodir}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/include/E57Format/E57Export.h
%{_libdir}/%{name}/%{_lib}/
%{_libdir}/%{name}/Mod/
%{_libdir}/%{name}/Ext/

View File

@@ -98,6 +98,7 @@
#include <Inventor/elements/SoNormalBindingElement.h>
#include <Inventor/elements/SoNormalElement.h>
#include <Inventor/elements/SoOverrideElement.h>
#include <Inventor/elements/SoPointSizeElement.h>
#include <Inventor/elements/SoProfileCoordinateElement.h>
#include <Inventor/elements/SoProfileElement.h>
#include <Inventor/elements/SoProjectionMatrixElement.h>
@@ -110,9 +111,11 @@
#include <Inventor/elements/SoViewportRegionElement.h>
#include <Inventor/elements/SoViewVolumeElement.h>
#include <Inventor/elements/SoWindowElement.h>
#include <Inventor/engines/SoCalculator.h>
#include <Inventor/engines/SoComposeVec3f.h>
#include <Inventor/engines/SoComposeRotationFromTo.h>
#include <Inventor/engines/SoComposeRotation.h>
#include <Inventor/engines/SoConcatenate.h>
#include <Inventor/errors/SoDebugError.h>
#include <Inventor/errors/SoError.h>
#include <Inventor/errors/SoReadError.h>
@@ -136,6 +139,7 @@
#include <Inventor/manips/SoClipPlaneManip.h>
#include <Inventor/manips/SoTransformerManip.h>
#include <Inventor/misc/SoChildList.h>
#include <Inventor/misc/SoContextHandler.h>
#include <Inventor/misc/SoState.h>
#include <Inventor/nodes/SoAnnotation.h>
#include <Inventor/nodes/SoAntiSquish.h>
@@ -149,6 +153,7 @@
#include <Inventor/nodes/SoCoordinate4.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoCylinder.h>
#include <Inventor/nodes/SoDepthBuffer.h>
#include <Inventor/nodes/SoDirectionalLight.h>
#include <Inventor/nodes/SoDrawStyle.h>
#include <Inventor/nodes/SoEnvironment.h>
@@ -173,6 +178,7 @@
#include <Inventor/nodes/SoNode.h>
#include <Inventor/nodes/SoNormal.h>
#include <Inventor/nodes/SoNormalBinding.h>
#include <Inventor/nodes/SoNurbsCurve.h>
#include <Inventor/nodes/SoNurbsSurface.h>
#include <Inventor/nodes/SoOrthographicCamera.h>
#include <Inventor/nodes/SoPerspectiveCamera.h>
@@ -183,6 +189,7 @@
#include <Inventor/nodes/SoProfileCoordinate2.h>
#include <Inventor/nodes/SoProfileCoordinate3.h>
#include <Inventor/nodes/SoQuadMesh.h>
#include <Inventor/nodes/SoResetTransform.h>
#include <Inventor/nodes/SoRotation.h>
#include <Inventor/nodes/SoRotationXYZ.h>
#include <Inventor/nodes/SoSelection.h>
@@ -201,6 +208,7 @@
#include <Inventor/nodes/SoTransformation.h>
#include <Inventor/nodes/SoTranslation.h>
#include <Inventor/nodes/SoTransparencyType.h>
#include <Inventor/nodes/SoVertexProperty.h>
#include <Inventor/nodekits/SoShapeKit.h>
#include <Inventor/manips/SoTransformBoxManip.h>
#include <Inventor/projectors/SbLineProjector.h>

View File

@@ -20,11 +20,9 @@
* *
***************************************************************************/
#ifndef __QtAll__
#define __QtAll__
// Qt Toolkit
// QtCore
#include <qglobal.h>
#include <QBuffer>
@@ -58,12 +56,13 @@
#include <QVariant>
#include <QVariantAnimation>
#include <QWaitCondition>
// QtGui
#include <QAbstractEventDispatcher>
#include <QAbstractItemModel>
#include <QStandardItemModel>
#include <QAbstractTextDocumentLayout>
#include <qaction.h>
#include <QAction>
#include <QActionGroup>
#include <qapplication.h>
#include <QBitmap>
@@ -104,8 +103,9 @@
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QMenu>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <QMessageBox>
#include <QMessageLogContext>
#include <QMimeData>
#include <qmovie.h>
@@ -159,18 +159,22 @@
#include <QWindow>
#include <QWhatsThis>
#include <QWhatsThisClickedEvent>
// QtNetwork
#include <QNetworkAccessManager>
#include <QTcpServer>
#include <QTcpSocket>
// QtSvg
#include <QSvgRenderer>
#include <QSvgWidget>
// QtWidgets
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QStackedWidget>
#include <QWidget>
// QtXML
# include <QDomDocument>
# include <QDomElement>

View File

@@ -61,6 +61,12 @@ set(MeshPart_Scripts
../Init.py
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${MeshPart_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(MeshPart PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
# Suppress -Wundefined-var-template
if (MINGW AND CMAKE_COMPILER_IS_CLANGXX)
unset(_flag_found CACHE)

View File

@@ -26,18 +26,20 @@
# include <memory>
# include <stdexcept>
# include <vector>
# include <TopoDS.hxx>
# include <TopoDS_Edge.hxx>
# include <TopoDS_Face.hxx>
# include <boost/python.hpp>
# include <boost/python/call.hpp>
# include <boost/python/class.hpp>
# include <boost/python/copy_const_reference.hpp>
# include <boost/python/module.hpp>
# include <boost/python/return_value_policy.hpp>
# include <boost/python/wrapper.hpp>
#endif
#include <boost/python.hpp>
#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <boost/python/wrapper.hpp>
#include <boost/python/call.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/return_value_policy.hpp>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <Eigen/Sparse>

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <algorithm>
# include <BRepMesh_IncrementalMesh.hxx>
# include <BRepTools.hxx>
# include <Standard_Version.hxx>

View File

@@ -20,5 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef __PRECOMPILED__
#define __PRECOMPILED__
@@ -36,193 +35,57 @@
#ifdef _PreComp_
// standard
#include <cmath>
#include <iostream>
// STL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
// OpenCasCade =====================================================================================
// Base
#include <Standard_Failure.hxx>
#include <Standard_GUID.hxx>
#include <Standard_AbortiveTransaction.hxx>
#include <Standard_Address.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Byte.hxx>
#include <Standard_Character.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_CString.hxx>
#include <Standard_ctype.hxx>
#include <Standard_DefineHandle.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_DimensionMismatch.hxx>
#include <Standard_DivideByZero.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_ExtCharacter.hxx>
#include <Standard_ExtString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_GUID.hxx>
#include <Standard_ImmutableObject.hxx>
#include <Standard_Integer.hxx>
#include <Standard_InternalType.hxx>
#include <Standard_IStream.hxx>
#include <Standard_KindOfType.hxx>
#include <Standard_LicenseError.hxx>
#include <Standard_LicenseNotFound.hxx>
#include <Standard_Macro.hxx>
#include <Standard_math.hxx>
#include <Standard_MultiplyDefined.hxx>
#include <Standard_NegativeValue.hxx>
#include <Standard_NoMoreObject.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_NullValue.hxx>
#include <Standard_NumericError.hxx>
#include <Standard_OId.hxx>
#include <Standard_OStream.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Overflow.hxx>
#include <Standard_Persistent.hxx>
#include <Standard_Persistent_proto.hxx>
#include <Standard_PrimitiveTypes.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_RangeError.hxx>
#include <Standard_Real.hxx>
#include <Standard_ShortReal.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Static.hxx>
#include <Standard_Storable.hxx>
#include <Standard_Stream.hxx>
#include <Standard_String.hxx>
#include <Standard_TooManyUsers.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Transient_proto.hxx>
#include <Standard_Type.hxx>
#include <Standard_TypeDef.hxx>
#include <Standard_TypeMismatch.hxx>
#include <Standard_Underflow.hxx>
#include <Standard_UUID.hxx>
#include <Standard_Version.hxx>
#include <Standard_WayOfLife.hxx>
// boost
#include <boost/python.hpp>
#include <boost/python/call.hpp>
#include <boost/python/class.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/module.hpp>
#include <boost/python/return_value_policy.hpp>
#include <boost/python/wrapper.hpp>
// OpenCasCade
#include <Bnd_Box.hxx>
#include <BndLib_Add3dCurve.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
#include <BRepCheck_Result.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepTools.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <GCE2d_MakeSegment.hxx>
#include <GCPnts_TangentialDeflection.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GCPnts_UniformDeflection.hxx>
#include <GCPnts_UniformAbscissa.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Circle.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Hyperbola.hxx>
#include <Geom_Line.hxx>
#include <Geom_Parabola.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAPI_IntCS.hxx>
#include <GeomTools_Curve2dSet.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <Precision.hxx>
#include <Poly_Triangulation.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Quantity_PhysicalQuantity.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Version.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <UnitsAPI.hxx>
#endif // _PreComp_
#endif

View File

@@ -72,6 +72,12 @@ set(FLATMESH_PY_SRCS
MeshFlatteningCommand.py
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${MeshPartGui_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(MeshPartGui PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
add_library(MeshPartGui SHARED ${MeshPartGui_SRCS} ${MeshPartGui_Scripts} ${FLATMESH_PY_SRCS})
target_link_libraries(MeshPartGui ${MeshPartGui_LIBS})

View File

@@ -42,11 +42,6 @@
# include <Inventor/nodes/SoSeparator.h>
#endif
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Part/App/Tools.h>
#include <Mod/Mesh/App/MeshFeature.h>
#include <Mod/Mesh/App/Core/Algorithm.h>
#include <Mod/Mesh/App/Core/Grid.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
@@ -55,6 +50,11 @@
#include <Gui/ViewProvider.h>
#include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h>
#include <Mod/Mesh/App/MeshFeature.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Part/App/Tools.h>
#include <Mod/Mesh/App/Core/Algorithm.h>
#include <Mod/Mesh/App/Core/Grid.h>
#include "CrossSections.h"
#include "ui_CrossSections.h"

View File

@@ -27,7 +27,19 @@
# include <QPointer>
# include <QStatusBar>
# include <QTimer>
# include <gp_Pnt.hxx>
# include <TColgp_Array1OfPnt.hxx>
# include <GeomAPI_PointsToBSpline.hxx>
# include <Geom_BSplineCurve.hxx>
# include <BRep_Tool.hxx>
# include <BRepBuilderAPI_MakeEdge.hxx>
# include <BRepBuilderAPI_MakePolygon.hxx>
# include <BRepMesh_IncrementalMesh.hxx>
# include <Poly_Polygon3D.hxx>
# include <TopoDS_Edge.hxx>
# include <TopoDS_Wire.hxx>
# include <Inventor/SoPickedPoint.h>
# include <Inventor/details/SoFaceDetail.h>
# include <Inventor/events/SoMouseButtonEvent.h>
@@ -67,17 +79,7 @@
#define HAVE_ATANH
#endif
#include <gp_Pnt.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Standard_Failure.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <Poly_Polygon3D.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
/* XPM */
static const char *cursor_curveonmesh[]={

View File

@@ -20,5 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef __PRECOMPILED_GUI__
#define __PRECOMPILED_GUI__
@@ -34,34 +33,49 @@
#ifdef _PreComp_
// standard
#include <iostream>
#include <cassert>
#include <cmath>
// STL
#include <vector>
#include <map>
#include <string>
#include <list>
#include <set>
#include <algorithm>
#include <stack>
#include <queue>
#include <bitset>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
#include <cfloat>
#include <sstream>
// Qt Toolkit
#ifndef __QtAll__
# include <Gui/QtAll.h>
#endif
#include <QApplication>
#include <QFuture>
#include <QMenu>
#include <QMessageBox>
#include <QKeyEvent>
#include <QMessageBox>
#include <QPointer>
#include <QPushButton>
#include <QStatusBar>
#include <QtConcurrentMap>
#include <QTimer>
// OCCT
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <Geom_BSplineCurve.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#include <gp_Pnt.hxx>
#include <Poly_Polygon3D.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
// Inventor
#include <Inventor/SoPickedPoint.h>
#include <Inventor/details/SoFaceDetail.h>
#include <Inventor/events/SoMouseButtonEvent.h>
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/nodes/SoCoordinate3.h>
#include <Inventor/nodes/SoDrawStyle.h>
#include <Inventor/nodes/SoLineSet.h>
#include <Inventor/nodes/SoPointSet.h>
#include <Inventor/nodes/SoSeparator.h>
#endif //_PreComp_

View File

@@ -27,11 +27,12 @@
# include <gp_Ax2.hxx>
# include <gp_Pnt.hxx>
# include <HLRAlgo_Projector.hxx>
# include <boost/math/special_functions/fpclassify.hpp>
#endif
#include <Base/GeometryPyCXX.h>
#include <Base/VectorPy.h>
#include <boost/math/special_functions/fpclassify.hpp>
#include "HLRBRep/HLRBRep_AlgoPy.h"
#include "HLRBRep/HLRBRep_AlgoPy.cpp"

View File

@@ -28,11 +28,12 @@
# include <gp_Pnt.hxx>
# include <HLRAlgo_Projector.hxx>
# include <Standard_Version.hxx>
# include <boost/math/special_functions/fpclassify.hpp>
#endif
#include <Base/GeometryPyCXX.h>
#include <Base/VectorPy.h>
#include <boost/math/special_functions/fpclassify.hpp>
#include "HLRBRep/HLRBRep_PolyAlgoPy.h"
#include "HLRBRep/HLRBRep_PolyAlgoPy.cpp"

View File

@@ -106,6 +106,7 @@
#endif
#include <BRepAdaptor_Surface.hxx>
#include <BRepAlgo.hxx>
#if OCC_VERSION_HEX < 0x070300
# include <BRepAlgo_Fuse.hxx>
#endif
@@ -176,6 +177,7 @@
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepOffsetAPI_MakePipeShell.hxx>
#include <BRepOffsetAPI_MakeThickSolid.hxx>
#include <BRepOffsetAPI_NormalProjection.hxx>
#include <BRepOffsetAPI_ThruSections.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
@@ -296,17 +298,21 @@
#include <GeomConvert.hxx>
#include <GeomConvert_ApproxCurve.hxx>
#include <GeomConvert_ApproxSurface.hxx>
#include <GeomConvert_BSplineCurveKnotSplitting.hxx>
#include <GeomConvert_BSplineCurveToBezierCurve.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomFill.hxx>
#include <GeomFill_AppSurf.hxx>
#include <GeomFill_Generator.hxx>
#include <GeomFill_ApproxStyle.hxx>
#include <GeomFill_BezierCurves.hxx>
#include <GeomFill_BSplineCurves.hxx>
#include <GeomFill_CorrectedFrenet.hxx>
#include <GeomFill_CurveAndTrihedron.hxx>
#include <GeomFill_EvolvedSection.hxx>
#include <GeomFill_Generator.hxx>
#include <GeomFill_Line.hxx>
#include <GeomFill_LocationLaw.hxx>
#include <GeomFill_NSections.hxx>
#include <GeomFill_Pipe.hxx>
#include <GeomFill_SectionGenerator.hxx>
#include <GeomFill_Sweep.hxx>
@@ -376,6 +382,8 @@
#include <IntTools_FClass2d.hxx>
#include <Law_Constant.hxx>
#include <LProp_NotDefined.hxx>
#include <math_Gauss.hxx>
#include <math_Matrix.hxx>
#include <Message_MsgFile.hxx>
#include <NCollection_List.hxx>
#include <OSD_OpenFile.hxx>
@@ -412,6 +420,7 @@
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_Wireframe.hxx>
#include <ShapeUpgrade_ShellSewing.hxx>
#include <ShapeUpgrade_RemoveInternalWires.hxx>
@@ -478,6 +487,7 @@
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef PART_PRECOMPILED_H
#define PART_PRECOMPILED_H
@@ -36,69 +35,53 @@
# pragma warning( disable : 4786 ) // specifier longer then 255 chars
#endif
#ifdef _PreComp_
// standard
#include <list>
#include <iostream>
#include <sstream>
#include <fcntl.h>
#include <array>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <memory>
#include <fstream>
#include <string>
#include <stdexcept>
#include <tuple>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
// QT
// STL
#include <array>
#include <fcntl.h>
#include <fstream>
#include <list>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
// Qt
#include <QtGlobal>
// Boost
#include <boost_signals2.hpp>
#include <boost/bind/bind.hpp>
#include <boost/utility.hpp>
#include <boost_graph_adjacency_list.hpp>
#include <boost/program_options.hpp>
//namespace po = boost::program_options;
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/regex.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
// OpenCasCade
#include "OpenCascadeAll.h"
#include <math_Gauss.hxx>
#include <math_Matrix.hxx>
#elif defined(FC_OS_WIN32)
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
# define NOMINMAX
#endif
#include <Windows.h>
#include <io.h>
#endif //_PreComp_
#ifndef _Standard_Version_HeaderFile
#include <Standard_Version.hxx>
# include <Standard_Version.hxx>
#endif
#endif

View File

@@ -160,11 +160,10 @@
# include <BRepAdaptor_HCompCurve.hxx>
#endif
# include <boost/algorithm/string/predicate.hpp>
# include <boost/core/ignore_unused.hpp>
#endif // _PreComp_
#include <boost/algorithm/string/predicate.hpp>
#include <boost/core/ignore_unused.hpp>
#include <App/Material.h>
#include <Base/BoundBox.h>
#include <Base/Builder3D.h>

View File

@@ -45,118 +45,22 @@
#ifdef _PreComp_
// standard
#include <iostream>
#include <cassert>
#include <cfloat>
# include <cmath>
#include <sstream>
#include <cmath>
// STL
#include <vector>
#include <list>
#include <map>
#include <string>
#include <set>
#include <algorithm>
#include <stack>
#include <queue>
#include <bitset>
#include <map>
#include <sstream>
#include <string>
#include <vector>
// OpenCasCade Base
#include <Standard_Failure.hxx>
#include <Standard_Version.hxx>
#if OCC_VERSION_HEX < 0x070400
#include <BRepMesh.hxx>
#endif
#include <BRepMesh_IncrementalMesh.hxx>
#include <Poly_Connect.hxx>
#include <Poly_Polygon3D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
#include <gp_Ax1.hxx>
#include <gp_Pnt.hxx>
#include <gp_Sphere.hxx>
#include <gp_Trsf.hxx>
#include <gce_ErrorType.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Line.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_ElementarySurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomLProp_SLProps.hxx>
#include <GeomLib.hxx>
#include <GeomProjLib.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Builder.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <BRepCheck_Result.hxx>
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepLProp_SLProps.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepProj_Projection.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <Bnd_Box.hxx>
#include <GCPnts_UniformDeflection.hxx>
#include <Precision.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <Interface_Static.hxx>
#include <ShapeAnalysis.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <ShapeFix_Wire.hxx>
#include <ShapeExtend_Explorer.hxx>
#include <ShapeFix_Edge.hxx>
#include <ShapeFix_Face.hxx>
#include <ShapeFix_Wireframe.hxx>
# include <BOPAlgo_ArgumentAnalyzer.hxx>
# include <BOPAlgo_ListOfCheckResult.hxx>
// OpenCasCade
#include <Mod/Part/App/OpenCascadeAll.h>
// Boost
#include <boost_signals2.hpp>
#include <boost/bind/bind.hpp>
#include <boost/regex.hpp>
#include <boost/algorithm/string/predicate.hpp>
// Qt Toolkit
#ifndef __QtAll__
@@ -165,33 +69,23 @@
// GL
// Include glext before InventorAll
# ifdef FC_OS_WIN32
#ifdef FC_OS_WIN32
# include <GL/gl.h>
# include <GL/glext.h>
#else
# ifdef FC_OS_MACOSX
# include <OpenGL/gl.h>
# include <OpenGL/glext.h>
# else
# ifndef GL_GLEXT_PROTOTYPES
# define GL_GLEXT_PROTOTYPES 1
# endif
# include <GL/gl.h>
# include <GL/glext.h>
# else
# ifdef FC_OS_MACOSX
# include <OpenGL/gl.h>
# include <OpenGL/glext.h>
# else
# ifndef GL_GLEXT_PROTOTYPES
# define GL_GLEXT_PROTOTYPES 1
# endif
# include <GL/gl.h>
# include <GL/glext.h>
# endif //FC_OS_MACOSX
# endif //FC_OS_WIN32
# endif //FC_OS_MACOSX
#endif //FC_OS_WIN32
// Should come after glext.h to avoid warnings
# include <Inventor/C/glue/gl.h>
#include <Inventor/misc/SoContextHandler.h>
#include <Inventor/nodes/SoDepthBuffer.h>
#include <Inventor/nodes/SoVertexProperty.h>
#include <Inventor/nodes/SoNurbsCurve.h>
#include <Inventor/engines/SoCalculator.h>
#include <Inventor/nodes/SoResetTransform.h>
#include <Inventor/elements/SoOverrideElement.h>
#include <Inventor/elements/SoPointSizeElement.h>
#include <Inventor/engines/SoConcatenate.h>
#include <Inventor/C/glue/gl.h>
// Inventor includes OpenGL
#ifndef __InventorAll__

View File

@@ -20,15 +20,14 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
# include <TopExp.hxx>
# include <TopExp_Explorer.hxx>
# include <boost/algorithm/string/predicate.hpp>
#endif
#include <boost/algorithm/string/predicate.hpp>
#include "ReferenceHighlighter.h"

View File

@@ -66,10 +66,10 @@
# include <Inventor/nodes/SoPolygonOffset.h>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoShapeHints.h>
#endif
#include <boost/algorithm/string/predicate.hpp>
#include <boost/regex.hpp>
# include <boost/regex.hpp>
# include <boost/algorithm/string/predicate.hpp>
#endif
#include <App/Application.h>
#include <App/Document.h>

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef __PRECOMPILED__
#define __PRECOMPILED__
@@ -35,71 +34,9 @@
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cassert>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <cstring>
#include <cmath>
// QT
#include <QObject>
#include <QCoreApplication>
// OpenCasCade =====================================================================================
// OpenCasCade
#include <Mod/Part/App/OpenCascadeAll.h>
// Apart from the Part OpenCascadeAll, I need:
# include <GProp_GProps.hxx>
# include <BRepAlgo.hxx>
# include <BRepAlgoAPI_Fuse.hxx>
# include <BRepAlgoAPI_Cut.hxx>
# include <BRepBuilderAPI_GTransform.hxx>
# include <BRepBuilderAPI_Transform.hxx>
# include <BRepFeat_MakePrism.hxx>
# include <BRepGProp.hxx>
# include <BRepGProp_Face.hxx>
# include <BRepLProp_SLProps.hxx>
# include <BRepProj_Projection.hxx>
# include <BRepBuilderAPI_MakeSolid.hxx>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <BRepBuilderAPI_Sewing.hxx>
# include <BRepBuilderAPI_MakePolygon.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <BRepClass3d_SolidClassifier.hxx>
# include <BRepExtrema_DistShapeShape.hxx>
# include <BRepFilletAPI_MakeChamfer.hxx>
# include <BRepOffsetAPI_DraftAngle.hxx>
# include <BRepOffsetAPI_MakeOffset.hxx>
# include <BRepOffsetAPI_ThruSections.hxx>
# include <BRepPrimAPI_MakeBox.hxx>
# include <BRepPrimAPI_MakeCylinder.hxx>
# include <BRepPrimAPI_MakeSphere.hxx>
# include <BRepPrimAPI_MakeCone.hxx>
# include <BRepPrimAPI_MakeTorus.hxx>
# include <BRepPrimAPI_MakePrism.hxx>
# include <ShapeAnalysis_FreeBounds.hxx>
# include <ShapeFix_Shape.hxx>
# include <ShapeFix_ShapeTolerance.hxx>
# include <GeomAPI_IntSS.hxx>
# include <TopExp.hxx>
# include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
# include <TopoDS.hxx>
# include <Precision.hxx>
# include <OSD_OpenFile.hxx>
#endif // _PreComp_
#endif

View File

@@ -218,6 +218,8 @@ SET(PartDesignGuiModule_SRCS
Resources/PartDesign.qrc
PreCompiled.cpp
PreCompiled.h
SketchWorkflow.cpp
SketchWorkflow.h
Utils.cpp
Utils.h
Workbench.cpp

View File

@@ -59,6 +59,7 @@
#include "DlgActiveBody.h"
#include "ReferenceSelection.h"
#include "SketchWorkflow.h"
#include "TaskFeaturePick.h"
#include "Utils.h"
#include "WorkflowManager.h"
@@ -494,340 +495,8 @@ CmdPartDesignNewSketch::CmdPartDesignNewSketch()
void CmdPartDesignNewSketch::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument ();
PartDesign::Body *pcActiveBody( nullptr );
auto shouldMakeBody( false );
if ( PartDesignGui::assureModernWorkflow( doc ) ) {
// We need either an active Body, or for there to be no Body
// objects (in which case, just make one) to make a new sketch.
pcActiveBody = PartDesignGui::getBody( /* messageIfNot = */ false );
if (!pcActiveBody) {
if ( doc->countObjectsOfType(PartDesign::Body::getClassTypeId()) == 0 ) {
shouldMakeBody = true;
} else {
PartDesignGui::DlgActiveBody dia(Gui::getMainWindow(), doc);
if (dia.exec() == QDialog::DialogCode::Accepted)
pcActiveBody = dia.getActiveBody();
if (!pcActiveBody)
return;
}
}
} else {
// No PartDesign feature without Body past FreeCAD 0.13
if ( PartDesignGui::isLegacyWorkflow( doc ) ) {
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.runCommandByName("Sketcher_NewSketch");
}
return;
}
// Hint:
// The behaviour of this command has changed with respect to a selected sketch:
// It doesn't try any more to edit a selected sketch but always tries to create
// a new sketch.
// See https://forum.freecadweb.org/viewtopic.php?f=3&t=44070
Gui::SelectionFilter FaceFilter ("SELECT Part::Feature SUBELEMENT Face COUNT 1");
Gui::SelectionFilter PlaneFilter ("SELECT App::Plane COUNT 1");
Gui::SelectionFilter PlaneFilter2("SELECT PartDesign::Plane COUNT 1");
if (PlaneFilter2.match())
PlaneFilter = PlaneFilter2;
if ( FaceFilter.match() || PlaneFilter.match() ) {
if (!pcActiveBody) {
// We shouldn't make a new Body in this case, because that means
// the source shape of the face/plane would be outside the Body.
PartDesignGui::getBody( /* messageIfNot = */ true );
return;
}
// get the selected object
std::string supportString;
App::DocumentObject* obj;
if (FaceFilter.match()) {
Gui::SelectionObject faceSelObject = FaceFilter.Result[0][0];
const std::vector<std::string>& subNames = faceSelObject.getSubNames();
obj = faceSelObject.getObject();
if (!obj->isDerivedFrom(Part::Feature::getClassTypeId()))
return;
// In case the selected face belongs to the body then it means its
// Display Mode Body is set to Tip. But the body face is not allowed
// to be used as support because otherwise it would cause a cyclic
// dependency. So, instead we use the tip object as reference.
// https://forum.freecadweb.org/viewtopic.php?f=3&t=37448
if (obj == pcActiveBody) {
App::DocumentObject* tip = pcActiveBody->Tip.getValue();
if (tip && tip->isDerivedFrom(Part::Feature::getClassTypeId()) && subNames.size() == 1) {
Gui::SelectionChanges msg;
msg.pDocName = faceSelObject.getDocName();
msg.pObjectName = tip->getNameInDocument();
msg.pSubName = subNames[0].c_str();
msg.pTypeName = tip->getTypeId().getName();
faceSelObject = Gui::SelectionObject(msg);
obj = tip;
// automatically switch to 'Through' mode
PartDesignGui::ViewProviderBody* vpBody = dynamic_cast<PartDesignGui::ViewProviderBody*>
(Gui::Application::Instance->getViewProvider(pcActiveBody));
if (vpBody) {
vpBody->DisplayModeBody.setValue("Through");
}
}
}
Part::Feature* feat = static_cast<Part::Feature*>(obj);
if (subNames.size() > 1) {
// No assert for wrong user input!
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Several sub-elements selected"),
QObject::tr("You have to select a single face as support for a sketch!"));
return;
}
// get the selected sub shape (a Face)
const Part::TopoShape &shape = feat->Shape.getValue();
TopoDS_Shape sh = shape.getSubShape(subNames[0].c_str());
const TopoDS_Face& face = TopoDS::Face(sh);
if (face.IsNull()) {
// No assert for wrong user input!
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No support face selected"),
QObject::tr("You have to select a face as support for a sketch!"));
return;
}
BRepAdaptor_Surface adapt(face);
if (adapt.GetType() != GeomAbs_Plane) {
TopLoc_Location loc;
Handle(Geom_Surface) surf = BRep_Tool::Surface(face, loc);
if (surf.IsNull() || !GeomLib_IsPlanarSurface(surf).IsPlanar()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No planar support"),
QObject::tr("You need a planar face as support for a sketch!"));
return;
}
}
supportString = faceSelObject.getAsPropertyLinkSubString();
}
else {
obj = PlaneFilter.Result[0][0].getObject();
supportString = getObjectCmd(obj,"(",",'')");
}
if (!pcActiveBody->hasObject(obj)) {
if ( !obj->isDerivedFrom ( App::Plane::getClassTypeId() ) ) {
// TODO check here if the plane associated with right part/body (2015-09-01, Fat-Zer)
auto pcActivePart = PartDesignGui::getPartFor(pcActiveBody, false);
//check the prerequisites for the selected objects
//the user has to decide which option we should take if external references are used
// TODO share this with UnifiedDatumCommand() (2015-10-20, Fat-Zer)
QDialog dia(Gui::getMainWindow());
PartDesignGui::Ui_DlgReference dlg;
dlg.setupUi(&dia);
dia.setModal(true);
int result = dia.exec();
if (result == QDialog::DialogCode::Rejected)
return;
else if (!dlg.radioXRef->isChecked()) {
openCommand(QT_TRANSLATE_NOOP("Command", "Make copy"));
std::string sub;
if (FaceFilter.match())
sub = FaceFilter.Result[0][0].getSubNames()[0];
auto copy = PartDesignGui::TaskFeaturePick::makeCopy(obj, sub, dlg.radioIndependent->isChecked());
if (pcActiveBody)
pcActiveBody->addObject(copy);
else if (pcActivePart)
pcActivePart->addObject(copy);
if (PlaneFilter.match())
supportString = getObjectCmd(copy,"(",",'')");
else
//it is ensured that only a single face is selected, hence it must always be Face1 of the shapebinder
supportString = getObjectCmd(copy,"(",",'Face1')");
commitCommand();
}
}
}
// create Sketch on Face or Plane
std::string FeatName = getUniqueObjectName("Sketch",pcActiveBody);
openCommand(QT_TRANSLATE_NOOP("Command", "Create a Sketch on Face"));
FCMD_OBJ_CMD(pcActiveBody,"newObject('Sketcher::SketchObject','" << FeatName << "')");
auto Feat = pcActiveBody->getDocument()->getObject(FeatName.c_str());
FCMD_OBJ_CMD(Feat,"Support = " << supportString);
FCMD_OBJ_CMD(Feat,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
updateActive();
PartDesignGui::setEdit(Feat,pcActiveBody);
}
else {
App::GeoFeatureGroupExtension *geoGroup( nullptr );
if (pcActiveBody) {
auto group( App::GeoFeatureGroupExtension::getGroupOfObject(pcActiveBody) );
if (group) {
geoGroup = group->getExtensionByType<App::GeoFeatureGroupExtension>();
}
}
std::vector<App::DocumentObject*> planes;
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> status;
// Start command early, so undo will undo any Body creation
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Create a new Sketch"));
if (shouldMakeBody) {
pcActiveBody = PartDesignGui::makeBody(doc);
if ( !pcActiveBody ) {
Base::Console().Error("Failed to create a Body object");
return;
}
}
// At this point, we have pcActiveBody
unsigned validPlaneCount = 0;
// Baseplanes are preapproved
try {
for ( auto plane: pcActiveBody->getOrigin ()->planes() ) {
planes.push_back (plane);
status.push_back(PartDesignGui::TaskFeaturePick::basePlane);
validPlaneCount++;
}
} catch (const Base::Exception &ex) {
Base::Console().Error ("%s\n", ex.what() );
}
auto datumPlanes( getDocument()->getObjectsOfType(PartDesign::Plane::getClassTypeId()) );
for (auto plane: datumPlanes) {
planes.push_back ( plane );
// Check whether this plane belongs to the active body
if ( pcActiveBody->hasObject(plane) ) {
if ( !pcActiveBody->isAfterInsertPoint ( plane ) ) {
validPlaneCount++;
status.push_back(PartDesignGui::TaskFeaturePick::validFeature);
} else {
status.push_back(PartDesignGui::TaskFeaturePick::afterTip);
}
} else {
PartDesign::Body *planeBody = PartDesign::Body::findBodyOf (plane);
if ( planeBody ) {
if ( ( geoGroup && geoGroup->hasObject ( planeBody, true ) ) ||
!App::GeoFeatureGroupExtension::getGroupOfObject (planeBody) ) {
status.push_back ( PartDesignGui::TaskFeaturePick::otherBody );
} else {
status.push_back ( PartDesignGui::TaskFeaturePick::otherPart );
}
} else {
if ( ( geoGroup && geoGroup->hasObject ( plane, true ) ) ||
!App::GeoFeatureGroupExtension::getGroupOfObject ( plane ) ) {
status.push_back ( PartDesignGui::TaskFeaturePick::otherPart );
} else {
status.push_back ( PartDesignGui::TaskFeaturePick::notInBody );
}
}
}
}
// Collect also shape binders consisting of a single planar face
auto shapeBinders( getDocument()->getObjectsOfType(PartDesign::ShapeBinder::getClassTypeId()) );
auto binders( getDocument()->getObjectsOfType(PartDesign::SubShapeBinder::getClassTypeId()) );
shapeBinders.insert(shapeBinders.end(),binders.begin(),binders.end());
for (auto binder : shapeBinders) {
// Check whether this plane belongs to the active body
if (pcActiveBody->hasObject(binder)) {
TopoDS_Shape shape = static_cast<Part::Feature*>(binder)->Shape.getValue();
if (!shape.IsNull() && shape.ShapeType() == TopAbs_FACE) {
const TopoDS_Face& face = TopoDS::Face(shape);
TopLoc_Location loc;
Handle(Geom_Surface) surf = BRep_Tool::Surface(face, loc);
if (!surf.IsNull() && GeomLib_IsPlanarSurface(surf).IsPlanar()) {
if (!pcActiveBody->isAfterInsertPoint (binder)) {
validPlaneCount++;
planes.push_back(binder);
status.push_back(PartDesignGui::TaskFeaturePick::validFeature);
}
}
}
}
}
// Determines if user made a valid selection in dialog
auto accepter = [](const std::vector<App::DocumentObject*>& features) -> bool {
return !features.empty();
};
// Called by dialog when user hits "OK" and accepter returns true
auto worker = [=](const std::vector<App::DocumentObject*>& features) {
// may happen when the user switched to an empty document while the
// dialog is open
if (features.empty())
return;
App::Plane* plane = static_cast<App::Plane*>(features.front());
std::string FeatName = getUniqueObjectName("Sketch",pcActiveBody);
std::string supportString = getObjectCmd(plane,"(",",[''])");
FCMD_OBJ_CMD(pcActiveBody,"newObject('Sketcher::SketchObject','" << FeatName << "')");
auto Feat = pcActiveBody->getDocument()->getObject(FeatName.c_str());
FCMD_OBJ_CMD(Feat,"Support = " << supportString);
FCMD_OBJ_CMD(Feat,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
Gui::Command::updateActive(); // Make sure the Support's Placement property is updated
PartDesignGui::setEdit(Feat,pcActiveBody);
};
// Called by dialog for "Cancel", or "OK" if accepter returns false
std::string docname = doc->getName();
auto quitter = [docname]() {
Gui::Document* document = Gui::Application::Instance->getDocument(docname.c_str());
if (document)
document->abortCommand();
};
if (validPlaneCount == 0) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No valid planes in this document"),
QObject::tr("Please create a plane first or select a face to sketch on"));
quitter();
return;
} else if (validPlaneCount == 1) {
worker(planes);
} else if (validPlaneCount > 1) {
// Show dialog and let user pick plane
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
PartDesignGui::TaskDlgFeaturePick *pickDlg = qobject_cast<PartDesignGui::TaskDlgFeaturePick *>(dlg);
if (dlg && !pickDlg) {
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
Gui::Control().closeDialog();
else {
quitter();
return;
}
}
if (dlg)
Gui::Control().closeDialog();
Gui::Selection().clearSelection();
Gui::Control().showDialog(new PartDesignGui::TaskDlgFeaturePick(planes, status, accepter, worker, true, quitter));
}
}
PartDesignGui::SketchWorkflow creator(getActiveGuiDocument());
creator.createSketch();
}
bool CmdPartDesignNewSketch::isActive()

View File

@@ -20,71 +20,43 @@
* *
***************************************************************************/
#ifndef __PRECOMPILED_GUI__
#define __PRECOMPILED_GUI__
#include <FCConfig.h>
#ifdef _MSC_VER
# pragma warning(disable : 4005)
#endif
#ifdef _PreComp_
// standard
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <sstream>
// Boost
#include <boost/bind/bind.hpp>
#include <boost/core/ignore_unused.hpp>
// OCC
#include <Standard_math.hxx>
#include <Standard_Version.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRep_Tool.hxx>
#include <GeomLib_IsPlanarSurface.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepAdaptor_Surface.hxx>
// STL
#include <vector>
#include <map>
#include <string>
#include <list>
#include <set>
#include <algorithm>
#include <stack>
#include <queue>
#include <bitset>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
// Boost
#include <boost/core/ignore_unused.hpp>
// Qt Toolkit
// OCC
#include <Standard_Version.hxx>
#include <Bnd_Box.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <GeomLib_IsPlanarSurface.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
// Qt
#ifndef __QtAll__
# include <Gui/QtAll.h>
#endif
#include <QMessageBox>
#include <QMenu>
#include <QAction>
#include <QMessageBox>
// Inventor
#ifndef __InventorAll__
# include <Gui/InventorAll.h>

View File

@@ -0,0 +1,751 @@
/**************************************************************************
* Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* 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 "PreCompiled.h"
#ifndef _PreComp_
# include <TopoDS.hxx>
# include <TopoDS_Face.hxx>
# include <boost/signals2.hpp>
# include <map>
# include <string>
# include <vector>
# include <QMessageBox>
#endif
#include "SketchWorkflow.h"
#include "DlgActiveBody.h"
#include "TaskFeaturePick.h"
#include "Utils.h"
#include "ViewProviderBody.h"
#include "WorkflowManager.h"
#include "ui_DlgReference.h"
#include <Mod/PartDesign/App/Body.h>
#include <Mod/PartDesign/App/DatumPlane.h>
#include <Mod/PartDesign/App/ShapeBinder.h>
#include <Mod/Part/App/Attacher.h>
#include <Mod/Part/App/TopoShape.h>
#include <App/Document.h>
#include <App/Origin.h>
#include <App/OriginFeature.h>
#include <App/Part.h>
#include <Gui/Application.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/SelectionFilter.h>
using namespace PartDesignGui;
namespace {
struct RejectException
{
};
struct WrongSelectionException
{
};
struct WrongSupportException
{
};
struct SupportNotPlanarException
{
};
struct MissingPlanesException
{
};
class SupportFaceValidator
{
public:
explicit SupportFaceValidator(Gui::SelectionObject faceSelection)
: faceSelection(faceSelection)
{
}
void handleSelectedBody(PartDesign::Body* activeBody)
{
App::DocumentObject* object = faceSelection.getObject();
std::vector<std::string> elements = faceSelection.getSubNames();
// In case the selected face belongs to the body then it means its
// Display Mode Body is set to Tip. But the body face is not allowed
// to be used as support because otherwise it would cause a cyclic
// dependency. So, instead we use the tip object as reference.
// https://forum.freecadweb.org/viewtopic.php?f=3&t=37448
if (object == activeBody) {
App::DocumentObject* tip = activeBody->Tip.getValue();
if (tip && tip->isDerivedFrom(Part::Feature::getClassTypeId()) && elements.size() == 1) {
Gui::SelectionChanges msg;
msg.pDocName = faceSelection.getDocName();
msg.pObjectName = tip->getNameInDocument();
msg.pSubName = elements[0].c_str();
msg.pTypeName = tip->getTypeId().getName();
faceSelection = Gui::SelectionObject{msg};
// automatically switch to 'Through' mode
setThroughModeOfBody(activeBody);
}
}
}
void throwIfInvalid()
{
App::DocumentObject* object = faceSelection.getObject();
std::vector<std::string> elements = faceSelection.getSubNames();
Part::Feature* partobject = dynamic_cast<Part::Feature*>(object);
if (!partobject) {
throw WrongSelectionException();
}
if (elements.size() != 1) {
throw WrongSelectionException();
}
// get the selected sub shape (a Face)
const Part::TopoShape &shape = partobject->Shape.getValue();
Part::TopoShape subshape(shape.getSubShape(elements[0].c_str()));
if (subshape.isNull()) {
throw WrongSupportException();
}
if (!subshape.isPlanar()) {
throw SupportNotPlanarException();
}
}
std::string getSupport() const
{
return faceSelection.getAsPropertyLinkSubString();
}
App::DocumentObject* getObject() const
{
return faceSelection.getObject();
}
private:
void setThroughModeOfBody(PartDesign::Body* activeBody)
{
// automatically switch to 'Through' mode
PartDesignGui::ViewProviderBody* vpBody = dynamic_cast<PartDesignGui::ViewProviderBody*>
(Gui::Application::Instance->getViewProvider(activeBody));
if (vpBody) {
vpBody->DisplayModeBody.setValue("Through");
}
}
private:
mutable Gui::SelectionObject faceSelection;
};
class SupportPlaneValidator
{
public:
explicit SupportPlaneValidator(Gui::SelectionObject faceSelection)
: faceSelection(faceSelection)
{
}
std::string getSupport() const
{
return Gui::Command::getObjectCmd(getObject(), "(",",'')");
}
App::DocumentObject* getObject() const
{
return faceSelection.getObject();
}
private:
mutable Gui::SelectionObject faceSelection;
};
class SketchPreselection
{
public:
SketchPreselection(Gui::Document* guidocument, PartDesign::Body* activeBody,
std::tuple<Gui::SelectionFilter, Gui::SelectionFilter> filter)
: guidocument(guidocument)
, activeBody(activeBody)
, faceFilter(std::get<0>(filter))
, planeFilter(std::get<1>(filter))
{
}
bool matches()
{
return faceFilter.match() || planeFilter.match();
}
std::string getSupport() const
{
return supportString;
}
void createSupport()
{
createBodyOrThrow();
// get the selected object
App::DocumentObject* selectedObject{};
if (faceFilter.match()) {
Gui::SelectionObject faceSelObject = faceFilter.Result[0][0];
SupportFaceValidator validator{faceSelObject};
validator.handleSelectedBody(activeBody);
validator.throwIfInvalid();
selectedObject = validator.getObject();
supportString = validator.getSupport();
}
else {
SupportPlaneValidator validator(planeFilter.Result[0][0]);
selectedObject = validator.getObject();
supportString = validator.getSupport();
}
handleIfSupportOutOfBody(selectedObject);
}
void createSketchOnSupport(const std::string& supportString)
{
// create Sketch on Face or Plane
App::Document* appdocument = guidocument->getDocument();
std::string FeatName = appdocument->getUniqueObjectName("Sketch");
guidocument->openCommand(QT_TRANSLATE_NOOP("Command", "Create a Sketch on Face"));
FCMD_OBJ_CMD(activeBody, "newObject('Sketcher::SketchObject','" << FeatName << "')");
auto Feat = appdocument->getObject(FeatName.c_str());
FCMD_OBJ_CMD(Feat, "Support = " << supportString);
FCMD_OBJ_CMD(Feat, "MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
Gui::Command::updateActive();
PartDesignGui::setEdit(Feat, activeBody);
}
private:
void createBodyOrThrow()
{
if (!activeBody) {
activeBody = PartDesignGui::getBody( /* messageIfNot = */ true );
if (activeBody) {
tryAddNewBodyToActivePart();
}
else {
throw RejectException();
}
}
}
void tryAddNewBodyToActivePart()
{
App::Part *activePart = PartDesignGui::getActivePart();
if (activePart) {
activePart->addObject(activeBody);
}
}
void handleIfSupportOutOfBody(App::DocumentObject* selectedObject)
{
if (!activeBody->hasObject(selectedObject)) {
if ( !selectedObject->isDerivedFrom ( App::Plane::getClassTypeId() ) ) {
// TODO check here if the plane associated with right part/body (2015-09-01, Fat-Zer)
//check the prerequisites for the selected objects
//the user has to decide which option we should take if external references are used
// TODO share this with UnifiedDatumCommand() (2015-10-20, Fat-Zer)
QDialog dia(Gui::getMainWindow());
PartDesignGui::Ui_DlgReference dlg;
dlg.setupUi(&dia);
dia.setModal(true);
int result = dia.exec();
if (result == QDialog::Rejected) {
throw RejectException();
}
if (!dlg.radioXRef->isChecked()) {
guidocument->openCommand(QT_TRANSLATE_NOOP("Command", "Make copy"));
auto copy = makeCopy(selectedObject, dlg.radioIndependent->isChecked());
supportString = supportFromCopy(copy);
guidocument->commitCommand();
}
}
}
}
App::DocumentObject* makeCopy(App::DocumentObject* selectedObject, bool independent)
{
std::string sub;
if (faceFilter.match())
sub = faceFilter.Result[0][0].getSubNames()[0];
auto copy = PartDesignGui::TaskFeaturePick::makeCopy(selectedObject, sub, independent);
addToBodyOrPart(copy);
return copy;
}
std::string supportFromCopy(App::DocumentObject* copy)
{
std::string supportString;
if (planeFilter.match()) {
supportString = Gui::Command::getObjectCmd(copy,"(",",'')");
}
else {
//it is ensured that only a single face is selected, hence it must always be Face1 of the shapebinder
supportString = Gui::Command::getObjectCmd(copy,"(",",'Face1')");
}
return supportString;
}
void addToBodyOrPart(App::DocumentObject* object)
{
auto activePart = PartDesignGui::getPartFor(activeBody, false);
if (activeBody) {
activeBody->addObject(object);
}
else if (activePart) {
activePart->addObject(object);
}
}
private:
Gui::Document* guidocument;
PartDesign::Body* activeBody;
Gui::SelectionFilter faceFilter;
Gui::SelectionFilter planeFilter;
std::string supportString;
};
class PlaneFinder
{
public:
PlaneFinder(App::Document* appdocument, PartDesign::Body* activeBody)
: appdocument(appdocument)
, activeBody(activeBody)
{
}
std::vector<App::DocumentObject*> getPlanes() const
{
return planes;
}
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> getStatus() const
{
return status;
}
unsigned countValidPlanes() const
{
return validPlaneCount;
}
void findBasePlanes()
{
try {
tryFindBasePlanes();
}
catch (const Base::Exception &ex) {
Base::Console().Error ("%s\n", ex.what() );
}
}
void findDatumPlanes()
{
App::GeoFeatureGroupExtension *geoGroup = getGroupExtensionOfBody();
auto datumPlanes( appdocument->getObjectsOfType(PartDesign::Plane::getClassTypeId()) );
for (auto plane : datumPlanes) {
planes.push_back ( plane );
// Check whether this plane belongs to the active body
if ( activeBody->hasObject(plane) ) {
if ( !activeBody->isAfterInsertPoint ( plane ) ) {
validPlaneCount++;
status.push_back(PartDesignGui::TaskFeaturePick::validFeature);
} else {
status.push_back(PartDesignGui::TaskFeaturePick::afterTip);
}
} else {
PartDesign::Body *planeBody = PartDesign::Body::findBodyOf (plane);
if ( planeBody ) {
if ( ( geoGroup && geoGroup->hasObject ( planeBody, true ) ) ||
!App::GeoFeatureGroupExtension::getGroupOfObject (planeBody) ) {
status.push_back ( PartDesignGui::TaskFeaturePick::otherBody );
} else {
status.push_back ( PartDesignGui::TaskFeaturePick::otherPart );
}
} else {
if ( ( geoGroup && geoGroup->hasObject ( plane, true ) ) ||
!App::GeoFeatureGroupExtension::getGroupOfObject ( plane ) ) {
status.push_back ( PartDesignGui::TaskFeaturePick::otherPart );
} else {
status.push_back ( PartDesignGui::TaskFeaturePick::notInBody );
}
}
}
}
}
void findShapeBinderPlanes()
{
// Collect also shape binders consisting of a single planar face
auto shapeBinders( appdocument->getObjectsOfType(PartDesign::ShapeBinder::getClassTypeId()) );
auto binders( appdocument->getObjectsOfType(PartDesign::SubShapeBinder::getClassTypeId()) );
shapeBinders.insert(shapeBinders.end(),binders.begin(),binders.end());
for (auto binder : shapeBinders) {
// Check whether this plane belongs to the active body
if (activeBody->hasObject(binder)) {
Part::TopoShape shape = static_cast<Part::Feature*>(binder)->Shape.getShape();
if (shape.isPlanar()) {
if (!activeBody->isAfterInsertPoint (binder)) {
validPlaneCount++;
planes.push_back(binder);
status.push_back(PartDesignGui::TaskFeaturePick::validFeature);
}
}
}
}
}
private:
void tryFindBasePlanes()
{
auto* origin = activeBody->getOrigin();
for (auto plane : origin->planes()) {
planes.push_back (plane);
status.push_back(PartDesignGui::TaskFeaturePick::basePlane);
validPlaneCount++;
}
}
App::GeoFeatureGroupExtension* getGroupExtensionOfBody() const
{
App::GeoFeatureGroupExtension *geoGroup{nullptr};
if (activeBody) {
auto group( App::GeoFeatureGroupExtension::getGroupOfObject(activeBody) );
if (group) {
geoGroup = group->getExtensionByType<App::GeoFeatureGroupExtension>();
}
}
return geoGroup;
}
private:
App::Document* appdocument;
PartDesign::Body* activeBody;
unsigned validPlaneCount = 0;
std::vector<App::DocumentObject*> planes;
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> status;
};
class SketchRequestSelection
{
public:
SketchRequestSelection(Gui::Document* guidocument, PartDesign::Body* activeBody)
: guidocument(guidocument)
, activeBody(activeBody)
{
}
void findSupport()
{
try {
// Start command early, so undo will undo any Body creation
guidocument->openCommand(QT_TRANSLATE_NOOP("Command", "Create a new Sketch"));
tryFindSupport();
}
catch (const RejectException&) {
guidocument->abortCommand();
throw;
}
catch (const MissingPlanesException&) {
guidocument->abortCommand();
throw;
}
}
private:
void tryFindSupport()
{
createBodyOrThrow();
findAndSelectPlane();
}
void createBodyOrThrow()
{
if (!activeBody) {
App::Document* appdocument = guidocument->getDocument();
activeBody = PartDesignGui::makeBody(appdocument);
if (activeBody) {
tryAddNewBodyToActivePart();
}
else {
throw RejectException();
}
}
}
void tryAddNewBodyToActivePart()
{
App::Part *activePart = PartDesignGui::getActivePart();
if (activePart) {
activePart->addObject(activeBody);
}
}
void findAndSelectPlane()
{
App::Document* appdocument = guidocument->getDocument();
PlaneFinder planeFinder{appdocument, activeBody};
planeFinder.findBasePlanes();
planeFinder.findDatumPlanes();
planeFinder.findShapeBinderPlanes();
std::vector<App::DocumentObject*> planes = planeFinder.getPlanes();
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> status = planeFinder.getStatus();
unsigned validPlaneCount = planeFinder.countValidPlanes();
//
// Lambda definitions
//
App::Document* documentOfBody = appdocument;
PartDesign::Body* partDesignBody = activeBody;
// Determines if user made a valid selection in dialog
auto acceptFunction = [](const std::vector<App::DocumentObject*>& features) -> bool {
return !features.empty();
};
// Called by dialog when user hits "OK" and accepter returns true
auto processFunction = [documentOfBody, partDesignBody](const std::vector<App::DocumentObject*>& features) {
SketchRequestSelection::createSketch(documentOfBody, partDesignBody, features);
};
// Called by dialog for "Cancel", or "OK" if accepter returns false
std::string docname = documentOfBody->getName();
auto rejectFunction = [docname]() {
Gui::Document* document = Gui::Application::Instance->getDocument(docname.c_str());
if (document)
document->abortCommand();
};
//
// End of lambda definitions
//
if (validPlaneCount == 0) {
throw MissingPlanesException();
}
else if (validPlaneCount == 1) {
processFunction(planes);
}
else if (validPlaneCount > 1) {
checkForShownDialog();
Gui::Selection().clearSelection();
// Show dialog and let user pick plane
Gui::Control().showDialog(new PartDesignGui::TaskDlgFeaturePick(planes, status, acceptFunction,
processFunction, true, rejectFunction));
}
}
void checkForShownDialog()
{
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
PartDesignGui::TaskDlgFeaturePick *pickDlg = qobject_cast<PartDesignGui::TaskDlgFeaturePick *>(dlg);
if (dlg && !pickDlg) {
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes) {
Gui::Control().closeDialog();
}
else {
throw RejectException();
}
}
if (dlg) {
Gui::Control().closeDialog();
}
}
static void createSketch(App::Document* documentOfBody, PartDesign::Body* partDesignBody,
const std::vector<App::DocumentObject*>& features)
{
// may happen when the user switched to an empty document while the
// dialog is open
if (features.empty())
return;
App::Plane* plane = static_cast<App::Plane*>(features.front());
std::string FeatName = documentOfBody->getUniqueObjectName("Sketch");
std::string supportString = Gui::Command::getObjectCmd(plane,"(",",[''])");
FCMD_OBJ_CMD(partDesignBody,"newObject('Sketcher::SketchObject','" << FeatName << "')");
auto Feat = partDesignBody->getDocument()->getObject(FeatName.c_str());
FCMD_OBJ_CMD(Feat,"Support = " << supportString);
FCMD_OBJ_CMD(Feat,"MapMode = '" << Attacher::AttachEngine::getModeName(Attacher::mmFlatFace)<<"'");
Gui::Command::updateActive(); // Make sure the Support's Placement property is updated
PartDesignGui::setEdit(Feat, partDesignBody);
}
private:
Gui::Document* guidocument;
PartDesign::Body* activeBody;
};
}
SketchWorkflow::SketchWorkflow(Gui::Document* document)
: guidocument(document)
, activeBody(nullptr)
{
appdocument = guidocument->getDocument();
}
void SketchWorkflow::createSketch()
{
try {
tryCreateSketch();
}
catch (const RejectException&) {
}
catch (const WrongSelectionException&) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Several sub-elements selected"),
QObject::tr("You have to select a single face as support for a sketch!"));
}
catch (const WrongSupportException&) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No support face selected"),
QObject::tr("You have to select a face as support for a sketch!"));
}
catch (const SupportNotPlanarException&) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No planar support"),
QObject::tr("You need a planar face as support for a sketch!"));
}
catch (const MissingPlanesException&) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No valid planes in this document"),
QObject::tr("Please create a plane first or select a face to sketch on"));
}
}
void SketchWorkflow::tryCreateSketch()
{
if (PartDesignGui::assureModernWorkflow(appdocument)) {
createSketchWithModernWorkflow();
}
// No PartDesign feature without Body past FreeCAD 0.13
else if (PartDesignGui::isLegacyWorkflow(appdocument)) {
createSketchWithLegacyWorkflow();
}
}
std::tuple<bool, PartDesign::Body*> SketchWorkflow::shouldCreateBody()
{
auto shouldMakeBody{false};
// We need either an active Body, or for there to be no Body
// objects (in which case, just make one) to make a new sketch.
PartDesign::Body* pdBody = PartDesignGui::getBody(/* messageIfNot = */ false);
if (!pdBody) {
if (appdocument->countObjectsOfType(PartDesign::Body::getClassTypeId()) == 0) {
shouldMakeBody = true;
}
else {
PartDesignGui::DlgActiveBody dia(Gui::getMainWindow(), appdocument);
if (dia.exec() == QDialog::Accepted) {
pdBody = dia.getActiveBody();
}
}
}
return std::make_tuple(shouldMakeBody, pdBody);
}
bool SketchWorkflow::shouldAbort(bool shouldMakeBody) const
{
return !shouldMakeBody && !activeBody;
}
std::tuple<Gui::SelectionFilter, Gui::SelectionFilter> SketchWorkflow::getFaceAndPlaneFilter() const
{
// Hint:
// The behaviour of this command has changed with respect to a selected sketch:
// It doesn't try any more to edit a selected sketch but always tries to create
// a new sketch.
// See https://forum.freecadweb.org/viewtopic.php?f=3&t=44070
Gui::SelectionFilter FaceFilter ("SELECT Part::Feature SUBELEMENT Face COUNT 1");
Gui::SelectionFilter PlaneFilter ("SELECT App::Plane COUNT 1");
Gui::SelectionFilter PlaneFilter2("SELECT PartDesign::Plane COUNT 1");
if (PlaneFilter2.match()) {
PlaneFilter = PlaneFilter2;
}
return std::make_tuple(FaceFilter, PlaneFilter);
}
void SketchWorkflow::createSketchWithModernWorkflow()
{
auto result = shouldCreateBody();
auto shouldMakeBody = std::get<0>(result);
activeBody = std::get<1>(result);
if (shouldAbort(shouldMakeBody)) {
return;
}
auto faceOrPlaneFilter = getFaceAndPlaneFilter();
SketchPreselection sketchOnFace{guidocument, activeBody, faceOrPlaneFilter};
if (sketchOnFace.matches()) {
// create Sketch on Face or Plane
sketchOnFace.createSupport();
sketchOnFace.createSketchOnSupport(sketchOnFace.getSupport());
}
else {
SketchRequestSelection requestSelection{guidocument, activeBody};
requestSelection.findSupport();
}
}
void SketchWorkflow::createSketchWithLegacyWorkflow()
{
Gui::CommandManager& cmdMgr = Gui::Application::Instance->commandManager();
cmdMgr.runCommandByName("Sketcher_NewSketch");
}

View File

@@ -0,0 +1,65 @@
/**************************************************************************
* Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* 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 PARTDESIGNGUI_SKETCHWORKFLOW_H
#define PARTDESIGNGUI_SKETCHWORKFLOW_H
#include <tuple>
#include <Mod/PartDesign/PartDesignGlobal.h>
#include <Gui/SelectionFilter.h>
namespace App {
class Document;
class DocumentObject;
class GeoFeatureGroupExtension;
}
namespace Gui {
class Document;
}
namespace PartDesign {
class Body;
}
namespace PartDesignGui {
class SketchWorkflow
{
public:
explicit SketchWorkflow(Gui::Document*);
void createSketch();
private:
void tryCreateSketch();
void createSketchWithModernWorkflow();
void createSketchWithLegacyWorkflow();
std::tuple<bool, PartDesign::Body*> shouldCreateBody();
bool shouldAbort(bool) const;
std::tuple<Gui::SelectionFilter, Gui::SelectionFilter> getFaceAndPlaneFilter() const;
private:
Gui::Document* guidocument;
App::Document* appdocument;
PartDesign::Body* activeBody;
};
} // namespace PartDesignGui
#endif // PARTDESIGNGUI_SKETCHWORKFLOW_H

View File

@@ -54,6 +54,12 @@ set(Points_Scripts
../Init.py
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Points_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(Points PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
add_library(Points SHARED ${Points_SRCS} ${Points_Scripts})
link_directories(${CMAKE_BINARY_DIR}/src/3rdParty/libE57Format)

View File

@@ -31,6 +31,7 @@
# include <boost/lexical_cast.hpp>
# include <boost/regex.hpp>
# include <boost/algorithm/string.hpp>
# include <boost/math/special_functions/fpclassify.hpp> // needed for compilation on some systems
#endif
#include <Base/Console.h>

View File

@@ -48,9 +48,9 @@
// boost
# include <boost/lexical_cast.hpp>
# include <boost/math/special_functions/fpclassify.hpp>
# include <boost/regex.hpp>
# include <boost/algorithm/string.hpp>
# include <boost/math/special_functions/fpclassify.hpp>
// Qt
# include <QtConcurrentMap>

View File

@@ -54,6 +54,12 @@ SET(PointsGuiIcon_SVG
Resources/icons/PointsWorkbench.svg
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${PointsGui_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(PointsGui PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
add_library(PointsGui SHARED ${PointsGui_SRCS} ${PointsGui_Scripts} ${PointsGuiIcon_SVG})
target_link_libraries(PointsGui ${PointsGui_LIBS})

View File

@@ -25,12 +25,6 @@
#include <FCConfig.h>
#ifdef FC_OS_WIN32
# ifndef NOMINMAX
# define NOMINMAX
# endif
#endif
#ifdef _PreComp_
// STL
@@ -38,10 +32,6 @@
# include <limits>
# include <memory>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
// boost
# include <boost/math/special_functions/fpclassify.hpp>

View File

@@ -20,17 +20,16 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/uuid/uuid_io.hpp>
#endif
#include "ExternalGeometryFacade.h"
#include <Base/Console.h> // Only for Debug - To be removed
#include <Base/Exception.h>
#include <boost/uuid/uuid_io.hpp>
#include "ExternalGeometryFacadePy.h"

View File

@@ -20,17 +20,16 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/uuid/uuid_io.hpp>
#endif
#include "GeometryFacade.h"
//#include <Base/Console.h> // Only for Debug, when/if necessary
#include <Base/Exception.h>
#include <boost/uuid/uuid_io.hpp>
#include "GeometryFacadePy.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef __PRECOMPILED__
#define __PRECOMPILED__
@@ -29,53 +28,33 @@
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cassert>
#include <string>
#include <map>
#include <memory>
#include <vector>
#include <iostream>
#include <set>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
// QT
#include <QDateTime>
// Boost
#include <boost/bind/bind.hpp>
#include <boost/format.hpp>
#include <boost/uuid/uuid_io.hpp>
// Opencascade
#include <Mod/Part/App/OpenCascadeAll.h>
// Other needed opencascade
# include <ShapeFix_Wire.hxx>
# include <BRepOffsetAPI_NormalProjection.hxx>
# include <GeomConvert_BSplineCurveKnotSplitting.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Edge.hxx>
# include <BRepBuilderAPI_MakeWire.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#elif defined(FC_OS_WIN32)
#ifndef NOMINMAX
#define NOMINMAX
# define NOMINMAX
#endif
#include <windows.h>
# include <windows.h>
#endif // _PreComp_
#endif
#endif

View File

@@ -20,14 +20,11 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/format.hpp>
#endif // #ifndef _PreComp_
#include <boost/format.hpp>
#include <Base/Exception.h>
#include <Mod/Part/App/Geometry.h>

View File

@@ -19,6 +19,8 @@ set(Spreadsheet_SRCS
Cell.cpp
Cell.h
DisplayUnit.h
PreCompiled.cpp
PreCompiled.h
PropertySheet.cpp
PropertySheet.h
PropertySheetPy.xml
@@ -31,8 +33,6 @@ set(Spreadsheet_SRCS
PropertyRowHeights.h
PropertyRowHeightsPy.xml
PropertyRowHeightsPyImp.cpp
PreCompiled.cpp
PreCompiled.h
Sheet.cpp
Sheet.h
SheetPy.xml
@@ -49,6 +49,12 @@ generate_from_xml(PropertySheetPy)
generate_from_xml(PropertyColumnWidthsPy)
generate_from_xml(PropertyRowHeightsPy)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Spreadsheet_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(Spreadsheet PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
add_library(Spreadsheet SHARED ${Spreadsheet_SRCS})
target_link_libraries(Spreadsheet ${Spreadsheet_LIBS})

View File

@@ -37,6 +37,7 @@
#ifdef _PreComp_
// STL
#include <algorithm>
#include <deque>
#include <map>
#include <memory>
@@ -51,13 +52,9 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
// Qt
#include <QLocale>
#endif //_PreComp_
#endif//_PreComp_
#endif // SPREADSHEET_PRECOMPILED_H

View File

@@ -21,8 +21,9 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <algorithm>
# include <boost/regex.hpp>
# include <boost/range/adaptor/map.hpp>
# include <boost/range/algorithm/copy.hpp>

View File

@@ -23,11 +23,13 @@
#include "PreCompiled.h"
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
#include <Base/Parameter.h>
#include "Blending/BlendCurvePy.h"
#include "Blending/BlendPointPy.h"
#include "Blending/FeatureBlendCurve.h"
#include "FeatureCut.h"
#include "FeatureExtend.h"
#include "FeatureFilling.h"
@@ -35,9 +37,6 @@
#include "FeatureSections.h"
#include "FeatureSewing.h"
#include <Base/Interpreter.h>
#include <Base/Parameter.h>
namespace Surface
{

View File

@@ -25,17 +25,18 @@
#ifndef _PreComp_
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Base/Tools.h>
#include <Geom_Curve.hxx>
#include <Precision.hxx>
#include <Standard_Version.hxx>
#include <TopoDS.hxx>
#include <gp_Pnt.hxx>
#endif
#include "FeatureBlendCurve.h"
#include <Base/Tools.h>
#include "Mod/Surface/App/Blending/BlendCurve.h"
#include "Mod/Surface/App/Blending/BlendPoint.h"
#include "FeatureBlendCurve.h"
using namespace Surface;
const App::PropertyFloatConstraint::Constraints StartParameterConstraint = {0.0, 1.0, 0.05};

View File

@@ -48,23 +48,6 @@ SET(Blending_SRCS
Blending/BlendCurve.h
)
SET(BlendingPy_SRCS
Blending/BlendPointPy.xml
Blending/BlendPointPyImp.cpp
Blending/BlendCurvePy.xml
Blending/BlendCurvePyImp.cpp
)
SOURCE_GROUP("Blending" FILES ${BlendingPy_SRCS})
SET(Blending_SRCS
Blending/FeatureBlendCurve.cpp
Blending/FeatureBlendCurve.h
Blending/BlendPoint.cpp
Blending/BlendPoint.h
Blending/BlendCurve.cpp
Blending/BlendCurve.h
)
SET(Surface_SRCS
${Blending_SRCS}
${BlendingPy_SRCS}
@@ -85,6 +68,12 @@ SET(Surface_SRCS
FeatureCut.h
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Surface_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(Surface PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
link_directories(${OCC_LIBRARY_DIR})
add_library(Surface SHARED ${Surface_SRCS})
target_link_libraries(Surface ${Surface_LIBS})

View File

@@ -22,20 +22,11 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <Precision.hxx>
# include <TopoDS.hxx>
#endif
#include "FeatureCut.h"
#include <BRepAlgoAPI_Cut.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Builder.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <Base/Tools.h>
#include <Base/Exception.h>
using namespace Surface;

View File

@@ -23,12 +23,11 @@
#ifndef SURFACE_FEATURECUT_H
#define SURFACE_FEATURECUT_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Surface/SurfaceGlobal.h>
namespace Surface
{

View File

@@ -22,28 +22,29 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepLProp_SLProps.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <gp_Pnt.hxx>
#include <Geom_BSplineSurface.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <Precision.hxx>
#include <Standard_Version.hxx>
# include <BRepAdaptor_Surface.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <BRepLProp_SLProps.hxx>
# include <Geom_BSplineSurface.hxx>
# include <GeomAPI_PointsToBSplineSurface.hxx>
# include <gp_Pnt.hxx>
# include <Precision.hxx>
# include <Standard_Version.hxx>
# include <TColgp_Array2OfPnt.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Face.hxx>
#endif
#include "FeatureExtend.h"
#include <Base/Tools.h>
#include <Base/Exception.h>
#include "FeatureExtend.h"
using namespace Surface;
const App::PropertyIntegerConstraint::Constraints SampleRange = {2,INT_MAX,1};
const App::PropertyFloatConstraint::Constraints ToleranceRange = {0.0,10.0,0.01};
const App::PropertyFloatConstraint::Constraints ExtendRange = {-0.5,10.0,0.01};
const App::PropertyIntegerConstraint::Constraints SampleRange = {2, INT_MAX, 1};
const App::PropertyFloatConstraint::Constraints ToleranceRange = {0.0, 10.0, 0.01};
const App::PropertyFloatConstraint::Constraints ExtendRange = {-0.5, 10.0, 0.01};
PROPERTY_SOURCE(Surface::Extend, Part::Spline)
Extend::Extend() : lockOnChangeMutex(false)

View File

@@ -23,12 +23,11 @@
#ifndef SURFACE_FEATUREEXTEND_H
#define SURFACE_FEATUREEXTEND_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>
namespace Surface
{

View File

@@ -22,22 +22,18 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepFill_Filling.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <Precision.hxx>
# include <string>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <BRepFill_Filling.hxx>
# include <BRep_Tool.hxx>
# include <gp_Pnt.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Face.hxx>
#endif
#include "FeatureFilling.h"
#include <Base/Tools.h>
#include <Base/Exception.h>
#include <string>
using namespace Surface;

View File

@@ -23,12 +23,11 @@
#ifndef SURFACE_FEATUREFILLING_H
#define SURFACE_FEATUREFILLING_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>
class BRepFill_Filling;
namespace Surface

View File

@@ -25,14 +25,8 @@
#ifndef _PreComp_
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_NurbsConvert.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineCurve.hxx>
@@ -49,13 +43,15 @@
#include <Standard_ConstructionError.hxx>
#include <StdFail_NotDone.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#endif
#include <Base/Exception.h>
#include <Base/Tools.h>
#include "FeatureGeomFillSurface.h"
using namespace Surface;
ShapeValidator::ShapeValidator()

View File

@@ -24,15 +24,14 @@
#ifndef FEATUREGEOMFILLSURFACE_H
#define FEATUREGEOMFILLSURFACE_H
#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>
#include <Geom_BoundedSurface.hxx>
#include <GeomFill_FillingStyle.hxx>
#include <ShapeExtend_WireData.hxx>
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>
namespace Surface
{

View File

@@ -22,22 +22,19 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomFill_NSections.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <Precision.hxx>
#include <Standard_Version.hxx>
# include <BRepAdaptor_Curve.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <Geom_BSplineSurface.hxx>
# include <Geom_TrimmedCurve.hxx>
# include <GeomFill_NSections.hxx>
# include <Precision.hxx>
# include <Standard_Version.hxx>
# include <TopLoc_Location.hxx>
# include <TopoDS.hxx>
#endif
#include "FeatureSections.h"
#include <Base/Tools.h>
#include <Base/Exception.h>
using namespace Surface;

View File

@@ -23,12 +23,11 @@
#ifndef SURFACE_FEATURESECTIONS_H
#define SURFACE_FEATURESECTIONS_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/FeaturePartSpline.h>
#include <Mod/Surface/SurfaceGlobal.h>
namespace Surface
{

View File

@@ -22,18 +22,13 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <Precision.hxx>
# include <BRepBuilderAPI_Sewing.hxx>
# include <Precision.hxx>
# include <TopoDS.hxx>
#endif
#include "FeatureSewing.h"
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <Base/Tools.h>
#include <Base/Exception.h>
using namespace Surface;

View File

@@ -24,11 +24,10 @@
#define SURFACE_FEATURESEWING_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Surface/SurfaceGlobal.h>
namespace Surface
{

View File

@@ -20,5 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef PRECOMPILED_H
#define PRECOMPILED_H
@@ -28,26 +27,11 @@
#ifdef _PreComp_
// standard
#include <cstdio>
#include <cassert>
#include <iostream>
// STL
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//opencascade
#include "OpenCascadeAll.h"
#include <GeomFill_NSections.hxx>
#include <Mod/Part/App/OpenCascadeAll.h>
#endif //_PreComp_

View File

@@ -29,6 +29,7 @@
#include <Gui/Application.h>
#include "Blending/ViewProviderBlendCurve.h"
#include "TaskFilling.h"
#include "TaskGeomFillSurface.h"
#include "TaskSections.h"

View File

@@ -69,6 +69,12 @@ SET(SurfaceGuiIcon_SVG
Resources/icons/Surface_Workbench.svg
)
if(FREECAD_USE_PCH)
add_definitions(-D_PreComp_)
GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${SurfaceGui_SRCS})
ADD_MSVC_PRECOMPILED_HEADER(SurfaceGui PreCompiled.h PreCompiled.cpp PCH_SRCS)
endif(FREECAD_USE_PCH)
link_directories(${OCC_LIBRARY_DIR})
add_library(SurfaceGui SHARED ${SurfaceGui_SRCS} ${SurfaceGuiIcon_SVG})
target_link_libraries(SurfaceGui ${SurfaceGui_LIBS})

View File

@@ -23,46 +23,24 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <sstream>
#include <QApplication>
#include <QString>
#include <QDir>
#include <QFileInfo>
#include <QLineEdit>
#include <QMessageBox>
#include <QPointer>
#include <Standard_math.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <Inventor/events/SoMouseButtonEvent.h>
# include <sstream>
# include <QApplication>
# include <QMessageBox>
# include <BRepAdaptor_Curve.hxx>
# include <GeomAPI_ProjectPointOnCurve.hxx>
# include <TopoDS_Edge.hxx>
# include <TopoDS_Shape.hxx>
#endif
#include <Base/Console.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/FileDialog.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/SelectionFilter.h>
#include <Gui/SelectionObject.h>
#include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h>
#include <Gui/WaitCursor.h>
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include "Mod/Part/App/PartFeature.h"
#include <BRepAdaptor_Curve.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
//===========================================================================

View File

@@ -20,5 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -20,7 +20,6 @@
* *
***************************************************************************/
#ifndef GUI_PRECOMPILED_H
#define GUI_PRECOMPILED_H
@@ -28,30 +27,26 @@
#ifdef _PreComp_
// standard
#include <cstdio>
#include <cassert>
// STL
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
// Qt
#include <QAction>
#include <QApplication>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
// Qt Toolkit
#ifndef __QtAll__
# include <Gui/QtAll.h>
#endif
// OpenCasCade
#include <BRepAdaptor_Curve.hxx>
#include <GeomAbs_Shape.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <TopExp.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#endif //_PreComp_

View File

@@ -21,31 +21,32 @@
***************************************************************************/
#include "PreCompiled.h"
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
#include <GeomAbs_Shape.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifndef _PreComp_
# include <QAction>
# include <QMenu>
# include <QMessageBox>
# include <QTimer>
# include <GeomAbs_Shape.hxx>
# include <TopExp.hxx>
# include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
# include <TopTools_ListIteratorOfListOfShape.hxx>
#endif
#include <Base/Console.h>
#include <App/Document.h>
#include <Gui/ViewProvider.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Gui/Control.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/SelectionObject.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "TaskFilling.h"
#include "ui_TaskFilling.h"
#include "TaskFillingEdge.h"
#include "TaskFillingVertex.h"
#include "ui_TaskFilling.h"
using namespace SurfaceGui;

View File

@@ -23,14 +23,13 @@
#ifndef SURFACEGUI_TASKFILLING_H
#define SURFACEGUI_TASKFILLING_H
#include <Gui/DocumentObserver.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/SelectionFilter.h>
#include <Gui/DocumentObserver.h>
#include <Base/BoundBox.h>
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Mod/Surface/App/FeatureFilling.h>
class QListWidgetItem;
namespace SurfaceGui

View File

@@ -22,25 +22,23 @@
***************************************************************************/
#include "PreCompiled.h"
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
#include <GeomAbs_Shape.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifndef _PreComp_
# include <QAction>
# include <QMessageBox>
# include <QTimer>
# include <GeomAbs_Shape.hxx>
# include <TopExp.hxx>
# include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
# include <TopTools_ListIteratorOfListOfShape.hxx>
#endif
#include <App/Document.h>
#include <Gui/ViewProvider.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/SelectionObject.h>
#include <Base/Console.h>
#include <Gui/Control.h>
#include <Gui/BitmapFactory.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "TaskFillingEdge.h"

View File

@@ -24,14 +24,11 @@
#ifndef SURFACEGUI_TASKFILLINGEDGE_H
#define SURFACEGUI_TASKFILLINGEDGE_H
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/SelectionFilter.h>
#include <Gui/DocumentObserver.h>
#include <Base/BoundBox.h>
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Gui/SelectionFilter.h>
#include <Mod/Surface/App/FeatureFilling.h>
class QListWidgetItem;
namespace SurfaceGui

View File

@@ -21,25 +21,16 @@
***************************************************************************/
#include "PreCompiled.h"
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
#include <GeomAbs_Shape.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifndef _PreComp_
# include <QAction>
# include <QTimer>
#endif
#include <App/Document.h>
#include <Gui/ViewProvider.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/SelectionObject.h>
#include <Base/Console.h>
#include <Gui/Control.h>
#include <Gui/BitmapFactory.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "TaskFillingVertex.h"

View File

@@ -23,14 +23,11 @@
#ifndef SURFACEGUI_TASKFILLINGVERTEX_H
#define SURFACEGUI_TASKFILLINGVERTEX_H
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/SelectionFilter.h>
#include <Gui/DocumentObserver.h>
#include <Base/BoundBox.h>
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Gui/SelectionFilter.h>
#include <Mod/Surface/App/FeatureFilling.h>
class QListWidgetItem;
namespace SurfaceGui

View File

@@ -22,22 +22,24 @@
***************************************************************************/
#include "PreCompiled.h"
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#ifndef _PreComp_
# include <QAction>
# include <QMenu>
# include <QMessageBox>
# include <QTimer>
# include <TopExp.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
#endif
#include <App/Document.h>
#include <Gui/ViewProvider.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Base/Console.h>
#include <Gui/Control.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/SelectionObject.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "TaskGeomFillSurface.h"

View File

@@ -23,14 +23,14 @@
#ifndef SURFACEGUI_TASKGEOMFILLSURFACE_H
#define SURFACEGUI_TASKGEOMFILLSURFACE_H
#include <GeomFill_FillingStyle.hxx>
#include <Gui/DocumentObserver.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/SelectionFilter.h>
#include <Gui/DocumentObserver.h>
#include <Base/BoundBox.h>
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Mod/Surface/App/FeatureGeomFillSurface.h>
#include <GeomFill_FillingStyle.hxx>
class QListWidgetItem;

View File

@@ -21,25 +21,22 @@
***************************************************************************/
#include "PreCompiled.h"
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
#include <GeomAbs_Shape.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#ifndef _PreComp_
# include <QAction>
# include <QMenu>
# include <QMessageBox>
# include <QTimer>
# include <TopExp.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
#endif
#include <App/Document.h>
#include <Gui/ViewProvider.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Base/Console.h>
#include <Gui/Control.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/SelectionObject.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "TaskSections.h"

View File

@@ -23,14 +23,14 @@
#ifndef SURFACEGUI_TASKSECTIONS_H
#define SURFACEGUI_TASKSECTIONS_H
#include <memory>
#include <Gui/DocumentObserver.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Gui/SelectionFilter.h>
#include <Gui/DocumentObserver.h>
#include <Base/BoundBox.h>
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Mod/Surface/App/FeatureSections.h>
#include <memory>
class QListWidgetItem;

View File

@@ -23,10 +23,10 @@
#include "PreCompiled.h"
#include <Gui/BitmapFactory.h>
#include <Mod/Part/Gui/ViewProvider.h>
#include "ViewProviderExtend.h"
using namespace SurfaceGui;
PROPERTY_SOURCE(SurfaceGui::ViewProviderExtend, PartGui::ViewProviderSpline)

View File

@@ -24,7 +24,7 @@
#define SURFACEGUI_VIEWPROVIDEREXTEND_H
#include <Mod/Part/Gui/ViewProviderSpline.h>
#include <Mod/Surface/App/FeatureExtend.h>
namespace SurfaceGui
{

View File

@@ -21,16 +21,14 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include "Workbench.h"
#include <Gui/MenuManager.h>
#include <Gui/ToolBarManager.h>
#include "Workbench.h"
using namespace SurfaceGui;
/// @namespace SurfaceGui @class Workbench

View File

@@ -33,17 +33,13 @@
// standard
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstdio>
#include <chrono>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>

View File

@@ -59,6 +59,7 @@
#endif
#include <QGLWidget>
#include <QPaintEngine>
#include <QStatusBar>
#include <QSvgGenerator>
#include <QTextList>
#include <QXmlQuery>
@@ -66,8 +67,10 @@
// OpenCasCade
#include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepLProp_SLProps.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
// Open Inventor
#include <Inventor/SbVec3f.h>

View File

@@ -22,33 +22,22 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
# include <cmath>
#endif // #ifndef _PreComp_
#include <App/Document.h>
#include <Base/Console.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Mod/TechDraw/App/DrawViewBalloon.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/ArrowPropEnum.h>
#include "TaskBalloon.h"
#include "ui_TaskBalloon.h"
#include "DrawGuiUtil.h"
#include "QGIViewBalloon.h"
#include "ViewProviderBalloon.h"
#include "TaskBalloon.h"
#include "ui_TaskBalloon.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -24,10 +24,10 @@
#ifndef GUI_TASKVIEW_TASKBALLOON_H
#define GUI_TASKVIEW_TASKBALLOON_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace TechDrawGui
{

View File

@@ -28,16 +28,11 @@
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/LineGroup.h>

View File

@@ -23,11 +23,9 @@
#ifndef TECHDRAWGUI_TASKCENTERLINE_H
#define TECHDRAWGUI_TASKCENTERLINE_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Mod/TechDraw/App/Cosmetic.h>

View File

@@ -21,49 +21,34 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QMessageBox>
# include <gp_Pnt.hxx>
#endif // #ifndef _PreComp_
#include <QMessageBox>
#include <QPushButton>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <App/Link.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/Quantity.h>
#include <Base/UnitsApi.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawComplexSection.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawComplexSection.h>
#include <Mod/TechDraw/App/Preferences.h>
#include <Mod/TechDraw/Gui/ui_TaskComplexSection.h>
#include "DrawGuiUtil.h"
#include "Widgets/CompassWidget.h"
#include "Widgets/VectorEditWidget.h"
#include "TaskComplexSection.h"
#include "ui_TaskComplexSection.h"
#include "DrawGuiUtil.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,13 +23,13 @@
#ifndef TECHDRAWGUI_TASKCOMPLEXSECTION_H
#define TECHDRAWGUI_TASKCOMPLEXSECTION_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <QString>
#include <Base/Vector3D.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace App
{

View File

@@ -21,46 +21,36 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <QStatusBar>
#include <QGraphicsScene>
# include <cmath>
# include <QStatusBar>
#endif // #ifndef _PreComp_
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/Quantity.h>
#include <Base/UnitsApi.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawProjGroup.h>
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/Gui/ui_TaskCosVertex.h>
#include "QGSPage.h"
#include "QGIView.h"
#include "ui_TaskCosVertex.h"
#include "TaskCosVertex.h"
#include "MDIViewPage.h"
#include "ViewProviderPage.h"
#include "QGIView.h"
#include "QGSPage.h"
#include "QGTracker.h"
#include "Rez.h"
#include "ViewProviderPage.h"
#include "TaskCosVertex.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,12 +23,12 @@
#ifndef TECHDRAWGUI_TASKCOSVERTEX_H
#define TECHDRAWGUI_TASKCOSVERTEX_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include "QGTracker.h"
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
#include "QGTracker.h"
namespace TechDraw
{

View File

@@ -21,42 +21,25 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#include <QButtonGroup>
#include <QStatusBar>
# include <cmath>
# include <BRepBuilderAPI_MakeEdge.hxx>
#endif
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/Gui/ui_TaskCosmeticLine.h>
#include "ui_TaskCosmeticLine.h"
#include "TaskCosmeticLine.h"
using namespace Gui;
using namespace TechDraw;
using namespace TechDrawGui;

View File

@@ -23,11 +23,11 @@
#ifndef TECHDRAWGUI_TASKCOSMETICLINE_H
#define TECHDRAWGUI_TASKCOSMETICLINE_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Base/Vector3D.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace TechDraw
{

View File

@@ -21,47 +21,20 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Bnd_Box.hxx>
#include <QButtonGroup>
#include <QStatusBar>
#include <QGraphicsScene>
# include <cmath>
#endif
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
#include <App/DocumentObject.h>
#include <Gui/Application.h>
#include <Base/Tools.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawViewDimension.h>
#include <Mod/TechDraw/App/DrawViewBalloon.h>
#include <Mod/TechDraw/Gui/ui_TaskCustomizeFormat.h>
#include <Mod/TechDraw/App/DrawViewDimension.h>
#include "PreferencesGui.h"
#include "QGVPage.h"
#include "QGIView.h"
#include "QGIPrimPath.h"
#include "MDIViewPage.h"
#include "ViewProviderPage.h"
#include "ViewProviderViewPart.h"
#include "Rez.h"
#include "TaskCustomizeFormat.h"
#include "ui_TaskCustomizeFormat.h"
# include "TaskCustomizeFormat.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,10 +23,9 @@
#ifndef TECHDRAWGUI_TASKCUSTOMIZEFORMAT_H
#define TECHDRAWGUI_TASKCUSTOMIZEFORMAT_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace App {

View File

@@ -22,45 +22,29 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <QGraphicsScene>
#include <QStatusBar>
#endif // #ifndef _PreComp_
#include <App/Document.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/Quantity.h>
#include <Base/UnitsApi.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawProjGroup.h>
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
#include <Mod/TechDraw/App/DrawViewDetail.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/Gui/ui_TaskDetail.h>
#include "QGSPage.h"
#include "QGIView.h"
#include "QGIGhostHighlight.h"
#include "ViewProviderPage.h"
#include "Rez.h"
#include "ui_TaskDetail.h"
#include "TaskDetail.h"
#include "QGIGhostHighlight.h"
#include "QGSPage.h"
#include "Rez.h"
#include "ViewProviderPage.h"
using namespace TechDrawGui;
using namespace TechDraw;

View File

@@ -23,11 +23,10 @@
#ifndef TECHDRAWGUI_TASKDETAIL_H
#define TECHDRAWGUI_TASKDETAIL_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Base/Vector3D.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
//TODO: make this a proper enum

View File

@@ -21,37 +21,26 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <QMessageBox>
# include <cmath>
# include <QMessageBox>
#endif // #ifndef _PreComp_
#include <Base/Console.h>
#include <Gui/Application.h>
#include <App/Document.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/SelectionObject.h>
#include <Gui/ViewProvider.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Mod/TechDraw/App/DrawViewDimension.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include "QGIViewDimension.h"
#include "ViewProviderDimension.h"
#include "ui_TaskDimension.h"
#include "TaskDimension.h"
#include "QGIViewDimension.h"
#include "ViewProviderDimension.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,10 +23,10 @@
#ifndef GUI_TASKVIEW_TASKDIMENSION_H
#define GUI_TASKVIEW_TASKDIMENSION_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace TechDrawGui
{

View File

@@ -21,33 +21,23 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
# include <cmath>
#endif // #ifndef _PreComp_
#include <App/Document.h>
#include <Base/Console.h>
#include <Base/Vector3D.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Mod/TechDraw/App/HatchLine.h>
#include <Mod/TechDraw/App/DrawGeomHatch.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include "ViewProviderGeomHatch.h"
#include "TaskGeomHatch.h"
#include <Mod/TechDraw/Gui/ui_TaskGeomHatch.h>
#include "ui_TaskGeomHatch.h"
#include "ViewProviderGeomHatch.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,10 +23,9 @@
#ifndef GUI_TASKVIEW_TASKGEOMHATCH_H
#define GUI_TASKVIEW_TASKGEOMHATCH_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace App

View File

@@ -22,35 +22,28 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
# include <cmath>
#endif // #ifndef _PreComp_
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/Vector3D.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include "PreferencesGui.h"
#include "ViewProviderHatch.h"
#include "TaskHatch.h"
#include <Mod/TechDraw/Gui/ui_TaskHatch.h>
#include "ui_TaskHatch.h"
#include "ViewProviderHatch.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -24,14 +24,12 @@
#ifndef GUI_TASKVIEW_TASKHATCH_H
#define GUI_TASKVIEW_TASKHATCH_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <App/Material.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/Gui/ui_TaskHatch.h>
#include "ui_TaskHatch.h"
class Ui_TaskHatch;

View File

@@ -21,11 +21,9 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <QStatusBar>
#include <QGraphicsScene>
# include <cmath>
# include <QStatusBar>
#endif
#include <App/Document.h>
@@ -34,34 +32,27 @@
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/ArrowPropEnum.h>
#include <Mod/TechDraw/App/DrawLeaderLine.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/LineGroup.h>
#include "TaskLeaderLine.h"
#include "ui_TaskLeaderLine.h"
#include "DrawGuiUtil.h"
#include "PreferencesGui.h"
#include "QGSPage.h"
#include "QGVPage.h"
#include "QGIView.h"
#include "QGIPrimPath.h"
#include "MDIViewPage.h"
#include "ViewProviderPage.h"
#include "ViewProviderLeader.h"
#include "QGTracker.h"
#include "QGEPath.h"
#include "PreferencesGui.h"
#include "QGILeaderLine.h"
#include "QGIView.h"
#include "QGSPage.h"
#include "QGTracker.h"
#include "Rez.h"
#include "ViewProviderLeader.h"
#include "ViewProviderPage.h"
using namespace Gui;

View File

@@ -23,13 +23,13 @@
#ifndef TECHDRAWGUI_TASKTEXTLEADER_H
#define TECHDRAWGUI_TASKTEXTLEADER_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include "QGTracker.h"
#include <Base/Vector3D.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
#include "QGTracker.h"
namespace TechDraw
{

View File

@@ -21,39 +21,28 @@
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
# include <cmath>
#endif // #ifndef _PreComp_
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/Vector3D.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/FileDialog.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/Gui/ui_TaskLineDecor.h>
#include <Mod/TechDraw/Gui/ui_TaskRestoreLines.h>
#include "TaskLineDecor.h"
#include "ui_TaskLineDecor.h"
#include "ui_TaskRestoreLines.h"
#include "QGIView.h"
#include "ViewProviderViewPart.h"
#include "TaskLineDecor.h"
using namespace Gui;
using namespace TechDraw;

View File

@@ -23,10 +23,9 @@
#ifndef GUI_TASKVIEW_TASKLINEDECOR_H
#define GUI_TASKVIEW_TASKLINEDECOR_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <Gui/TaskView/TaskDialog.h>
#include <Gui/TaskView/TaskView.h>
#include <Mod/TechDraw/TechDrawGlobal.h>
namespace App
@@ -34,7 +33,6 @@ namespace App
class DocumentObject;
}
namespace TechDrawGui
{

Some files were not shown because too many files have changed in this diff Show More