From: Anthony Geay Date: Wed, 1 Feb 2017 16:11:06 +0000 (+0100) Subject: Ze solution ? X-Git-Tag: V8_3_0a2~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=14c381302ff07d5d10f5b6063c25acedf4bc3eec;p=tools%2Fmedcoupling.git Ze solution ? --- diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx index 1212c73ce..226ff2ccb 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx @@ -512,7 +512,9 @@ bool ComposedEdge::isInOrOut(Node *nodeToTest) const if(b.nearlyWhere((*nodeToTest)[0],(*nodeToTest)[1])==OUT) return false; std::set< IntersectElement > inOutSwitch; - double ref(isInOrOutAlg(nodeToTest,inOutSwitch)); + std::set nodes; + getAllNodes(nodes); + double ref(isInOrOutAlg(nodeToTest,nodes,inOutSwitch)); bool ret(false); for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++) { @@ -536,7 +538,12 @@ bool ComposedEdge::isInOrOut(Node *nodeToTest) const bool ComposedEdge::isInOrOut2(Node *nodeToTest) const { std::set< IntersectElement > inOutSwitch; - double ref(isInOrOutAlg(nodeToTest,inOutSwitch)); + std::set nodes; + getAllNodes(nodes); + for(std::set::const_iterator iter=nodes.begin();iter!=nodes.end();iter++) + if(sqrt((*iter)->distanceWithSq(*nodeToTest))::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++) { @@ -557,11 +564,9 @@ bool ComposedEdge::isInOrOut2(Node *nodeToTest) const return ret; } -double ComposedEdge::isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement >& inOutSwitch) const +double ComposedEdge::isInOrOutAlg(Node *nodeToTest, const std::set& nodes, std::set< IntersectElement >& inOutSwitch) const { // searching for e1 - std::set nodes; - getAllNodes(nodes); std::set radialDistributionOfNodes; std::set::const_iterator iter; for(iter=nodes.begin();iter!=nodes.end();iter++) @@ -607,52 +612,6 @@ double ComposedEdge::isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement > return ref; } -/*bool ComposedEdge::isInOrOut(Node *aNodeOn, Node *nodeToTest) const -{ - - EdgeInfLin *e1=new EdgeInfLin(aNodeOn,nodeToTest); - double ref=e1->getCharactValue(*nodeToTest); - set< IntersectElement > inOutSwitch; - for(vector::const_iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++) - { - ElementaryEdge *val=dynamic_cast(*iter); - if(val) - { - Edge *e=val->getPtr(); - auto_ptr intersc(Edge::buildIntersectorWith(e1,e)); - bool obviousNoIntersection,areOverlapped; - intersc->areOverlappedOrOnlyColinears(0,obviousNoIntersection,areOverlapped); - if(obviousNoIntersection) - { - continue; - } - if(!areOverlapped) - { - list< IntersectElement > listOfIntesc=intersc->getIntersectionsCharacteristicVal(); - for(list< IntersectElement >::iterator iter2=listOfIntesc.begin();iter2!=listOfIntesc.end();iter2++) - if((*iter2).isIncludedByBoth()) - inOutSwitch.insert(*iter2); - } - //if overlapped we can forget - } - else - throw Exception("Invalid use of ComposedEdge::isInOrOut : only one level supported !"); - } - e1->decrRef(); - bool ret=false; - for(set< IntersectElement >::iterator iter=inOutSwitch.begin();iter!=inOutSwitch.end();iter++) - { - if((*iter).getVal1()getLoc()==ON_1) - ret=!ret; - } - else - break; - } - return ret; -}*/ - bool ComposedEdge::getDirection() const { throw Exception("ComposedEdge::getDirection : no sense"); diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.hxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.hxx index 6d43873af..a475986e1 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.hxx @@ -111,7 +111,7 @@ namespace INTERP_KERNEL INTERPKERNEL_EXPORT bool intresincEqCoarse(const Edge *other) const; private: std::list* getListBehind() { return &_sub_edges; } - double isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement >& inOutSwitch) const; + double isInOrOutAlg(Node *nodeToTest, const std::set& nodes, std::set< IntersectElement >& inOutSwitch) const; protected: ~ComposedEdge(); private: