}
#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
*/
template<class T>
-class SMDS_EXPORT SMDS_Ptr : public std::unique_ptr< T >
+class SMDS_Ptr : public std::unique_ptr< T >
{
bool myIsOwner;
# --- 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})
#include <windows.h>
#endif
+#include <Basics_Utils.hxx>
+
using namespace std;
//=============================================================================
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
class SMESH_Mesh;
class SMESH_subMesh;
class SMESH_subMeshEventListener;
-class SMESH_subMeshEventListenerData;
+struct SMESH_subMeshEventListenerData;
typedef SMESH_subMeshEventListener EventListener;
typedef SMESH_subMeshEventListenerData EventListenerData;
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,
myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
if (!mySimulation)
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
- mySimulation->SetData(&myPreview.in());
+ mySimulation->SetData( myPreview._retn());
}
//================================================================================
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
{
*/
//================================================================================
-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;
class vtkTextActor;
class vtkUnstructuredGrid;
-namespace SMESH
-{
- class MeshPreviewStruct;
-}
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
/*!
* \brief Displayer of the mesh edition preview
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 );
#include <boost/filesystem.hpp>
+#include <Basics_Utils.hxx>
+
namespace boofs = boost::filesystem;
//================================================================================
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 );
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
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 )
{
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
{
// 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
)
# --- 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)
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]) );
+ }
}
};
#include <cstdlib>
#include <cstring>
#include <ctime>
+#include <algorithm>
using namespace std;
using namespace MESHCUT;
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++)