Sketcher: fix external edges selection

* fix selection from Sketcher Task Panel
 * fix selection from 3D View
 * Synchronize selection between Task Panel and 3D View

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
This commit is contained in:
CalligaroV
2024-05-29 10:13:21 +02:00
committed by Chris Hennes
parent 13296ccfc2
commit 4a486b21ed
2 changed files with 48 additions and 3 deletions

View File

@@ -2209,6 +2209,16 @@ void ViewProviderSketch::onSelectionChanged(const Gui::SelectionChanges& msg)
sketchHandler->applyCursor();
this->updateColor();
}
else if (shapetype.size() > 12 && shapetype.substr(0, 12) == "ExternalEdge") {
int GeoId = std::atoi(&shapetype[12]) - 1;
GeoId = -GeoId - 3;
resetPreselectPoint();
preselection.PreselectCurve = GeoId;
if (sketchHandler)
sketchHandler->applyCursor();
this->updateColor();
}
else if (shapetype.size() > 6 && shapetype.substr(0, 6) == "Vertex") {
int PtIndex = std::atoi(&shapetype[6]) - 1;
setPreselectPoint(PtIndex);
@@ -2449,7 +2459,12 @@ void ViewProviderSketch::doBoxSelection(const SbVec2s& startPos, const SbVec2s&
auto selectEdge = [this](int edgeid) {
std::stringstream ss;
ss << "Edge" << edgeid;
if (edgeid >= 0) {
ss << "Edge" << edgeid;
}
else {
ss << "ExternalEdge" << -edgeid - 1;
}
addSelection2(ss.str());
};