diff --git a/CMakeLists.txt b/CMakeLists.txt index 157b9cc41..5d34122f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,8 +133,10 @@ FIND_PACKAGE(SalomeSWIG REQUIRED) FIND_PACKAGE(SalomeOmniORB REQUIRED) IF(DEFINED EMSCRIPTEN) LIST(TRANSFORM OMNIORB_LIBRARIES REPLACE "\.so$" "\.a") +ELSE() + FIND_PACKAGE(SalomeOmniORBPy REQUIRED) ENDIF() -FIND_PACKAGE(SalomeOmniORBPy REQUIRED) + # LibXml2 FIND_PACKAGE(SalomeLibXml2 REQUIRED) # HDF5 diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 3cd70b272..fc04d7e62 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -155,5 +155,6 @@ SET(SMESH_StdMeshers StdMeshers) SET(SMESH_StdMeshersEngine StdMeshersEngine) SET(SMESH_StdMeshersGUI StdMeshersGUI) SET(SMESH_MeshJobManagerEngine MeshJobManagerEngine) +SET(SMESH_SPADDERPluginTesterEngine SPADDERPluginTesterEngine) SET(SMESH_SalomeIDLSMESH SalomeIDLSMESH) SET(SMESH_SalomeIDLSPADDER SalomeIDLSPADDER) diff --git a/src/SMDS/CMakeLists.txt b/src/SMDS/CMakeLists.txt index 50a0120dc..87a4b4b47 100644 --- a/src/SMDS/CMakeLists.txt +++ b/src/SMDS/CMakeLists.txt @@ -92,7 +92,7 @@ SET(SMDS_SOURCES SMDS_FaceOfNodes.cxx SMDS_FacePosition.cxx SMDS_LinearEdge.cxx - # SMDS_MemoryLimit.cxx + SMDS_MemoryLimit.cxx SMDS_Mesh.cxx SMDS_MeshCell.cxx SMDS_MeshElement.cxx @@ -121,8 +121,10 @@ ADD_LIBRARY(SMDS ${SMDS_SOURCES}) TARGET_LINK_LIBRARIES(SMDS ${_link_LIBRARIES} ) INSTALL(TARGETS SMDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -# ADD_EXECUTABLE(SMDS_MemoryLimit ${SMDS_MemoryLimit_SOURCES}) -# TARGET_LINK_LIBRARIES(SMDS_MemoryLimit ${_link_LIBRARIES}) -# INSTALL(TARGETS SMDS_MemoryLimit EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) +IF (NOT DEFINED EMSCRIPTEN) + ADD_EXECUTABLE(SMDS_MemoryLimit ${SMDS_MemoryLimit_SOURCES}) + TARGET_LINK_LIBRARIES(SMDS_MemoryLimit ${_link_LIBRARIES}) + INSTALL(TARGETS SMDS_MemoryLimit EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) +ENDIF() INSTALL(FILES ${SMDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index 68a420151..4e282be3f 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -137,7 +137,6 @@ smIdType SMDS_ElementFactory::GetMaxID() id = myChunks[i].Get1stID() + index; break; } - std::cout << "Max id is " << id << std::endl; return id; } @@ -172,8 +171,6 @@ smIdType SMDS_ElementFactory::GetMinID() SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id ) { - // std::cout << "New element" << id << std::endl; - smIdType iChunk = ( id - 1 ) / theChunkSize; smIdType index = ( id - 1 ) % theChunkSize; while ((smIdType) myChunks.size() <= iChunk ) @@ -205,7 +202,6 @@ SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id ) const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) const { - // std::cout << "Find element, # chunks: " << myChunks.size() << std::endl; if ( id > 0 ) { smIdType iChunk = ( id - 1 ) / theChunkSize; @@ -494,7 +490,6 @@ void SMDS_NodeFactory::Clear() void SMDS_NodeFactory::SetNbShapes( size_t nbShapes ) { - std::cout << "Set Nb Shapes node" << nbShapes << std::endl; clearVector( myShapeDim ); myShapeDim.resize( nbShapes+1, theDefaultShapeDim ); } @@ -518,8 +513,6 @@ int SMDS_NodeFactory::GetShapeDim( int shapeID ) const void SMDS_NodeFactory::SetShapeDim( int shapeID, int dim ) { - // std::cout << "Set shape dim node" << shapeID << " " << dim << std::endl; - if ( shapeID >= (int)myShapeDim.size() ) myShapeDim.resize( shapeID + 10, theDefaultShapeDim ); myShapeDim[ shapeID ] = dim; @@ -696,8 +689,6 @@ int SMDS_ElementChunk::GetShapeID( const SMDS_MeshElement* e ) const void SMDS_ElementChunk::SetShapeID( const SMDS_MeshElement* e, int shapeID ) const { - // std::cout << "Set shape ID node" << shapeID << std::endl; - //const size_t nbRanges = mySubIDRanges.Size(); SMDS_ElementChunk* me = const_cast( this ); @@ -803,8 +794,6 @@ SMDS_PositionPtr SMDS_ElementChunk::GetPosition( const SMDS_MeshNode* n ) const void SMDS_ElementChunk::SetPosition( const SMDS_MeshNode* n, const SMDS_PositionPtr& pos, int shapeID ) { - // std::cout << "Set node position" << shapeID << std::endl; - int shapeDim = pos ? pos->GetDim() : theDefaultShapeDim; if ( shapeID < 1 ) { diff --git a/src/SMDS/SMDS_MemoryLimit.cxx b/src/SMDS/SMDS_MemoryLimit.cxx index adb58fb13..3df6454de 100644 --- a/src/SMDS/SMDS_MemoryLimit.cxx +++ b/src/SMDS/SMDS_MemoryLimit.cxx @@ -25,7 +25,8 @@ // This is not done inside a function of SALOME because allocated memory is not always // returned to the system. (PAL16631) // -#if !defined WIN32 && !defined __APPLE__ && !defined __EMSCRIPTEN__ +#ifndef __EMSCRIPTEN__ +#if !defined WIN32 && !defined __APPLE__ #include #endif @@ -34,7 +35,7 @@ int main () { // To better understand what is going on here, consult bug [SALOME platform 0019911] -#if !defined WIN32 && !defined __APPLE__ && !defined __EMSCRIPTEN__ +#if !defined WIN32 && !defined __APPLE__ struct sysinfo si; int err = sysinfo( &si ); if ( err ) @@ -66,3 +67,4 @@ int main () return -1; } +#endif diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 930c66831..1475b5951 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -2998,9 +2998,7 @@ void SMDS_Mesh::CompactMesh() { this->myCompactTime = this->myModifTime; - std::cout << "Start has holes" << std::endl; bool idsChange = HasNumerationHoles(); - std::cout << "done holes" << std::endl; if ( idsChange ) { @@ -3008,7 +3006,6 @@ void SMDS_Mesh::CompactMesh() for ( ; holder != myElemHolders.end(); ++holder ) (*holder)->beforeCompacting(); } - std::cout << "OldCellSize" << std::endl; smIdType oldCellSize = myCellFactory->GetMaxID(); @@ -3017,8 +3014,6 @@ void SMDS_Mesh::CompactMesh() myNodeFactory->Compact( idNodesOldToNew ); myCellFactory->Compact( idCellsNewToOld ); - std::cout << "removed holes" << std::endl; - // make VTK IDs correspond to SMDS IDs smIdType newNodeSize = myNodeFactory->NbUsedElements(); smIdType newCellSize = myCellFactory->NbUsedElements(); @@ -3035,8 +3030,6 @@ void SMDS_Mesh::CompactMesh() idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew; } } - std::cout << "Restore elements" << std::endl; - std::set< SMDS_ElementHolder* >::iterator holder = myElemHolders.begin(); for ( ; holder != myElemHolders.end(); ++holder ) @@ -3093,6 +3086,5 @@ bool SMDS_Mesh::HasNumerationHoles() void SMDS_Mesh::setNbShapes( size_t nbShapes ) { - std::cout << "Set nb shapes to " << nbShapes << std::endl; myNodeFactory->SetNbShapes( nbShapes ); } diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt index 460491bad..cb4dbc086 100644 --- a/src/SMESH/CMakeLists.txt +++ b/src/SMESH/CMakeLists.txt @@ -68,11 +68,12 @@ SET(_link_LIBRARIES MeshDriverMED MeshDriverUNV MeshDriverGMF - # ${DriverCGNS_LIB} ${MEDCoupling_medloader} - # Qt5::Core ) +IF (NOT DEFINED EMSCRIPTEN) + LIST(_link_LIBRARIES APPEND ${DriverCGNS_LIB} "Qt5::Core") +ENDIF() # --- headers --- # header files / no moc processing diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 6546b38f3..abeb74508 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -757,14 +757,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, } } - std::cout << "Start compact" << std::endl; if ( aCompactMesh ) { aMesh.GetMeshDS()->Modified(); - std::cout << "Done modified compact" << std::endl; aMesh.GetMeshDS()->CompactMesh(); } - std::cout << "Done compact" << std::endl; return ret; } diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index c3123f2f3..49f83e0c6 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -643,20 +643,14 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape, anError->clear(); SMESH_subMesh *subMesh = GetSubMesh(aSubShape); - if ( !subMesh || !subMesh->GetId()) { - // std::cout << "Could not get submesh" << std::endl; + if ( !subMesh || !subMesh->GetId()) return SMESH_Hypothesis::HYP_BAD_SUBSHAPE; - } SMESH_Hypothesis *anHyp = GetHypothesis( anHypId ); if ( !anHyp ) { - // std::cout << "Could not get submesh" << std::endl; throw SALOME_Exception(LOCALIZED("hypothesis does not exist")); } - // std::cout << "All ok" << std::endl; - - bool isGlobalHyp = IsMainShape( aSubShape ); // NotConformAllowed can be only global diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index b6b8cb4cf..a12ea872d 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -52,7 +52,10 @@ #ifndef WIN32 #include #endif -// #include + +#ifndef __EMSCRIPTEN__ +#include +#endif #ifdef WIN32 #pragma warning(disable:4251) // Warning DLL Interface ... @@ -186,6 +189,7 @@ class SMESH_EXPORT SMESH_Mesh SMESH_Mesh* FindMesh( int meshId ) const; SMESHDS_Mesh * GetMeshDS() { return _meshDS; } + const SMESHDS_Mesh * GetMeshDS() const { return _meshDS; } SMESH_Gen *GetGen() { return _gen; } diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index ab59e7f2e..3a948e618 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -75,7 +75,7 @@ SET(_link_LIBRARIES ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} ${KERNEL_SalomeCatalog} - # ${PYTHON_LIBRARIES} + ${PYTHON_LIBRARIES} ${OpenCASCADE_ApplicationFramework_LIBRARIES} ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} ${GEOM_GEOMClient} @@ -129,7 +129,6 @@ SET(SMESHEngine_SOURCES SMESH_Gen_i_1.cxx SMESH_Gen_No_Session_i.cxx SMESH_Gen_Session_i.cxx - # SMESH_PythonDump.cxx # Emscripten: duplicate symbol SMESH_Mesh_i.cxx SMESH_subMesh_i.cxx SMESH_MeshEditor_i.cxx @@ -151,6 +150,10 @@ SET(SMESHEngine_SOURCES SMESH_ParallelMesh_i.cxx ) +IF (NOT DEFINED EMSCRIPTEN) + LIST(SMESHEngine_SOURCES APPEND SMESH_PythonDump.cxx) # Emscripten: duplicate symbol +ENDIF() + # --- rules --- ADD_LIBRARY(SMESHEngine ${SMESHEngine_SOURCES}) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 2c2bf5a9f..9b3454a20 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -153,9 +153,12 @@ #include #include -// #include -// #include -// #include +#ifndef __EMSCRIPTEN__ +#include +#include +#include +#endif + #include namespace fs = boost::filesystem; @@ -4966,7 +4969,9 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, } // convert orderEntryLists to string std::ostringstream ostream; - // boost::archive::text_oarchive( ostream ) << orderEntryLists; +#ifndef __EMSCRIPTEN__ + boost::archive::text_oarchive( ostream ) << orderEntryLists; +#endif std::string orderEntryString = ostream.str(); // write HDF group @@ -6153,8 +6158,9 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, aDataset->CloseOnDisk(); std::list< std::list< std::string > > orderEntryLists; - // SMESHUtils::BoostTxtArchive( dataString ) >> orderEntryLists; - +#ifndef __EMSCRIPTEN__ + SMESHUtils::BoostTxtArchive( dataString ) >> orderEntryLists; +#endif TListOfListOfInt anOrderIds; for ( const std::list< std::string >& entryList : orderEntryLists ) { diff --git a/src/SMESH_I/SMESH_Homard_i.cxx b/src/SMESH_I/SMESH_Homard_i.cxx index 9a4ac1aab..0f1fb1c0c 100644 --- a/src/SMESH_I/SMESH_Homard_i.cxx +++ b/src/SMESH_I/SMESH_Homard_i.cxx @@ -35,8 +35,8 @@ #include "SALOMEconfig.h" // Have to be included before std headers -// #include -// #include +#include +#include #include #include @@ -1848,23 +1848,23 @@ CORBA::Long HOMARD_Gen_i::ComputeCAO() // C. Lancement des projections MESSAGE (". Lancement des projections"); - // assert(Py_IsInitialized()); - // PyGILState_STATE gstate; - // gstate = PyGILState_Ensure(); - // PyRun_SimpleString("from FrontTrack import FrontTrack"); - // // FrontTrack().track( fic_med_brut, fic_med_new, l_fr, xao_file ) - // std::string pyCommand ("FrontTrack().track( \""); - // pyCommand += theInputMedFile + "\", \"" + theOutputMedFile + "\", ["; - // for (int i = 0; i < icpt; i++) { - // if (i > 0) pyCommand += ", "; - // pyCommand += "\""; - // pyCommand += theInputNodeFiles[i]; - // pyCommand += "\""; - // } - // pyCommand += "], \"" + theXaoFileName + "\", False )"; - // MESSAGE (". Lancement des projections: pyCommand = " << pyCommand); - // PyRun_SimpleString(pyCommand.c_str()); - // PyGILState_Release(gstate); + assert(Py_IsInitialized()); + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); + PyRun_SimpleString("from FrontTrack import FrontTrack"); + // FrontTrack().track( fic_med_brut, fic_med_new, l_fr, xao_file ) + std::string pyCommand ("FrontTrack().track( \""); + pyCommand += theInputMedFile + "\", \"" + theOutputMedFile + "\", ["; + for (int i = 0; i < icpt; i++) { + if (i > 0) pyCommand += ", "; + pyCommand += "\""; + pyCommand += theInputNodeFiles[i]; + pyCommand += "\""; + } + pyCommand += "], \"" + theXaoFileName + "\", False )"; + MESSAGE (". Lancement des projections: pyCommand = " << pyCommand); + PyRun_SimpleString(pyCommand.c_str()); + PyGILState_Release(gstate); // D. Transfert des coordonnées modifiées dans le fichier historique de HOMARD // On lance une exécution spéciale de HOMARD en attendant diff --git a/src/StdMeshers/StdMeshers_BlockRenumber.cxx b/src/StdMeshers/StdMeshers_BlockRenumber.cxx index f0e8fdec5..a732be79b 100644 --- a/src/StdMeshers/StdMeshers_BlockRenumber.cxx +++ b/src/StdMeshers/StdMeshers_BlockRenumber.cxx @@ -34,14 +34,14 @@ #include #include #include -// #include +#include #include #include #include #include -// #include +#include //============================================================================= /*! @@ -280,9 +280,10 @@ void StdMeshers_RenumberHelper::DoReplaceNodes() ostream & StdMeshers_BlockRenumber::SaveTo(ostream & save) { - // boost::archive::text_oarchive archive( save ); - // archive << *this; - +#ifndef __EMSCRIPTEN__ + boost::archive::text_oarchive archive( save ); + archive << *this; +#endif return save; } diff --git a/src/StdMeshers/StdMeshers_BlockRenumber.hxx b/src/StdMeshers/StdMeshers_BlockRenumber.hxx index ae908fe2b..f25c5bf8f 100644 --- a/src/StdMeshers/StdMeshers_BlockRenumber.hxx +++ b/src/StdMeshers/StdMeshers_BlockRenumber.hxx @@ -38,7 +38,7 @@ #include #include -// #include +#include #include class SMESH_Mesh; @@ -114,7 +114,7 @@ public: private: // Persistence: define both input and output at once - // friend class boost::serialization::access; + friend class boost::serialization::access; template void serialize( Archive & ar, const unsigned int /*version*/ ) { ar & _blockCS; diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 337201dad..eb8cc3b09 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -548,7 +548,6 @@ namespace bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) { - std::cout << "Start compute Hexa 3D" << std::endl; // PAL14921. Enable catching std::bad_alloc and Standard_OutOfMemory outside //Unexpect aCatch(SalomeException); SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); diff --git a/src/Tools/padder/meshjob/impl/CMakeLists.txt b/src/Tools/padder/meshjob/impl/CMakeLists.txt index 16f08d490..cb66f9aca 100644 --- a/src/Tools/padder/meshjob/impl/CMakeLists.txt +++ b/src/Tools/padder/meshjob/impl/CMakeLists.txt @@ -34,7 +34,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SMESHDS ${PROJECT_SOURCE_DIR}/src/SMDS ${PROJECT_SOURCE_DIR}/src/SMESHUtils - # ${PROJECT_BINARY_DIR}/src/Tools/padder/meshjob/idl + ${PROJECT_BINARY_DIR}/src/Tools/padder/meshjob/idl ${PROJECT_BINARY_DIR}/idl ) @@ -83,10 +83,10 @@ SET(MeshJobManagerEngine_SOURCES MeshJobManager_i.cxx ) -# SET(SPADDERPluginTesterEngine_SOURCES -# SPADDERPluginTester_i.hxx -# SPADDERPluginTester_i.cxx -# ) +SET(SPADDERPluginTesterEngine_SOURCES + SPADDERPluginTester_i.hxx + SPADDERPluginTester_i.cxx +) # - swiggy pop if (NOT DEFINED EMSCRIPTEN) @@ -112,13 +112,13 @@ SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_BINS} EXTRA_DPYS "${ endif() # --- rules --- -# ADD_LIBRARY(MeshJobManagerEngine ${MeshJobManagerEngine_SOURCES}) -# TARGET_LINK_LIBRARIES(MeshJobManagerEngine ${MeshJobManagerEngine_LIBRARIES} ) -# INSTALL(TARGETS MeshJobManagerEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +ADD_LIBRARY(MeshJobManagerEngine ${MeshJobManagerEngine_SOURCES}) +TARGET_LINK_LIBRARIES(MeshJobManagerEngine ${MeshJobManagerEngine_LIBRARIES} ) +INSTALL(TARGETS MeshJobManagerEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -# ADD_LIBRARY(SPADDERPluginTesterEngine ${SPADDERPluginTesterEngine_SOURCES}) -# TARGET_LINK_LIBRARIES(SPADDERPluginTesterEngine ${SPADDERPluginTesterEngine_LIBRARIES} ) -# INSTALL(TARGETS SPADDERPluginTesterEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +ADD_LIBRARY(SPADDERPluginTesterEngine ${SPADDERPluginTesterEngine_SOURCES}) +TARGET_LINK_LIBRARIES(SPADDERPluginTesterEngine ${SPADDERPluginTesterEngine_LIBRARIES} ) +INSTALL(TARGETS SPADDERPluginTesterEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -# INSTALL(FILES ${MeshJobManagerEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${MeshJobManagerEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})