ignore whole selected objects for Part linear/angular measurement tool

Whole objects selected in the model tree will be ignored for the measurement element selection.
This allows for selecting and toggling the visibility of an object in the model tree.
This commit is contained in:
bdieterm
2023-08-12 19:05:00 +02:00
committed by wwmayer
parent c3d1836345
commit d5c4e501ad

View File

@@ -560,6 +560,9 @@ PartGui::TaskMeasureLinear::~TaskMeasureLinear()
void PartGui::TaskMeasureLinear::onSelectionChanged(const Gui::SelectionChanges& msg)
{
if (msg.pSubName[0] == '\0')
return; // ignore whole objects selected in the model tree, e.g. when toggling the visibility of an object
if (buttonSelectedIndex == 0)
{
if (msg.Type == Gui::SelectionChanges::AddSelection)
@@ -1557,6 +1560,9 @@ PartGui::TaskMeasureAngular::~TaskMeasureAngular()
void PartGui::TaskMeasureAngular::onSelectionChanged(const Gui::SelectionChanges& msg)
{
if (msg.pSubName[0] == '\0')
return; // ignore whole objects selected in the model tree, e.g. when toggling the visibility of an object
TopoDS_Shape shape;
Base::Matrix4D mat;
if (!getShapeFromStrings(shape, std::string(msg.pDocName),