Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / INTERP_KERNEL / TargetIntersector.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
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 #ifndef __TARGETINTERSECTOR__HXX__
20 #define __TARGETINTERSECTOR__HXX__
21
22 #include "INTERPKERNELDefines.hxx"
23
24 #include <vector>
25
26 namespace INTERP_KERNEL
27 {
28   /**
29    * \brief Abstract base class of Intersector classes. 
30    * These classes represent a target element and calculate its intersection
31    * with the source elements.
32    */
33   template<class MyMeshType, class MyMatrix>
34   class TargetIntersector
35   {
36   public:
37     typedef typename MyMeshType::MyConnType ConnType;
38   public:
39     /*!
40      * \addtogroup InterpKerGrpIntPlan
41      * @{
42      */
43     /*!
44      * Tool for cell intersection, result is always positive.
45      * @param icellT id of cell in target mesh in \b C \b mode.
46      * @param icellsS ids of cells in source mesh in \b C \b mode.
47      * @param res is an IN/OUT parameter that represents the icellTth row in final matrix, fed with at most icellsS elements. 
48      */
49     virtual void intersectCells(ConnType targetCell, const std::vector<ConnType>& srcCells, MyMatrix& res) = 0;
50     //! @}
51     //Tool for cell filtering
52     virtual int getNumberOfRowsOfResMatrix() const = 0;
53     virtual int getNumberOfColsOfResMatrix() const = 0;
54     virtual ~TargetIntersector() { }
55   };
56 }
57
58 #endif