From ea570ad2cc1398bbe197ee440c593874e97c73a7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 22 Jul 2011 10:14:11 +0100 Subject: [PATCH] ENH: surfaceFeatureExtract: disabled curvature calculation (only CGAL dependency) --- .../surface/surfaceFeatureExtract/Make/files | 2 +- .../surfaceFeatureExtract/Make/options | 22 ++++++++++++++- .../surfaceFeatureExtract.C | 28 ++++++++++++------- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/applications/utilities/surface/surfaceFeatureExtract/Make/files b/applications/utilities/surface/surfaceFeatureExtract/Make/files index 0c0f6f7966..94ddc1e7e2 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/Make/files +++ b/applications/utilities/surface/surfaceFeatureExtract/Make/files @@ -1,4 +1,4 @@ surfaceFeatureExtract.C -CGALPolyhedron/buildCGALPolyhedron.C +/* CGALPolyhedron/buildCGALPolyhedron.C */ EXE = $(FOAM_APPBIN)/surfaceFeatureExtract diff --git a/applications/utilities/surface/surfaceFeatureExtract/Make/options b/applications/utilities/surface/surfaceFeatureExtract/Make/options index 155b9f53db..cedd70cc17 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/Make/options +++ b/applications/utilities/surface/surfaceFeatureExtract/Make/options @@ -1,10 +1,12 @@ +#if false + EXE_FROUNDING_MATH = -frounding-math EXE_NDEBUG = -DNDEBUG USE_F2C = -DCGAL_USE_F2C - include $(GENERAL_RULES)/CGAL EXE_INC = \ + -DENABLE_CURVATURE \ ${EXE_FROUNDING_MATH} \ ${EXE_NDEBUG} \ ${USE_F2C} \ @@ -27,3 +29,21 @@ EXE_LIBS = \ -ledgeMesh \ -ltriSurface \ -lsampling + +#else + +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude + +EXE_LIBS = \ + -lmeshTools \ + -ledgeMesh \ + -ltriSurface \ + -lsampling + +#endif diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index a4a242558a..2536dd3504 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -29,11 +29,9 @@ Description \*---------------------------------------------------------------------------*/ - -#include "triangle.H" -#include "triSurface.H" #include "argList.H" #include "Time.H" +#include "triSurface.H" #include "surfaceFeatures.H" #include "featureEdgeMesh.H" #include "extendedFeatureEdgeMesh.H" @@ -43,16 +41,17 @@ Description #include "triSurfaceMesh.H" #include "vtkSurfaceWriter.H" #include "triSurfaceFields.H" -#include "unitConversion.H" #include "indexedOctree.H" #include "treeDataEdge.H" #include "unitConversion.H" +#ifdef ENABLE_CURVATURE #include "buildCGALPolyhedron.H" #include "CGALPolyhedronRings.H" #include #include #include +#endif using namespace Foam; @@ -150,6 +149,7 @@ void drawHitProblem } +#ifdef ENABLE_CURVATURE scalarField calcCurvature(const triSurface& surf) { scalarField k(surf.points().size(), 0); @@ -296,7 +296,7 @@ scalarField calcCurvature(const triSurface& surf) return k; } - +#endif // Unmark non-manifold edges if individual triangles are not features void unmarkBaffles @@ -405,11 +405,6 @@ int main(int argc, char *argv[]) "writeVTK", "write extendedFeatureEdgeMesh vtk files" ); - argList::addBoolOption - ( - "calcCurvature", - "calculate curvature and closeness fields" - ); argList::addOption ( "closeness", @@ -433,6 +428,14 @@ int main(int argc, char *argv[]) "remove any non-manifold (open or more than two connected faces) edges" ); +# ifdef ENABLE_CURVATURE + argList::addBoolOption + ( + "calcCurvature", + "calculate curvature and closeness fields" + ); +# endif + # include "setRootCase.H" # include "createTime.H" @@ -955,6 +958,8 @@ int main(int argc, char *argv[]) externalClosenessField.write(); + +#ifdef ENABLE_CURVATURE scalarField k = calcCurvature(surf); // Modify the curvature values on feature edges and points to be zero. @@ -984,6 +989,7 @@ int main(int argc, char *argv[]) ); kField.write(); +#endif if (writeVTK) { @@ -1011,6 +1017,7 @@ int main(int argc, char *argv[]) true // verbose ); +# ifdef ENABLE_CURVATURE vtkSurfaceWriter().write ( runTime.constant()/"triSurface", // outputDir @@ -1022,6 +1029,7 @@ int main(int argc, char *argv[]) true, // isNodeValues true // verbose ); +# endif } Info<< "End\n" << endl;