]> SALOME platform Git repositories - plugins/ghs3dprlplugin.git/commitdiff
Salome HOME
Win32 compilation of the GHS3DPRLPLUGIN.
authorrnv <rnv@opencascade.com>
Sat, 28 Apr 2012 06:55:12 +0000 (06:55 +0000)
committerrnv <rnv@opencascade.com>
Sat, 28 Apr 2012 06:55:12 +0000 (06:55 +0000)
14 files changed:
src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.hxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL_i.hxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.cxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis.hxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_Hypothesis_i.hxx
src/GHS3DPRLPlugin/GHS3DPRLPlugin_i.cxx
src/GHS3DPRLPlugin/Makefile.am
src/gui/GHS3DPRLPluginGUI.cxx
src/gui/GHS3DPRLPluginGUI_HypothesisCreator.cxx
src/gui/GHS3DPRLPluginGUI_HypothesisCreator.h
src/gui/Makefile.am
src/tepal2med/ghs3dprl_mesh_wrap.cxx
src/tepal2med/tepal2med.cxx

index 6204021e5dac47ec44421a07470e603894807354..cb93731912bed4d270d9656eeb64d97f15efede5 100755 (executable)
@@ -144,7 +144,7 @@ static bool writeGHS3DPRLFiles (const TCollection_AsciiString &  GHS3DPRL_In,
    ofstream theFile;
    theFile.open(namefile.ToCString(),ios::out);
 #ifdef WIN32
-   Ok=theFile->is_open();
+   Ok = theFile.is_open();
 #else
    Ok=theFile.rdbuf()->is_open();
 #endif
@@ -186,7 +186,7 @@ static bool writeGHS3DPRLFiles (const TCollection_AsciiString &  GHS3DPRL_In,
    removeFile(namefile);
    theFile.open(namefile.ToCString(),ios::out);
 #ifdef WIN32
-   Ok=theFile->is_open();
+   Ok=theFile.is_open();
 #else
    Ok=theFile.rdbuf()->is_open();
 #endif
@@ -297,8 +297,8 @@ static bool readResult(FILE *                           theFile,
   int line = 1, EndOfFile = 0, nbElem = 0, nField = 10, nbRef = 0, aGHS3DPRLNodeID = 0;
   const char * theField;
 
-  const char * tabField [nField];
-  int    tabRef [nField];
+  vector<const char*> tabField = vector<const char*>(nField);
+  vector<int> tabRef = vector<int>(nField);
 
   tabField[0] = "MeshVersionFormatted";    tabRef[0] = 0;
   tabField[1] = "Dimension";               tabRef[1] = 0;
@@ -345,7 +345,7 @@ static bool readResult(FILE *                           theFile,
 
                       if ( strcmp(theField, "Vertices") == 0 ) {
                           int aGHS3DPRLID;
-                          double coord[nbRef];
+                          vector<double> coord = vector<double>(nbRef);
                           SMDS_MeshNode * aGHS3DPRLNode;
 
                           for ( int iElem = 0; iElem < nbElem; iElem++ ) {
@@ -359,7 +359,7 @@ static bool readResult(FILE *                           theFile,
                           }
                       }
                       else {
-                          const SMDS_MeshNode * node[nbRef];
+                          vector<const SMDS_MeshNode*> node = vector<const SMDS_MeshNode*>(nbRef);
                           SMDS_MeshElement* aGHS3DPRLElement;
                           map <int,const SMDS_MeshNode*>::iterator itOnGHS3DPRLNode;
 
index c44931016ea286e1d17676378384556f1e70376c..2ed2f90465b57d2f17e56a5b7dc499edd5448791 100755 (executable)
@@ -25,6 +25,8 @@
 #ifndef _GHS3DPRLPlugin_GHS3DPRL_HXX_
 #define _GHS3DPRLPlugin_GHS3DPRL_HXX_
 
+#include "GHS3DPRLPlugin_Defs.hxx"
+
 #include "SMESH_3D_Algo.hxx"
 #include "SMESH_Mesh.hxx"
 #include "Utils_SALOME_Exception.hxx"
@@ -32,7 +34,7 @@
 class SMESH_Mesh;
 class GHS3DPRLPlugin_Hypothesis;
 
-class GHS3DPRLPlugin_GHS3DPRL: public SMESH_3D_Algo
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_GHS3DPRL: public SMESH_3D_Algo
 {
 public:
   GHS3DPRLPlugin_GHS3DPRL(int hypId, int studyId, SMESH_Gen* gen);
index cab206978b281bc8fefff4a1f63dcceb136a6781..3c57137da4f1b036b1a2e8341dcb65583f190597 100755 (executable)
@@ -25,6 +25,8 @@
 #ifndef _GHS3DPRLPlugin_GHS3DPRL_I_HXX_
 #define _GHS3DPRLPlugin_GHS3DPRL_I_HXX_
 
+#include "GHS3DPRLPlugin_Defs.hxx"
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm)
 #include CORBA_SERVER_HEADER(SALOME_Exception)
@@ -35,7 +37,7 @@
 // ======================================================
 // GHS3DPRL 3d algorithm
 // ======================================================
-class GHS3DPRLPlugin_GHS3DPRL_i:
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_GHS3DPRL_i:
   public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_GHS3DPRL,
   public virtual SMESH_3D_Algo_i
 {
index c378fd24ba80b73fd932f737d2f69d6d90cca937..04bb483be83c38ecb0bab673fbe8ccda1c0b0228 100755 (executable)
@@ -62,7 +62,7 @@ static std::string cutOrReplaceBlancs(std::string theIn)
 
   for (int i = 0, j = 0; i < len; i++)
   {
-    ushort ucs = (ushort)(str1[i]);
+    unsigned short ucs = (unsigned short)(str1[i]);
     if ((9 <= ucs && ucs <= 13) || ucs == 32)
     {
       if (!del)
index 789a4a96e8df939590f744797a8036a4d357008d..8d9808a160e34bc813c28ef50ab4362e77677d99 100755 (executable)
 #ifndef _GHS3DPRLPlugin_Hypothesis_HXX_
 #define _GHS3DPRLPlugin_Hypothesis_HXX_
 
+#include "GHS3DPRLPlugin_Defs.hxx"
+
 #include "SMESH_Hypothesis.hxx"
 #include "Utils_SALOME_Exception.hxx"
 
 //  Parameters for work of GHS3DPRL
 //
 
-class GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
 
index 7d2a44c71159e7a657ca32f1f1e5e16f50075f4d..0c9d0fb4d1feed057c3fee9a6e398980845290f1 100755 (executable)
@@ -25,6 +25,8 @@
 #ifndef _GHS3DPRLPlugin_Hypothesis_i_HXX_
 #define _GHS3DPRLPlugin_Hypothesis_i_HXX_
 
+#include "GHS3DPRLPlugin_Defs.hxx"
+
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm)
 
@@ -35,7 +37,7 @@ class SMESH_Gen;
 
 // GHS3DPRLPlugin parameters hypothesis
 
-class GHS3DPRLPlugin_Hypothesis_i:
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis_i:
   public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_Hypothesis,
   public virtual SMESH_Hypothesis_i
 {
index abf671a66644c1b4ab7c575039231c9153ab91d8..026c48378c449b1adc50e3af5e5a41dafc4806cc 100755 (executable)
@@ -22,6 +22,7 @@
 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
 // ---
 //
+#include "GHS3DPRLPlugin_Defs.hxx"
 #include "SMESH_Hypothesis_i.hxx"
 
 #include "utilities.h"
@@ -43,7 +44,10 @@ template <class T> class GHS3DPRLPlugin_Creator_i:public HypothesisCreator_i<T>
 
 extern "C"
 {
-  GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
+
+  GHS3DPRLPLUGIN_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName);
+
+  GHS3DPRLPLUGIN_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
   {
     MESSAGE("GetHypothesisCreator " << aHypName);
 
index 60b2a21bdc959fc64a282b029aff9d49d7e8ac68..94b935c79b30079ae5a6592c8e2eeda646e98664 100644 (file)
@@ -56,8 +56,11 @@ libGHS3DPRLEngine_la_CPPFLAGS =      \
 
 libGHS3DPRLEngine_la_LDFLAGS  =                        \
        ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \
-       $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine   \
-       $(KERNEL_LDFLAGS) -lSalomeGenericObj
+       $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \
+       $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace \
+       $(MED_LDFLAGS) -lSalomeIDLMED \
+       $(CAS_LDFLAGS) -lTKBRep -lTKG3d -lTKTopAlgo\
+       $(SMESH_LDFLAGS) -lSMDS -lSMESH -lSMESHDS -lTKG2d
 
 # Scripts to be installed.
 dist_salomescript_DATA= GHS3DPRLPluginDC.py
index 589dd28c48b6e6699e71c5a3cd4dc684f5758238..d4d8f4001950b7a165b112c96096ca06c18c07da 100755 (executable)
@@ -31,7 +31,7 @@
 //=============================================================================
 extern "C"
 {
-  SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
+  GHS3DPRLPLUGINGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
   {
     SMESHGUI_GenericHypothesisCreator* aCreator = NULL;
     if( aHypType=="GHS3DPRL_Parameters" )
index 2d022bceeed9505216ed75988c17a6a250381bb0..c0f9e489885c6bbf33596816b70229686b1010be 100755 (executable)
@@ -46,6 +46,7 @@ GHS3DPRLPluginGUI_HypothesisCreator::GHS3DPRLPluginGUI_HypothesisCreator( const
 : SMESHGUI_GenericHypothesisCreator( theHypType ),
   myIs3D( true )
 {
+  printf("Hypo creator !!!!!!!!!!!!!!!!!!!!!!!!!! RNV");
 }
 
 GHS3DPRLPluginGUI_HypothesisCreator::~GHS3DPRLPluginGUI_HypothesisCreator()
index f583fdd8e50de62f9e48cd301f6144c7bffdc152..b7717c90d4cd88fdf06853a0ef885e39c8de2c0c 100755 (executable)
 #ifndef GHS3DPRLPLUGINGUI_HypothesisCreator_H
 #define GHS3DPRLPLUGINGUI_HypothesisCreator_H
 
+#ifdef WIN32
+  #if defined GHS3DPRLPluginGUI_EXPORTS
+    #define GHS3DPRLPLUGINGUI_EXPORT __declspec( dllexport )
+  #else
+    #define GHS3DPRLPLUGINGUI_EXPORT __declspec( dllimport )
+  #endif
+#else
+  #define GHS3DPRLPLUGINGUI_EXPORT
+#endif
+
+
 #include <SMESHGUI_Hypotheses.h>
 
 class QtxIntSpinBox;
@@ -44,7 +55,7 @@ typedef struct
 /*!
  * \brief Class for creation of GHS3DPRL hypotheses
 */
-class GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
+class GHS3DPRLPLUGINGUI_EXPORT GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
 {
   Q_OBJECT
 
index 662226cf358824a67dc8851c90476c99b84ee78a..386397f1569fb6befe58e1cff3f9ac261887bd68 100644 (file)
@@ -59,9 +59,11 @@ libGHS3DPRLPluginGUI_la_CPPFLAGS =   \
        -I$(top_builddir)/idl
 
 libGHS3DPRLPluginGUI_la_LDFLAGS =              \
+       $(QT_LIBS) \
        ../GHS3DPRLPlugin/libGHS3DPRLEngine.la  \
        ${SMESH_LDFLAGS} -lSMESH                \
-       $(CAS_KERNEL)
+       $(CAS_KERNEL) \
+       $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp
 
 # resources files
 nodist_salomeres_DATA =                        \
index 704f9e2f59db69340cba73e91a78b299c0d310e6..b4206df1be5f7afe6f6e58b879b2eb7ed5a422dc 100755 (executable)
 #include <libxml/parser.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
+#ifdef WIN32
+#include <io.h>
+#include <windows.h>
+#include <time.h>
+#define F_OK 0
+#undef max
+#undef min
+#endif
 
 #include <QFile>
 #include <QRegExp>
@@ -1371,12 +1379,20 @@ bool ghs3dprl_mesh_wrap::Write_masterxmlMEDfile()
    //Description tag
    node = xmlNewChild(root_node,0, BAD_CAST "description",0);
    xmlNewProp(node, BAD_CAST "what", BAD_CAST "tetrahedral mesh by tepal");
+#ifdef WIN32
+  SYSTEMTIME  present;
+  GetLocalTime ( &present );
+  sprintf(buff,"%04d/%02d/%02d %02dh%02dm",
+          present.wYear,present.wMonth,present.wDay,
+          present.wHour,present.wMinute);
+#else
    time_t present;
    time(&present);
    struct tm *time_asc = localtime(&present);
    sprintf(buff,"%04d/%02d/%02d %02dh%02dm",
            time_asc->tm_year+1900,time_asc->tm_mon+1,time_asc->tm_mday,
            time_asc->tm_hour,time_asc->tm_min);
+#endif
    xmlNewProp(node, BAD_CAST "when", BAD_CAST buff);
    xmlNewProp(node, BAD_CAST "from", BAD_CAST "tepal2med");
 
@@ -1489,7 +1505,12 @@ bool ghs3dprl_mesh_wrap::Write_MEDfiles_v2(bool deletekeys)
    cmd=pathini+casename+"_skin.med";
    int ret = access(cmd.toLatin1().constData(),F_OK); //on regarde si le fichier existe
    if (ret >= 0) {
-      cmd="cp "+pathini+casename+"_skin.med "+tmp;
+#ifdef WIN32
+      cmd="copy ";
+#else 
+      cmd="cp ";
+#endif
+      cmd = cmd+pathini+casename+"_skin.med "+tmp;
       //std::cout<<"Copy skin.med Command = "<<cmd<<std::endl;
       system(cmd.toLatin1().constData()); 
       if (verbose>0) std::cout<<"CreateMEDFile for initial skin <"<<tmp.toLatin1().constData()<<">\n"; }
@@ -2249,4 +2270,3 @@ med_int ghs3dprl_mesh_wrap::create_families(med_idt fid, int sign)
    return ires;
 }
 
-
index 5fdb715e82aaa2602777e3e7c56b4d0ed9f25007..4672fd83759e28ca60740708c411a165500f2eb0 100755 (executable)
@@ -33,6 +33,7 @@
 #include <iostream>
 #include <sstream>
 #include <fstream>
+#include <vector>
 
 #include <qstring.h>
 
 #include "ghs3dprl_msg_parser.h"
 #include "dlg_ghs3dmain.h"
 
+#ifdef WIN32
+#include <io.h>
+#include <windows.h>
+#define F_OK 0
+#endif
+
 //#include "MEDMEM_Exception.hxx"
 //#include "MEDMEM_define.hxx"
 
@@ -112,11 +119,12 @@ bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw)
    med_bool tran;
    
    //version qt3
-   char chaine[nomfilemed.length()+1];
+   char* chaine = (char*)malloc((nomfilemed.length()+1)*sizeof(char));
    strncpy(chaine,nomfilemed.toLatin1().constData(),nomfilemed.length()+1);
    //std::cout<<"*** ReadFileMED *** "<<chaine<<"\n";
 
    fid=ouvre_fichier_MED(chaine,mymailw->verbose);
+   free(chaine);
    if (fid == 0) {
       std::cerr<<"Problem opening file "<<nomfilemed.toLatin1().constData()<<"\n";
       return false;
@@ -199,7 +207,8 @@ bool ReadFileMED(QString nomfilemed,ghs3dprl_mesh_wrap *mymailw)
       return false;
    }
 
-med_int famdelete[nfam],ifamdelete=0,idelete;
+med_int ifamdelete=0,idelete;
+std::vector<med_int> famdelete = std::vector<med_int>(nfam);
 {
   med_int ngro;
   char *gro;
@@ -713,6 +722,7 @@ int main(int argc, char *argv[])
          "\n   --deletegroups=\""<<deletegroups.toLatin1().constData()<<"\"\n";
    
    //utile si appel par plugin ghs3dprl sur big meshes et tepal sur plusieurs jours
+#ifndef WIN32
    if (background=="yes"){
       pid_t pid = fork();
       if (pid > 0) {
@@ -725,6 +735,9 @@ int main(int argc, char *argv[])
       setsid();
       system("sleep 10");  //for debug
    }
+#else
+   printf("background mode is not supported on win32 platform !\n");
+#endif
 
    //"tepal -f exemple1 -n 4"
    if (launchtepal=="yes"){