Skip to content

Commit fb1a03c

Browse files
committed
Remove commands during clearSession
1 parent dbf79ab commit fb1a03c

File tree

1 file changed

+0
-61
lines changed

1 file changed

+0
-61
lines changed

src/Core/Internal/Context.cpp

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,67 +1710,6 @@ void Context::clearSession()
17101710
// annulation de la sélection
17111711
m_selection_manager->clearSelection ( );
17121712

1713-
//creation de la commande de destruction
1714-
Internal::CommandComposite* command = new Internal::CommandComposite(*this, TkUtil::UTF8String ("Destruction de tout, les commandes précédentes n'ont plus lieu d'être ! ", TkUtil::Charset::UTF_8));
1715-
1716-
// trace dans le script
1717-
TkUtil::UTF8String cmd (TkUtil::Charset::UTF_8);
1718-
cmd << getContextAlias() << ".clearSession()";
1719-
command->setScriptCommand(cmd);
1720-
1721-
// commande de destruction de toutes les entités maillages qui ont pu être construites
1722-
Mesh::CommandDestroyMesh* commandMesh = new Mesh::CommandDestroyMesh(*this);
1723-
1724-
command->addCommand(commandMesh);
1725-
1726-
// commande de destruction de toutes les entités topologiques qui ont pu être construites
1727-
std::vector<Topo::TopoEntity*> ve;
1728-
std::vector<Topo::Block*> blocks;
1729-
getTopoManager().getBlocks(blocks);
1730-
for (uint i=0; i<blocks.size(); i++)
1731-
ve.push_back(blocks[i]);
1732-
std::vector<Topo::CoFace*> cofaces;
1733-
getTopoManager().getCoFaces(cofaces);
1734-
for (uint i=0; i<cofaces.size(); i++)
1735-
ve.push_back(cofaces[i]);
1736-
std::vector<Topo::CoEdge*> coedges;
1737-
getTopoManager().getCoEdges(coedges);
1738-
for (uint i=0; i<coedges.size(); i++)
1739-
ve.push_back(coedges[i]);
1740-
std::vector<Topo::Vertex*> vertices;
1741-
getTopoManager().getVertices(vertices);
1742-
for (uint i=0; i<vertices.size(); i++)
1743-
ve.push_back(vertices[i]);
1744-
1745-
Topo::CommandDestroyTopo* commandTopo = new Topo::CommandDestroyTopo(*this, ve, true);
1746-
1747-
command->addCommand(commandTopo);
1748-
1749-
// commande de destruction de toutes les entités géométriques qui ont pu être construites
1750-
std::vector<Geom::GeomEntity*> entities;
1751-
std::vector<Geom::Volume*> volumes = getGeomManager().getVolumesObj();
1752-
for (uint i=0; i<volumes.size(); i++)
1753-
entities.push_back(volumes[i]);
1754-
std::vector<Geom::Surface*> surfaces = getGeomManager().getSurfacesObj();
1755-
for (uint i=0; i<surfaces.size(); i++)
1756-
entities.push_back(surfaces[i]);
1757-
std::vector<Geom::Curve*> curves = getGeomManager().getCurvesObj();
1758-
for (uint i=0; i<curves.size(); i++)
1759-
entities.push_back(curves[i]);
1760-
std::vector<Geom::Vertex*> vtx = getGeomManager().getVerticesObj();
1761-
for (uint i=0; i<vtx.size(); i++)
1762-
entities.push_back(vtx[i]);
1763-
1764-
Geom::CommandRemove* commandGeom = new Geom::CommandRemove(*this, entities, true);
1765-
1766-
command->addCommand(commandGeom);
1767-
1768-
// TODO [EB] Destruction des SysCoord
1769-
1770-
// on passe au gestionnaire de commandes qui exécute la commande en // ou non
1771-
// et la stocke dans le gestionnaire de undo-redo si c'est une réussite
1772-
getCommandManager().addCommand(command, Utils::Command::DO);
1773-
17741713
m_command_manager->clear();
17751714
m_name_manager->clear();
17761715
m_geom_manager->clear();

0 commit comments

Comments
 (0)