Salome HOME
Improve swig generation process on Windows platform.
[tools/medcoupling.git] / src / INTERP_KERNEL / Geometric2D / InterpKernelGeo2DEdge.cxx
index 4791618242d783ad6759f87f84a92762b83321a1..574c6ff85568d5eef4785bae192689c1b54d7e3f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  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
@@ -163,6 +163,40 @@ unsigned MergePoints::getNumberOfAssociations() const
   return ret;
 }
 
+void MergePoints::PushInMap(int key, int value, std::map<int,int>& mergedNodes)
+{
+  if(key!=-1 && value!=-1)
+    mergedNodes[key]=value;
+}
+
+void MergePoints::updateMergedNodes(int e1Start, int e1End, int e2Start, int e2End, std::map<int,int>& mergedNodes)
+{
+  unsigned subTot(_ass1Start1+_ass1End1+_ass1Start2+_ass1End2);
+  if(subTot!=0)
+    {
+      if(_ass1Start1 && _ass1Start2)
+        PushInMap(e2Start,e1Start,mergedNodes);
+      if(_ass1Start1 && _ass1End2)
+        PushInMap(e2End,e1Start,mergedNodes);
+      if(_ass1End1 && _ass1Start2)
+        PushInMap(e2Start,e1End,mergedNodes);
+      if(_ass1End1 && _ass1End2)
+        PushInMap(e2End,e1End,mergedNodes);
+    }
+  subTot=_ass2Start1+_ass2End1+_ass2Start2+_ass2End2;
+  if(subTot!=0)
+    {
+      if(_ass2Start1 && _ass2Start2)
+        PushInMap(e2Start,e1Start,mergedNodes);
+      if(_ass2Start1 && _ass2End2)
+        PushInMap(e2End,e1Start,mergedNodes);
+      if(_ass2End1 && _ass2Start2)
+        PushInMap(e2Start,e1End,mergedNodes);
+      if(_ass2End1 && _ass2End2)
+        PushInMap(e2End,e1End,mergedNodes);
+    }
+}
+
 IntersectElement::IntersectElement(double val1, double val2, bool start1, bool end1, bool start2, bool end2, Node *node
                                    , const Edge& e1, const Edge& e2, bool keepOrder):_1S(keepOrder?start1:start2),
                                        _1E(keepOrder?end1:end2),
@@ -692,6 +726,11 @@ void Edge::unApplySimilarity(double xBary, double yBary, double dimChar)
   _bounds.unApplySimilarity(xBary,yBary,dimChar);
 }
 
+void Edge::getMiddleOfPointsOriented(const double *p1, const double *p2, double *mid) const
+{
+  return getMiddleOfPoints(p1, p2, mid);
+}
+
 bool Edge::Intersect(const Edge *f1, const Edge *f2, EdgeIntersector *intersector, const Bounds *whereToFind, MergePoints& commonNode,
                      ComposedEdge& outValForF1, ComposedEdge& outValForF2)
 {