_isAutoColor = false;
_isModified = false;
_shapeDiagonal = 0.0;
+ _rmGroupCallUp = 0;
_myMeshDS->ShapeToMesh( PseudoShape() );
}
+//================================================================================
+/*!
+ * \brief Constructor of SMESH_Mesh being a base of some descendant class
+ */
+//================================================================================
+
+SMESH_Mesh::SMESH_Mesh():
+ _groupId( 0 ), _nbSubShapes( 0 )
+{
+ _myMeshDS = 0;
+ _isShapeToMesh = false;
+ _isAutoColor = false;
+ _isModified = false;
+ _shapeDiagonal = 0.0;
+ _rmGroupCallUp = 0;
+}
+
//=============================================================================
/*!
*
delete aGroup;
}
_mapGroup.clear();
+
+ if ( _rmGroupCallUp) delete _rmGroupCallUp;
+ _rmGroupCallUp = 0;
}
//=============================================================================
_myMeshDS->ClearMesh();
// update compute state of submeshes
- if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) ) {
- SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
- /*complexShapeFirst=*/false);
- while ( smIt->more() ) {
- sm = smIt->next();
- sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
- }
+ if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) )
+ {
+ sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+ sm->ComputeSubMeshStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+ sm->ComputeStateEngine( SMESH_subMesh::CLEAN ); // for event listeners (issue 0020918)
+ sm->ComputeSubMeshStateEngine( SMESH_subMesh::CLEAN );
}
_isModified = false;
}
// NotConformAllowed can be only global
if ( !isGlobalHyp )
{
+ // NOTE: this is not a correct way to check a name of hypothesis,
+ // there should be an attribute of hypothesis saying that it can/can't
+ // be global/local
string hypName = anHyp->GetName();
if ( hypName == "NotConformAllowed" )
{
}
}
}
- HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
+ HasModificationsToDiscard(); // to reset _isModified flag if a mesh becomes empty
+
+ GetMeshDS()->Modified();
if(MYDEBUG) subMesh->DumpAlgoState(true);
if(MYDEBUG) SCRUTE(ret);
HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
+ GetMeshDS()->Modified();
+
if(MYDEBUG) subMesh->DumpAlgoState(true);
if(MYDEBUG) SCRUTE(ret);
return ret;
}
}
}
- HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty
+ HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
+ GetMeshDS()->Modified();
}
//=============================================================================
*/
//================================================================================
-int SMESH_Mesh::NbNodes() throw(SALOME_Exception)
+int SMESH_Mesh::NbNodes() const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbNodes();
*/
//================================================================================
-int SMESH_Mesh::Nb0DElements() throw(SALOME_Exception)
+int SMESH_Mesh::Nb0DElements() const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().Nb0DElements();
*/
//================================================================================
-int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbEdges(order);
*/
//================================================================================
-int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbFaces(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbPolygons() throw(SALOME_Exception)
+int SMESH_Mesh::NbPolygons() const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolygons();
*/
//================================================================================
-int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbVolumes(order);
*/
//================================================================================
-int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTetras(order);
*/
//================================================================================
-int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexas(order);
*/
//================================================================================
-int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPyramids(order);
*/
//================================================================================
-int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) throw(SALOME_Exception)
+int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPrisms(order);
*/
//================================================================================
-int SMESH_Mesh::NbPolyhedrons() throw(SALOME_Exception)
+int SMESH_Mesh::NbPolyhedrons() const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolyhedrons();
*/
//================================================================================
-int SMESH_Mesh::NbSubMesh() throw(SALOME_Exception)
+int SMESH_Mesh::NbSubMesh() const throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbSubMesh();
return anIds;
}
+//================================================================================
+/*!
+ * \brief Set a caller of RemoveGroup() at level of CORBA API implementation.
+ * The set upCaller will be deleted by SMESH_Mesh
+ */
+//================================================================================
+
+void SMESH_Mesh::SetRemoveGroupCallUp( TRmGroupCallUp* upCaller )
+{
+ if ( _rmGroupCallUp ) delete _rmGroupCallUp;
+ _rmGroupCallUp = upCaller;
+}
//=============================================================================
/*!
*/
//=============================================================================
-void SMESH_Mesh::RemoveGroup (const int theGroupID)
+bool SMESH_Mesh::RemoveGroup (const int theGroupID)
{
if (_mapGroup.find(theGroupID) == _mapGroup.end())
- return;
+ return false;
GetMeshDS()->RemoveGroup( _mapGroup[theGroupID]->GetGroupDS() );
delete _mapGroup[theGroupID];
_mapGroup.erase (theGroupID);
+ if (_rmGroupCallUp)
+ _rmGroupCallUp->RemoveGroup( theGroupID );
+ return true;
}
//=======================================================================
for ( desType = TopAbs_VERTEX; desType >= memberType; desType-- )
for (TopExp_Explorer des( theShape, TopAbs_ShapeEnum( desType )); des.More(); des.Next())
{
+ if ( !_mapAncestors.Contains( des.Current() )) continue;// issue 0020982
TopTools_ListOfShape& ancList = _mapAncestors.ChangeFromKey( des.Current() );
TopTools_ListIteratorOfListOfShape ancIt (ancList);
while ( ancIt.More() && ancIt.Value().ShapeType() >= memberType )