From e6fdd5e80998eb5b244598dc4b8c20c6389c0b33 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 28 Feb 2013 15:44:06 +0000 Subject: [PATCH] Merge from V6_main 28/02/2013 --- build_cmake | 2 +- build_cmake.bat | 2 +- src/HexoticPlugin/HexoticPlugin_Hexotic.cxx | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build_cmake b/build_cmake index 166d83a..aea1b59 100755 --- a/build_cmake +++ b/build_cmake @@ -21,7 +21,7 @@ CURRENT_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` cd ${CONF_DIR} -python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --hexoticplugin +python $KERNEL_ROOT_DIR/salome_adm/cmake_files/deprecated/am2cmake.py --hexoticplugin status=$? cd ${CURRENT_DIR} exit $status diff --git a/build_cmake.bat b/build_cmake.bat index 5f803d4..aee9960 100644 --- a/build_cmake.bat +++ b/build_cmake.bat @@ -17,4 +17,4 @@ @REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @REM -%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --hexoticplugin +%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\deprecated\am2cmake.py --hexoticplugin diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index c188a48..64bbbbb 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -95,9 +95,7 @@ HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* #ifdef WITH_BLSURFPLUGIN _blsurfHypo = NULL; #endif -#ifdef WITH_SMESH_CANCEL_COMPUTE _compute_canceled = false; -#endif } //============================================================================= @@ -962,11 +960,11 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, if (_iShape == 0 && _nbShape == 0) { _nbShape = countShape( meshDS, TopAbs_SOLID ); // we count the number of shapes - //_tabNode = new SMDS_MeshNode*[_nbShape]; // we declare the size of the node array } // to prevent from displaying error message after computing, // SetIsAlwaysComputed( true ) to empty sub-meshes + vector< SMESH_subMesh* > subMeshesAlwaysComp; for ( int i = 0; i < _nbShape; ++i ) if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( aShape )) { @@ -976,7 +974,10 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, { sm = smIt->next(); if ( !sm->IsMeshComputed() ) + { sm->SetIsAlwaysComputed( true ); + subMeshesAlwaysComp.push_back( sm ); + } } } @@ -984,10 +985,6 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, if (_iShape == _nbShape ) { - // for (int i=0; i<_nbShape; i++) // we destroy the (_nbShape - 1) nodes created and used - // meshDS->RemoveNode( _tabNode[i] ); // to simulate successful mesh computing. - // delete [] _tabNode; - // create bounding box for each shape of the compound int iShape = 0; @@ -1064,7 +1061,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, MESSAGE("HexoticPlugin_Hexotic::Compute"); - system( run_Hexotic.data() ); + int status = system( run_Hexotic.data() ); // -------------- // read a result @@ -1111,10 +1108,16 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& aMesh, if ( std::search( fileBeg, fileEnd, msgLic, msgLic+strlen(msgLic)) != fileEnd ) error("Licence problems."); } + if ( status > 0 && WEXITSTATUS(status) == 127 ) + error("hexotic: command not found"); } cout << "Hexahedra meshing " << hexahedraMessage << std::endl; cout << std::endl; + // restore "always computed" flag of sub-meshes (0022127) + for ( size_t iSM = 0; iSM < subMeshesAlwaysComp.size(); ++iSM ) + subMeshesAlwaysComp[ iSM ]->SetIsAlwaysComputed( false ); + delete [] tabShape; for (int i=0; i<_nbShape; i++) delete [] tabBox[i]; -- 2.39.2