#include <SMESH_MeshEditor.hxx>
#include <SMESH_MesherHelper.hxx>
#include <StdMeshers_FaceSide.hxx>
+#include <StdMeshers_ProjectionUtils.hxx>
#include <StdMeshers_ViscousLayers2D.hxx>
#include <Basics_Utils.hxx>
#include <TopoDS_Wire.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
-#include <gp_XY.hxx>
-#include <gp_XYZ.hxx>
#ifndef WIN32
#include <fenv.h>
error(_comment);
}
+ // Set event listeners
+ if ( _hypothesis )
+ for ( int iF = 1; iF <= fmap.Size(); ++iF )
+ {
+ const TopoDS_Shape& face = fmap( iF );
+ SetEventListener( aMesh.GetSubMesh( face ));
+ }
+
// Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false)
#ifndef WIN32
if ( oldFEFlags > 0 )
entryToShape.insert({ entry, shape });
}
}
+
+//================================================================================
+/*!
+ * \brief Sets event listener to submeshes if enforced mesh is defined
+ * \param subMesh - submesh where algo is set
+ *
+ * This method is called when a submesh gets HYP_OK algo_state.
+ * After being set, event listener is notified on each event of a submesh.
+ * By default none listener is set
+ */
+//================================================================================
+
+void BLSURFPlugin_BLSURF::SetEventListener(SMESH_subMesh* faceSubMesh)
+{
+ if ( !_hypothesis )
+ return;
+
+ for ( const BLSURFPlugin_Hypothesis::EnforcedMesh& enfMesh : _hypothesis->GetEnforcedMeshes() )
+ {
+ SMESH_Mesh* mesh1D;
+ _hypothesis->GetEnforcedSegments( enfMesh, mesh1D );
+ if ( !mesh1D )
+ continue;
+
+ TopExp_Explorer edgeExp( mesh1D->GetShapeToMesh(), TopAbs_EDGE );
+ if ( edgeExp.More() )
+ StdMeshers_ProjectionUtils::SetEventListener( faceSubMesh,
+ edgeExp.Current(),
+ mesh1D );
+ // StdMeshers_ProjectionUtils::SetEventListener( faceSubMesh,
+ // mesh1D->GetShapeToMesh(),
+ // mesh1D );
+ }
+ return;
+}
+
+//================================================================================
+/*!
+ * \brief Allow algo to do something after persistent restoration
+ * \param subMesh - restored submesh
+ *
+ * This method is called only if a submesh has HYP_OK algo_state.
+ */
+//================================================================================
+
+void BLSURFPlugin_BLSURF::SubmeshRestored(SMESH_subMesh* subMesh)
+{
+ SetEventListener( subMesh );
+}
* \param [in] braNodes - nodes of the branch
* \param [in] nodeIndex - index of a node of the branch
* \param [inout] mesh - mesh holding the nodes and segments
- *
- *
*/
//================================================================================
SMESH_Mesh* mesh1D;
SMDS_ElemIteratorPtr segIt = theHyp->GetEnforcedSegments( theEnfMesh, mesh1D );
if ( !segIt->more() )
- return;
+ throw SALOME_Exception("No edges in an enforced mesh");
// setup predicates to detect nodes on FACE boundary
setupPredicates( theShape );