PrintMeshInfo(tria)
# remove a local hypothesis
-mesh = tria.GetMesh()
-mesh.RemoveHypothesis(edge, hyp4)
+tria.RemoveHypothesis(hyp4, edge)
# compute the mesh
tria.Compute()
# Creating a hexahedral mesh on a cylinder.
-# Note: it is a copy of 'ex24_cylinder.py' from SMESH_SWIG
+#
+# This example uses Partition to divide the cylinder into blocks, which is
+# a general approach. But for the case of cylinder there is a dedicated
+# command creating a blocked cylinder: geompy.MakeDividedCylinder()
import salome
salome.salome_init()
// shape
- bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
- int event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP;
+ bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
+ SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP;
SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp);
// shape
- bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
- int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;
+ bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
+ SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;
SMESH_subMesh *subMesh = GetSubMesh(aSubShape);
//================================================================================
SMESH_Hypothesis::Hypothesis_Status
- SMESH_subMesh::AlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
+ SMESH_subMesh::AlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp)
{
// **** les retour des evenement shape sont significatifs
// (add ou remove fait ou non)
//================================================================================
SMESH_Hypothesis::Hypothesis_Status
- SMESH_subMesh::SubMeshesAlgoStateEngine(int event,
+ SMESH_subMesh::SubMeshesAlgoStateEngine(algo_event event,
SMESH_Hypothesis * anHyp,
bool exitOnFatal)
{
if ( !sameShapeType )
{
// check if the algo allows presence of global algos of dimension the algo
- // can generate it-self
+ // can generate it-self;
+ // always keep a node on VERTEX, as this node can be shared by segments
+ // lying on EDGEs not shared by the VERTEX of sm, due to MergeNodes (PAL23068)
int shapeDim = SMESH_Gen::GetShapeDim( sm->GetSubShape() );
- keepSubMeshes = algoRequiringCleaning->NeedLowerHyps( shapeDim );
+ keepSubMeshes = ( algoRequiringCleaning->NeedLowerHyps( shapeDim ) || shapeDim == 0 );
prevShapeType = sm->GetSubShape().ShapeType();
toKeepPrevShapeType = keepSubMeshes;
}
*/
//=============================================================================
-bool SMESH_subMesh::ComputeStateEngine(int event)
+bool SMESH_subMesh::ComputeStateEngine(compute_event event)
{
switch ( event ) {
case MODIF_ALGO_STATE:
//purpose :
//=======================================================================
-void SMESH_subMesh::ComputeSubMeshStateEngine(int event, const bool includeSelf)
+void SMESH_subMesh::ComputeSubMeshStateEngine(compute_event event, const bool includeSelf)
{
SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(includeSelf,false);
while ( smIt->more() )
switch ( event ) {
case SMESH_subMesh::CLEAN:
for ( ; smIt != smEnd; ++ smIt)
- (*smIt)->ComputeStateEngine( event );
+ (*smIt)->ComputeStateEngine( SMESH_subMesh::compute_event( event ));
break;
case SMESH_subMesh::COMPUTE:
case SMESH_subMesh::COMPUTE_SUBMESH:
public:
SMESH_Hypothesis::Hypothesis_Status
- AlgoStateEngine(int event, SMESH_Hypothesis * anHyp);
+ AlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp);
SMESH_Hypothesis::Hypothesis_Status
- SubMeshesAlgoStateEngine(int event, SMESH_Hypothesis * anHyp, bool exitOnFatal=false);
+ SubMeshesAlgoStateEngine(algo_event event, SMESH_Hypothesis * anHyp, bool exitOnFatal=false);
algo_state GetAlgoState() const { return _algoState; }
compute_state GetComputeState() const { return _computeState; }
void DumpAlgoState(bool isMain);
- bool ComputeStateEngine(int event);
- void ComputeSubMeshStateEngine(int event, const bool includeSelf=false);
+ bool ComputeStateEngine(compute_event event);
+ void ComputeSubMeshStateEngine(compute_event event, const bool includeSelf=false);
bool Evaluate(MapShapeNbElems& aResMap);
{
//MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups);
if (elt->GetType() == SMDSAbs_Node) {
- RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh);
+ RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh, fromGroups);
return;
}
return false;
for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints > 0 ].size(); ++iS )
- shortMap.Add( theShortEdges[ nbBranchPoints ][ iS ]);
+ shortMap.Add( theShortEdges[ nbBranchPoints > 0 ][ iS ]);
++nbBranchPoints;
}