Salome HOME
Unwarningization under Win.
[tools/medcoupling.git] / src / INTERP_KERNEL / Geometric2D / InterpKernelGeo2DComposedEdge.cxx
index c57210de9e049d6b22169eaa9c78f5d4d0c7cb98..8242278d73c26d08fb7af4f64560527235e48d8e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
 
 #include "InterpKernelGeo2DComposedEdge.hxx"
 #include "InterpKernelGeo2DElementaryEdge.hxx"
@@ -135,6 +136,21 @@ void ComposedEdge::initLocations() const
     (*iter)->initLocations();
 }
 
+void ComposedEdge::initLocationsWithOther(const ComposedEdge& other) const
+{
+  std::set<Edge *> s1,s2;
+  for(std::list<ElementaryEdge *>::const_iterator it1=_sub_edges.begin();it1!=_sub_edges.end();it1++)
+    s1.insert((*it1)->getPtr());
+  for(std::list<ElementaryEdge *>::const_iterator it2=other._sub_edges.begin();it2!=other._sub_edges.end();it2++)
+    s2.insert((*it2)->getPtr());
+  initLocations();
+  other.initLocations();
+  std::vector<Edge *> s3;
+  std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),std::back_insert_iterator< std::vector<Edge *> >(s3));
+  for(std::vector<Edge *>::const_iterator it3=s3.begin();it3!=s3.end();it3++)
+    (*it3)->declareOn();
+}
+
 ComposedEdge *ComposedEdge::clone() const
 {
   return new ComposedEdge(*this);
@@ -255,6 +271,8 @@ void ComposedEdge::unApplyGlobalSimilarityExt(ComposedEdge& other, double xBary,
     (*iter)->unApplySimilarity(xBary,yBary,fact);
   for(std::list<ElementaryEdge *>::iterator iter=_sub_edges.begin();iter!=_sub_edges.end();iter++)
     (*iter)->unApplySimilarity(xBary,yBary,fact);
+  for(std::list<ElementaryEdge *>::iterator iter=other._sub_edges.begin();iter!=other._sub_edges.end();iter++)
+    (*iter)->unApplySimilarity(xBary,yBary,fact);
 }
 
 double ComposedEdge::normalizeExt(ComposedEdge *other, double& xBary, double& yBary)