From 3044dd2f4986d4e2c0ccffe695206ebc730a7abf Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 14 Jan 2014 10:15:28 +0000 Subject: [PATCH] Little optimization in InOut detection. --- .../Geometric2D/InterpKernelGeo2DComposedEdge.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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); -- 2.39.2