From: ageay Date: Tue, 14 Jan 2014 10:15:28 +0000 (+0000) Subject: Little optimization in InOut detection. X-Git-Tag: V7_3_1b1^2~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=03a710fce77c5b99221a8968bc6b750a83b30db4;p=modules%2Fmed.git Little optimization in InOut detection. --- diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx index ba6ce3141..0f033d88a 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx @@ -441,13 +441,19 @@ void ComposedEdge::getBarycenter(double *bary, double& weigh) const } /*! + * This method makes the hypothesis that \a nodeToTest can be either IN or OUT. + * * \sa ComposedEdge::isInOrOut2 */ bool ComposedEdge::isInOrOut(Node *nodeToTest) const { + Bounds b; b.prepareForAggregation(); + fillBounds(b); + if(b.nearlyWhere((*nodeToTest)[0],(*nodeToTest)[1])==OUT) + return false; std::set< IntersectElement > inOutSwitch; double ref(isInOrOutAlg(nodeToTest,inOutSwitch)); - bool ret=false; + bool ret(false); for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++) { if((*iter4).getVal1() inOutSwitch; double ref(isInOrOutAlg(nodeToTest,inOutSwitch)); - bool ret=false; + bool ret(false); for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++) { double val((*iter4).getVal1()); @@ -494,10 +499,6 @@ bool ComposedEdge::isInOrOut2(Node *nodeToTest) const double ComposedEdge::isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement >& inOutSwitch) const { - Bounds b; b.prepareForAggregation(); - fillBounds(b); - //if(b.nearlyWhere((*nodeToTest)[0],(*nodeToTest)[1])==OUT) - // return false; // searching for e1 std::set nodes; getAllNodes(nodes);