SALOME - SMESH
NETGENPlugin_Mesher.hxx
Go to the documentation of this file.
00001 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 //  This library is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU Lesser General Public
00008 //  License as published by the Free Software Foundation; either
00009 //  version 2.1 of the License.
00010 //
00011 //  This library is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 //  Lesser General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU Lesser General Public
00017 //  License along with this library; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //  NETGENPlugin : C++ implementation
00023 // File      : NETGENPlugin_Mesher.hxx
00024 // Author    : Michael Sazonov (OCN)
00025 // Date      : 31/03/2006
00026 // Project   : SALOME
00027 // $Header$
00028 //=============================================================================
00029 //
00030 #ifndef _NETGENPlugin_Mesher_HXX_
00031 #define _NETGENPlugin_Mesher_HXX_
00032 
00033 #include "NETGENPlugin_Defs.hxx"
00034 #include "StdMeshers_FaceSide.hxx"
00035 #include <map>
00036 
00037 class SMESH_Mesh;
00038 class SMESHDS_Mesh;
00039 class TopoDS_Shape;
00040 class NETGENPlugin_Hypothesis;
00041 class NETGENPlugin_SimpleHypothesis_2D;
00042 namespace netgen {
00043   class OCCGeometry;
00044   class Mesh;
00045 }
00046 
00051 class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher 
00052 {
00053  public:
00054   // ---------- PUBLIC METHODS ----------
00055 
00056   NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape,
00057                        const bool isVolume);
00058 
00059   void SetParameters(const NETGENPlugin_Hypothesis* hyp);
00060   void SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp);
00061 
00062   bool Compute();
00063 
00064   bool Evaluate(MapShapeNbElems& aResMap);
00065 
00066   static void PrepareOCCgeometry(netgen::OCCGeometry&          occgeom,
00067                                  const TopoDS_Shape&           shape,
00068                                  SMESH_Mesh&                   mesh,
00069                                  std::list< SMESH_subMesh* > * meshedSM=0);
00070 
00071   static void RemoveTmpFiles();
00072 
00073 protected:
00074 
00075   bool fillNgMesh(netgen::OCCGeometry&                occgeom,
00076                   netgen::Mesh&                       ngMesh,
00077                   std::vector<SMDS_MeshNode*>&        nodeVec,
00078                   const std::list< SMESH_subMesh* > & meshedSM);
00079 
00080   void defaultParameters();
00081 
00082 
00083  private:
00084   SMESH_Mesh*          _mesh;
00085   const TopoDS_Shape&  _shape;
00086   bool                 _isVolume;
00087   bool                 _optimize;
00088 
00089   const NETGENPlugin_SimpleHypothesis_2D * _simpleHyp;
00090   std::map< int, std::pair<int,int> >      _faceDescriptors;
00091 };
00092 
00093 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines