Salome HOME
3819122cdd5a5f910532dea11aebec58f511a97d
[modules/med.git] / src / MEDMEM / PointLocator.hxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _POINT_LOCATOR_HXX_
21 #define _POINT_LOCATOR_HXX_
22
23 #include "MEDMEM.hxx"
24
25 #include <list>
26 #include <vector>
27
28 namespace INTERP_KERNEL
29 {
30   class GenericMesh;
31   class GenericPointLocatorAlgos;
32 }
33
34 namespace MEDMEM
35 {
36   class MESH;
37
38   class MEDMEM_EXPORT PointLocator
39   {
40   public:
41     PointLocator(const MEDMEM::MESH& mesh);
42     virtual ~PointLocator();
43     std::list<int> locate(const double* x);
44   protected:
45     PointLocator() {}
46     INTERP_KERNEL::GenericMesh *_medmesh;
47     INTERP_KERNEL::GenericPointLocatorAlgos* _point_locator;
48   };
49
50   class MEDMEM_EXPORT PointLocatorInSimplex : public PointLocator
51   {
52   public:
53     PointLocatorInSimplex(const MEDMEM::MESH& mesh);
54
55     static void getNodeWightsInSimplex( const std::vector<const double*>& nodes,
56                                         const double* p, double* weghts );
57   };
58 }
59
60 #endif