From: ageay Date: Thu, 15 Apr 2010 07:54:15 +0000 (+0000) Subject: Correct no respects of code rules. X-Git-Tag: V5_1_main_FINAL~130 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1eafc01158afec2aaa0b97a12424ff35b2f41716;p=tools%2Fmedcoupling.git Correct no respects of code rules. --- diff --git a/src/INTERP_KERNEL/CurveIntersector.txx b/src/INTERP_KERNEL/CurveIntersector.txx index 469c4ab8d..a27bed48d 100644 --- a/src/INTERP_KERNEL/CurveIntersector.txx +++ b/src/INTERP_KERNEL/CurveIntersector.txx @@ -20,6 +20,7 @@ #define __CURVEINTERSECTOR_TXX__ #include "CurveIntersector.hxx" +#include "InterpolationUtils.hxx" #include diff --git a/src/INTERP_KERNEL/InterpolationCurve.hxx b/src/INTERP_KERNEL/InterpolationCurve.hxx index fe3706e93..144149f51 100644 --- a/src/INTERP_KERNEL/InterpolationCurve.hxx +++ b/src/INTERP_KERNEL/InterpolationCurve.hxx @@ -33,8 +33,8 @@ namespace INTERP_KERNEL // Main function to interpolate template - int interpolateMeshes(const MyMeshType& mesh1, const MyMeshType& mesh2, - MatrixType& result, const char *method); + int interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, + MatrixType& result, const char *method); }; } diff --git a/src/INTERP_KERNEL/InterpolationCurve.txx b/src/INTERP_KERNEL/InterpolationCurve.txx index d7181ce61..4309fb1ed 100644 --- a/src/INTERP_KERNEL/InterpolationCurve.txx +++ b/src/INTERP_KERNEL/InterpolationCurve.txx @@ -88,38 +88,42 @@ namespace INTERP_KERNEL CurveIntersector* intersector=0; std::string meth(method); - if(meth=="P0P0") { - intersector = new CurveIntersectorP0P0 - (myMeshT, myMeshS, - InterpolationOptions::getPrecision(), - InterpolationOptions::getBoundingBoxAdjustmentAbs(), - InterpolationOptions::getMedianPlane(), - InterpolationOptions::getPrintLevel()); - } - else if(meth=="P0P1") { - intersector = new CurveIntersectorP0P1 - (myMeshT, myMeshS, - InterpolationOptions::getPrecision(), - InterpolationOptions::getBoundingBoxAdjustmentAbs(), - InterpolationOptions::getMedianPlane(), - InterpolationOptions::getPrintLevel()); - } - else if(meth=="P1P0") { - intersector = new CurveIntersectorP1P0 - (myMeshT, myMeshS, - InterpolationOptions::getPrecision(), - InterpolationOptions::getBoundingBoxAdjustmentAbs(), - InterpolationOptions::getMedianPlane(), - InterpolationOptions::getPrintLevel()); - } - else if(meth=="P1P1") { - intersector = new CurveIntersectorP1P1 - (myMeshT, myMeshS, - InterpolationOptions::getPrecision(), - InterpolationOptions::getBoundingBoxAdjustmentAbs(), - InterpolationOptions::getMedianPlane(), - InterpolationOptions::getPrintLevel()); - } + if(meth=="P0P0") + { + intersector = new CurveIntersectorP0P0 + (myMeshT, myMeshS, + InterpolationOptions::getPrecision(), + InterpolationOptions::getBoundingBoxAdjustmentAbs(), + InterpolationOptions::getMedianPlane(), + InterpolationOptions::getPrintLevel()); + } + else if(meth=="P0P1") + { + intersector = new CurveIntersectorP0P1 + (myMeshT, myMeshS, + InterpolationOptions::getPrecision(), + InterpolationOptions::getBoundingBoxAdjustmentAbs(), + InterpolationOptions::getMedianPlane(), + InterpolationOptions::getPrintLevel()); + } + else if(meth=="P1P0") + { + intersector = new CurveIntersectorP1P0 + (myMeshT, myMeshS, + InterpolationOptions::getPrecision(), + InterpolationOptions::getBoundingBoxAdjustmentAbs(), + InterpolationOptions::getMedianPlane(), + InterpolationOptions::getPrintLevel()); + } + else if(meth=="P1P1") + { + intersector = new CurveIntersectorP1P1 + (myMeshT, myMeshS, + InterpolationOptions::getPrecision(), + InterpolationOptions::getBoundingBoxAdjustmentAbs(), + InterpolationOptions::getMedianPlane(), + InterpolationOptions::getPrintLevel()); + } else throw INTERP_KERNEL::Exception("Invalid method specified ! Must be in : \"P0P0\" \"P0P1\" \"P1P0\" or \"P1P1\""); /****************************************************************/ @@ -144,26 +148,27 @@ namespace INTERP_KERNEL long start_intersection = clock(); const ConnType *connIndxT = myMeshT.getConnectivityIndexPtr(); for(int iT=0; iT intersecting_elems; - double bb[2*SPACEDIM]; - intersector->getElemBB(bb,myMeshT,OTT::indFC(iT),nb_nodesT); - my_tree.getIntersectingElems(bb, intersecting_elems); - intersector->intersectCells(iT,intersecting_elems,result); - counter += intersecting_elems.size(); - } + { + int nb_nodesT = connIndxT[iT+1] - connIndxT[iT]; + std::vector intersecting_elems; + double bb[2*SPACEDIM]; + intersector->getElemBB(bb,myMeshT,OTT::indFC(iT),nb_nodesT); + my_tree.getIntersectingElems(bb, intersecting_elems); + intersector->intersectCells(iT,intersecting_elems,result); + counter += intersecting_elems.size(); + } int ret = intersector->getNumberOfColsOfResMatrix(); delete intersector; - - if (InterpolationOptions::getPrintLevel() >= 1) { - long end_intersection=clock(); - std::cout << "Filtering time= " << end_filtering-start_filtering << std::endl; - std::cout << "Intersection time= " << end_intersection-start_intersection << std::endl; - long global_end =clock(); - std::cout << "Number of computed intersections = " << counter << std::endl; - std::cout << "Global time= " << global_end - global_start << std::endl; - } + + if (InterpolationOptions::getPrintLevel() >= 1) + { + long end_intersection=clock(); + std::cout << "Filtering time= " << end_filtering-start_filtering << std::endl; + std::cout << "Intersection time= " << end_intersection-start_intersection << std::endl; + long global_end =clock(); + std::cout << "Number of computed intersections = " << counter << std::endl; + std::cout << "Global time= " << global_end - global_start << std::endl; + } return ret; } }