Skip to content

Commit

Permalink
[Raytracing] App: remove unused includes
Browse files Browse the repository at this point in the history
- also some sorting
  • Loading branch information
donovaly committed Dec 6, 2022
1 parent ffb97ab commit 10d6e4b
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 129 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Raytracing/App/AppRaytracing.cpp
Expand Up @@ -23,14 +23,14 @@
#include "PreCompiled.h"

#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
#include <Base/PyObjectBase.h>

#include "LuxFeature.h"
#include "LuxProject.h"
#include "RayFeature.h"
#include "RayProject.h"
#include "RaySegment.h"
#include "LuxFeature.h"
#include "LuxProject.h"


namespace Raytracing {
Expand Down
10 changes: 3 additions & 7 deletions src/Mod/Raytracing/App/AppRaytracingPy.cpp
Expand Up @@ -22,22 +22,18 @@

#include "PreCompiled.h"

#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
#include <App/Application.h>

#include <Base/Console.h>
#include <Base/FileInfo.h>
#include <Base/Interpreter.h>
#include <Base/Stream.h>
#include "PovTools.h"
#include <Mod/Part/App/TopoShapePy.h>

#include "LuxTools.h"
// automatically generated.....
#include "FreeCADpov.h"

#include <Mod/Part/App/TopoShape.h>
#include <Mod/Part/App/TopoShapePy.h>
#include <App/Application.h>


using namespace std;

Expand Down
6 changes: 1 addition & 5 deletions src/Mod/Raytracing/App/LuxFeature.cpp
Expand Up @@ -20,22 +20,18 @@
* *
***************************************************************************/


#include "PreCompiled.h"

#ifndef _PreComp_
# include <ShapeAnalysis_ShapeContents.hxx>
# include <Standard.hxx>
#endif

#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Mod/Part/App/PartFeature.h>

#include "LuxFeature.h"
#include "LuxTools.h"

#include <ShapeAnalysis_ShapeContents.hxx>


using namespace Raytracing;
using namespace std;
Expand Down
3 changes: 0 additions & 3 deletions src/Mod/Raytracing/App/LuxFeature.h
Expand Up @@ -20,14 +20,11 @@
* *
***************************************************************************/


#ifndef _LuxFeature_h_
#define _LuxFeature_h_

#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include <App/PropertyFile.h>
#include <App/PropertyStandard.h>

#include "RaySegment.h"

Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Raytracing/App/LuxProject.cpp
Expand Up @@ -20,20 +20,20 @@
* *
***************************************************************************/


#include "PreCompiled.h"

#ifndef _PreComp_
# include <Standard.hxx>
# include <string>
#endif

#include <Base/FileInfo.h>
#include <Base/Console.h>
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/FileInfo.h>

#include "LuxProject.h"
#include "LuxFeature.h"
#include "LuxTools.h"


using namespace Raytracing;
using namespace std;
Expand Down
5 changes: 1 addition & 4 deletions src/Mod/Raytracing/App/LuxProject.h
Expand Up @@ -20,17 +20,14 @@
* *
***************************************************************************/




#ifndef _LuxProject_h_
#define _LuxProject_h_

#include <App/DocumentObjectGroup.h>
#include <App/PropertyStandard.h>
#include <App/PropertyFile.h>
#include <Mod/Raytracing/RaytracingGlobal.h>


namespace Raytracing
{

Expand Down
16 changes: 5 additions & 11 deletions src/Mod/Raytracing/App/LuxTools.cpp
Expand Up @@ -23,28 +23,22 @@
#include "PreCompiled.h"

#ifndef _PreComp_
# include <BRep_Tool.hxx>
# include <sstream>

# include <BRepMesh_IncrementalMesh.hxx>
# include <GeomAPI_ProjectPointOnSurf.hxx>
# include <GeomLProp_SLProps.hxx>
# include <Poly_Triangulation.hxx>
# include <TopExp_Explorer.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Face.hxx>
# include <sstream>

This comment has been minimized.

Copy link
@adrianinsaval

adrianinsaval Dec 6, 2022

Member

could this be the missing include? LuxTools.h was included in LuxProject.cpp before


#endif

#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Sequencer.h>
#include <Base/Matrix.h>
#include <App/ComplexGeoData.h>
#include <boost/regex.hpp>

#include <Mod/Part/App/Tools.h>

#include "PovTools.h"
#include "LuxTools.h"
#include <Mod/Part/App/Tools.h>


using Base::Console;

Expand Down
3 changes: 1 addition & 2 deletions src/Mod/Raytracing/App/LuxTools.h
Expand Up @@ -20,15 +20,14 @@
* *
***************************************************************************/


#ifndef _LuxTools_h_
#define _LuxTools_h_

#include <gp_Vec.hxx>
#include <vector>

#include "PovTools.h"


class TopoDS_Shape;
class TopoDS_Face;

Expand Down
14 changes: 5 additions & 9 deletions src/Mod/Raytracing/App/PovTools.cpp
Expand Up @@ -23,26 +23,22 @@
#include "PreCompiled.h"

#ifndef _PreComp_
# include <BRep_Tool.hxx>
# include <sstream>

# include <BRepMesh_IncrementalMesh.hxx>
# include <GeomAPI_ProjectPointOnSurf.hxx>
# include <GeomLProp_SLProps.hxx>
# include <Poly_Triangulation.hxx>
# include <TopExp_Explorer.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Face.hxx>
# include <sstream>
#endif

#include <App/ComplexGeoData.h>
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Sequencer.h>
#include <Base/Stream.h>
#include <App/ComplexGeoData.h>

#include <Mod/Part/App/Tools.h>

#include "PovTools.h"
#include <Mod/Part/App/Tools.h>


using Base::Console;

Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Raytracing/App/PovTools.h
Expand Up @@ -20,14 +20,15 @@
* *
***************************************************************************/


#ifndef _PovTools_h_
#define _PovTools_h_

#include <gp_Vec.hxx>
#include <vector>

#include <Mod/Raytracing/RaytracingGlobal.h>


class TopoDS_Shape;
class TopoDS_Face;

Expand Down
51 changes: 3 additions & 48 deletions src/Mod/Raytracing/App/PreCompiled.h
Expand Up @@ -20,7 +20,6 @@
* *
***************************************************************************/


#ifndef __PRECOMPILED__
#define __PRECOMPILED__

Expand All @@ -32,9 +31,9 @@
#include <cstdio>
#include <cassert>


// STL
#include <algorithm>
#include <bitset>
#include <iostream>
#include <list>
#include <map>
Expand All @@ -44,60 +43,16 @@
#include <stack>
#include <string>
#include <vector>
#include <bitset>

// OpenCascade View
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <Bnd_Box.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_NurbsConvert.hxx>
#include <BRepMesh.hxx>
#include <BRepMesh_Edge.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRepMesh_Triangle.hxx>
#include <BRepTools.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Sphere.hxx>
#include <gp_Trsf.hxx>
#include <OSD_FileIterator.hxx>
#include <OSD_Timer.hxx>
#include <Poly_Array1OfTriangle.hxx>
#include <Poly_Connect.hxx>
#include <Poly_Triangulation.hxx>
#include <ShapeAnalysis_ShapeContents.hxx>
#include <Standard.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
#include <TColStd_ListOfReal.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRep_Tool.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomLProp_SLProps.hxx>
#include <TopoDS_Face.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Edge.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <GCPnts_UniformDeflection.hxx>

#include <TopoDS_Shape.hxx>

#endif //_PreComp_

Expand Down
4 changes: 0 additions & 4 deletions src/Mod/Raytracing/App/RayFeature.cpp
Expand Up @@ -20,15 +20,11 @@
* *
***************************************************************************/


#include "PreCompiled.h"

#ifndef _PreComp_
# include <Standard.hxx>
#endif

#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Mod/Part/App/PartFeature.h>

#include "RayFeature.h"
Expand Down
3 changes: 0 additions & 3 deletions src/Mod/Raytracing/App/RayFeature.h
Expand Up @@ -20,14 +20,11 @@
* *
***************************************************************************/


#ifndef _RayFeature_h_
#define _RayFeature_h_

#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include <App/PropertyFile.h>
#include <App/PropertyStandard.h>

#include "RaySegment.h"

Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Raytracing/App/RayProject.cpp
Expand Up @@ -20,21 +20,21 @@
* *
***************************************************************************/


#include "PreCompiled.h"

#ifndef _PreComp_
# include <Standard.hxx>
# include <string>
#endif

#include <Base/FileInfo.h>
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/FileInfo.h>
#include <Base/Stream.h>
#include <App/Application.h>

#include "RayProject.h"
#include "RayFeature.h"


using namespace Raytracing;
using namespace std;

Expand Down
5 changes: 1 addition & 4 deletions src/Mod/Raytracing/App/RayProject.h
Expand Up @@ -20,17 +20,14 @@
* *
***************************************************************************/




#ifndef _RayProject_h_
#define _RayProject_h_

#include <App/DocumentObjectGroup.h>
#include <App/PropertyStandard.h>
#include <App/PropertyFile.h>
#include <Mod/Raytracing/RaytracingGlobal.h>


namespace Raytracing
{

Expand Down

4 comments on commit 10d6e4b

@adrianinsaval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not compile on archlinux:

FAILED: src/Mod/Raytracing/App/CMakeFiles/Raytracing.dir/LuxProject.cpp.o 
/usr/sbin/ccache /usr/lib/ccache/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DPYCXX_6_2_COMPATIBILITY -DQT_CORE_LIB -DQT_NO_DEBUG -DQT_XML_LIB -DRaytracing_EXPORTS -D_OCC64 -I/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/build/src/Mod/Raytracing/App/Raytracing_autogen/include -I/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/build -I/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/build/src -I/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/src -I/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/build/src/Mod/Raytracing/App -I/usr/include/opencascade -I/usr/include/python3.10 -isystem /usr/include/qt -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtXml -Wall -Wextra -Wno-write-strings -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -w -fPIC -fPIC -std=gnu++17 -MD -MT src/Mod/Raytracing/App/CMakeFiles/Raytracing.dir/LuxProject.cpp.o -MF src/Mod/Raytracing/App/CMakeFiles/Raytracing.dir/LuxProject.cpp.o.d -o src/Mod/Raytracing/App/CMakeFiles/Raytracing.dir/LuxProject.cpp.o -c /__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/src/Mod/Raytracing/App/LuxProject.cpp
/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/src/Mod/Raytracing/App/LuxProject.cpp: In member function ‘virtual App::DocumentObjectExecReturn* Raytracing::LuxProject::execute()’:
/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/src/Mod/Raytracing/App/LuxProject.cpp:83:21: error: variable ‘std::ifstream file’ has initializer but incomplete type
   83 |     ifstream file ( fi.filePath().c_str() );
      |                     ^~
/__w/pacman-repo/pacman-repo/PKGBUILD/freecad-git/src/FreeCAD/src/Mod/Raytracing/App/LuxProject.cpp:87:20: error: variable ‘std::ofstream ofile’ has initializer but incomplete type
   87 |     ofstream ofile(tempName.c_str());
      |                    ^~~~~~~~
[3016/4168] Building CXX object src/Mod/Measure/App/CMakeFiles/Measure.dir/AppMeasure.cpp.o
[3017/4168] Linking CXX shared library Mod/Surface/Surface.so
ninja: build stopped: subcommand failed.

@donovaly
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not compile on archlinux:

83 | ifstream file ( fi.filePath().c_str() );
| ^~

It seems an STL header is missing. I added them now explicitly: c6c273e

Do you use precompiled headers? (CMake option "FREECAD_USE_PCH")

Please try out master and report back.

@adrianinsaval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use precompiled headers? (CMake option "FREECAD_USE_PCH")

If it's not on by default then I don't think so, AFAIK that's only relevant to use on windows

@donovaly
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use precompiled headers? (CMake option "FREECAD_USE_PCH")

If it's not on by default then I don't think so, AFAIK that's only relevant to use on windows

For me it is the default. But you can simply open CMake and check

Please sign in to comment.