[TD]CL removal

This commit is contained in:
wandererfan
2019-11-06 14:52:16 -05:00
committed by WandererFan
parent 5957b72573
commit 3921a22e8b
3 changed files with 37 additions and 11 deletions

View File

@@ -1328,6 +1328,38 @@ void DrawViewPart::removeCenterLine(int idx)
}
}
void DrawViewPart::removeCenterLine(std::string delTag)
{
// Base::Console().Message("DVP::removeCL(%s)\n", delTag.c_str());
std::vector<CenterLine*> cLines = CenterLines.getValues();
std::vector<CenterLine*> newLines;
for (auto& cl: cLines) {
if (cl->getTagAsString() != delTag) {
newLines.push_back(cl);
}
}
CenterLines.setValues(newLines);
}
void DrawViewPart::removeCenterLine(std::vector<std::string> delTags)
{
std::vector<CenterLine*> cLines = CenterLines.getValues();
std::vector<CenterLine*> newLines;
for (auto& cl: cLines) {
bool found = false;
for (auto& dt: delTags) {
if (cl->getTagAsString() == dt) {
found = true; //this cl is in delete list
break;
}
}
if (!found) {
newLines.push_back(cl);
}
}
CenterLines.setValues(newLines);
}
void DrawViewPart::replaceCenterLine(int idx, TechDraw::CenterLine* cl)
{
std::vector<CenterLine*> lines = CenterLines.getValues();