From 9d73526fbc8ecc160281df9046ad4aed0b57e779 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 25 Sep 2017 16:12:08 +0300 Subject: [PATCH 01/12] Clean-up deprecated OCCT-related code --- src/SMESH/SMESH_Algo.cxx | 2 -- src/SMESH/SMESH_MeshEditor.cxx | 2 -- src/SMESH/SMESH_Pattern.cxx | 2 -- src/SMESH/SMESH_subMesh.cxx | 2 -- src/SMESHGUI/SMESHGUI.cxx | 2 -- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 8 ----- src/SMESHGUI/SMESHGUI_Filter.cxx | 14 ++++---- src/SMESHGUI/SMESHGUI_Filter.h | 14 ++++---- src/SMESHUtils/SMESH_TryCatch.hxx | 1 - src/SMESH_I/SMESH_2smeshpy.cxx | 32 ++++++++--------- src/SMESH_I/SMESH_2smeshpy.hxx | 34 +++++++++---------- src/SMESH_I/SMESH_Filter_i.cxx | 13 ------- src/SMESH_I/SMESH_MeshEditor_i.cxx | 16 --------- src/SMESH_I/SMESH_Pattern_i.cxx | 2 -- src/StdMeshers/StdMeshers_Cartesian_3D.cxx | 9 ----- src/StdMeshers/StdMeshers_Distribution.cxx | 15 -------- .../StdMeshers_NumberOfSegments.cxx | 11 ------ src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 2 -- .../StdMeshersGUI_DistrPreview.cxx | 15 -------- 19 files changed, 46 insertions(+), 150 deletions(-) diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 4e4002ee3..968154d1a 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -42,8 +42,6 @@ #include "SMESH_TypeDefs.hxx" #include "SMESH_subMesh.hxx" -#include - #include #include #include diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index cfe4c3e86..83066678d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -46,8 +46,6 @@ #include "SMESH_OctreeNode.hxx" #include "SMESH_subMesh.hxx" -#include - #include "utilities.h" #include "chrono.hxx" diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index db6e60e8c..51564bf78 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -75,8 +75,6 @@ #include #include -#include - #include #include "utilities.h" diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 22fa65b99..2f89997ba 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -38,8 +38,6 @@ #include "SMESH_MesherHelper.hxx" #include "SMESH_subMeshEventListener.hxx" -#include - #include "utilities.h" #include "OpUtil.hxx" #include "Basics_Utils.hxx" diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 527386e74..e92c78093 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2646,9 +2646,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if(checkLock(aStudy)) break; SUIT_OverrideCursor wc; try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif SMESH::UpdateView(); } catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 5a32503a1..2d48bf78a 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1984,9 +1984,7 @@ void SMESHGUI_PrecomputeOp::onPreview() SMESH::long_array_var aShapesId = new SMESH::long_array(); try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif SMESH::MeshPreviewStruct_var previewData = gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId); @@ -2009,9 +2007,7 @@ void SMESHGUI_PrecomputeOp::onPreview() } try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); // check if there are memory problems for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) @@ -2227,9 +2223,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() } SUIT_OverrideCursor aWaitCursor; try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif aRes = gen->Evaluate(myMesh, myMainShape); } catch(const SALOME::SALOME_Exception & S_ex){ @@ -2237,9 +2231,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() } try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); } catch(const SALOME::SALOME_Exception & S_ex){ diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index 05d003387..1222c4b80 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -33,13 +33,13 @@ #include #include -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_Filter, VTKViewer_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter, SMESHGUI_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter, SMESHGUI_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_FacesFilter, SMESHGUI_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter, SMESHGUI_Filter) -OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_Filter, VTKViewer_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_FacesFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter, SMESHGUI_Filter) +IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter) /* Class : SMESHGUI_PredicateFilter diff --git a/src/SMESHGUI/SMESHGUI_Filter.h b/src/SMESHGUI/SMESHGUI_Filter.h index ec36f46d6..08a43c767 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.h +++ b/src/SMESHGUI/SMESHGUI_Filter.h @@ -70,7 +70,7 @@ public: Standard_EXPORT virtual bool IsObjValid( const int ) const = 0; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_Filter,VTKViewer_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_Filter,VTKViewer_Filter) }; /* @@ -99,7 +99,7 @@ private: SMESH::Predicate_var myPred; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter,SMESHGUI_Filter) }; /* @@ -121,7 +121,7 @@ public: Standard_EXPORT virtual bool IsNodeFilter() const; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter,SMESHGUI_Filter) }; /* @@ -143,7 +143,7 @@ public: Standard_EXPORT virtual bool IsNodeFilter() const; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter,SMESHGUI_Filter) }; /* @@ -165,7 +165,7 @@ public: Standard_EXPORT virtual bool IsNodeFilter() const; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_FacesFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_FacesFilter,SMESHGUI_Filter) }; /* @@ -187,7 +187,7 @@ public: Standard_EXPORT virtual bool IsNodeFilter() const; public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter,SMESHGUI_Filter) }; /* @@ -211,7 +211,7 @@ public: Standard_EXPORT static int GetId( SMDSAbs_GeometryType geom ); public: - OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter,SMESHGUI_Filter) + DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter,SMESHGUI_Filter) }; #endif // SMESHGUI_FILTER_H diff --git a/src/SMESHUtils/SMESH_TryCatch.hxx b/src/SMESHUtils/SMESH_TryCatch.hxx index 05d00a1b5..44047a694 100644 --- a/src/SMESHUtils/SMESH_TryCatch.hxx +++ b/src/SMESHUtils/SMESH_TryCatch.hxx @@ -33,7 +33,6 @@ #include #include #include -#include #include // IMPORTANT: include this file _after_ OCC ones, else OCC_CATCH_SIGNALS can be undefined! diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 876365b0c..220e3d581 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -50,22 +50,22 @@ #include #endif -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyObject ,Standard_Transient); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyCommand ,Standard_Transient); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyGen ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyMesh ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySubMesh ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyMeshEditor ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesis ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySelfEraser ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyGroup ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyFilter ,_pyObject); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyAlgorithm ,_pyHypothesis); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis); -OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pyObject ,Standard_Transient); +IMPLEMENT_STANDARD_RTTIEXT(_pyCommand ,Standard_Transient); +IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient); +IMPLEMENT_STANDARD_RTTIEXT(_pyGen ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyMesh ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pySubMesh ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyMeshEditor ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesis ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pySelfEraser ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyGroup ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyFilter ,_pyObject); +IMPLEMENT_STANDARD_RTTIEXT(_pyAlgorithm ,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis); using namespace std; using SMESH::TPythonDump; diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index 6fd991533..4531a38ed 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -40,8 +40,6 @@ #include #include -#include - #include #include CORBA_CLIENT_HEADER(SALOMEDS) @@ -160,7 +158,7 @@ public: bool AddAccessorMethod( _pyID theObjectID, const char* theAcsMethod ); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyCommand,Standard_Transient) + DEFINE_STANDARD_RTTIEXT(_pyCommand,Standard_Transient) }; // ------------------------------------------------------------------------------------- @@ -200,7 +198,7 @@ public: virtual void ClearCommands(); virtual void Free() {} - OCCT_DEFINE_STANDARD_RTTIEXT(_pyObject,Standard_Transient) + DEFINE_STANDARD_RTTIEXT(_pyObject,Standard_Transient) }; // ------------------------------------------------------------------------------------- @@ -331,7 +329,7 @@ private: std::map< _AString, ExportedMeshData > myFile2ExportedMesh; Handle( _pyHypothesisReader ) myHypReader; - OCCT_DEFINE_STANDARD_RTTIEXT(_pyGen,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyGen,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -372,7 +370,7 @@ private: static void AddMeshAccess( const Handle(_pyCommand)& theCommand ) { theCommand->SetObject( theCommand->GetObject() + "." _pyMesh_ACCESS_METHOD ); } - OCCT_DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject) }; #undef _pyMesh_ACCESS_METHOD @@ -392,7 +390,7 @@ public: virtual void Flush() {} virtual bool CanClear(); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -476,7 +474,7 @@ public: //void ComputeSaved ( const Handle(_pyCommand)& theComputeCommand ); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyHypothesis,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyHypothesis,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -493,7 +491,7 @@ public: virtual const char* AccessorMethod() const { return "GetAlgorithm()"; } virtual bool IsWrappable(const _pyID& theMesh) { return !myIsWrapped; } - OCCT_DEFINE_STANDARD_RTTIEXT(_pyAlgorithm,_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pyAlgorithm,_pyHypothesis) }; // ------------------------------------------------------------------------------------- @@ -508,7 +506,7 @@ public: virtual void Process( const Handle(_pyCommand)& theCommand); virtual void Flush(); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis) }; DEFINE_STANDARD_HANDLE (_pyComplexParamHypo, _pyHypothesis); @@ -530,7 +528,7 @@ public: const _pyID& theMesh); virtual void Free() { my1dHyp.Nullify(); } - OCCT_DEFINE_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis) }; DEFINE_STANDARD_HANDLE (_pyLayerDistributionHypo, _pyHypothesis); @@ -547,7 +545,7 @@ public: const _pyID& theMesh); void Flush(); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis) }; DEFINE_STANDARD_HANDLE (_pyNumberOfSegmentsHyp, _pyHypothesis); @@ -562,7 +560,7 @@ public: _pySegmentLengthAroundVertexHyp(const Handle(_pyCommand)& theCrCmd): _pyHypothesis(theCrCmd) {} virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, const _pyID& theMesh); - OCCT_DEFINE_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis) }; DEFINE_STANDARD_HANDLE (_pySegmentLengthAroundVertexHyp, _pyHypothesis); @@ -581,7 +579,7 @@ public: virtual bool CanClear(); static bool IsAliveCmd( const Handle(_pyCommand)& theCmd ); - OCCT_DEFINE_STANDARD_RTTIEXT(_pySelfEraser,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pySelfEraser,_pyObject) }; DEFINE_STANDARD_HANDLE (_pySelfEraser, _pyObject); @@ -603,7 +601,7 @@ public: void SetCreator( const Handle(_pyObject)& theCreator ) { myCreator = theCreator; } static bool CanBeArgOfMethod(const _AString& theMethodName); - OCCT_DEFINE_STANDARD_RTTIEXT(_pySubMesh,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pySubMesh,_pyObject) }; // ------------------------------------------------------------------------------------- /*! @@ -623,7 +621,7 @@ public: //virtual void Free() { myUsers.clear(); } const _pyID& GetNewID() const { return myNewID; } - OCCT_DEFINE_STANDARD_RTTIEXT(_pyFilter,_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyFilter,_pyObject) }; DEFINE_STANDARD_HANDLE (_pyFilter, _pyObject); @@ -644,7 +642,7 @@ public: virtual bool CanClear(); void RemovedWithContents(); - OCCT_DEFINE_STANDARD_RTTIEXT(_pyGroup,_pySubMesh) + DEFINE_STANDARD_RTTIEXT(_pyGroup,_pySubMesh) }; // ------------------------------------------------------------------------------------- @@ -659,7 +657,7 @@ public: _pyHypothesisReader(); Handle(_pyHypothesis) GetHypothesis(const _AString& hypType, const Handle(_pyCommand)& creationCmd) const; - OCCT_DEFINE_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient) + DEFINE_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient) }; #endif diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 9432b9117..95c338377 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -40,8 +40,6 @@ #include #include -#include - #include #include #include @@ -3941,16 +3939,6 @@ CORBA::Boolean FilterLibrary_i::Save() if ( myFileName == 0 || strlen( myFileName ) == 0 ) return false; -#if OCC_VERSION_MAJOR < 7 - FILE* aOutFile = fopen( myFileName, "wt" ); - if ( !aOutFile ) - return false; - - LDOM_XmlWriter aWriter( aOutFile ); - aWriter.SetIndentation( 2 ); - aWriter << myDoc; - fclose( aOutFile ); -#else std::filebuf fb; fb.open( myFileName, std::ios::out ); @@ -3960,7 +3948,6 @@ CORBA::Boolean FilterLibrary_i::Save() aWriter.SetIndentation( 2 ); aWriter.Write( os, myDoc ); fb.close(); -#endif TPythonDump()< #include #include -#include #include #include @@ -76,15 +75,8 @@ #include #include -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 -#define NO_CAS_CATCH -#endif - #include - -#ifdef NO_CAS_CATCH #include -#endif #include #include @@ -3890,7 +3882,6 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject, }; gp_Trsf aTrsf; -#if OCC_VERSION_LARGE > 0x06070100 // fight against orthogonalization // aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]), // 0, S[1], 0, thePoint.y * (1-S[1]), @@ -3903,13 +3894,6 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject, thePoint.z * (1-S[2])); M.SetDiagonal( S[0], S[1], S[2] ); -#else - double tol = std::numeric_limits::max(); - aTrsf.SetValues( S[0], 0, 0, thePoint.x * (1-S[0]), - 0, S[1], 0, thePoint.y * (1-S[1]), - 0, 0, S[2], thePoint.z * (1-S[2]), tol, tol); -#endif - TIDSortedElemSet copyElements; TIDSortedElemSet* workElements = &elements; if ( myIsPreviewMode ) diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index ca5bcd0d2..70dab5de7 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -295,9 +295,7 @@ SMESH::point_array* } bool ok = false; try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; -#endif ok = myPattern.Apply( aMesh, fset, theNodeIndexOnKeyPoint1, theReverse ); } catch (Standard_Failure& exc) { diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 0b92acc5f..002f20961 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -36,7 +36,6 @@ #include #include -#include #include @@ -1371,11 +1370,7 @@ namespace } if ( surf->IsKind( STANDARD_TYPE(Geom_BSplineSurface )) || surf->IsKind( STANDARD_TYPE(Geom_BezierSurface ))) -#if OCC_VERSION_MAJOR < 7 - if ( !noSafeTShapes.insert((const Standard_Transient*) _face.TShape() ).second ) -#else if ( !noSafeTShapes.insert( _face.TShape().get() ).second ) -#endif isSafe = false; double f, l; @@ -1415,11 +1410,7 @@ namespace edgeIsSafe = false; } } -#if OCC_VERSION_MAJOR < 7 - if ( !edgeIsSafe && !noSafeTShapes.insert((const Standard_Transient*) e.TShape() ).second ) -#else if ( !edgeIsSafe && !noSafeTShapes.insert( e.TShape().get() ).second ) -#endif isSafe = false; } return isSafe; diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index f1f26aebf..7fb3956ad 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -31,16 +31,9 @@ #include #include -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 -#define NO_CAS_CATCH -#endif - #include #include - -#ifdef NO_CAS_CATCH #include -#endif using namespace std; @@ -60,9 +53,7 @@ bool Function::value( const double, double& f ) const bool ok = true; if (myConv == 0) { try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif f = pow( 10., f ); } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -192,9 +183,7 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) { bool ok = true; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); } catch(Standard_Failure) { @@ -228,9 +217,7 @@ bool FunctionExpr::value( const double t, double& f ) const ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t; bool ok = true; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif f = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -246,9 +233,7 @@ double FunctionExpr::integral( const double a, const double b ) const { double res = 0.0; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif math_GaussSingleIntegration _int ( *static_cast( const_cast (this) ), a, b, 20 ); if( _int.IsDone() ) diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 2ff7274fc..927e96d02 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -42,15 +42,8 @@ #include #include -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 -#define NO_CAS_CATCH -#endif - #include - -#ifdef NO_CAS_CATCH #include -#endif #include @@ -238,9 +231,7 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) if( _convMode==0 ) { try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif val = pow( 10.0, val ); } catch(Standard_Failure) { @@ -335,9 +326,7 @@ bool process( const TCollection_AsciiString& str, int convMode, bool parsed_ok = true; Handle( ExprIntrp_GenExp ) myExpr; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); } catch(Standard_Failure) { diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx index bbf339a8b..23962cba2 100644 --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx @@ -29,8 +29,6 @@ #include "StdMeshers_RadialPrism_3D.hxx" -#include - #include "StdMeshers_ProjectionUtils.hxx" #include "StdMeshers_NumberOfLayers.hxx" #include "StdMeshers_LayerDistribution.hxx" diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index 7eb2f3348..7761be258 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -37,15 +37,8 @@ #include #include -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 -#define NO_CAS_CATCH -#endif - #include - -#ifdef NO_CAS_CATCH #include -#endif #ifdef WIN32 # include @@ -356,9 +349,7 @@ void StdMeshersGUI_DistrPreview::update() x = y = 0; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif replot(); } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -404,9 +395,7 @@ bool StdMeshersGUI_DistrPreview::init( const QString& str ) Kernel_Utils::Localizer loc; bool parsed_ok = true; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.toLatin1().data() ); } catch(Standard_Failure) { @@ -446,9 +435,7 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) ok = true; try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif res = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -472,9 +459,7 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const case EXPONENT: { try { -#ifdef NO_CAS_CATCH OCC_CATCH_SIGNALS; -#endif // in StdMeshers_NumberOfSegments.cc // const double PRECISION = 1e-7; // From 51760fb76f57da9ab446585e6f87b101679c58cb Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 25 Sep 2017 18:23:37 +0200 Subject: [PATCH 02/12] choice of MED format, minor version, for backward compatibility --- idl/SMESH_Mesh.idl | 23 +++- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 33 ++++- src/MEDWrapper/Base/MED_Common.hxx | 6 +- src/MEDWrapper/Factory/MED_Factory.cxx | 46 +++---- src/MEDWrapper/Factory/MED_Factory.hxx | 3 +- src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx | 133 +++++++++++---------- src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx | 3 +- src/SMESH/SMESH_Mesh.cxx | 1 + src/SMESHGUI/SMESHGUI.cxx | 15 ++- src/SMESH_I/SMESH_DumpPython.cxx | 11 ++ src/SMESH_I/SMESH_Gen_i.cxx | 15 ++- src/SMESH_I/SMESH_Mesh_i.cxx | 5 +- src/SMESH_SWIG/smeshBuilder.py | 26 ++-- 13 files changed, 209 insertions(+), 111 deletions(-) diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index f3feeaea3..74619a175 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -238,11 +238,28 @@ module SMESH /*! * Enumeration for ExportToMED*() + * MED_V2_1 and MED_V2_2 are here for compatibility and mean respectively obsolete and MED_LATEST. + * MED_MINOR_0 to MED_MINOR_9 are use to specify the minor version used by MEDfichier + * to write MED files (major version cannot be changed). + * This allows backward compatibility from a newer version of SALOME to an older one: + * for instance, a MESH produced in SALOME 8.4 (med 3.3) can be written in med 3.2 format + * to be read in SALOME 8.3. */ enum MED_VERSION { MED_V2_1, - MED_V2_2 + MED_V2_2, + MED_LATEST, + MED_MINOR_0, + MED_MINOR_1, + MED_MINOR_2, + MED_MINOR_3, + MED_MINOR_4, + MED_MINOR_5, + MED_MINOR_6, + MED_MINOR_7, + MED_MINOR_8, + MED_MINOR_9 }; /*! @@ -686,8 +703,8 @@ module SMESH raises (SALOME::SALOME_Exception); /*! - * Export Mesh to MED_V2_1 MED format - * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1 + * Export Mesh to MED_LATEST MED format + * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_LATEST * and overwrite parameter equal to true * The method is kept in order to support old functionality */ diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index b4f49a216..82722c15f 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -70,6 +70,7 @@ void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, { Driver_SMESHDS_Mesh::SetFile(theFileName); myMedVersion = theId; + //MESSAGE("myMedVersion:"<(majeur, mineur, release); -// else - MED::GetVersionRelease(majeur, mineur, release); + MED::GetVersionRelease(majeur, mineur, release); + TInt imposedMineur = mineur; + switch( theVersion ) { + case MED::eV2_1 : + case MED::eV2_2 : + case MED::eLATEST : break; + case MED::eMINOR_0 : imposedMineur = 0; break; + case MED::eMINOR_1 : imposedMineur = 1; break; + case MED::eMINOR_2 : imposedMineur = 2; break; + case MED::eMINOR_3 : imposedMineur = 3; break; + case MED::eMINOR_4 : imposedMineur = 4; break; + case MED::eMINOR_5 : imposedMineur = 5; break; + case MED::eMINOR_6 : imposedMineur = 6; break; + case MED::eMINOR_7 : imposedMineur = 7; break; + case MED::eMINOR_8 : imposedMineur = 8; break; + case MED::eMINOR_9 : imposedMineur = 9; break; + case MED::eVUnknown : imposedMineur = mineur; break; + } + if (imposedMineur > mineur) + imposedMineur = mineur; ostringstream name; if ( theNbDigits > 0 ) name << majeur; if ( theNbDigits > 1 ) - name << "." << mineur; + name << "." << imposedMineur; if ( theNbDigits > 2 ) name << "." << release; return name.str(); @@ -456,7 +477,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() break; } } - + //MESSAGE("myMedVersion:"<CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName); //MESSAGE("Add - aMeshName : "<GetName()); diff --git a/src/MEDWrapper/Base/MED_Common.hxx b/src/MEDWrapper/Base/MED_Common.hxx index 8030d84bd..00eb32bdf 100644 --- a/src/MEDWrapper/Base/MED_Common.hxx +++ b/src/MEDWrapper/Base/MED_Common.hxx @@ -44,8 +44,10 @@ #endif namespace MED{ - - enum EVersion {eVUnknown = -1, eV2_1, eV2_2}; + // enum EVersion sould be synchronized with enum MED_VERSION in SMESH_Mesh.idl (.hh) + // i.e. same positive values! + enum EVersion {eVUnknown = -1, eV2_1, eV2_2, eLATEST, + eMINOR_0, eMINOR_1, eMINOR_2, eMINOR_3, eMINOR_4, eMINOR_5, eMINOR_6, eMINOR_7, eMINOR_8, eMINOR_9}; typedef enum {eFAUX, eVRAI} EBooleen ; typedef double TFloat; diff --git a/src/MEDWrapper/Factory/MED_Factory.cxx b/src/MEDWrapper/Factory/MED_Factory.cxx index 49d47fad5..6c1d9909b 100644 --- a/src/MEDWrapper/Factory/MED_Factory.cxx +++ b/src/MEDWrapper/Factory/MED_Factory.cxx @@ -23,7 +23,6 @@ #include "MED_Factory.hxx" #include "MED_Utilities.hxx" #include "MED_V2_2_Wrapper.hxx" - #include #include #include @@ -90,6 +89,7 @@ namespace MED if(aMajor == 2 && aMinor == 1) aVersion = eV2_1; else + // TODO: check major is not superior to library and switch on minor aVersion = eV2_2; } else { @@ -124,20 +124,19 @@ namespace MED } PWrapper CrWrapper(const std::string& theFileName, - bool theDoPreCheckInSeparateProcess) + bool theDoPreCheckInSeparateProcess, + int theMinor) { PWrapper aWrapper; + if (theMinor <0) + theMinor = MED_MINOR_NUM; EVersion aVersion = GetVersionId(theFileName,theDoPreCheckInSeparateProcess); switch(aVersion){ - case eV2_2: - aWrapper.reset(new MED::V2_2::TVWrapper(theFileName)); - break; case eV2_1: EXCEPTION(std::runtime_error,"Cannot open file '"< #include +#include #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -99,11 +100,14 @@ namespace MED TFile(const TFile&); public: - TFile(const std::string& theFileName): + TFile(const std::string& theFileName, TInt theMinor=-1): myCount(0), myFid(0), - myFileName(theFileName) - {} + myFileName(theFileName), + myMinor(theMinor) + { + if ((myMinor < 0) || (myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM; + } ~TFile() { @@ -115,12 +119,12 @@ namespace MED { if(myCount++ == 0){ const char* aFileName = myFileName.c_str(); - myFid = MEDfileOpen(aFileName,med_access_mode(theMode)); + myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), MED_MAJOR_NUM, myMinor, MED_RELEASE_NUM); } if(theErr) *theErr = TErr(myFid); else if(myFid < 0) - EXCEPTION(std::runtime_error,"TFile - MEDfileOpen('"<Open(theMode,theErr); } @@ -163,15 +171,12 @@ namespace MED //--------------------------------------------------------------- - TVWrapper::TVWrapper(const std::string& theFileName): - myFile(new TFile(theFileName)) + TVWrapper::TVWrapper(const std::string& theFileName, TInt theMinor): + myMinor(theMinor), + myFile(new TFile(theFileName, theMinor)) { TErr aRet; myFile->Open( eLECTURE_ECRITURE, &aRet ); - // if(aRet < 0) - // myFile->Close(); - // myFile->Open( eLECTURE_AJOUT, &aRet ); - // } if(aRet < 0) { myFile->Close(); myFile->Open( eLECTURE, &aRet ); @@ -188,7 +193,7 @@ namespace MED TVWrapper ::GetNbMeshes(TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -204,7 +209,7 @@ namespace MED MED::TMeshInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -247,7 +252,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -316,7 +321,7 @@ namespace MED ::GetNbFamilies(const MED::TMeshInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -334,7 +339,7 @@ namespace MED const MED::TMeshInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -354,7 +359,7 @@ namespace MED const MED::TMeshInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -374,7 +379,7 @@ namespace MED MED::TFamilyInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -417,7 +422,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -476,7 +481,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -514,7 +519,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -552,7 +557,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -613,7 +618,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -669,7 +674,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -723,7 +728,7 @@ namespace MED EGeometrieElement theGeom, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -761,7 +766,7 @@ namespace MED ETable theTable, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -790,7 +795,7 @@ namespace MED ::GetNodeInfo(MED::TNodeInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -867,7 +872,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -953,7 +958,7 @@ namespace MED ::GetPolygoneInfo(MED::TPolygoneInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1012,7 +1017,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1071,7 +1076,7 @@ namespace MED EConnectivite theConnMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return 0; @@ -1105,7 +1110,7 @@ namespace MED ::GetPolyedreInfo(TPolyedreInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1168,7 +1173,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1272,7 +1277,7 @@ namespace MED EConnectivite theConnMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) EXCEPTION(std::runtime_error,"GetPolyedreConnSize - (...)"); @@ -1321,7 +1326,7 @@ namespace MED { TEntityInfo anInfo; - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return anInfo; @@ -1431,7 +1436,7 @@ namespace MED EConnectivite theConnMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -1478,7 +1483,7 @@ namespace MED //---------------------------------------------------------------------------- void TVWrapper::GetCellInfo(MED::TCellInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1537,7 +1542,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1618,7 +1623,8 @@ namespace MED //! Read geom type of MED_BALL structural element EGeometrieElement TVWrapper::GetBallGeom(const TMeshInfo& theMeshInfo) { - TFileWrapper aFileWrapper(myFile,eLECTURE); + TErr anError; + TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor); // read med_geometry_type of "MED_BALL" element char geotypename[ MED_NAME_SIZE + 1] = MED_BALL_NAME; @@ -1629,7 +1635,8 @@ namespace MED //! Read number of balls in the Mesh TInt TVWrapper::GetNbBalls(const TMeshInfo& theMeshInfo) { - TFileWrapper aFileWrapper(myFile,eLECTURE); + TErr anError; + TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor); EGeometrieElement ballType = GetBallGeom( theMeshInfo ); if ( ballType < 0 ) @@ -1642,7 +1649,7 @@ namespace MED //! Read a MEDWrapped representation of MED_BALL from the MED file void TVWrapper::GetBallInfo(TBallInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); // check geometry of MED_BALL if ( theInfo.myGeom == eBALL ) @@ -1681,7 +1688,7 @@ namespace MED //! Write a MEDWrapped representation of MED_BALL to the MED file void TVWrapper::SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); TErr ret; char ballsupportname[MED_NAME_SIZE+1]="BALL_SUPPORT_MESH"; @@ -1769,7 +1776,7 @@ namespace MED TVWrapper ::GetNbFields(TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -1784,7 +1791,7 @@ namespace MED ::GetNbComp(TInt theFieldId, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -1800,7 +1807,7 @@ namespace MED MED::TFieldInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1850,7 +1857,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1902,7 +1909,7 @@ namespace MED TVWrapper ::GetNbGauss(TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -1917,7 +1924,7 @@ namespace MED ::GetGaussPreInfo(TInt theId, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 ); @@ -1958,7 +1965,7 @@ namespace MED TGaussInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -1989,7 +1996,7 @@ namespace MED TVWrapper ::GetNbProfiles(TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return -1; @@ -2002,7 +2009,7 @@ namespace MED ::GetProfilePreInfo(TInt theId, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return TProfileInfo::TInfo(); @@ -2029,7 +2036,7 @@ namespace MED TProfileInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2054,7 +2061,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2102,7 +2109,7 @@ namespace MED TErr* theErr) { theEntity = EEntiteMaillage(-1); - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr){ if(theEntityInfo.empty()) @@ -2225,7 +2232,7 @@ namespace MED MED::TTimeStampInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); const TGeom2Size& aGeom2Size = theInfo.myGeom2Size; @@ -2320,7 +2327,7 @@ namespace MED const TKey2Gauss& theKey2Gauss, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2488,7 +2495,7 @@ namespace MED EModeAcces theMode, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2598,7 +2605,7 @@ namespace MED { if(theInfo.myMeshInfo->myType != eSTRUCTURE) return; - TFileWrapper aFileWrapper(myFile,theMode,theErr); + TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2675,7 +2682,7 @@ namespace MED ::GetGrilleInfo(TGrilleInfo& theInfo, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; @@ -2831,7 +2838,7 @@ namespace MED EGrilleType& theGridType, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) EXCEPTION(std::runtime_error," GetGrilleType - aFileWrapper (...)"); @@ -2856,7 +2863,7 @@ namespace MED TIntVector& theStruct, TErr* theErr) { - TFileWrapper aFileWrapper(myFile,eLECTURE,theErr); + TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor); if(theErr && *theErr < 0) return; diff --git a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx index a06e1c15c..45f9a14a5 100644 --- a/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx +++ b/src/MEDWrapper/V2_2/MED_V2_2_Wrapper.hxx @@ -91,7 +91,7 @@ namespace MED TVWrapper& operator=(const TVWrapper&); public: - TVWrapper(const std::string& theFileName); + TVWrapper(const std::string& theFileName, TInt theMinor=-1); //---------------------------------------------------------------------------- virtual @@ -482,6 +482,7 @@ namespace MED protected: PFile myFile; + TInt myMinor; }; } } diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 76987e5b1..7de8ef36f 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1402,6 +1402,7 @@ void SMESH_Mesh::ExportMED(const char * file, bool theAllElemsToGroup) throw(SALOME_Exception) { + //MESSAGE("MED_VERSION:"<< theVersion); SMESH_TRY; DriverMED_W_SMESHDS_Mesh myWriter; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index e92c78093..b584a345d 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -143,6 +143,7 @@ #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #include CORBA_CLIENT_HEADER(SMESH_MeshEditor) #include CORBA_CLIENT_HEADER(SMESH_Measurements) +#include CORBA_CLIENT_HEADER(SMESH_Mesh) // Qt includes // #define INCLUDE_MENUITEM_DEF // VSR commented ???????? @@ -653,7 +654,7 @@ namespace // Get parameters of export operation QString aFilename; - SMESH::MED_VERSION aFormat = SMESH::MED_V2_2; + SMESH::MED_VERSION aFormat = SMESH::MED_LATEST; // Init the parameters with the default values bool aIsASCII_STL = true; bool toCreateGroups = false; @@ -741,11 +742,17 @@ namespace else if ( isMED || isSAUV ) // Export to MED or SAUV { QMap aFilterMap; - //QString v21 (aMesh->GetVersionString(SMESH::MED_V2_1, 2)); if ( isMED ) { QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2)); - //aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v21 ) + " (*.med)", SMESH::MED_V2_1 ); aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v22 ) + " (*.med)", SMESH::MED_V2_2 ); + int minor = v22.split(".").last().toInt(); + int vv= int(SMESH::MED_MINOR_0); // add all minor from 0 to current + for (int ii=0; iiGetVersionString(SMESH::MED_VERSION(vv), 2); + aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", SMESH::MED_VERSION(vv)); + vv = vv +1; + } } else { // isSAUV aFilterMap.insert("All files (*)", SMESH::MED_V2_1 ); @@ -826,7 +833,7 @@ namespace } if( !toOverwrite ) { // can't append to an existing using other format - SMESH::MED_VERSION aVersion = SMESH::MED_V2_1; + SMESH::MED_VERSION aVersion = aFormat; //SMESH::MED_V2_1; bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toUtf8().constData(), aVersion ); if( !isVersionOk || aVersion != aFormat ) { int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(), diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index 6298cb099..19c46da07 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -495,6 +495,17 @@ namespace SMESH switch (theVersion) { case SMESH::MED_V2_1: myStream << "SMESH.MED_V2_1"; break; case SMESH::MED_V2_2: myStream << "SMESH.MED_V2_2"; break; + case SMESH::MED_LATEST: myStream << "SMESH.MED_LATEST"; break; + case SMESH::MED_MINOR_0: myStream << "SMESH.MED_MINOR_0"; break; + case SMESH::MED_MINOR_1: myStream << "SMESH.MED_MINOR_1"; break; + case SMESH::MED_MINOR_2: myStream << "SMESH.MED_MINOR_2"; break; + case SMESH::MED_MINOR_3: myStream << "SMESH.MED_MINOR_3"; break; + case SMESH::MED_MINOR_4: myStream << "SMESH.MED_MINOR_4"; break; + case SMESH::MED_MINOR_5: myStream << "SMESH.MED_MINOR_5"; break; + case SMESH::MED_MINOR_6: myStream << "SMESH.MED_MINOR_6"; break; + case SMESH::MED_MINOR_7: myStream << "SMESH.MED_MINOR_7"; break; + case SMESH::MED_MINOR_8: myStream << "SMESH.MED_MINOR_8"; break; + case SMESH::MED_MINOR_9: myStream << "SMESH.MED_MINOR_9"; break; default: myStream << theVersion; } return *this; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 916a1f222..ec2a92572 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2968,8 +2968,19 @@ CORBA::Boolean SMESH_Gen_i::GetMEDVersion(const char* theFileName, theVersion = SMESH::MED_V2_1; MED::EVersion aVersion = MED::GetVersionId( theFileName ); switch( aVersion ) { - case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true; - case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true; + case MED::eV2_1 : theVersion = SMESH::MED_V2_1; return true; + case MED::eV2_2 : theVersion = SMESH::MED_V2_2; return true; + case MED::eLATEST : theVersion = SMESH::MED_LATEST; return true; + case MED::eMINOR_0 : theVersion = SMESH::MED_MINOR_0; return true; + case MED::eMINOR_1 : theVersion = SMESH::MED_MINOR_1; return true; + case MED::eMINOR_2 : theVersion = SMESH::MED_MINOR_2; return true; + case MED::eMINOR_3 : theVersion = SMESH::MED_MINOR_3; return true; + case MED::eMINOR_4 : theVersion = SMESH::MED_MINOR_4; return true; + case MED::eMINOR_5 : theVersion = SMESH::MED_MINOR_5; return true; + case MED::eMINOR_6 : theVersion = SMESH::MED_MINOR_6; return true; + case MED::eMINOR_7 : theVersion = SMESH::MED_MINOR_7; return true; + case MED::eMINOR_8 : theVersion = SMESH::MED_MINOR_8; return true; + case MED::eMINOR_9 : theVersion = SMESH::MED_MINOR_9; return true; case MED::eVUnknown : return false; } return false; diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 163446233..c4393b108 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -3022,6 +3022,7 @@ void SMESH_Mesh_i::ExportToMEDX (const char* file, CORBA::Boolean autoDimension) throw(SALOME::SALOME_Exception) { + //MESSAGE("SMESH::MED_VERSION:"<< theVersion); SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -3048,6 +3049,7 @@ void SMESH_Mesh_i::ExportToMED (const char* file, SMESH::MED_VERSION theVersion) throw(SALOME::SALOME_Exception) { + //MESSAGE("SMESH::MED_VERSION:"<< theVersion); ExportToMEDX(file,auto_groups,theVersion,true); } @@ -3061,7 +3063,8 @@ void SMESH_Mesh_i::ExportMED (const char* file, CORBA::Boolean auto_groups) throw(SALOME::SALOME_Exception) { - ExportToMEDX(file,auto_groups,SMESH::MED_V2_2,true); + //MESSAGE("SMESH::MED_VERSION:"<< SMESH::MED_LATEST); + ExportToMEDX(file,auto_groups,SMESH::MED_LATEST,true); } //================================================================================ diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 11ba7dcf7..f2bbcaccc 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1793,9 +1793,14 @@ class Mesh: # @param auto_groups boolean parameter for creating/not creating # the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; # the typical use is auto_groups=False. - # @param version MED format version (MED_V2_1 or MED_V2_2, - # the latter meaning any current version). The parameter is - # obsolete since MED_V2_1 is no longer supported. + # @param version MED format version + # - MED_V2_1 is obsolete. + # - MED_V2_2 means current version (kept for compatibility reasons) + # - MED_LATEST means current version. + # - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED + # to use for writing MED files, for backward compatibility : + # for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3, + # to allow the file to be read with SALOME 8.3. # @param overwrite boolean parameter for overwriting/not overwriting the file # @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh # @param autoDimension if @c True (default), a space dimension of a MED mesh can be either @@ -1811,7 +1816,7 @@ class Mesh: # - 'f' stands for "_faces _" field; # - 's' stands for "_solids _" field. # @ingroup l2_impexp - def ExportMED(self, f, auto_groups=0, version=MED_V2_2, + def ExportMED(self, f, auto_groups=0, version=MED_LATEST, overwrite=1, meshPart=None, autoDimension=True, fields=[], geomAssocFields=''): if meshPart or fields or geomAssocFields: unRegister = genObjUnRegister() @@ -1915,9 +1920,14 @@ class Mesh: # Export the mesh in a file in MED format # allowing to overwrite the file if it exists or add the exported data to its contents # @param f the file name - # @param version MED format version (MED_V2_1 or MED_V2_2, - # the latter meaning any current version). The parameter is - # obsolete since MED_V2_1 is no longer supported. + # @param version MED format version: + # - MED_V2_1 is obsolete. + # - MED_V2_2 means current version (kept for compatibility reasons) + # - MED_LATEST means current version. + # - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED + # to use for writing MED files, for backward compatibility : + # for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3, + # to allow the file to be read with SALOME 8.3. # @param opt boolean parameter for creating/not creating # the groups Group_On_All_Nodes, Group_On_All_Faces, ... # @param overwrite boolean parameter for overwriting/not overwriting the file @@ -1927,7 +1937,7 @@ class Mesh: # - 3D in the rest cases.
# If @a autoDimension is @c False, the space dimension is always 3. # @ingroup l2_impexp - def ExportToMED(self, f, version=MED_V2_2, opt=0, overwrite=1, autoDimension=True): + def ExportToMED(self, f, version=MED_LATEST, opt=0, overwrite=1, autoDimension=True): self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension) # Operations with groups: From 7e498745c6ac2023df7fb0acc530d9e0aa388237 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 3 Oct 2017 11:19:09 +0300 Subject: [PATCH 03/12] Increment version: 8.4.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3e766d8d..b0edc0bad 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,11 +31,11 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 4) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +SET(${PROJECT_NAME_UC}_VERSION_DEV 0) # Common CMake macros # =================== From ce117a786167a4eee00ec74b48de2bc6de17e100 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 4 Oct 2017 15:33:47 +0300 Subject: [PATCH 04/12] 23487: EDF 15571 - Mesh with quadratic algo 1D Update medium nodes after smoothing --- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 362 +++++++++++--------- 1 file changed, 194 insertions(+), 168 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index dca977adc..994089cfe 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -64,17 +64,15 @@ #include "utilities.h" #include "Utils_ExceptHandlers.hxx" -#ifndef StdMeshers_Array2OfNode_HeaderFile -#define StdMeshers_Array2OfNode_HeaderFile -typedef const SMDS_MeshNode* SMDS_MeshNodePtr; -typedef NCollection_Array2 StdMeshers_Array2OfNode; -#endif +#include -using namespace std; +typedef NCollection_Array2 StdMeshers_Array2OfNode; typedef gp_XY gp_UV; typedef SMESH_Comment TComm; +using namespace std; + //============================================================================= /*! * @@ -1010,14 +1008,14 @@ bool StdMeshers_Quadrangle_2D::IsApplicable( const TopoDS_Shape & aShape, bool t continue; } - int nbNoDegenEdges = 0; + int nbNoDegenEdges = 0, totalNbEdges = 0; TopExp_Explorer eExp( aFace, TopAbs_EDGE ); - for ( ; eExp.More() && nbNoDegenEdges < 3; eExp.Next() ) { + for ( ; eExp.More() && nbNoDegenEdges < 3; eExp.Next(), ++totalNbEdges ) { if ( !SMESH_Algo::isDegenerated( TopoDS::Edge( eExp.Current() ))) ++nbNoDegenEdges; } - if ( toCheckAll && nbNoDegenEdges < 3 ) return false; - if ( !toCheckAll && nbNoDegenEdges >= 3 ) return true; + if ( toCheckAll && ( totalNbEdges < 4 && nbNoDegenEdges < 3 )) return false; + if ( !toCheckAll && ( totalNbEdges >= 4 || nbNoDegenEdges >= 3 )) return true; } return ( toCheckAll && nbFoundFaces != 0 ); } @@ -1139,7 +1137,7 @@ FaceQuadStruct::Ptr StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & } } } - else + else //if ( !myHelper || !myHelper->IsRealSeam( edge )) { sideEdges.push_back( edge ); } @@ -3895,173 +3893,179 @@ void StdMeshers_Quadrangle_2D::smooth (FaceQuadStruct::Ptr quad) { // "smooth" by computing node positions using 3D TFI and further projection - int nbhoriz = quad->iSize; - int nbvertic = quad->jSize; - - SMESH_TNodeXYZ a0( quad->UVPt( 0, 0 ).node ); - SMESH_TNodeXYZ a1( quad->UVPt( nbhoriz-1, 0 ).node ); - SMESH_TNodeXYZ a2( quad->UVPt( nbhoriz-1, nbvertic-1 ).node ); - SMESH_TNodeXYZ a3( quad->UVPt( 0, nbvertic-1 ).node ); - - for (int i = 1; i < nbhoriz-1; i++) + list< FaceQuadStruct::Ptr >::iterator q = myQuadList.begin(); + for ( ; q != myQuadList.end() ; ++q ) { - SMESH_TNodeXYZ p0( quad->UVPt( i, 0 ).node ); - SMESH_TNodeXYZ p2( quad->UVPt( i, nbvertic-1 ).node ); - for (int j = 1; j < nbvertic-1; j++) + quad = *q; + int nbhoriz = quad->iSize; + int nbvertic = quad->jSize; + + SMESH_TNodeXYZ a0( quad->UVPt( 0, 0 ).node ); + SMESH_TNodeXYZ a1( quad->UVPt( nbhoriz-1, 0 ).node ); + SMESH_TNodeXYZ a2( quad->UVPt( nbhoriz-1, nbvertic-1 ).node ); + SMESH_TNodeXYZ a3( quad->UVPt( 0, nbvertic-1 ).node ); + + for (int i = 1; i < nbhoriz-1; i++) { - SMESH_TNodeXYZ p1( quad->UVPt( nbhoriz-1, j ).node ); - SMESH_TNodeXYZ p3( quad->UVPt( 0, j ).node ); - - UVPtStruct& uvp = quad->UVPt( i, j ); - - gp_Pnt p = myHelper->calcTFI(uvp.x,uvp.y, a0,a1,a2,a3, p0,p1,p2,p3); - gp_Pnt2d uv = surface->NextValueOfUV( uvp.UV(), p, 10*tol ); - gp_Pnt pnew = surface->Value( uv ); - - meshDS->MoveNode( uvp.node, pnew.X(), pnew.Y(), pnew.Z() ); - uvp.u = uv.X(); - uvp.v = uv.Y(); - } - } - return; - } - - // Get nodes to smooth - - typedef map< const SMDS_MeshNode*, TSmoothNode, TIDCompare > TNo2SmooNoMap; - TNo2SmooNoMap smooNoMap; - - // fixed nodes - set< const SMDS_MeshNode* > fixedNodes; - for ( size_t i = 0; i < myForcedPnts.size(); ++i ) - { - fixedNodes.insert( myForcedPnts[i].node ); - if ( myForcedPnts[i].node->getshapeId() != myHelper->GetSubShapeID() ) - { - TSmoothNode & sNode = smooNoMap[ myForcedPnts[i].node ]; - sNode._uv = myForcedPnts[i].uv; - sNode._xyz = SMESH_TNodeXYZ( myForcedPnts[i].node ); - } - } - SMESHDS_SubMesh* fSubMesh = meshDS->MeshElements( quad->face ); - SMDS_NodeIteratorPtr nIt = fSubMesh->GetNodes(); - while ( nIt->more() ) // loop on nodes bound to a FACE - { - const SMDS_MeshNode* node = nIt->next(); - TSmoothNode & sNode = smooNoMap[ node ]; - sNode._uv = myHelper->GetNodeUV( quad->face, node ); - sNode._xyz = SMESH_TNodeXYZ( node ); - if ( fixedNodes.count( node )) - continue; // fixed - no triangles - - // set sNode._triangles - SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator( SMDSAbs_Face ); - while ( fIt->more() ) - { - const SMDS_MeshElement* face = fIt->next(); - const int nbN = face->NbCornerNodes(); - const int nInd = face->GetNodeIndex( node ); - const int prevInd = myHelper->WrapIndex( nInd - 1, nbN ); - const int nextInd = myHelper->WrapIndex( nInd + 1, nbN ); - const SMDS_MeshNode* prevNode = face->GetNode( prevInd ); - const SMDS_MeshNode* nextNode = face->GetNode( nextInd ); - sNode._triangles.push_back( TTriangle( & smooNoMap[ prevNode ], - & smooNoMap[ nextNode ])); - } - } - // set _uv of smooth nodes on FACE boundary - set< StdMeshers_FaceSide* > sidesOnEdge; - list< FaceQuadStruct::Ptr >::iterator q = myQuadList.begin(); - for ( ; q != myQuadList.end() ; ++q ) - for ( size_t i = 0; i < (*q)->side.size(); ++i ) - if ( ! (*q)->side[i].grid->Edge(0).IsNull() && - //(*q)->nbNodeOut( i ) == 0 && - sidesOnEdge.insert( (*q)->side[i].grid.get() ).second ) - { - const vector& uvVec = (*q)->side[i].grid->GetUVPtStruct(); - for ( unsigned j = 0; j < uvVec.size(); ++j ) + SMESH_TNodeXYZ p0( quad->UVPt( i, 0 ).node ); + SMESH_TNodeXYZ p2( quad->UVPt( i, nbvertic-1 ).node ); + for (int j = 1; j < nbvertic-1; j++) { - TSmoothNode & sNode = smooNoMap[ uvVec[j].node ]; - sNode._uv = uvVec[j].UV(); - sNode._xyz = SMESH_TNodeXYZ( uvVec[j].node ); + SMESH_TNodeXYZ p1( quad->UVPt( nbhoriz-1, j ).node ); + SMESH_TNodeXYZ p3( quad->UVPt( 0, j ).node ); + + UVPtStruct& uvp = quad->UVPt( i, j ); + + gp_Pnt p = myHelper->calcTFI(uvp.x,uvp.y, a0,a1,a2,a3, p0,p1,p2,p3); + gp_Pnt2d uv = surface->NextValueOfUV( uvp.UV(), p, 10*tol ); + gp_Pnt pnew = surface->Value( uv ); + + meshDS->MoveNode( uvp.node, pnew.X(), pnew.Y(), pnew.Z() ); + uvp.u = uv.X(); + uvp.v = uv.Y(); } } - - // define reference orientation in 2D - TNo2SmooNoMap::iterator n2sn = smooNoMap.begin(); - for ( ; n2sn != smooNoMap.end(); ++n2sn ) - if ( !n2sn->second._triangles.empty() ) - break; - if ( n2sn == smooNoMap.end() ) return; - const TSmoothNode & sampleNode = n2sn->second; - const bool refForward = ( sampleNode._triangles[0].IsForward( sampleNode._uv )); - - // Smoothing - - for ( int iLoop = 0; iLoop < 5; ++iLoop ) + } + } + else { + // Get nodes to smooth + + typedef map< const SMDS_MeshNode*, TSmoothNode, TIDCompare > TNo2SmooNoMap; + TNo2SmooNoMap smooNoMap; + + // fixed nodes + boost::container::flat_set< const SMDS_MeshNode* > fixedNodes; + for ( size_t i = 0; i < myForcedPnts.size(); ++i ) + { + fixedNodes.insert( myForcedPnts[i].node ); + if ( myForcedPnts[i].node->getshapeId() != myHelper->GetSubShapeID() ) + { + TSmoothNode & sNode = smooNoMap[ myForcedPnts[i].node ]; + sNode._uv = myForcedPnts[i].uv; + sNode._xyz = SMESH_TNodeXYZ( myForcedPnts[i].node ); + } + } + SMESHDS_SubMesh* fSubMesh = meshDS->MeshElements( quad->face ); + SMDS_NodeIteratorPtr nIt = fSubMesh->GetNodes(); + while ( nIt->more() ) // loop on nodes bound to a FACE + { + const SMDS_MeshNode* node = nIt->next(); + TSmoothNode & sNode = smooNoMap[ node ]; + sNode._uv = myHelper->GetNodeUV( quad->face, node ); + sNode._xyz = SMESH_TNodeXYZ( node ); + if ( fixedNodes.count( node )) + continue; // fixed - no triangles + + // set sNode._triangles + SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator( SMDSAbs_Face ); + while ( fIt->more() ) + { + const SMDS_MeshElement* face = fIt->next(); + const int nbN = face->NbCornerNodes(); + const int nInd = face->GetNodeIndex( node ); + const int prevInd = myHelper->WrapIndex( nInd - 1, nbN ); + const int nextInd = myHelper->WrapIndex( nInd + 1, nbN ); + const SMDS_MeshNode* prevNode = face->GetNode( prevInd ); + const SMDS_MeshNode* nextNode = face->GetNode( nextInd ); + sNode._triangles.push_back( TTriangle( & smooNoMap[ prevNode ], + & smooNoMap[ nextNode ])); + } + } + // set _uv of smooth nodes on FACE boundary + set< StdMeshers_FaceSide* > sidesOnEdge; + list< FaceQuadStruct::Ptr >::iterator q = myQuadList.begin(); + for ( ; q != myQuadList.end() ; ++q ) + for ( size_t i = 0; i < (*q)->side.size(); ++i ) + if ( ! (*q)->side[i].grid->Edge(0).IsNull() && + //(*q)->nbNodeOut( i ) == 0 && + sidesOnEdge.insert( (*q)->side[i].grid.get() ).second ) + { + const vector& uvVec = (*q)->side[i].grid->GetUVPtStruct(); + for ( unsigned j = 0; j < uvVec.size(); ++j ) + { + TSmoothNode & sNode = smooNoMap[ uvVec[j].node ]; + sNode._uv = uvVec[j].UV(); + sNode._xyz = SMESH_TNodeXYZ( uvVec[j].node ); + } + } + + // define reference orientation in 2D + TNo2SmooNoMap::iterator n2sn = smooNoMap.begin(); + for ( ; n2sn != smooNoMap.end(); ++n2sn ) + if ( !n2sn->second._triangles.empty() ) + break; + if ( n2sn == smooNoMap.end() ) return; + const TSmoothNode & sampleNode = n2sn->second; + const bool refForward = ( sampleNode._triangles[0].IsForward( sampleNode._uv )); + + // Smoothing + + for ( int iLoop = 0; iLoop < 5; ++iLoop ) + { + for ( n2sn = smooNoMap.begin(); n2sn != smooNoMap.end(); ++n2sn ) + { + TSmoothNode& sNode = n2sn->second; + if ( sNode._triangles.empty() ) + continue; // not movable node + + gp_XY newUV; + bool isValid = false; + bool use3D = ( iLoop > 2 ); // 3 loops in 2D and 2, in 3D + + if ( use3D ) + { + // compute a new XYZ + gp_XYZ newXYZ (0,0,0); + for ( size_t i = 0; i < sNode._triangles.size(); ++i ) + newXYZ += sNode._triangles[i]._n1->_xyz; + newXYZ /= sNode._triangles.size(); + + // compute a new UV by projection + newUV = surface->NextValueOfUV( sNode._uv, newXYZ, 10*tol ).XY(); + + // check validity of the newUV + for ( size_t i = 0; i < sNode._triangles.size() && isValid; ++i ) + isValid = ( sNode._triangles[i].IsForward( newUV ) == refForward ); + } + if ( !isValid ) + { + // compute a new UV by averaging + newUV.SetCoord(0.,0.); + for ( unsigned i = 0; i < sNode._triangles.size(); ++i ) + newUV += sNode._triangles[i]._n1->_uv; + newUV /= sNode._triangles.size(); + + // check validity of the newUV + isValid = true; + for ( unsigned i = 0; i < sNode._triangles.size() && isValid; ++i ) + isValid = ( sNode._triangles[i].IsForward( newUV ) == refForward ); + } + if ( isValid ) + { + sNode._uv = newUV; + sNode._xyz = surface->Value( newUV ).XYZ(); + } + } + } + + // Set new XYZ to the smoothed nodes + for ( n2sn = smooNoMap.begin(); n2sn != smooNoMap.end(); ++n2sn ) { TSmoothNode& sNode = n2sn->second; if ( sNode._triangles.empty() ) continue; // not movable node - gp_XY newUV; - bool isValid = false; - bool use3D = ( iLoop > 2 ); // 3 loops in 2D and 2, in 3D + SMDS_MeshNode* node = const_cast< SMDS_MeshNode*>( n2sn->first ); + gp_Pnt xyz = surface->Value( sNode._uv ); + meshDS->MoveNode( node, xyz.X(), xyz.Y(), xyz.Z() ); - if ( use3D ) - { - // compute a new XYZ - gp_XYZ newXYZ (0,0,0); - for ( size_t i = 0; i < sNode._triangles.size(); ++i ) - newXYZ += sNode._triangles[i]._n1->_xyz; - newXYZ /= sNode._triangles.size(); - - // compute a new UV by projection - newUV = surface->NextValueOfUV( sNode._uv, newXYZ, 10*tol ).XY(); - - // check validity of the newUV - for ( size_t i = 0; i < sNode._triangles.size() && isValid; ++i ) - isValid = ( sNode._triangles[i].IsForward( newUV ) == refForward ); - } - if ( !isValid ) - { - // compute a new UV by averaging - newUV.SetCoord(0.,0.); - for ( unsigned i = 0; i < sNode._triangles.size(); ++i ) - newUV += sNode._triangles[i]._n1->_uv; - newUV /= sNode._triangles.size(); - - // check validity of the newUV - isValid = true; - for ( unsigned i = 0; i < sNode._triangles.size() && isValid; ++i ) - isValid = ( sNode._triangles[i].IsForward( newUV ) == refForward ); - } - if ( isValid ) - { - sNode._uv = newUV; - sNode._xyz = surface->Value( newUV ).XYZ(); - } + // store the new UV + node->SetPosition( SMDS_PositionPtr( new SMDS_FacePosition( sNode._uv.X(), sNode._uv.Y() ))); } } - // Set new XYZ to the smoothed nodes - - for ( n2sn = smooNoMap.begin(); n2sn != smooNoMap.end(); ++n2sn ) - { - TSmoothNode& sNode = n2sn->second; - if ( sNode._triangles.empty() ) - continue; // not movable node - - SMDS_MeshNode* node = const_cast< SMDS_MeshNode*>( n2sn->first ); - gp_Pnt xyz = surface->Value( sNode._uv ); - meshDS->MoveNode( node, xyz.X(), xyz.Y(), xyz.Z() ); - - // store the new UV - node->SetPosition( SMDS_PositionPtr( new SMDS_FacePosition( sNode._uv.X(), sNode._uv.Y() ))); - } - // Move medium nodes in quadratic mesh if ( _quadraticMesh ) { @@ -4085,6 +4089,7 @@ void StdMeshers_Quadrangle_2D::smooth (FaceQuadStruct::Ptr quad) meshDS->MoveNode( node, xyz.X(), xyz.Y(), xyz.Z() ); } } + return; } //================================================================================ @@ -4180,12 +4185,18 @@ bool StdMeshers_Quadrangle_2D::check() if ( myHelper->HasSeam() ) for ( int i = 0; i < nbN && !nInFace; ++i ) if ( !myHelper->IsSeamShape( nn[i]->getshapeId() )) + { nInFace = nn[i]; + gp_XY uv = myHelper->GetNodeUV( geomFace, nInFace ); + if ( myHelper->IsOnSeam( uv )) + nInFace = NULL; + } toCheckUV = true; for ( int i = 0; i < nbN; ++i ) uv[ i ] = myHelper->GetNodeUV( geomFace, nn[i], nInFace, &toCheckUV ); + bool isBad = false; switch ( nbN ) { case 4: { @@ -4198,19 +4209,34 @@ bool StdMeshers_Quadrangle_2D::check() if ( sign1 * sign2 < 0 ) continue; // this should not happen } - if ( sign1 * okSign < 0 ) - badFaces.push_back ( f ); + isBad = ( sign1 * okSign < 0 ); break; } case 3: { double sign = getArea( uv[0], uv[1], uv[2] ); - if ( sign * okSign < 0 ) - badFaces.push_back ( f ); + isBad = ( sign * okSign < 0 ); break; } default:; } + + // if ( isBad && myHelper->HasRealSeam() ) + // { + // // detect a case where a face intersects the seam + // for ( int iPar = 1; iPar < 3; ++iPar ) + // if ( iPar & myHelper->GetPeriodicIndex() ) + // { + // double min = uv[0].Coord( iPar ), max = uv[0].Coord( iPar ); + // for ( int i = 1; i < nbN; ++i ) + // { + // min = Min( min, uv[i].Coord( iPar )); + // max = Max( max, uv[i].Coord( iPar )); + // } + // } + // } + if ( isBad ) + badFaces.push_back ( f ); } if ( !badFaces.empty() ) @@ -4264,7 +4290,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, if ( SMESH_Algo::isDegenerated( prevE )) { list::reverse_iterator edge = ++theWire.rbegin(); - while ( SMESH_Algo::isDegenerated( *edge )) + while ( SMESH_Algo::isDegenerated( *edge ) /*|| helper.IsRealSeam( *edge )*/) ++edge; if ( edge == theWire.rend() ) return false; @@ -4273,7 +4299,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, list::iterator edge = theWire.begin(); for ( int iE = 0; edge != theWire.end(); ++edge, ++iE ) { - if ( SMESH_Algo::isDegenerated( *edge )) + if ( SMESH_Algo::isDegenerated( *edge ) /*|| helper.IsRealSeam( *edge )*/) { ++theNbDegenEdges; continue; From 5049cf97958f70b5ab67e592f8da9f563ac96987 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Mon, 9 Oct 2017 14:40:21 +0200 Subject: [PATCH 05/12] Update translation files from Crowdin --- src/SMESHGUI/SMESH_msg_ja.ts | 168 ++++++++++++++++++++++++----------- 1 file changed, 116 insertions(+), 52 deletions(-) diff --git a/src/SMESHGUI/SMESH_msg_ja.ts b/src/SMESHGUI/SMESH_msg_ja.ts index 5aa45dcb0..77c673410 100644 --- a/src/SMESHGUI/SMESH_msg_ja.ts +++ b/src/SMESHGUI/SMESH_msg_ja.ts @@ -39,6 +39,10 @@ CGNS_FILES_FILTER CGNS ファイル + + CGNS_EXPORT_ELEMS_BY_TYPE + タイプで要素をグループ化 + GMF_ASCII_FILES_FILTER GMFアスキーファイル @@ -383,6 +387,22 @@ MEN_DEL_GROUP グループとその内容を削除します。 + + MEN_ADD_TO_GROUP + グループに追加 + + + MEN_REMOVE_FROM_GROUP + グループから削除 + + + STB_ADD_TO_GROUP + 選択要素をグループに追加 + + + STB_REMOVE_FROM_GROUP + 選択要素をグループから削除 + MEN_FACE_ORIENTATION フェースの向き @@ -871,6 +891,10 @@ MEN_QUADRATIC_PENTAHEDRON 二次ウェッジ + + MEN_BIQUADRATIC_PENTAHEDRON + 4次五面体 + MEN_QUADRATIC_PYRAMID 四角錐 @@ -1343,6 +1367,10 @@ SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE 二次くさびを追加します。 + + SMESH_ADD_BIQUADRATIC_PENTAHEDRON_TITLE + 4次五面体の追加 + SMESH_ADD_QUADRATIC_PYRAMID_TITLE 四角錐を追加します。 @@ -2479,10 +2507,18 @@ SMESH_QUADRATIC_PENTAHEDRON 二次ウェッジ + + SMESH_BIQUADRATIC_PENTAHEDRON + 4次五面体 + SMESH_QUADRATIC_PENTAHEDRONS 二次ウェッジ + + SMESH_BIQUADRATIC_PENTAHEDRONS + 4次五面体 + SMESH_QUADRATIC_PYRAMID 四角錐 @@ -3327,6 +3363,10 @@ STB_QUADRATIC_PENTAHEDRON 二次ウェッジ + + STB_BIQUADRATIC_PENTAHEDRON + 4次五面体 + STB_QUADRATIC_PYRAMID 四角錐 @@ -4003,6 +4043,10 @@ TOP_QUADRATIC_PENTAHEDRON 二次ウェッジ + + TOP_BIQUADRATIC_PENTAHEDRON + 4次五面体 + TOP_QUADRATIC_PYRAMID 四角錐 @@ -4831,6 +4875,10 @@ SMESH_ADD_QUADRATIC_PENTAHEDRON 二次くさびを追加します。 + + SMESH_ADD_BIQUADRATIC_PENTAHEDRON + 4次五面体の追加 + SMESH_ADD_QUADRATIC_PYRAMID 二次ピラミッドの追加 @@ -5252,6 +5300,10 @@ SEPARATE_CORNERS_AND_MEDIUM 2次セルのコーナ節点と中間節点をマージできません + + AVOID_MAKING_HOLES + 穴作成の回避 + KEEP_NODES 維持節点 @@ -5848,108 +5900,108 @@ エンティティの種類 - ENTITY_TYPE_0 - NONE + ENTITY_TYPE_0 + POINT1 - ENTITY_TYPE_1 - POINT1 + ENTITY_TYPE_1 + POINT1 - ENTITY_TYPE_2 - SEG2 + ENTITY_TYPE_2 + SEG2 - ENTITY_TYPE_3 - SEG3 + ENTITY_TYPE_3 + SEG3 - ENTITY_TYPE_4 - TRIA3 + ENTITY_TYPE_4 + TRIA3 - ENTITY_TYPE_5 - TRIA6 + ENTITY_TYPE_5 + TRIA6 - ENTITY_TYPE_6 - TRIA7 + ENTITY_TYPE_6 + QUAD4 - ENTITY_TYPE_7 - QUAD4 + ENTITY_TYPE_7 + QUAD8 - ENTITY_TYPE_8 - QUAD8 + ENTITY_TYPE_8 + QUAD9 - ENTITY_TYPE_9 - QUAD9 + ENTITY_TYPE_9 + TETRA4 - ENTITY_TYPE_10 - POLYGON + ENTITY_TYPE_10 + TETRA10 - ENTITY_TYPE_11 - QPOLYGON + ENTITY_TYPE_11 + PYRA5 - ENTITY_TYPE_12 - TETRA4 + ENTITY_TYPE_12 + PYRA13 - ENTITY_TYPE_13 - TETRA10 + ENTITY_TYPE_13 + PENTA6 - ENTITY_TYPE_14 - PYRA5 + ENTITY_TYPE_14 + PENTA15 - ENTITY_TYPE_15 - PYRA13 + ENTITY_TYPE_15 + HEXA8 - ENTITY_TYPE_16 - HEXA8 + ENTITY_TYPE_16 + HEXA20 - ENTITY_TYPE_17 - HEXA20 + ENTITY_TYPE_17 + HEXA27 - ENTITY_TYPE_18 - HEXA27 + ENTITY_TYPE_18 + OCTA12 - ENTITY_TYPE_19 - PENTA6 + ENTITY_TYPE_19 + ポリゴン - ENTITY_TYPE_20 - PENTA15 + ENTITY_TYPE_20 + POLYEDRE - ENTITY_TYPE_21 - PENTA18 + ENTITY_TYPE_21 + [なし] - ENTITY_TYPE_22 - OCTA12 + ENTITY_TYPE_22 + ボール - ENTITY_TYPE_23 - POLYEDRE + ENTITY_TYPE_23 + QPOLYEDRE - ENTITY_TYPE_24 - QPOLYEDRE + ENTITY_TYPE_24 + ボール - ENTITY_TYPE_25 - BALL + ENTITY_TYPE_25 + ボール GEOM_TYPE @@ -6878,6 +6930,14 @@ SMESH_CREATE_GROUP_FROM_GEOM ジオメトリからグループを作成 + + ELEMENTS + 要素 + + + ELEMENTS_TOOLTIP + 0D要素がない + SMESHGUI_MeshOrderDlg @@ -7306,6 +7366,10 @@ ELEM_MODE 要素 + + SHOW_IDS + IDの表示 + BUT_DUMP_MESH 書き出し(&D) From 09d1bbfd302cef2debe83d42d4cc8ae92e8b95f8 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Mon, 9 Oct 2017 15:28:34 +0200 Subject: [PATCH 06/12] Update French translation files --- src/SMESHGUI/SMESH_msg_fr.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 72358f7d0..2f5882e99 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -39,6 +39,10 @@ CGNS_FILES_FILTER Fichiers CGNS + + CGNS_EXPORT_ELEMS_BY_TYPE + Groupe les éléments par type + GMF_ASCII_FILES_FILTER Fichiers GMF ASCII @@ -384,6 +388,22 @@ MEN_DEL_GROUP Supprimer les groupes et leur contenu + + MEN_ADD_TO_GROUP + Ajoute dans le groupe + + + MEN_REMOVE_FROM_GROUP + Supprime du groupe + + + STB_ADD_TO_GROUP + Ajoute dans le groupe les éléments sélectionnés + + + STB_REMOVE_FROM_GROUP + Supprime du groupe les éléments sélectionnés + MEN_FACE_ORIENTATION Orientation des faces @@ -5337,6 +5357,10 @@ Choisissez un groupe et essayez de nouveau SEPARATE_CORNERS_AND_MEDIUM Pas de fusion du coin et des noeuds moyens des cellules quadratiques + + AVOID_MAKING_HOLES + Evite de créer des trous + KEEP_NODES Les noeuds à conserver pendant la fusion @@ -7011,6 +7035,14 @@ Il y a trop peu de points dans le fichier SMESH_CREATE_GROUP_FROM_GEOM Créer des groupes à partir de la géométrie + + ELEMENTS + Eléments + + + ELEMENTS_TOOLTIP + Pas d'éléments 0D + SMESHGUI_MeshOrderDlg @@ -7441,6 +7473,10 @@ en raison de leurs types incompatibles: ELEM_MODE Elément + + SHOW_IDS + Montre les IDs + BUT_DUMP_MESH &Dump From 678b908f16db09e6c5b38edddcd5b6081e1d4936 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 9 Oct 2017 15:28:05 +0300 Subject: [PATCH 07/12] Typo fixes http://www.salome-platform.org/forum/forum_10/433845793 --- CMakeLists.txt | 2 +- ChangeLog | 8 ++++---- README | 2 +- SalomeSMESHConfig.cmake.in | 2 +- idl/SMESH_Gen.idl | 2 +- src/SMDS/SMDS_Mesh.cxx | 16 ++++++++-------- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 6 +++--- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 2 +- .../StdMeshers_CartesianParameters3D.cxx | 2 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 3 ++- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 2 +- .../StdMeshers_RadialQuadrangle_1D2D.cxx | 4 ++-- src/StdMeshers/StdMeshers_Regular_1D.cxx | 2 +- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 2 +- src/Tools/YamsPlug/doc/Advanced_params.rst | 6 +++--- src/Tools/YamsPlug/doc/Mandatory_params.rst | 2 +- src/Tools/ZCracksPlug/zcracks.ui | 2 +- .../padder/meshjob/impl/MeshJobManager_i.cxx | 2 +- 19 files changed, 36 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0edc0bad..41580b95c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB) # Prerequisites # ============= # Find "big" prerequisites first - they reference themselves many others -# -> this can help finding the smaller prerequisites and detect conficts. +# -> this can help finding the smaller prerequisites and detect conflicts. # In our case KERNEL has already loaded many prereq: ## diff --git a/ChangeLog b/ChangeLog index 85c700e46..7df59af50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,7 @@ 2004-01-05 16:14 Jerome Robert - * adm_local/unix/config_files/check_Netgen.m4: Fix a mispelled + * adm_local/unix/config_files/check_Netgen.m4: Fix a misspelled environment variable for idl python 2004-01-05 14:28 tag V1_3_1 @@ -59,7 +59,7 @@ 2004-01-05 09:05 Jerome Robert * src/: SMDS/SMDS_Mesh.cxx, SMESHDS/SMESHDS_Document.cxx: [Bug - SMESH4830] bug in instal with gcc 2.95. Bug fixed. Note: SGI say + SMESH4830] bug in install with gcc 2.95. Bug fixed. Note: SGI say that is requiered to use set_intersection (see http://www.sgi.com/tech/stl/set_intersection.html). @@ -73,7 +73,7 @@ 2003-12-15 13:15 Nadir Bouhamou * src/SMESHDS/SMESHDS_Script.cxx: correct a small bug found by the - EDF developpement team (PN and AT) : AddVolume in the case of a + EDF development team (PN and AT) : AddVolume in the case of a Tetrahedron. 2003-12-11 09:51 Jerome Robert @@ -1194,7 +1194,7 @@ * idl/Makefile.in, adm_local/unix/make_commence.in, adm_local/unix/make_omniorb.in, build_configure, - configure.in.base: NRI : Update IDL Dependancies. + configure.in.base: NRI : Update IDL Dependencies. 2003-05-28 07:20 Nicolas Rejneri diff --git a/README b/README index 78f5c9b6f..74932ecba 100644 --- a/README +++ b/README @@ -41,7 +41,7 @@ Installation Pre-requisites -------------- -SALOME platform relies on a set of third-party softwares; some of them are needed +SALOME platform relies on a set of third-party software; some of them are needed at build time only, while other ones are needed in runtime also. For more information about the pre-requisites please visit SALOME platform web diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 6fe86346c..7ff429caf 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -1,6 +1,6 @@ # - Config file for the @PROJECT_NAME@ package # It defines the following variables. -# Specific to the pacakge @PROJECT_NAME@ itself: +# Specific to the package @PROJECT_NAME@ itself: # @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file # diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index 75fbe0894..03ae8e0f8 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -149,7 +149,7 @@ module SMESH SALOMEDS::Study GetCurrentStudy(); /*! - * Create a hypothesis that can be shared by differents parts of the mesh. + * Create a hypothesis that can be shared by different parts of the mesh. * An hypothesis is either: * - a method used to generate or modify a part of the mesh (algorithm). * - a parameter or a law used by an algorithm. diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 9f89ced58..40caa2c88 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -1696,10 +1696,10 @@ const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const return (const SMDS_MeshNode *)myNodes[vtkId+1]; } -/////////////////////////////////////////////////////////////////////////////// -///Create a triangle and add it to the current mesh. This method do not bind an -///ID to the create triangle. -/////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +///Create a triangle and add it to the current mesh. This method does not bind +///an ID to the create triangle. +////////////////////////////////////////////////////////////////////////////// SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2, const SMDS_MeshNode * node3, @@ -1746,10 +1746,10 @@ SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1, } } -/////////////////////////////////////////////////////////////////////////////// -///Create a quadrangle and add it to the current mesh. This methode do not bind -///a ID to the create triangle. -/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +///Create a quadrangle and add it to the current mesh. This method does not bind +///an ID to the create triangle. +//////////////////////////////////////////////////////////////////////////////// SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2, const SMDS_MeshNode * node3, diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 2d48bf78a..b762d3018 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1232,7 +1232,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, currentCellChanged(); // to update buttons } } - // show dialog and wait, becase Compute can be invoked from Preview operation + // show dialog and wait, because Compute can be invoked from Preview operation //aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer aCompDlg->show(); } @@ -2389,7 +2389,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes, currentCellChanged(); // to update buttons } } - // show dialog and wait, becase Compute can be invoked from Preview operation + // show dialog and wait, because Compute can be invoked from Preview operation //aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer aCompDlg->show(); } diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index c7d806b7d..0b2cbb975 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1118,14 +1118,14 @@ bool SMESHGUI_GroupDlg::onApply() { if ( myFilter->_is_nil() ) return false; - if (CORBA::is_nil(myGroupOnFilter)) { // creation + if (CORBA::is_nil(myGroupOnFilter)) // creation + { if (myMesh->_is_nil()) return false; myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, SMESH::toUtf8(myName->text()), myFilter); - resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); isCreation = true; } @@ -1139,7 +1139,7 @@ bool SMESHGUI_GroupDlg::onApply() anIsOk = true; } - if( anIsOk ) + if ( anIsOk ) { SALOMEDS::Color aColor = getGroupColor(); resultGroup->SetColor(aColor); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 5651284ab..1b50b43d1 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -435,7 +435,7 @@ void SMESHGUI_MultiEditDlg::onOk() //======================================================================= // name : SMESHGUI_MultiEditDlg::getIds -// Purpose : Retrive identifiers from list box or the whole object +// Purpose : Retrieve identifiers from list box or the whole object //======================================================================= SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj) diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index f55687ca3..6c0fcb6a5 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -792,7 +792,7 @@ std::ostream & StdMeshers_CartesianParameters3D::SaveTo(std::ostream & save) //======================================================================= //function : LoadFrom -//purpose : resore my parameters from a stream +//purpose : restore my parameters from a stream //======================================================================= std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load) diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 9fc322c75..4dd948be3 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -111,6 +111,7 @@ namespace { algo->myProxyMesh.reset( new SMESH_ProxyMesh( *helper->GetMesh() )); algo->myQuadList.clear(); + algo->myHelper = 0; if ( helper ) algo->_quadraticMesh = helper->GetIsQuadratic(); @@ -2589,7 +2590,7 @@ double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr //======================================================================= //function : isSimpleQuad -//purpose : check if the bottom FACE is meshable with nice qudrangles, +//purpose : check if the bottom FACE is meshable with nice quadrangles, // if so the block aproach can work rather fast. // This is a temporary mean caused by problems in StdMeshers_Sweeper //======================================================================= diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 11f2b5e97..924eba9bf 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -701,7 +701,7 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the RETURN_BAD_RESULT("edge2 does not belong to theShape2"); } // - // Look for 2 corresponing faces: + // Look for 2 corresponding faces: // TopoDS_Shape F1, F2; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index dc573828e..ca07b07a9 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -669,7 +669,7 @@ public: return true; } // ----------------------------------------------------------------------------- - //! Make mesh on an adge using assigned 1d hyp or defaut nb of segments + //! Make mesh on an adge using assigned 1d hyp or default nb of segments bool ComputeCircularEdge( SMESH_Mesh& aMesh, const StdMeshers_FaceSidePtr& aSide ) { @@ -697,7 +697,7 @@ public: return ok; } // ----------------------------------------------------------------------------- - //! Make mesh on an adge using assigned 1d hyp or defaut nb of segments + //! Make mesh on an adge using assigned 1d hyp or default nb of segments bool EvaluateCircularEdge(SMESH_Mesh& aMesh, const StdMeshers_FaceSidePtr aSide, MapShapeNbElems& aResMap) diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 6746a502c..32270cdcc 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -1139,7 +1139,7 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t if ( !nFirst || !nLast ) return error( COMPERR_BAD_INPUT_MESH, "No node on vertex"); - // remove elements created by e.g. patern mapping (PAL21999) + // remove elements created by e.g. pattern mapping (PAL21999) // CLEAN event is incorrectly ptopagated seemingly due to Propagation hyp // so TEMPORARY solution is to clean the submesh manually if (SMESHDS_SubMesh * subMeshDS = meshDS->MeshElements(theShape)) diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 00f409de8..0864aaa25 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -5144,7 +5144,7 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data, { #ifdef __myDEBUG SMDS_MeshElement::iterator nIt = closestFace->begin_nodes(); - cout << "Shortest distance: _LayerEdge nodes: tgt " << le->_nodes.back()->GetID() + cout << "#Shortest distance: _LayerEdge nodes: tgt " << le->_nodes.back()->GetID() << " src " << le->_nodes[0]->GetID()<< ", intersection with face (" << (*nIt++)->GetID()<<" "<< (*nIt++)->GetID()<<" "<< (*nIt++)->GetID() << ") distance = " << distToIntersection<< endl; diff --git a/src/Tools/YamsPlug/doc/Advanced_params.rst b/src/Tools/YamsPlug/doc/Advanced_params.rst index 23b0385bd..e0034905b 100644 --- a/src/Tools/YamsPlug/doc/Advanced_params.rst +++ b/src/Tools/YamsPlug/doc/Advanced_params.rst @@ -8,7 +8,7 @@ Advanced Remeshing Options - **Ridge detection** if not set (ridge detection disabled ), MeshGems-SurfOpt will not try to detect any new ridge edge by its own mechanism : -it will consider as ridge only the ridges given in the mesh. All non-ridge edges that would have been detected as ridge by the Ridge angle paramaeter (see below split edge) will be considered as part of the same continuous patch. This option should not be checked when all the known ridges of the mesh are given and when all other possible ridges are not geometric ridges to take into account. +it will consider as ridge only the ridges given in the mesh. All non-ridge edges that would have been detected as ridge by the Ridge angle parameter (see below split edge) will be considered as part of the same continuous patch. This option should not be checked when all the known ridges of the mesh are given and when all other possible ridges are not geometric ridges to take into account. - **Point smoothing** When not set (point smoothing is disabled), MeshGems-SurfOpt will not try to move the initial given vertices (along an edge, a ridge or onto the surface), hence MeshGems-SurfOpt will only swap edges, remove vertices or add vertices (refines) to change the mesh. @@ -34,8 +34,8 @@ These two parameters allow the user to prescribe a Maximal/Minimal size for the - **Mesh gradation** -This paramater P controls the element size variation : MeshGems-SurfOpt will avoid having two adjacent egdes which sizes vary more than th given gradation. a size correction is applied to the size map : if two adjacent edges are respectively e1 and e2 long and e2 > Pxe1, then, the new size for the second edge will be set to P x e1. -**This procedure is desactived if P=-1** +This parameter P controls the element size variation : MeshGems-SurfOpt will avoid having two adjacent egdes which sizes vary more than th given gradation. A size correction is applied to the size map : if two adjacent edges are respectively e1 and e2 long and e2 > Pxe1, then, the new size for the second edge will be set to P x e1. +**This procedure is deactived if P=-1** diff --git a/src/Tools/YamsPlug/doc/Mandatory_params.rst b/src/Tools/YamsPlug/doc/Mandatory_params.rst index d4aff8f19..8d9cf5560 100644 --- a/src/Tools/YamsPlug/doc/Mandatory_params.rst +++ b/src/Tools/YamsPlug/doc/Mandatory_params.rst @@ -98,7 +98,7 @@ it can be : - relative : the maximal chordal deviation - epsilon max - is set to *s x the parameter* where *s* is the size of the bounding box longest diagonal. By default, the parameter is set to 0.001 and the maximum deviation is then set to 0.001 x s, - which is equivalent to say that, for a bouding box of 1 meter, the maximal deviation is 1 mm. + which is equivalent to say that, for a bounding box of 1 meter, the maximal deviation is 1 mm. - absolute : the maximal chordal deviation is the parameter itself. eg if the parameter equals 2, the maximal chordal deviation will be 2 (mm if the point coordonates are given in mm). Following that criterion: diff --git a/src/Tools/ZCracksPlug/zcracks.ui b/src/Tools/ZCracksPlug/zcracks.ui index 8fc299d22..3de4be60e 100644 --- a/src/Tools/ZCracksPlug/zcracks.ui +++ b/src/Tools/ZCracksPlug/zcracks.ui @@ -567,7 +567,7 @@ - Extraction length (optionnal) + Extraction length (optional) Extraction length diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index 7a77330d8..9f9510225 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -371,7 +371,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo // Specification of the working spaces: // // - local_directory: can be used to specify where to find the input - // files on the local resource. It's optionnal if you specify the + // files on the local resource. It's optional if you specify the // absolute path name of input files. // // - result_directory: must be used to specify where to download the From f5f73b5e032add07cbf85be516b7187a10965e33 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 10 Oct 2017 14:27:04 +0300 Subject: [PATCH 08/12] Fix broken links to TUI pages in GUI documentation --- doc/salome/gui/SMESH/doxyfile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/salome/gui/SMESH/doxyfile.in b/doc/salome/gui/SMESH/doxyfile.in index 164ad9220..2b716b2c0 100755 --- a/doc/salome/gui/SMESH/doxyfile.in +++ b/doc/salome/gui/SMESH/doxyfile.in @@ -41,6 +41,7 @@ WARNINGS = YES INPUT = @CMAKE_CURRENT_SOURCE_DIR@/input $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM/input FILE_PATTERNS = *.doc EXCLUDE = +EXCLUDE_PATTERNS = tui_*.doc IMAGE_PATH = $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM @CMAKE_CURRENT_SOURCE_DIR@/images EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples @CMAKE_SOURCE_DIR@/src/SMESH_SWIG From f4da288f5ad3179707ce8b34b6425c93b4d73992 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 12 Oct 2017 16:02:58 +0200 Subject: [PATCH 09/12] [V84] Fix conflict netgen / netgen contrib in GMSH --- CMakeLists.txt | 7 ++++++- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 24 +++++++++++++---------- src/SMESH_I/SMESH_Gen_i.cxx | 10 +++++++--- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41580b95c..77a998c37 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,11 @@ OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON) OPTION(SALOME_BUILD_GUI "Enable GUI" ON) OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF) OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF) +OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" OFF) + +IF(SALOME_SMESH_DYNLOAD_LOCAL) + ADD_DEFINITIONS(-DDYNLOAD_LOCAL) +ENDIF(SALOME_SMESH_DYNLOAD_LOCAL) #On Linux use Fortran to compile MEFISTO2D IF(NOT WIN32) @@ -85,7 +90,7 @@ IF(NOT WIN32) ADD_DEFINITIONS(-DENABLE_MEFISTO) ENDIF(NOT WIN32) -MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB) +MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB SALOME_SMESH_DYNLOAD_LOCAL) # Prerequisites # ============= diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 021e003b9..def3ff557 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -63,16 +63,20 @@ #endif #ifdef WIN32 -#define LibHandle HMODULE -#define LoadLib( name ) LoadLibrary( name ) -#define GetProc GetProcAddress -#define UnLoadLib( handle ) FreeLibrary( handle ); -#else -#define LibHandle void* -#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) -#define GetProc dlsym -#define UnLoadLib( handle ) dlclose( handle ); -#endif + #define LibHandle HMODULE + #define LoadLib( name ) LoadLibrary( name ) + #define GetProc GetProcAddress + #define UnLoadLib( handle ) FreeLibrary( handle ); +#else // WIN32 + #define LibHandle void* + #ifdef DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_LOCAL ) + #else // DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) + #endif // DYNLOAD_LOCAL + #define GetProc dlsym + #define UnLoadLib( handle ) dlclose( handle ); +#endif // WIN32 #ifdef _DEBUG_ static int MYDEBUG = 0; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index ec2a92572..f6877fa47 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -62,12 +62,16 @@ #define LoadLib( name ) LoadLibrary( name ) #define GetProc GetProcAddress #define UnLoadLib( handle ) FreeLibrary( handle ); -#else +#else // WIN32 #define LibHandle void* - #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) + #ifdef DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_LOCAL ) + #else // DYNLOAD_LOCAL + #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL ) + #endif // DYNLOAD_LOCAL #define GetProc dlsym #define UnLoadLib( handle ) dlclose( handle ); -#endif +#endif // WIN32 #include "SMESH_Gen_i.hxx" #include "SMESH_version.h" From ca5275c924507e615246cc4ceed8267c9dddc0a7 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 12 Oct 2017 12:48:54 +0300 Subject: [PATCH 10/12] 0023473: [CEA 2163] SMESH compilation failure with a PyCompileError - Add direct dependencies between targets generated by PYQT_WRAP_UIC and SALOME_INSTALL_SCRIPTS macros to avoid races problem --- src/Tools/MGCleanerPlug/CMakeLists.txt | 35 ++++++++++-------- src/Tools/MeshCut/CMakeLists.txt | 17 ++++----- src/Tools/Verima/Gui/CMakeLists.txt | 16 ++++---- src/Tools/YamsPlug/CMakeLists.txt | 34 ++++++++++------- src/Tools/ZCracksPlug/CMakeLists.txt | 37 +++++++++++-------- src/Tools/blocFissure/ihm/CMakeLists.txt | 16 ++++---- src/Tools/padder/spadderpy/gui/CMakeLists.txt | 19 ++++++---- 7 files changed, 98 insertions(+), 76 deletions(-) diff --git a/src/Tools/MGCleanerPlug/CMakeLists.txt b/src/Tools/MGCleanerPlug/CMakeLists.txt index 50a2d05c9..71758729d 100644 --- a/src/Tools/MGCleanerPlug/CMakeLists.txt +++ b/src/Tools/MGCleanerPlug/CMakeLists.txt @@ -16,36 +16,41 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + IF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF(SALOME_BUILD_DOC) -INCLUDE(UsePyQt) +IF(SALOME_BUILD_GUI) + INCLUDE(UsePyQt) +ENDIF(SALOME_BUILD_GUI) # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS MGCleanerMonPlugDialog.py MGCleanerMonViewText.py MGCleanerplug_plugin.py ) -# --- resources --- - -# uic files / to be processed by pyuic -SET(_pyuic_files - MGCleanerPlugDialog.ui - MGCleanerViewText.ui -) - -# scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +IF(SALOME_BUILD_GUI) + # uic files / to be processed by pyuic + SET(_pyuic_FILES + MGCleanerPlugDialog.ui + MGCleanerViewText.ui + ) + # scripts / pyuic wrappings + PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) +ENDIF(SALOME_BUILD_GUI) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) IF(SALOME_BUILD_GUI) - SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) -ENDIF(SALOME_BUILD_GUI) \ No newline at end of file + SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py) + # add dependency of compiled py files on uic files in order + # to avoid races problems when compiling in parallel + ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) +ENDIF(SALOME_BUILD_GUI) diff --git a/src/Tools/MeshCut/CMakeLists.txt b/src/Tools/MeshCut/CMakeLists.txt index 2125c0be1..44c8cae1c 100644 --- a/src/Tools/MeshCut/CMakeLists.txt +++ b/src/Tools/MeshCut/CMakeLists.txt @@ -38,7 +38,7 @@ SET(_link_LIBRARIES # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS meshcut_plugin.py ) @@ -61,26 +61,25 @@ SET(MeshCut_SOURCES ) IF(SALOME_BUILD_GUI) - # --- resources --- - # uic files / to be processed by pyuic - SET(_pyuic_files + SET(_pyuic_FILES MeshCutDialog.ui ) - # scripts / pyuic wrappings - PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) - + PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) ENDIF(SALOME_BUILD_GUI) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) ADD_EXECUTABLE(MeshCut ${MeshCut_SOURCES}) TARGET_LINK_LIBRARIES(MeshCut ${_link_LIBRARIES}) INSTALL(TARGETS MeshCut EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) IF(SALOME_BUILD_GUI) - INSTALL(FILES ${_pyuic_SCRIPTS} DESTINATION ${SALOME_INSTALL_BINS}) + SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_BINS} TARGET_NAME _target_name_pyuic_py) + # add dependency of compiled py files on uic files in order + # to avoid races problems when compiling in parallel + ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) ENDIF(SALOME_BUILD_GUI) diff --git a/src/Tools/Verima/Gui/CMakeLists.txt b/src/Tools/Verima/Gui/CMakeLists.txt index 07c0275a1..1e0cf7b74 100644 --- a/src/Tools/Verima/Gui/CMakeLists.txt +++ b/src/Tools/Verima/Gui/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE(UsePyQt) # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS maFenetreChoix.py monEditor.py monNomBase.py @@ -30,10 +30,8 @@ SET(plugin_SCRIPTS __init__.py ) -# --- resources --- - # uic files / to be processed by pyuic -SET(_pyuic_files +SET(_pyuic_FILES desFenetreChoix.ui desStat.ui myMainTotale.ui @@ -42,12 +40,14 @@ SET(_pyuic_files nomBase.ui tousLesJobs.ui ) - # scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui) +SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui TARGET_NAME _target_name_pyuic_py) +# add dependency of compiled py files on uic files in order +# to avoid races problems when compiling in parallel +ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) diff --git a/src/Tools/YamsPlug/CMakeLists.txt b/src/Tools/YamsPlug/CMakeLists.txt index 29e6fc99f..9ab185c11 100644 --- a/src/Tools/YamsPlug/CMakeLists.txt +++ b/src/Tools/YamsPlug/CMakeLists.txt @@ -21,30 +21,36 @@ IF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF(SALOME_BUILD_DOC) -INCLUDE(UsePyQt) +IF(SALOME_BUILD_GUI) + INCLUDE(UsePyQt) +ENDIF(SALOME_BUILD_GUI) # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS monYamsPlugDialog.py monViewText.py yamsplug_plugin.py ) -# --- resources --- - -# uic files / to be processed by pyuic -SET(_pyuic_files - YamsPlugDialog.ui - ViewText.ui -) - -# scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +IF(SALOME_BUILD_GUI) + # uic files / to be processed by pyuic + SET(_pyuic_FILES + YamsPlugDialog.ui + ViewText.ui + ) + # scripts / pyuic wrappings + PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) +ENDIF(SALOME_BUILD_GUI) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) \ No newline at end of file +IF(SALOME_BUILD_GUI) + SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py) + # add dependency of compiled py files on uic files in order + # to avoid races problems when compiling in parallel + ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) +ENDIF(SALOME_BUILD_GUI) diff --git a/src/Tools/ZCracksPlug/CMakeLists.txt b/src/Tools/ZCracksPlug/CMakeLists.txt index 288b9d783..2f87a5cf1 100644 --- a/src/Tools/ZCracksPlug/CMakeLists.txt +++ b/src/Tools/ZCracksPlug/CMakeLists.txt @@ -19,12 +19,14 @@ ADD_SUBDIRECTORY(casTests) -INCLUDE(UsePyQt) +IF(SALOME_BUILD_GUI) + INCLUDE(UsePyQt) +ENDIF(SALOME_BUILD_GUI) # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS __init__.py ellipse.py genereCrack.py @@ -38,22 +40,27 @@ SET(plugin_SCRIPTS Zset.py ) -SET(command_SCRIPTS +SET(_command_SCRIPTS zcracksLaunch.py ) -# --- resources --- - -# uic files / to be processed by pyuic -SET(_pyuic_files - zcracks.ui -) - -# scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +IF(SALOME_BUILD_GUI) + # uic files / to be processed by pyuic + SET(_pyuic_FILES + zcracks.ui + ) + # scripts / pyuic wrappings + PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) +ENDIF(SALOME_BUILD_GUI) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks) -SALOME_INSTALL_SCRIPTS("${command_SCRIPTS}" ${SALOME_INSTALL_BINS}) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks) +SALOME_INSTALL_SCRIPTS("${_command_SCRIPTS}" ${SALOME_INSTALL_BINS}) +IF(SALOME_BUILD_GUI) + SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks TARGET_NAME _target_name_pyuic_py) + # add dependency of compiled py files on uic files in order + # to avoid races problems when compiling in parallel + ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) +ENDIF(SALOME_BUILD_GUI) + diff --git a/src/Tools/blocFissure/ihm/CMakeLists.txt b/src/Tools/blocFissure/ihm/CMakeLists.txt index 5ba2e6075..a561ab816 100644 --- a/src/Tools/blocFissure/ihm/CMakeLists.txt +++ b/src/Tools/blocFissure/ihm/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE(UsePyQt) # --- scripts --- # scripts / static -SET(plugin_SCRIPTS +SET(_plugin_SCRIPTS __init__.py fissureCoude_ihm.py fissureCoude_plugin.py @@ -30,19 +30,19 @@ SET(plugin_SCRIPTS dialogFissureCoude.dic ) -# --- resources --- - # uic files / to be processed by pyuic -SET(_pyuic_files +SET(_pyuic_FILES fissureCoude.ui fissureGenerale.ui ) - # scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) # --- rules --- -SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm) +SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm) -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm) +SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm TARGET_NAME _target_name_pyuic_py) +# add dependency of compiled py files on uic files in order +# to avoid races problems when compiling in parallel +ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) diff --git a/src/Tools/padder/spadderpy/gui/CMakeLists.txt b/src/Tools/padder/spadderpy/gui/CMakeLists.txt index 8bffecdc7..3ee6b8567 100644 --- a/src/Tools/padder/spadderpy/gui/CMakeLists.txt +++ b/src/Tools/padder/spadderpy/gui/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE(UsePyQt) # --- scripts --- # scripts / static -SET(py_SCRIPTS +SET(_py_SCRIPTS __init__.py plugindialog.py inputdialog.py @@ -32,7 +32,7 @@ SET(py_SCRIPTS # --- resources --- # uic files / to be processed by pyuic -SET(spadderpy_DATA +SET(_spadderpy_DATA parameters.png input.png select.png @@ -46,15 +46,20 @@ SET(spadderpy_DATA steelbar.png ) -SET(_pyuic_files +SET(_pyuic_FILES plugindialog.ui inputframe.ui ) # scripts / pyuic wrappings -PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) +PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) # --- rules --- -SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui) -SALOME_INSTALL_SCRIPTS("${py_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui) -INSTALL(FILES ${spadderpy_DATA} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui) +SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui TARGET_NAME _target_name_pyuic_py) +# add dependency of compiled py files on uic files in order +# to avoid races problems when compiling in parallel +ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) + +SALOME_INSTALL_SCRIPTS("${_py_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui) + +INSTALL(FILES ${_spadderpy_DATA} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui) From 62a5ed1578d719311fbf4cebf77c9d014205a510 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 3 Nov 2017 10:23:05 +0300 Subject: [PATCH 11/12] 0023492: EDF 15654 - Simple case NETGEN1D2D3D fails - Additional change to commit f4da288f: set SALOME_SMESH_DYNLOAD_LOCAL option ON by default (temporarily, until better solution isn't found) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a998c37..57381c39c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON) OPTION(SALOME_BUILD_GUI "Enable GUI" ON) OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF) OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF) -OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" OFF) +OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" ON) IF(SALOME_SMESH_DYNLOAD_LOCAL) ADD_DEFINITIONS(-DDYNLOAD_LOCAL) From 70c33e5f83059e589c93b7818348e3c003eaec4d Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 16 Nov 2017 15:17:10 +0300 Subject: [PATCH 12/12] 0023505: Sigsegv with fuse on cylinder and cone - Switch to C++ exception handling mechanism --- src/StdMeshers/StdMeshers_Distribution.cxx | 3 --- src/StdMeshers/StdMeshers_NumberOfSegments.cxx | 2 -- src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx | 4 ---- 3 files changed, 9 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 7fb3956ad..aeef4e1ef 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -56,7 +56,6 @@ bool Function::value( const double, double& f ) const OCC_CATCH_SIGNALS; f = pow( 10., f ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } @@ -187,7 +186,6 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; } @@ -220,7 +218,6 @@ bool FunctionExpr::value( const double t, double& f ) const OCC_CATCH_SIGNALS; f = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 927e96d02..98dac7e84 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -235,7 +235,6 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector& table) val = pow( 10.0, val ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); throw SALOME_Exception( LOCALIZED( "invalid value")); return; } @@ -330,7 +329,6 @@ bool process( const TCollection_AsciiString& str, int convMode, myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index 7761be258..f9ad75818 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -352,7 +352,6 @@ void StdMeshersGUI_DistrPreview::update() OCC_CATCH_SIGNALS; replot(); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); } } @@ -399,7 +398,6 @@ bool StdMeshersGUI_DistrPreview::init( const QString& str ) myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.toLatin1().data() ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } @@ -438,7 +436,6 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) OCC_CATCH_SIGNALS; res = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; res = 0.0; } @@ -466,7 +463,6 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const if(v < -7) v = -7.0; v = pow( 10.0, v ); } catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); v = 0.0; ok = false; }