1 // Copyright (C) 2007-2023 CEA/DEN, EDF R&D
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, or (at your option) any later version.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __PLANARINTERSECTOR_HXX__
22 #define __PLANARINTERSECTOR_HXX__
24 #include "TargetIntersector.txx"
25 #include "NormalizedUnstructuredMesh.hxx"
30 namespace INTERP_KERNEL
32 class TranslationRotationMatrix;
34 template<class MyMeshType, class MyMatrix>
35 class PlanarIntersector : public TargetIntersector<MyMeshType,MyMatrix>
38 static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
39 static const int MESHDIM=MyMeshType::MY_MESHDIM;
40 typedef typename MyMeshType::MyConnType ConnType;
41 static const NumberingPolicy numPol=MyMeshType::My_numPol;
42 typedef typename std::map<ConnType,std::set<ConnType> > DuplicateFacesType;
44 PlanarIntersector(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double minDot3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
45 virtual ~PlanarIntersector();
46 void createBoundingBoxes(const MyMeshType& mesh, std::vector<double>& bbox);
47 inline void getElemBB(double* bb, const MyMeshType& mesh, ConnType iP, ConnType nb_nodes);
48 static int Projection(double *Coords_A, double *Coords_B,
49 ConnType nb_NodesA, ConnType nb_NodesB, double epsilon, double md3DSurf, double minDot3DSurf, double median_plane, bool do_rotate);
50 virtual const DuplicateFacesType* getIntersectFaces() const
55 int projectionThis(double *Coords_A, double *Coords_B, ConnType nb_NodesA, ConnType nb_NodesB);
56 void getRealTargetCoordinates(ConnType icellT, std::vector<double>& coordsT);
57 void getRealSourceCoordinates(ConnType icellS, std::vector<double>& coordsS);
58 void getRealTargetCoordinatesPermute(ConnType icellT, ConnType offset, std::vector<double>& coordsT);
59 void getRealSourceCoordinatesPermute(ConnType icellS, ConnType offset, std::vector<double>& coordsS);
60 void getRealCoordinates(ConnType icellT, ConnType icellS, ConnType nbNodesT, ConnType nbNodesS, std::vector<double>& coordsT, std::vector<double>& coordsS, int& orientation);
61 double getValueRegardingOption(double val) const;
62 static void Rotate3DTriangle( double* PP1, double*PP2, double*PP3,
63 TranslationRotationMatrix& rotation_matrix);
65 const ConnType *_connectT;
66 const ConnType *_connectS;
67 const double *_coordsT;
68 const double *_coordsS;
69 const ConnType *_connIndexT;
70 const ConnType *_connIndexS;
71 const MyMeshType& _meshT;
72 const MyMeshType& _meshS;
73 double _dim_caracteristic;
74 double _max_distance_3Dsurf_intersect;
75 double _min_dot_btw_3Dsurf_intersect;