diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index 8922a80edaa5b338c6861cc6ce27dec1055c9566..fc00182526d83b6ba1e714680d6b8eaec9d03367 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -53,36 +53,6 @@ static void fixEdgeToValue(GEdge *ed, double value, dofManager<double> &myAssemb } } -int intersection_segments (SPoint3 &p1, SPoint3 &p2, - SPoint3 &q1, SPoint3 &q2, - double x[2]) -{ - double xp_max = std::max(p1.x(),p2.x()); - double yp_max = std::max(p1.y(),p2.y()); - double xq_max = std::max(q1.x(),q2.x()); - double yq_max = std::max(q1.y(),q2.y()); - - double xp_min = std::min(p1.x(),p2.x()); - double yp_min = std::min(p1.y(),p2.y()); - double xq_min = std::min(q1.x(),q2.x()); - double yq_min = std::min(q1.y(),q2.y()); - if (yq_min > yp_max || xq_min > xp_max || - yq_max < yp_min || xq_max < xp_min){ - return 0; - } - else{ - double A[2][2]; - A[0][0] = p2.x()-p1.x(); - A[0][1] = q1.x()-q2.x(); - A[1][0] = p2.y()-p1.y(); - A[1][1] = q1.y()-q2.y(); - double b[2] = {q1.x()-p1.x(),q1.y()-p1.y()}; - sys2x2(A,b,x); - - return (x[0] >= 0.0 && x[0] <= 1. && - x[1] >= 0.0 && x[1] <= 1.); - } -} static void printBound(std::vector<MVertex*> &l, int tag){ //print boundary char name[256]; diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp index 724deb291f39e0d8d89902c59c90f9cc16e9dd6e..4b8c37725f66336d74c19be6bc0628e8bd023cee 100644 --- a/Mesh/meshGFaceDelaunayInsertion.cpp +++ b/Mesh/meshGFaceDelaunayInsertion.cpp @@ -655,10 +655,6 @@ void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris, fclose (ff); } -int intersection_segments (SPoint3 &p1, SPoint3 &p2, - SPoint3 &q1, SPoint3 &q2, - double x[2]); - static MTri3* search4Triangle (MTri3 *t, double pt[2], std::vector<double> &Us, std::vector<double> &Vs, std::set<MTri3*,compareTri3Ptr> &AllTris) { diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp index 2d5e97f62e128260ba1dab86db23c2e6481570c6..e1c4131aaa15941f75fadff03c5df082d48fe180 100644 --- a/Mesh/meshGFaceOptimize.cpp +++ b/Mesh/meshGFaceOptimize.cpp @@ -20,12 +20,15 @@ #include "Generator.h" #include "Context.h" #include "OS.h" -#include "PView.h" -#include "PViewData.h" #include "SVector3.h" #include "SPoint3.h" -#ifdef HAVE_MATCH +#if defined(HAVE_POST) +#include "PView.h" +#include "PViewData.h" +#endif + +#if defined(HAVE_MATCH) extern "C" int FAILED_NODE; extern "C" struct CCdatagroup; extern "C" int perfect_match @@ -2290,6 +2293,7 @@ double Temporary::compute_alignment(const MEdge&_edge, MElement*element1, MEleme void Temporary::read_data(std::string file_name) { +#if defined(HAVE_POST) int i,j,number; double x,y,z; MElement*element; @@ -2312,6 +2316,7 @@ void Temporary::read_data(std::string file_name) gradients[number] = SVector3(x,y,z); } } +#endif } void Temporary::quadrilaterize(std::string file_name,double _w1,double _w2,double _w3) diff --git a/Numeric/Numeric.cpp b/Numeric/Numeric.cpp index 569c6661a6aa31c1be373f2caef47796a3d6e82a..fc48c43e8c8d08ff84bbf478eb583020fd1c66ce 100644 --- a/Numeric/Numeric.cpp +++ b/Numeric/Numeric.cpp @@ -1166,3 +1166,34 @@ void signedDistancesPointsEllipseLine(std::vector<double>&distances, } } } + +int intersection_segments (SPoint3 &p1, SPoint3 &p2, + SPoint3 &q1, SPoint3 &q2, + double x[2]) +{ + double xp_max = std::max(p1.x(),p2.x()); + double yp_max = std::max(p1.y(),p2.y()); + double xq_max = std::max(q1.x(),q2.x()); + double yq_max = std::max(q1.y(),q2.y()); + + double xp_min = std::min(p1.x(),p2.x()); + double yp_min = std::min(p1.y(),p2.y()); + double xq_min = std::min(q1.x(),q2.x()); + double yq_min = std::min(q1.y(),q2.y()); + if (yq_min > yp_max || xq_min > xp_max || + yq_max < yp_min || xq_max < xp_min){ + return 0; + } + else{ + double A[2][2]; + A[0][0] = p2.x()-p1.x(); + A[0][1] = q1.x()-q2.x(); + A[1][0] = p2.y()-p1.y(); + A[1][1] = q1.y()-q2.y(); + double b[2] = {q1.x()-p1.x(),q1.y()-p1.y()}; + sys2x2(A,b,x); + + return (x[0] >= 0.0 && x[0] <= 1. && + x[1] >= 0.0 && x[1] <= 1.); + } +} diff --git a/Numeric/Numeric.h b/Numeric/Numeric.h index b921e327546c630d2623bb7451d6e40b1c8e1bf8..d946666d8bb2bd4654f04c546e83524ddd3b51eb 100644 --- a/Numeric/Numeric.h +++ b/Numeric/Numeric.h @@ -110,4 +110,9 @@ void signedDistancesPointsEllipseLine (std::vector<double>&distances, std::vector<SPoint3>&closePts, const std::vector<SPoint3> &pts, const SPoint3 &p1, const SPoint3 &p2); + +int intersection_segments (SPoint3 &p1, SPoint3 &p2, + SPoint3 &q1, SPoint3 &q2, + double x[2]); + #endif