Salome HOME
Improve swig generation process on Windows platform.
[tools/medcoupling.git] / src / INTERP_KERNEL / Geometric2D / InterpKernelGeo2DNode.hxx
index 2adb5c04b5baba3b522bb4e57f275381dea8b7b0..b1fa82d0799ecb0d046ee792c665af44e18a5587 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
 namespace INTERP_KERNEL
 {
   typedef enum
-    {
-      IN_1      =  7,
-      ON_1      =  8,
-      ON_LIM_1  = 12,
-      ON_TANG_1 =  9,
-      OUT_1     = 10,
-      UNKNOWN   = 11
-    } TypeOfLocInPolygon;
+  {
+    IN_1      =  7,
+    ON_1      =  8,
+    ON_LIM_1  = 12,
+    ON_TANG_1 =  9,
+    OUT_1     = 10,
+    UNKNOWN   = 11
+  } TypeOfLocInPolygon;
 
   class Bounds;
-  
+
   /*!
    * Representation of a 2D point, and potentially its location relative to a polygon.
    * As nodes can be shared between edges it is handled with ref counting.
@@ -55,6 +55,12 @@ namespace INTERP_KERNEL
     Node(std::istream& stream);
     void incrRef() const { _cnt++; }
     bool decrRef();
+    void initHitStatus() const { _hit=0; }
+    char getHitStatus() const { return _hit; }
+    void hitMeAlone(double xBary, double yBary, double dimChar) { if(_hit==0) { _hit=1; applySimilarity(xBary,yBary,dimChar); } }
+    void unHitMeAlone(double xBary, double yBary, double dimChar) { if(_hit==0) { _hit=1; unApplySimilarity(xBary,yBary,dimChar); } }
+    void hitMeAfter(double xBary, double yBary, double dimChar) { if(_hit==0) { hitMeAlone(xBary,yBary,dimChar); _hit=2; } else if(_hit==1) declareOn(); }
+    void unHitMeAfter(double xBary, double yBary, double dimChar) { if(_hit==0) { unHitMeAlone(xBary,yBary,dimChar); _hit=2; } }
     void initLocs() const { _loc=UNKNOWN; }
     void setLoc(TypeOfLocInPolygon loc) const { _loc=loc; }
     TypeOfLocInPolygon getLoc() const { return _loc; }
@@ -95,6 +101,7 @@ namespace INTERP_KERNEL
   protected:
     ~Node();
   protected:
+    mutable char _hit;
     mutable unsigned char _cnt;
     mutable TypeOfLocInPolygon _loc;
     double _coords[2];