| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8042810 commit 9fe43d5
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,14 +87,27 @@ bool SolveSpaceUI::PruneGroups(hGroup hg) { | |||
| 87 | 87 | } | |
| 88 | 88 | ||
| 89 | 89 | bool SolveSpaceUI::PruneRequests(hGroup hg) { | |
| 90 | - auto e = std::find_if(SK.entity.begin(), SK.entity.end(), | ||
| 91 | - [&](Entity &e) { return e.group == hg && !EntityExists(e.workplane); }); | ||
| 92 | - if(e != SK.entity.end()) { | ||
| 93 | - (deleted.requests)++; | ||
| 94 | - SK.entity.RemoveById(e->h); | ||
| 95 | - return true; | ||
| 90 | + const int requests = SK.request.n; | ||
| 91 | + for(Entity &e : SK.entity) { | ||
| 92 | + if(e.group != hg) { | ||
| 93 | + continue; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + if(!e.h.isFromRequest()) { | ||
| 97 | + continue; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + if(EntityExists(e.workplane)) { | ||
| 101 | + continue; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + Request *r = SK.GetRequest(e.h.request()); | ||
| 105 | + r->tag = 1; | ||
| 96 | 106 | } | |
| 97 | - return false; | ||
| 107 | + SK.request.RemoveTagged(); | ||
| 108 | + deleted.requests += requests - SK.request.n; | ||
| 109 | + | ||
| 110 | + return requests > SK.request.n; | ||
| 98 | 111 | } | |
| 99 | 112 | ||
| 100 | 113 | bool SolveSpaceUI::PruneConstraints(hGroup hg) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1039,14 +1039,6 @@ void GraphicsWindow::ForceTextWindowShown() { | |||
| 1039 | 1039 | } | |
| 1040 | 1040 | ||
| 1041 | 1041 | void GraphicsWindow::DeleteTaggedRequests() { | |
| 1042 | - // Delete any requests that were affected by this deletion. | ||
| 1043 | - for(Request &r : SK.request) { | ||
| 1044 | - if(r.workplane == Entity::FREE_IN_3D) continue; | ||
| 1045 | - if(!r.workplane.isFromRequest()) continue; | ||
| 1046 | - Request *wrkpl = SK.GetRequest(r.workplane.request()); | ||
| 1047 | - if(wrkpl->tag) | ||
| 1048 | - r.tag = 1; | ||
| 1049 | - } | ||
| 1050 | 1042 | // Rewrite any point-coincident constraints that were affected by this | |
| 1051 | 1043 | // deletion. | |
| 1052 | 1044 | for(Request &r : SK.request) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments