From 3e31c7c3114d087adede444a397374c697df85a4 Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 6 Dec 2007 11:09:00 +0000 Subject: [PATCH] Porting gcc 4.2. --- src/INTERP_KERNEL/ConvexIntersector.cxx | 5 ++++- src/INTERP_KERNEL/GenericIntersector.cxx | 4 +++- src/INTERP_KERNEL/PolygonAlgorithms.hxx | 23 ++++++++++++----------- src/INTERP_KERNEL/TransformedTriangle.hxx | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/INTERP_KERNEL/ConvexIntersector.cxx b/src/INTERP_KERNEL/ConvexIntersector.cxx index 4af8de1b0..eba6e19a6 100644 --- a/src/INTERP_KERNEL/ConvexIntersector.cxx +++ b/src/INTERP_KERNEL/ConvexIntersector.cxx @@ -7,6 +7,9 @@ using namespace MED_EN; using namespace MEDMEM; +using INTERP_UTILS::distance2; +using INTERP_UTILS::norm; + namespace MEDMEM { template @@ -89,7 +92,7 @@ namespace MEDMEM /*** Compute the intersection area ***/ INTERP_UTILS::PolygonAlgorithms P( _Epsilon, _Precision); - deque inter = P.PolygonAlgorithms::intersect_convex_polygons(&Coords_A[0], &Coords_B[0], + deque inter = P.intersect_convex_polygons(&Coords_A[0], &Coords_B[0], nb_dist_NodesA, nb_dist_NodesB); double area[DIM]; int nb_inter =((int)inter.size())/DIM; diff --git a/src/INTERP_KERNEL/GenericIntersector.cxx b/src/INTERP_KERNEL/GenericIntersector.cxx index 9b98caaf8..d880e26f4 100644 --- a/src/INTERP_KERNEL/GenericIntersector.cxx +++ b/src/INTERP_KERNEL/GenericIntersector.cxx @@ -7,6 +7,8 @@ using namespace MED_EN; using namespace MEDMEM; +using INTERP_UTILS::norm; + namespace MEDMEM { template @@ -108,7 +110,7 @@ namespace MEDMEM } deque inter = - P.PolygonAlgorithms::intersect_convex_polygons(&Coords_subP_A[0], &Coords_subP_B[0], + P.intersect_convex_polygons(&Coords_subP_A[0], &Coords_subP_B[0], nb_nodes_A, nb_nodes_B); double area[DIM]; int nb_inter =((int)inter.size())/DIM; diff --git a/src/INTERP_KERNEL/PolygonAlgorithms.hxx b/src/INTERP_KERNEL/PolygonAlgorithms.hxx index f956cf098..018c5d5de 100644 --- a/src/INTERP_KERNEL/PolygonAlgorithms.hxx +++ b/src/INTERP_KERNEL/PolygonAlgorithms.hxx @@ -1,6 +1,7 @@ #ifndef _PolygonAlgorithms_HXX_ #define _PolygonAlgorithms_HXX_ +#include #include #include @@ -26,18 +27,18 @@ namespace INTERP_UTILS { public: PolygonAlgorithms(double epsilon, double precision); - deque intersect_convex_polygons(const double* P_1,const double* P_2, int N1, int N2); + std::deque intersect_convex_polygons(const double* P_1,const double* P_2, int N1, int N2); //Not yet tested - int convex_decomposition(const double * P, int N, vector< map< int,int > >& components, - vector< int >& components_index, const double epsilon); + int convex_decomposition(const double * P, int N, std::vector< std::map< int,int > >& components, + std::vector< int >& components_index, const double epsilon); private: - deque< double > _Inter;/* vertices of the intersection P1^P2 */ - vector< pair< int,int > > _End_segments; /* segments containing inter final edges */ + std::deque< double > _Inter;/* vertices of the intersection P1^P2 */ + std::vector< std::pair< int,int > > _End_segments; /* segments containing inter final edges */ /* status list of segments (ending point, starting point) intersected by the sweeping line */ /* and a boolean true if the ending point is in the intersection */ - multimap< int, pair< int,bool> > _Status; + std::multimap< int, std::pair< int,bool> > _Status; bool _Is_in_intersection; bool _Terminus; double _Vdouble[DIM]; @@ -57,18 +58,18 @@ namespace INTERP_UTILS const double * G); void add_crossing0(const double * A, const double * B, int i, int i_next, const double * C, const double * D, int j, int j_next); - void add_crossing( double * ABCD, pair< int,int > i_i_next, pair< int,int > j_j_next); + void add_crossing( double * ABCD, std::pair< int,int > i_i_next, std::pair< int,int > j_j_next); void add_new_vertex( int i, int i_glob, int i_next_glob, int i_prev_glob, const double * P); bool intersect_segment_segment(const double * A, const double * B, const double * C, const double * D, const double * E, double * V); //Not yet tested - void convex_decomposition(const double* P, int N, double* n, vector< int > subP, int NsubP, - vector< map< int,int > >& components, vector< int >& components_index, + void convex_decomposition(const double* P, int N, double* n, std::vector< int > subP, int NsubP, + std::vector< std::map< int,int > >& components, std::vector< int >& components_index, int& Ncomp, int sign, const double epsilon); - void conv_hull(const double *P, int N, double * n, map< int,int >& subP, - map< int,int >& not_in_hull, int& NsubP, const double epsilon); + void conv_hull(const double *P, int N, double * n, std::map< int,int >& subP, + std::map< int,int >& not_in_hull, int& NsubP, const double epsilon); }; }; diff --git a/src/INTERP_KERNEL/TransformedTriangle.hxx b/src/INTERP_KERNEL/TransformedTriangle.hxx index 178184d19..3a83960bb 100644 --- a/src/INTERP_KERNEL/TransformedTriangle.hxx +++ b/src/INTERP_KERNEL/TransformedTriangle.hxx @@ -327,7 +327,7 @@ namespace INTERP_UTILS // indices to use in tables DP_FOR_SEG_FACET_INTERSECTION and SIGN_FOR_SEG_FACET_INTERSECTION // for the calculation of the coordinates (x,y,z) of the intersection points // for Segment-Facet and Segment-Edge intersections - static const int TransformedTriangle::DP_INDEX[12]; + static const int DP_INDEX[12]; // correspondance edge - corners static const TetraCorner CORNERS_FOR_EDGE[12]; -- 2.39.2