From 04f422caebc57d58ee682a5ef9d1809325c3ba71 Mon Sep 17 00:00:00 2001 From: eap Date: Sat, 24 Apr 2021 13:18:13 +0300 Subject: [PATCH 1/4] fix Error in "image" directive: no content permitted. --- src/Tools/blocFissure/doc/pipes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/blocFissure/doc/pipes.rst b/src/Tools/blocFissure/doc/pipes.rst index 2101f546a..386e41842 100644 --- a/src/Tools/blocFissure/doc/pipes.rst +++ b/src/Tools/blocFissure/doc/pipes.rst @@ -11,7 +11,7 @@ Cracked bended pipes being a common encountered case, a specific module was deve :align: center :alt: Print screen of GUI - Print screen of GUI of the extension *Meshed Pipe with a crack* +Print screen of GUI of the extension *Meshed Pipe with a crack* The GUI is a window with mandatory and optional parameters. Optional parameters have to be activated by ticking the corresponding check box. Parameters are explained on the following figures and table. Angles are in degrees and lengths dimensions are all the same and shall then be consistent with each other’s. From 4ba3c7cda8107895fea66822ea93d03bbfc2e218 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Apr 2021 13:22:23 +0300 Subject: [PATCH 2/4] bos #20256 [CEA 18523] Porting SMESH to int 64 bits Fix export huge mesh to MED --- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index e7739b177..b0d98d2c3 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -786,7 +786,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() // iterator on elements of a current type SMDS_ElemIteratorPtr elemIterator; - int iElem = 0; + TInt iElem = 0; // Treat POLYGONs // --------------- From 78e2e09d5ce1cbe60fc91140e6025ea175bd5c8b Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Apr 2021 13:51:32 +0300 Subject: [PATCH 3/4] bos #20256 [CEA 18523] Porting SMESH to int 64 bits Fix import huge mesh from MED --- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 1a3fd08a5..bc343e1b5 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -503,7 +503,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() default:; } vector aNodeIds(aNbNodes); - for ( int iElem = 0; iElem < aNbElems; iElem++ ) + for ( TInt iElem = 0; iElem < aNbElems; iElem++ ) { bool anIsValidConnect = false; TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); From b79f3c0765077420af47201c7f12b5654a6c04ed Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 5 May 2021 13:28:17 +0300 Subject: [PATCH 4/4] bos #24257 [CEA] Fatal error when creating a submesh if the mesh is on a sub-shape Adjust isSubshapeOk() for SHAPERSTUDY where GEOM_Gen::AddSubShape() not implemented --- src/Driver/Driver_Mesh.h | 2 -- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 55 +++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/Driver/Driver_Mesh.h b/src/Driver/Driver_Mesh.h index a1af52641..9eac8fc88 100644 --- a/src/Driver/Driver_Mesh.h +++ b/src/Driver/Driver_Mesh.h @@ -72,8 +72,6 @@ class MESHDRIVER_EXPORT Driver_Mesh virtual SMESH_ComputeErrorPtr GetError(); - //virtual bool CanExportMesh() const { return false; } //= 0; - // check if a mesh is too large to export it using IDTYPE; // check either max ID or number of elements template< typename IDTYPE > diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 46293261d..68791630a 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -43,6 +43,7 @@ // SALOME GEOM includes #include #include +#include #include #include #include @@ -318,10 +319,29 @@ SUIT_SelectionFilter* SMESHGUI_MeshOp::createFilter( const int theId ) const return 0; } +//================================================================================ +/*! + * \brief Return type of shape contained in a group + */ +//================================================================================ + +TopAbs_ShapeEnum getGroupType(const TopoDS_Shape& group) +{ + if ( group.ShapeType() != TopAbs_COMPOUND ) + return group.ShapeType(); + + // iterate on a compound + TopoDS_Iterator it( group ); + if ( it.More() ) + return getGroupType( it.Value() ); + + return TopAbs_SHAPE; +} + //================================================================================ /*! * \brief check if selected shape is a sub-shape of the shape to mesh - * \retval bool - check result + * \retval bool - check result */ //================================================================================ bool SMESHGUI_MeshOp::isSubshapeOk() const @@ -354,7 +374,8 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const // check all selected shapes QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); - for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) { + for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) + { QString aSubGeomEntry = (*aSubShapesIter); _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data()); if (!pSubGeom) return false; @@ -366,7 +387,8 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const // skl for NPAL14695 - implementation of searching of mainObj GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as mainObj already exists! */ - while( !mainObj->_is_nil()) { + while( !mainObj->_is_nil()) + { CORBA::String_var entry1 = mainObj->GetEntry(); CORBA::String_var entry2 = mainGeom->GetEntry(); if (std::string( entry1.in() ) == entry2.in() ) @@ -382,21 +404,18 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const GEOM::SHAPE,/*sorted=*/false); if ( ids->length() > 0 ) { - ids->length( 1 ); - GEOM::GEOM_Object_var compSub = geomGen->AddSubShape( aSubGeomVar, ids ); - if ( !compSub->_is_nil() ) - { - GEOM::ListOfGO_var shared = sop->GetSharedShapes( mainGeom, - compSub, - compSub->GetShapeType() ); - geomGen->RemoveObject( compSub ); - compSub->UnRegister(); - if ( shared->length() > 0 ) { - geomGen->RemoveObject( shared[0] ); - shared[0]->UnRegister(); - } - return ( shared->length() > 0 ); - } + GEOM_Client geomClient; + TopoDS_Shape subShape = geomClient.GetShape( geomGen, aSubGeomVar ); + TopoDS_Shape mainShape = geomClient.GetShape( geomGen, mainGeom ); + if ( subShape.IsNull() || mainShape.IsNull() ) + return false; + + TopAbs_ShapeEnum subType = getGroupType( subShape ); + TopTools_IndexedMapOfShape subMap; + TopExp::MapShapes( subShape, subType, subMap ); + for ( TopExp_Explorer exp( mainShape, subType ); exp.More(); exp.Next() ) + if ( subMap.Contains( exp.Current() )) + return true; } } }