Fix regression in pattern reference selection

Reference selection in the GUI was accidentially changed to only
allow specific types of objects, preventing e.g. selection of a DatumPlane
for mirroring.

This restores the previous functionality.
This commit is contained in:
André Althaus
2024-03-12 16:10:01 +01:00
committed by Yorik van Havre
parent 67a31fa948
commit 35ca189589
3 changed files with 6 additions and 9 deletions

View File

@@ -221,7 +221,7 @@ void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges
if (originalSelected(msg)) {
exitSelectionMode();
}
else if (selectionMode == SelectionMode::Reference) {
else {
auto pcLinearPattern = static_cast<PartDesign::LinearPattern*>(getObject());
std::vector<std::string> directions;
@@ -232,9 +232,7 @@ void TaskLinearPatternParameters::onSelectionChanged(const Gui::SelectionChanges
}
// Note: ReferenceSelection has already checked the selection for validity
if (selObj->isDerivedFrom<App::Line>() || selObj->isDerivedFrom<Part::Feature>()
|| selObj->isDerivedFrom<PartDesign::Line>()
|| selObj->isDerivedFrom<PartDesign::Plane>()) {
if (selectionMode == SelectionMode::Reference || selObj->isDerivedFrom<App::Line>()) {
setupTransaction();
pcLinearPattern->Direction.setValue(selObj, directions);
recomputeFeature();

View File

@@ -134,7 +134,7 @@ void TaskMirroredParameters::onSelectionChanged(const Gui::SelectionChanges& msg
if (originalSelected(msg)) {
exitSelectionMode();
}
else if (selectionMode == SelectionMode::Reference) {
else {
auto pcMirrored = static_cast<PartDesign::Mirrored*>(getObject());
std::vector<std::string> mirrorPlanes;
@@ -144,7 +144,7 @@ void TaskMirroredParameters::onSelectionChanged(const Gui::SelectionChanges& msg
return;
}
if (selObj->isDerivedFrom<App::Plane>()) {
if (selectionMode == SelectionMode::Reference || selObj->isDerivedFrom<App::Plane>()) {
setupTransaction();
pcMirrored->MirrorPlane.setValue(selObj, mirrorPlanes);
recomputeFeature();

View File

@@ -221,7 +221,7 @@ void TaskPolarPatternParameters::onSelectionChanged(const Gui::SelectionChanges&
if (originalSelected(msg)) {
exitSelectionMode();
}
else if (selectionMode == SelectionMode::Reference) {
else {
auto pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
std::vector<std::string> axes;
@@ -231,8 +231,7 @@ void TaskPolarPatternParameters::onSelectionChanged(const Gui::SelectionChanges&
return;
}
if (selObj->isDerivedFrom<App::Line>() || selObj->isDerivedFrom<Part::Feature>()
|| selObj->isDerivedFrom<PartDesign::Line>()) {
if (selectionMode == SelectionMode::Reference || selObj->isDerivedFrom<App::Line>()) {
setupTransaction();
pcPolarPattern->Axis.setValue(selObj, axes);
recomputeFeature();