Skip to content

Commit a135089

Browse files
lelandaisbmpoudot
authored andcommitted
Fix undo clear group bug
1 parent e8fae55 commit a135089

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/Core/Internal/InfoCommand.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,15 @@ void InfoCommand::addGroupInfoEntity(Group::GroupEntity* entity, type t)
217217
TkUtil::AutoMutex autoMutex (&m_mutex);
218218
#ifdef _DEBUG2
219219
std::cout<<"addGroupInfoEntity("<<entity->getName()<<" (id "<<entity->getUniqueId()<<"),"
220-
<<type2String(m_group_entities_info[entity])<<" => "<<type2String(t)
221-
<<")"<<std::endl;
220+
<<type2String(m_group_entities_info[entity])<<" -> "<<type2String(t);
222221
#endif
223222
type old_t = m_group_entities_info[entity];
224223
if (old_t < t)
225224
m_group_entities_info[entity] = t;
225+
226+
#ifdef _DEBUG2
227+
std::cout<<" ==> "<<type2String(m_group_entities_info[entity])<<")"<<std::endl;
228+
#endif
226229
}
227230
/*----------------------------------------------------------------------------*/
228231
void InfoCommand::getGeomInfoEntity(uint ind, Geom::GeomEntity* &entity, type &t)

src/Core/Mesh/CommandClearGroupName.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ void CommandClearGroupName::internalExecute()
183183
/*----------------------------------------------------------------------------*/
184184
void CommandClearGroupName::internalUndo()
185185
{
186+
187+
getInfoCommand().permCreatedDeleted();
188+
189+
// suppression de ce qui a été ajouté
190+
deleteCreatedMeshEntities();
191+
192+
// permute toutes les propriétés internes avec leur sauvegarde
193+
permInternalsStats();
194+
186195
Group::GroupManager& gm = getContext().getGroupManager();
187196
std::string default_group_name = gm.getDefaultName(m_dim);
188197

@@ -268,18 +277,18 @@ void CommandClearGroupName::internalUndo()
268277
}
269278
break;
270279
}
271-
280+
}
281+
/*----------------------------------------------------------------------------*/
282+
void CommandClearGroupName::internalRedo()
283+
{
272284
getInfoCommand().permCreatedDeleted();
273285

274286
// suppression de ce qui a été ajouté
275287
deleteCreatedMeshEntities();
276288

277289
// permute toutes les propriétés internes avec leur sauvegarde
278290
permInternalsStats();
279-
}
280-
/*----------------------------------------------------------------------------*/
281-
void CommandClearGroupName::internalRedo()
282-
{
291+
283292
switch(m_dim){
284293
case(0):{
285294
for (std::vector<Geom::GeomEntity*>::iterator iter = m_geom_entities.begin();
@@ -360,14 +369,6 @@ void CommandClearGroupName::internalRedo()
360369
}
361370
break;
362371
}
363-
364-
getInfoCommand().permCreatedDeleted();
365-
366-
// suppression de ce qui a été ajouté
367-
deleteCreatedMeshEntities();
368-
369-
// permute toutes les propriétés internes avec leur sauvegarde
370-
permInternalsStats();
371372
}
372373
/*----------------------------------------------------------------------------*/
373374
void CommandClearGroupName::

0 commit comments

Comments
 (0)