Back to index

salome-smesh  6.5.0
MeshCut_Utils.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2006-2012  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 __MESHCUT_UTILS_HXX__
00021 #define __MESHCUT_UTILS_HXX__
00022 
00023 extern "C"
00024   {
00025 #include <med.h>
00026   }
00027 
00028 #include <string>
00029 #include <vector>
00030 #include <map>
00031 
00032 namespace MESHCUT
00033   {
00034 
00035     enum TYPE_MAILLE
00036     {
00037       POI1, SEG2, SEG3, TRIA3, TRIA6, QUAD4, QUAD8, TETRA4, TETRA10, PYRAM5, PYRAM13, PENTA6, PENTA15, HEXA8, HEXA20
00038     };
00039 
00040     bool estUnTypeMaille(std::string S);
00041     void ERREUR(const char* msg);
00042     char* string2char(std::string str);
00043     std::string int2string(int k);
00044     float char2float(const char* ch);
00045     std::string float2string(float f);
00046     bool appartient(std::string e, std::string tableau[], int taille);
00047     float arrondi(float x);
00048     int numNoeudPointe(std::string b1, std::string b2, std::string b3);
00049     std::string strip(std::string S);
00050     std::string entierSur10_g(int i);
00051     std::string entierSur10_d(int i);
00052     std::string typeEnsight(std::string type);
00053     int Nnoeuds(TYPE_MAILLE type);
00054     int NnoeudsGeom(TYPE_MAILLE type);
00055     int codeGMSH(std::string type);
00056     std::string floatEnsight(float x);
00057     bool typeComplexe(std::string type);
00058     std::string ASTER8(std::string s);
00059     float dObservateur(float a, float b, float c);
00060 
00061     int copieFichier(std::string source, std::string cible);
00062     med_geometry_type InstanceMGE(TYPE_MAILLE TYPE);
00063     int chrono();
00064     TYPE_MAILLE typeMaille(std::string type);
00065     std::string MGE2string(med_geometry_type MGE);
00066     std::string TM2string(TYPE_MAILLE MGE);
00067     TYPE_MAILLE string2TM(std::string stm);
00068     std::string coordIndex_ILS(TYPE_MAILLE tm);
00069     std::string coordIndex_IFS(TYPE_MAILLE tm);
00070     std::string SIGNE(double x);
00071     void champType(std::string type, med_entity_type MEM, med_geometry_type MGE, med_idt fid, med_idt fidout,
00072                    char *maa, char *nomChamp, char *nomChampMoy, med_field_type typeChamp, char *compChamp,
00073                    char *unitChamp, med_int nCompChamp, std::map<std::string, int> REFGAUSS, int ichamp);
00074     std::string nomMaille(TYPE_MAILLE tm, int nl);
00075     bool appartientVN(int n, std::vector<int> V);
00076     float distance2(float x1, float y1, float z1, float x2, float y2, float z2);
00077     void conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N);
00078 
00079   }
00080 
00081 #endif