Back to index

salome-med  6.5.0
PlanarIntersector.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __PLANARINTERSECTOR_HXX__
00021 #define __PLANARINTERSECTOR_HXX__
00022 
00023 #include "TargetIntersector.hxx"
00024 #include "NormalizedUnstructuredMesh.hxx"
00025 
00026 #include <map>
00027 #include <set>
00028 
00029 namespace INTERP_KERNEL
00030 {
00031   class TranslationRotationMatrix;
00032   
00033   template<class MyMeshType, class MyMatrix>
00034   class PlanarIntersector : public TargetIntersector<MyMeshType,MyMatrix>
00035   {
00036   public:
00037     static const int SPACEDIM=MyMeshType::MY_SPACEDIM;
00038     static const int MESHDIM=MyMeshType::MY_MESHDIM;
00039     typedef typename MyMeshType::MyConnType ConnType;
00040     static const NumberingPolicy numPol=MyMeshType::My_numPol;
00041     typedef typename std::map<int,std::set<int> > DuplicateFacesType;
00042   public:
00044     PlanarIntersector(const MyMeshType& meshT, const MyMeshType& meshS, double dimCaracteristic, double precision, double md3DSurf, double medianPlane, bool doRotate, int orientation, int printLevel);
00046     virtual ~PlanarIntersector();
00047     void createBoundingBoxes(const MyMeshType& mesh, std::vector<double>& bbox);
00048     void adjustBoundingBoxes(std::vector<double>& bbox, double surf3DAdjustmentEps, double surf3DAdjustmentEpsAbs);
00049     inline void getElemBB(double* bb, const MyMeshType& mesh, ConnType iP, ConnType nb_nodes);
00050     static int projection(double *Coords_A, double *Coords_B,
00051                           int nb_NodesA, int nb_NodesB, double epsilon, double md3DSurf, double median_plane, bool do_rotate);
00052     virtual const DuplicateFacesType* getIntersectFaces() const
00053     {
00054       return NULL;
00055     }
00056   protected :
00057     int projectionThis(double *Coords_A, double *Coords_B, int nb_NodesA, int nb_NodesB);
00058     void getRealTargetCoordinates(ConnType icellT, std::vector<double>& coordsT);
00059     void getRealSourceCoordinates(ConnType icellS, std::vector<double>& coordsS);
00060     void getRealTargetCoordinatesPermute(ConnType icellT, int offset, std::vector<double>& coordsT);
00061     void getRealSourceCoordinatesPermute(ConnType icellS, int offset, std::vector<double>& coordsS);
00062     void getRealCoordinates(ConnType icellT, ConnType icellS, ConnType nbNodesT, ConnType nbNodesS, std::vector<double>& coordsT, std::vector<double>& coordsS, int& orientation);
00063     double getValueRegardingOption(double val) const;
00064     static void rotate3DTriangle( double* PP1, double*PP2, double*PP3,
00065                                   TranslationRotationMatrix& rotation_matrix);
00066   protected:
00067     const ConnType *_connectT;
00068     const ConnType *_connectS;
00069     const double *_coordsT;
00070     const double *_coordsS;
00071     const ConnType *_connIndexT;
00072     const ConnType *_connIndexS;
00073     const MyMeshType& _meshT;
00074     const MyMeshType& _meshS;
00075     double _dim_caracteristic;
00076     double _max_distance_3Dsurf_intersect;
00077     double _precision;
00078     double _median_plane;
00079     bool _do_rotate;
00080     int _orientation;
00081     int _print_level;
00082   };
00083 }
00084 
00085 #endif