throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
+
+ const int prevNbMeshEnt = NbNodes() + NbElements();
+
if ( _preMeshInfo )
_preMeshInfo->ForgetOrLoad();
- const int prevNbMeshEnt = _impl->NbNodes() + _impl->GetMeshDS()->NbElements();
-
std::string error;
SMESH_Hypothesis::Hypothesis_Status status = addHypothesis( aSubShape, anHyp, &error );
anErrorText = error.c_str();
if ( n->NbInverseElements() == 0 )
_impl->GetMeshDS()->RemoveFreeNode( n, /*sm=*/0 );
+ _impl->GetMeshDS()->Modified();
+ _impl->SetIsModified( true );
+
// Update Python script (theGroup must be alive for this)
pyDump << SMESH::SMESH_Mesh_var(_this())
<< ".RemoveGroupWithContents( " << theGroup << " )";
bool geomChanged = true;
GEOM::GEOM_Object_var oldGeom = GetShapeToMesh();
if ( !theNewGeom->_is_nil() && !oldGeom->_is_nil() )
- geomChanged = ( //oldGeom->_is_equivalent( theNewGeom ) ||
- oldGeom->GetTick() < theNewGeom->GetTick() );
+ geomChanged = ( oldGeom->GetTick() != theNewGeom->GetTick() );
TopoDS_Shape S = _impl->GetShapeToMesh();
GEOM_Client* geomClient = _gen_i->GetShapeReader();
TCollection_AsciiString aIOR;
- CORBA::String_var ior;
if ( geomClient->Find( S, aIOR ))
geomClient->RemoveShapeFromBuffer( aIOR );
// clear buffer also for sub-groups
- const std::set<SMESHDS_GroupBase*>& groups = _impl->GetMeshDS()->GetGroups();
+ SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
+ const std::set<SMESHDS_GroupBase*>& groups = meshDS->GetGroups();
std::set<SMESHDS_GroupBase*>::const_iterator g = groups.begin();
for (; g != groups.end(); ++g)
if (const SMESHDS_GroupOnGeom* group = dynamic_cast<SMESHDS_GroupOnGeom*>(*g))
geomClient->RemoveShapeFromBuffer( aIOR );
}
+ // clear buffer also for sub-meshes
+ std::map<int, SMESH_subMesh_i*>::const_iterator aSubMeshIter = _mapSubMesh_i.cbegin();
+ for(; aSubMeshIter != _mapSubMesh_i.cend(); aSubMeshIter++) {
+ int aShapeID = aSubMeshIter->first;
+ const TopoDS_Shape& aSubShape = meshDS->IndexToShape(aShapeID);
+ TCollection_AsciiString aShapeIOR;
+ if ( geomClient->Find( aSubShape, aShapeIOR ))
+ geomClient->RemoveShapeFromBuffer( aShapeIOR );
+ }
+
typedef struct {
int shapeID, fromID, toID; // indices of elements of a sub-mesh
} TRange;
std::vector< TRange > elemRanges, nodeRanges; // elements of sub-meshes
std::vector< SMDS_PositionPtr > positions; // node positions
- SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
if ( !geomChanged )
{
// store positions of elements on geometry
{
SMESH_Mesh_i* _mesh;
TCallUp_i(SMESH_Mesh_i* mesh):_mesh(mesh) {}
- virtual void RemoveGroup (const int theGroupID) { _mesh->removeGroup( theGroupID ); }
- virtual void HypothesisModified( int hypID,
- bool updIcons) { _mesh->onHypothesisModified( hypID,
- updIcons ); }
- virtual void Load () { _mesh->Load(); }
- virtual bool IsLoaded() { return _mesh->IsLoaded(); }
+ void RemoveGroup (const int theGroupID) override { _mesh->removeGroup( theGroupID ); }
+ void HypothesisModified( int hypID,
+ bool updIcons) override { _mesh->onHypothesisModified( hypID,
+ updIcons ); }
+ void Load () override { _mesh->Load(); }
+ bool IsLoaded() override { return _mesh->IsLoaded(); }
+ TopoDS_Shape GetShapeByEntry(const std::string& entry) override
+ {
+ GEOM::GEOM_Object_var go = SMESH_Gen_i::GetGeomObjectByEntry( entry );
+ return SMESH_Gen_i::GeomObjectToShape( go );
+ }
};
}
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'"
<< file << "', "
<< "auto_groups=" <<auto_groups << ", "
- << "minor=" << version << ", "
+ << "version=" << version << ", "
<< "overwrite=" << overwrite << ", "
<< "meshPart=None, "
<< "autoDimension=" << autoDimension << " )";