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
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
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;
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++ ) {
}
}
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;
#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"
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);
#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)
// ======================================================
// 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
{
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)
#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:
#ifndef _GHS3DPRLPlugin_Hypothesis_i_HXX_
#define _GHS3DPRLPlugin_Hypothesis_i_HXX_
+#include "GHS3DPRLPlugin_Defs.hxx"
+
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GHS3DPRLPlugin_Algorithm)
// GHS3DPRLPlugin parameters hypothesis
-class GHS3DPRLPlugin_Hypothesis_i:
+class GHS3DPRLPLUGIN_EXPORT GHS3DPRLPlugin_Hypothesis_i:
public virtual POA_GHS3DPRLPlugin::GHS3DPRLPlugin_Hypothesis,
public virtual SMESH_Hypothesis_i
{
// Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
// ---
//
+#include "GHS3DPRLPlugin_Defs.hxx"
#include "SMESH_Hypothesis_i.hxx"
#include "utilities.h"
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);
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
//=============================================================================
extern "C"
{
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
+ GHS3DPRLPLUGINGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
{
SMESHGUI_GenericHypothesisCreator* aCreator = NULL;
if( aHypType=="GHS3DPRL_Parameters" )
: SMESHGUI_GenericHypothesisCreator( theHypType ),
myIs3D( true )
{
+ printf("Hypo creator !!!!!!!!!!!!!!!!!!!!!!!!!! RNV");
}
GHS3DPRLPluginGUI_HypothesisCreator::~GHS3DPRLPluginGUI_HypothesisCreator()
#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;
/*!
* \brief Class for creation of GHS3DPRL hypotheses
*/
-class GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
+class GHS3DPRLPLUGINGUI_EXPORT GHS3DPRLPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
{
Q_OBJECT
-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 = \
#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>
//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");
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"; }
return ires;
}
-
#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"
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;
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;
"\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) {
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"){