return iEnd;
}
-void QuadraticPolygon::ComputeResidual(const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, int idThis,
- std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1)
+void QuadraticPolygon::ComputeResidual(const QuadraticPolygon& pol1, const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, const std::map<INTERP_KERNEL::Node *,int>& mapp, int offset, int idThis,
+ std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1, std::vector<int>& nb2)
{
for(std::set<Edge *>::const_iterator it=edgesInPol2OnBoundary.begin();it!=edgesInPol2OnBoundary.end();it++)
{ (*it)->initLocs(); (*it)->declareIn(); }
if((*it)->getEndNode()->getLoc()==ON_1)
{ curN=(*it)->getStartNode(); edgesInPol2OnBoundaryL.erase(it); tmp1->pushBack(new ElementaryEdge(*it,false)); break; }
}
+ if(!curN)
+ throw INTERP_KERNEL::Exception("Presence of a target polygon fully included in source polygon ! The partition of this leads to a non simply connex cell (with hole) ! Impossible ! Such resulting cell cannot be stored in MED cell format !");
//
while(curN->getLoc()!=ON_1 && !edgesInPol2OnBoundaryL.empty())
{
}
pol2Zip.push_back(tmp1);
}
- //pol2.zipConsecutiveInSegments();
- //std::vector<QuadraticPolygon *> ret;
- //if(!pol2Zip.empty())
- // closePolygons(pol2Zip,pol1,ret);
+ for(std::list<ElementaryEdge *>::const_iterator it=pol1._sub_edges.begin();it!=pol1._sub_edges.end();it++)
+ { (*it)->getPtr()->initLocs(); (*it)->declareOut(); }
+ for(std::set<Edge *>::const_iterator it=notUsedInPol1.begin();it!=notUsedInPol1.end();it++)
+ { (*it)->initLocs(); (*it)->declareIn(); }
+ for(std::set<Edge *>::const_iterator it=edgesInPol2OnBoundary.begin();it!=edgesInPol2OnBoundary.end();it++)
+ { (*it)->initLocs(); (*it)->declareOn(); }
+ std::vector<QuadraticPolygon *> ret;
+ if(pol2Zip.empty())
+ return;
+ QuadraticPolygon *firstPol2=*(pol2Zip.begin());
+ firstPol2->closePolygons(pol2Zip,pol1,ret);
+ //
+ for(std::vector<QuadraticPolygon *>::iterator it=ret.begin();it!=ret.end();it++)
+ {
+ (*it)->appendCrudeData(mapp,0.,0.,1.,offset,addCoordsQuadratic,conn,connI);
+ nb1.push_back(idThis);
+ nb2.push_back(-1);
+ delete *it;
+ }
}
static void SplitPolygonsEachOther(QuadraticPolygon& pol1, QuadraticPolygon& pol2, int& nbOfSplits);
std::vector<QuadraticPolygon *> buildIntersectionPolygons(const QuadraticPolygon& pol1, const QuadraticPolygon& pol2) const;
bool amIAChanceToBeCompletedBy(const QuadraticPolygon& pol1Splitted, const QuadraticPolygon& pol2NotSplitted, bool& direction);
- static void ComputeResidual(const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, int idThis,
- std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1);
+ static void ComputeResidual(const QuadraticPolygon& pol1, const std::set<Edge *>& notUsedInPol1, const std::set<Edge *>& edgesInPol2OnBoundary, const std::map<INTERP_KERNEL::Node *,int>& mapp, int offset, int idThis,
+ std::vector<double>& addCoordsQuadratic, std::vector<int>& conn, std::vector<int>& connI, std::vector<int>& nb1, std::vector<int>& nb2);
protected:
std::list<QuadraticPolygon *> zipConsecutiveInSegments() const;
void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;