Salome HOME
updated copyright message
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Attractor.hxx
index 2caf2b33fdfe1abceb4355af41b52e3113476338..ae5f415edeb5f5558753698656efde05a4f97814 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <NCollection_Map.hxx>
 
 #include <Geom_Surface.hxx>
-#include <Handle_Geom_Surface.hxx>
 #include <Geom2d_Curve.hxx>
-#include <Handle_Geom2d_Curve.hxx>
 #include <Geom_Curve.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_AIS_InteractiveObject.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Wire.hxx>
@@ -69,7 +65,7 @@
 #include <GProp_GProps.hxx>
 #include <BRepGProp.hxx>
 
-#ifndef WNT
+#ifndef WIN32
 #include <fenv.h>
 #endif
 
@@ -92,6 +88,7 @@ class BLSURFPlugin_Attractor {
     
     bool init();                                                // Calculates the discrete points correponding to attractor 
                                                                 // and intialises the map of distances
+    void avoidOutOfBounds(int& i, int&j);
     void edgeInit(Handle(Geom_Surface) aSurf, const TopoDS_Edge& anEdge);
     
     double              GetSize (double u, double v);
@@ -138,8 +135,14 @@ class BLSURFPlugin_Attractor {
     
     bool              _isMapBuilt;
     bool              _isEmpty;
+
+  // data of a specific case: a point attractor on a plane
+  Handle(Geom_Surface) _plane;
+  gp_Pnt               _attractorPnt;
     
-    double            _distance(double u, double v);            // Retrieve the value of the distance map at point (u,v) of the parametric space of _face
+  double            (BLSURFPlugin_Attractor::*_distance)(double u, double v);            // Retrieve the value of the distance map at point (u,v) of the parametric space of _face
+  double            _distanceFromMap(double u, double v);
+  double            _distanceFromPoint(double u, double v);
 };    
 
 #endif