mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-25 04:50:32 +05:00
SALOME 9.1.0 Windows version
This commit is contained in:
parent
00bd895f44
commit
c5f8cda9bf
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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})
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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]) );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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++)
|
||||
|
Loading…
Reference in New Issue
Block a user