Salome HOME
SALOME 9.1.0 Windows version
authorrnv <rnv@opencascade.com>
Wed, 29 Aug 2018 11:47:50 +0000 (14:47 +0300)
committervsr <vsr@opencascade.com>
Fri, 7 Sep 2018 12:00:24 +0000 (15:00 +0300)
16 files changed:
src/MEDWrapper/MED_Factory.cxx
src/SMDS/SMDS_Position.hxx
src/SMESH/CMakeLists.txt
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_subMesh.hxx
src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx
src/SMESHGUI/SMESHGUI_MeshEditPreview.h
src/SMESHUtils/SMESH_File.cxx
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_SWIG_WITHIHM/CMakeLists.txt
src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
src/Tools/MeshCut/MeshCut_Utils.cxx

index 51fe44ce3f79263b688e5b8713381086a9ccebde..dbe60c05154886b9b21fe1009e6ca96b19114cd5 100644 (file)
@@ -37,12 +37,25 @@ extern "C"
 }
 #include <utilities.h>
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+
 namespace MED
 {
   bool exists(const std::string& fileName)
   {
 #ifdef WIN32
-    return (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
+#ifdef UNICODE
+       size_t length = strlen(fileName.c_str()) + sizeof(char);
+       wchar_t* path = new wchar_t[length];
+       memset(path, '\0', length);
+       mbstowcs(path, fileName.c_str(), length);
+#else
+       cosnt char* path = xmlPath.c_str();
+#endif
+    return (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES);
 #else
     return (access(fileName.c_str(), F_OK) == 0);
 #endif
index 62c4042d3322fd09c299aa3afd83d3112b4408c7..31fdde7bc31b6e01603fbbe855a15fc60532c8e8 100644 (file)
@@ -54,7 +54,7 @@ class SMDS_EXPORT SMDS_Position
  */
 
 template<class T>
-class SMDS_EXPORT SMDS_Ptr : public std::unique_ptr< T >
+class SMDS_Ptr : public std::unique_ptr< T >
 {
   bool myIsOwner;
 
index 3e41c626a54e45ada33fe715206ec5b9fcb31061..fc119ed8f749089802dcac4fbc7d745168bd5acc 100644 (file)
@@ -110,6 +110,10 @@ SET(SMESHimpl_SOURCES
 # --- rules ---
 
 ADD_LIBRARY(SMESHimpl ${SMESHimpl_SOURCES})
+IF(WIN32)
+  TARGET_COMPILE_OPTIONS(SMESHimpl PRIVATE /bigobj) 
+ENDIF(WIN32)
+
 TARGET_LINK_LIBRARIES(SMESHimpl ${_link_LIBRARIES} )
 INSTALL(TARGETS SMESHimpl EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
index 4b5814c1f1244ca09eb9afce4d8c3475c5405194..574d4b3dedba14709fe847a3806a3c72378678d1 100644 (file)
@@ -52,6 +52,8 @@
   #include <windows.h>
 #endif
 
+#include <Basics_Utils.hxx>
+
 using namespace std;
 
 //=============================================================================
@@ -1029,7 +1031,15 @@ std::vector< std::string > SMESH_Gen::GetPluginXMLPaths()
       xmlPath += sep + plugin + ".xml";
       bool fileOK;
 #ifdef WIN32
-      fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
+#ifdef UNICODE
+         const wchar_t* path = Kernel_Utils::decode_s(xmlPath);
+#else
+         const char* path = xmlPath.c_str();
+#endif
+      fileOK = (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES);
+#ifdef UNICODE
+         delete path;
+#endif
 #else
       fileOK = (access(xmlPath.c_str(), F_OK) == 0);
 #endif
index 9db6348cdf056c034efe4d9447c8473b2184a741..c91deb64ceb8dcc274da39d9af908a55d0da2dae 100644 (file)
@@ -48,7 +48,7 @@ class SMESH_Hypothesis;
 class SMESH_Mesh;
 class SMESH_subMesh;
 class SMESH_subMeshEventListener;
-class SMESH_subMeshEventListenerData;
+struct SMESH_subMeshEventListenerData;
 
 typedef SMESH_subMeshEventListener     EventListener;
 typedef SMESH_subMeshEventListenerData EventListenerData;
index 43ffce19a67f367f4949264da0ed02afac0ab0f1..3b038c5ff07ca1072b4897bddd1941641b975298 100644 (file)
@@ -265,7 +265,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
           prop->Delete();
 
           SMESH::MeshPreviewStruct_var previewData = aEditor->GetPreviewData();
-          myBadElemsPreview->SetData( & previewData.in() );
+          myBadElemsPreview->SetData( previewData._retn() );
           myBadElemsPreview->SetVisibility(true);
 
           SUIT_MessageBox* mb = new SUIT_MessageBox(SUIT_MessageBox::Warning,
index f3c23cfb59b16c551d25e0500e6930c7f1f22297..701fef8e4480b2b30c853d40b5dc5efe61e509e1 100644 (file)
@@ -536,7 +536,7 @@ void SMESHGUI_FindElemByPointOp::redisplayPreview()
   myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
   if (!mySimulation)
     mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
-  mySimulation->SetData(&myPreview.in());
+  mySimulation->SetData( myPreview._retn());
 }
 
 //================================================================================
index f3176684a6b783438aac029f9b101dac07cf57d6..7aff8c6ce1b4b281c333e3d19cadf152d9832d07 100644 (file)
@@ -521,7 +521,17 @@ namespace SMESH
       try {
         // load plugin library
         if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
-        LibHandle libHandle = LoadLib( aClientLibName.toUtf8().data() );
+#ifdef WIN32
+#ifdef UNICODE
+               LPTSTR path = new TCHAR[aClientLibName.length() + 1];
+               path[aClientLibName.toWCharArray(path)] = '\0';
+#else
+               const char* path = aClientLibName.toUtf8().data();
+#endif
+#else
+               char* path = aClientLibName.toUtf8().data();
+#endif
+        LibHandle libHandle = LoadLib( path );
         if (!libHandle) {
           // report any error, if occurred
           {
index 7dca619fb97c75670ee3ead61eb71c461f293899..1e58474dd93ed98e358e0eb7b2d1997553020944 100644 (file)
@@ -167,7 +167,7 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
  */
 //================================================================================
 
-void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct* previewData)
+void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct_var previewData)
 {
   // Create points
   const SMESH::nodes_array& aNodesXYZ = previewData->nodesXYZ;
index 5ae485a74216144a35718efdb61dc2106d7b45e2..6d58999adab417e621e242ec3fecd9a3d6c1ad17 100644 (file)
@@ -37,10 +37,8 @@ class SVTK_ViewWindow;
 class vtkTextActor;
 class vtkUnstructuredGrid;
 
-namespace SMESH
-{
-  class MeshPreviewStruct;
-}
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
 
 /*!
  * \brief Displayer of the mesh edition preview
@@ -59,7 +57,7 @@ public:
   SMESHGUI_MeshEditPreview( SVTK_ViewWindow* );
   ~SMESHGUI_MeshEditPreview();
 
-  void                 SetData( const SMESH::MeshPreviewStruct* );
+  void                 SetData( const SMESH::MeshPreviewStruct_var );
 
   void                 SetVisibility( bool );
   void                 SetColor( double, double, double );
index 556212201577637d642265fd613a4cc9ecde78b8..2472d9eb3a365ee6bbcd772b4f42e2103886b18c 100644 (file)
@@ -36,6 +36,8 @@
 
 #include <boost/filesystem.hpp>
 
+#include <Basics_Utils.hxx>
+
 namespace boofs = boost::filesystem;
 
 //================================================================================
@@ -79,9 +81,17 @@ bool SMESH_File::open()
   if ( !_map && length > 0 )
   {
 #ifdef WIN32
-    _file = CreateFile(_name.data(), GENERIC_READ, FILE_SHARE_READ,
+#ifdef UNICODE
+         const wchar_t* name = Kernel_Utils::decode(_name.data());
+#else
+         char* name = name.data();
+#endif
+    _file = CreateFile(name, GENERIC_READ, FILE_SHARE_READ,
                        NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     bool ok = ( _file != INVALID_HANDLE_VALUE );
+#ifdef UNICODE
+       delete name;
+#endif
 #else
     _file = ::open(_name.data(), O_RDONLY );
     bool ok = ( _file >= 0 );
@@ -291,14 +301,21 @@ bool SMESH_File::getInts(std::vector<int>& ints)
 bool SMESH_File::openForWriting()
 {
 #ifdef WIN32
-
-  _file = CreateFile( _name.c_str(),          // name of the write
+#ifdef UNICODE
+       const wchar_t* name = Kernel_Utils::decode(_name.data());
+#else
+       char* name = name.data();
+#endif
+  _file = CreateFile( name,          // name of the write
                       GENERIC_WRITE,          // open for writing
                       0,                      // do not share
                       NULL,                   // default security
                       OPEN_ALWAYS,            // CREATE NEW or OPEN EXISTING
                       FILE_ATTRIBUTE_NORMAL,  // normal file
                       NULL);                  // no attr. template
+#ifdef UNICODE
+  delete name;
+#endif
   return ( _file != INVALID_HANDLE_VALUE );
 
 #else
index 52b2795a947e510034b278fd7de5023cd204afd7..6c1329704730f8e023c112b2f2f2803367f4da32 100644 (file)
@@ -1999,7 +1999,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
           args.push_back( theCommand->GetArg( i ) );
       }
       theCommand->RemoveArgs();
-      for ( uint i = 0; i < args.size(); i++ )
+      for ( unsigned int i = 0; i < args.size(); i++ )
         theCommand->SetArg( i+1, args[i] );
       if ( theCommand->GetNbArgs() == 4 )
       {
@@ -2056,7 +2056,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
         args.splice( newPos, args, args.begin() );
       }
       std::list< _AString >::iterator a = args.begin();
-      for ( uint i = 1; a != args.end(); ++i, ++a )
+      for ( unsigned int i = 1; a != args.end(); ++i, ++a )
         theCommand->SetArg( i, *a );
     }
     // remember file name
index f994b82f0762ac67efd7c632710618cb0685a379..75c9d2184ece2e5cde5aec19f65771cdbe4fd314 100644 (file)
@@ -439,7 +439,19 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp
     {
       // load plugin library
       if(MYDEBUG) MESSAGE("Loading server meshers plugin library ...");
-      LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
+#ifdef WIN32
+  #ifdef UNICODE
+         const wchar_t* path = Kernel_Utils::decode_s(aPlatformLibName);
+  #else
+         const char* path = aPlatformLibName.c_str();
+  #endif
+#else
+         const char* path = aPlatformLibName.c_str();
+#endif
+      LibHandle libHandle = LoadLib( path );
+#if defined(WIN32) && defined(UNICODE)
+         delete path;
+#endif
       if (!libHandle)
       {
         // report any error, if occurred
index 9b52ec3bf4216b535654a12bf0b134bebfa8a967..7ed53786379fc2d81d70309728731c6437dfc47d 100644 (file)
@@ -96,8 +96,13 @@ SET(_swig_SCRIPTS
 )
 
 # --- rules ---
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+  SWIG_ADD_MODULE(libSMESH_Swig python ${SMESH_Swig_SOURCES})
+ELSE()
+  SWIG_ADD_LIBRARY(libSMESH_Swig LANGUAGE python SOURCES ${SMESH_Swig_SOURCES})
+ENDIF()
+
 
-SWIG_ADD_MODULE(libSMESH_Swig python ${SMESH_Swig_SOURCES})
 SWIG_LINK_LIBRARIES(libSMESH_Swig ${_link_LIBRARIES})
 SWIG_CHECK_GENERATION(libSMESH_Swig)
 IF(WIN32)
index 8e8ed0ad832e96d9efcf0ef438076f7e065030c5..b36929250b9aec6219174857f350c7991eb2054b 100644 (file)
@@ -2050,8 +2050,9 @@ public:
     SVTK_IndexedMapOfIds idMap;
     selector->GetCompositeIndex( actor->getIO(), idMap );
 
-    for ( int i = 1; i <= idMap.Extent(); i++ )
-      myResult.push_back( std::make_pair<int,int>( (int)idMap( i )[0], (int)idMap( i )[1]) );
+    for ( int i = 1; i <= idMap.Extent(); i++ ) {
+      myResult.push_back( std::make_pair( (int)idMap(i)[0], (int)idMap(i)[1]) );
+       }
   }
 };
 
index 3a41721cafda0cccae8d70cce7e845831bb84f38..f8d26b366916beb9d89a2bbc2826855cedabb714 100644 (file)
@@ -25,6 +25,7 @@
 #include <cstdlib>
 #include <cstring>
 #include <ctime>
+#include <algorithm>
 
 using namespace std;
 using namespace MESHCUT;
@@ -924,7 +925,7 @@ void MESHCUT::champType(std::string type, med_entity_type MEM, med_geometry_type
       if (debug)
         {
           cout << endl << "       Liste des valeurs du champ brut aux 3 premiers éléments:" << endl;
-          for (imaille = 0; imaille < min(nmailles, 3); imaille++)
+          for (imaille = 0; imaille < std::min(nmailles, 3); imaille++)
             {
               cout << "         Maille " << imaille << endl;
               for (igauss = 0; igauss < ngauss; igauss++)