Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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