Back to index

salome-med  6.5.0
MEDMEM_Extractor.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
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 // File      : MEDMEM_Extractor.hxx
00021 // Created   : Thu Dec 18 10:52:01 2008
00022 // Author    : Edward AGAPOV (eap)
00023 //
00024 #ifndef __MEDMEM_EXTRACTOR_HXX__
00025 #define __MEDMEM_EXTRACTOR_HXX__
00026 
00027 #include "MEDMEM_Exception.hxx"
00028 #include "MEDMEM_Mesh.hxx"
00029 #include "MEDMEM_Field.hxx"
00030 
00031 #include <map>
00032 #include <vector>
00033 #include <set>
00034 
00035 namespace MEDMEM
00036 {
00046   class MEDMEM_EXPORT Extractor
00047   {
00058   public:
00059     Extractor(const FIELD<double>& inputField) throw (MEDEXCEPTION);
00060     ~Extractor();
00068     FIELD<double>* extractPlane(const double* coords, const double* normal) throw (MEDEXCEPTION);
00069 
00077     FIELD<double>* extractLine(const double* coords, const double* direction) throw (MEDEXCEPTION);
00078 
00079   private:
00080 
00081     MESH* divideEdges(const double*       coords,
00082                       const double*       normal,
00083                       std::map<int,std::set<int> >& new2oldCells);
00084                      
00085     MESH* transfixFaces( const double*       coords,
00086                          const double*       direction,
00087                          std::map<int,std::set<int> >& new2oldCells);
00088 
00089     FIELD<double>* makeField( const std::map<int,std::set<int> >& new2oldCells,
00090                               MESH*                               mesh) const;
00091 
00092     void computeDistanceOfNodes(const double* point, const double* normal);
00093 
00094     void sortNodes( std::map< int, std::vector< int > >& connByNbNodes,
00095                     const double* nodeCoords,
00096                     const double* point,
00097                     const double* normal,
00098                     const std::list<int> & nbNodesPerPolygon);
00099 
00100 
00101     const FIELD<double>* _myInputField; 
00102     const MESH*          _myInputMesh;  
00103     std::vector<double>  _myNodeDistance; 
00104   };
00105 }
00106 
00107 #endif