From 4ef555d8e9a676e2dec7ff174c47f2342e3b9f02 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 18 Sep 2009 13:17:15 +0000 Subject: [PATCH] windows port --- src/GUI/BLSURFPluginGUI.cxx | 8 +++++++ src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx | 24 +++++++++---------- src/GUI/BLSURFPluginGUI_HypothesisCreator.h | 10 +++++++- src/GUI/Makefile.am | 1 + src/PluginUtils/GeomSelectionTools.h | 14 +++++++++-- src/PluginUtils/Makefile.am | 7 +++++- 6 files changed, 48 insertions(+), 16 deletions(-) diff --git a/src/GUI/BLSURFPluginGUI.cxx b/src/GUI/BLSURFPluginGUI.cxx index 9414ad1..1ecc755 100755 --- a/src/GUI/BLSURFPluginGUI.cxx +++ b/src/GUI/BLSURFPluginGUI.cxx @@ -21,6 +21,14 @@ // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) // --- // +#ifdef WNT +// E.A. : On windows with python 2.6, there is a conflict +// E.A. : between pymath.h and Standard_math.h which define +// E.A. : some same symbols : acosh, asinh, ... +#include +#include +#endif + #include "BLSURFPluginGUI_HypothesisCreator.h" //============================================================================= diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index dfaf627..c86ce90 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -233,7 +233,7 @@ BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QStr aSel = GeomToolSelected->selectionMgr(); /* Initialize the Python interpreter */ - if (not Py_IsInitialized()) + if (! Py_IsInitialized()) throw ("Error: Python interpreter is not initialized"); PyGILState_STATE gstate; gstate = PyGILState_Ensure(); @@ -262,7 +262,7 @@ GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool() BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); MESSAGE("aStudy->StudyId(): " << aStudy->StudyId()); - if (that->GeomToolSelected == NULL or that->GeomToolSelected->getMyStudy() != aStudy) { + if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) { MESSAGE("GeomToolSelected is created"); that->GeomToolSelected = new GeomSelectionTools(aStudy); } @@ -1108,16 +1108,16 @@ void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(int row,int col) QString entry = that->mySizeMapTable->item(row, SMP_ENTRY_COLUMN)->text(); QString sizeMap = that->mySizeMapTable->item(row, SMP_SIZEMAP_COLUMN)->text().trimmed(); MESSAGE("entry: " << entry.toStdString() << ", sizeMap: " << sizeMap.toStdString()); - if (not that->mySMPShapeTypeMap.contains(entry)) + if (! that->mySMPShapeTypeMap.contains(entry)) return; if (that->mySMPMap.contains(entry)) if (that->mySMPMap[entry] == sizeMap) return; QColor* bgColor = new QColor("white"); QColor* fgColor = new QColor("black"); - if (not sizeMap.isEmpty()) { + if (! sizeMap.isEmpty()) { that->mySMPMap[entry] = sizeMap; - if (not sizeMapValidationFromRow(row)) { + if (! sizeMapValidationFromRow(row)) { bgColor->setRgb(255,0,0); fgColor->setRgb(255,255,255); } @@ -1220,7 +1220,7 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation() MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()"); int row = 0, nbRows = mySizeMapTable->rowCount(); for ( ; row < nbRows; ++row ) - if (not sizeMapValidationFromRow(row)) + if (! sizeMapValidationFromRow(row)) return false; return true; } @@ -1240,11 +1240,11 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEnt BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - if (not that->mySMPMap.contains(myEntry)) { + if (! that->mySMPMap.contains(myEntry)) { MESSAGE("Geometry with entry "<mySMPShapeTypeMap.contains(myEntry)) { + if (! that->mySMPShapeTypeMap.contains(myEntry)) { MESSAGE("Shape type with entry "<mySMPMap[myEntry].startsWith("ATTRACTOR")) { MESSAGE("Attractor" ); // if ((that->mySMPMap[myEntry].count(QRegExp("ATTRACTOR([0-9])")) != 1)) - if ((that->mySMPMap[myEntry].count('(') != 1) or - (that->mySMPMap[myEntry].count(')') != 1) or - (that->mySMPMap[myEntry].count(';') != 4) or + if ((that->mySMPMap[myEntry].count('(') != 1) || + (that->mySMPMap[myEntry].count(')') != 1) || + (that->mySMPMap[myEntry].count(';') != 4) || (that->mySMPMap[myEntry].size() == 15)){ if (displayError) SUIT_MessageBox::warning( dlg(),"Definition of attractor : Error" ,"An attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b)" ); @@ -1284,7 +1284,7 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEnt expr = "def f() : return " + that->mySMPMap[myEntry].toStdString(); } //assert(Py_IsInitialized()); - if (not Py_IsInitialized()) + if (! Py_IsInitialized()) throw ("Erreur: Python interpreter is not initialized"); PyGILState_STATE gstate; gstate = PyGILState_Ensure(); diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index db48e08..b66f74f 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -27,7 +27,7 @@ #define BLSURFPLUGINGUI_HypothesisCreator_H #ifdef WIN32 - #ifdef BLSURFPLUGIN_GUI_EXPORTS + #if defined BLSURFPLUGIN_GUI_EXPORTS || defined BLSURFPluginGUI_EXPORTS #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllexport ) #else #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllimport ) @@ -36,6 +36,14 @@ #define BLSURFPLUGIN_GUI_EXPORT #endif +#ifdef WNT +// E.A. : On windows with python 2.6, there is a conflict +// E.A. : between pymath.h and Standard_math.h which define +// E.A. : some same symbols : acosh, asinh, ... +#include +#include +#endif + #include #include #include diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 28c611f..c2d5b2e 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -62,6 +62,7 @@ libBLSURFPluginGUI_la_CPPFLAGS = \ libBLSURFPluginGUI_la_LDFLAGS = \ ../BLSURFPlugin/libBLSURFEngine.la \ ../PluginUtils/libGeomSelectionTools.la \ + $(GUI_LDFLAGS) -lqtx -lSalomeApp \ ${SMESH_LDFLAGS} -lSMESH \ $(CAS_KERNEL) $(BLSURF_LIBS) diff --git a/src/PluginUtils/GeomSelectionTools.h b/src/PluginUtils/GeomSelectionTools.h index 8abdf3c..85c312d 100644 --- a/src/PluginUtils/GeomSelectionTools.h +++ b/src/PluginUtils/GeomSelectionTools.h @@ -22,6 +22,16 @@ #ifndef _GEOMSELECTIONTOOLS_H_ #define _GEOMSELECTIONTOOLS_H_ +#ifdef WIN32 +# ifdef GeomSelectionTools_EXPORTS +# define GEOMSELECTIONTOOLS_EXPORT __declspec( dllexport ) +# else +# define GEOMSELECTIONTOOLS_EXPORT __declspec( dllimport ) +# endif +#else +# define GEOMSELECTIONTOOLS_EXPORT +#endif + #include "SALOMEDSClient.hxx" #include "SALOME_InteractiveObject.hxx" #include @@ -41,7 +51,7 @@ class LightApp_SelectionMgr; * */ -class GeomSelectionTools +class GEOMSELECTIONTOOLS_EXPORT GeomSelectionTools { private: @@ -67,4 +77,4 @@ public: }; -#endif // _GEOMSELECTIONTOOLS_H_ \ No newline at end of file +#endif // _GEOMSELECTIONTOOLS_H_ diff --git a/src/PluginUtils/Makefile.am b/src/PluginUtils/Makefile.am index 2ba0d12..7b35669 100644 --- a/src/PluginUtils/Makefile.am +++ b/src/PluginUtils/Makefile.am @@ -50,8 +50,13 @@ libGeomSelectionTools_la_CPPFLAGS = \ -I$(top_builddir)/idl libGeomSelectionTools_la_LDFLAGS = \ + $(QT_LIBS) \ + $(CORBA_LIBS) \ + $(KERNEL_LDFLAGS) -lSalomeIDLKernel -lSALOMELocalTrace -lSalomeLifeCycleCORBA \ + $(GUI_LDFLAGS) -lSalomeObject -lsuit -lLightApp -lSalomeApp \ + $(GEOM_LDFLAGS) -lSalomeIDLGEOM -lGEOMClient \ ${SMESH_LDFLAGS} -lSMESH \ - $(CAS_KERNEL) + $(CAS_KERNEL) -lTKBRep -lTKG3d # resources files #nodist_salomeres_DATA = \ -- 2.39.2