Assembly: Use icon overlay for unconnected joints instead of annoying warning. (#22662)
* Core: FeaturePython : Add getOverlayIcons to python interface * Assembly: unconnected joints icon overlay Fix #22643 * Update src/Mod/Assembly/Gui/ViewProviderAssembly.cpp Co-authored-by: Kacper Donat <kadet1090@gmail.com> * Update AssemblyObject.cpp * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update ViewProviderFeaturePython.h * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update ViewProviderFeaturePython.h * Update JointObject.py * Update ViewProviderFeaturePython.h * Update ViewProviderFeaturePython.cpp * Update Application.cpp * Update ViewProviderFeaturePython.cpp * Update ViewProviderFeaturePython.h * Update ViewProviderAssembly.cpp --------- Co-authored-by: Kacper Donat <kadet1090@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -939,23 +939,17 @@ void AssemblyObject::removeUnconnectedJoints(std::vector<App::DocumentObject*>&
|
||||
}
|
||||
|
||||
// Filter out unconnected joints
|
||||
joints.erase(
|
||||
std::remove_if(
|
||||
joints.begin(),
|
||||
joints.end(),
|
||||
[&](App::DocumentObject* joint) {
|
||||
App::DocumentObject* obj1 = getMovingPartFromRef(this, joint, "Reference1");
|
||||
App::DocumentObject* obj2 = getMovingPartFromRef(this, joint, "Reference2");
|
||||
if (!isObjInSetOfObjRefs(obj1, connectedParts)
|
||||
|| !isObjInSetOfObjRefs(obj2, connectedParts)) {
|
||||
Base::Console().warning(
|
||||
"%s is unconnected to a grounded part so it is ignored.\n",
|
||||
joint->getFullName());
|
||||
return true; // Remove joint if any connected object is not in connectedParts
|
||||
}
|
||||
return false;
|
||||
}),
|
||||
joints.end());
|
||||
joints.erase(std::remove_if(joints.begin(),
|
||||
joints.end(),
|
||||
[&](App::DocumentObject* joint) {
|
||||
App::DocumentObject* obj1 =
|
||||
getMovingPartFromRef(this, joint, "Reference1");
|
||||
App::DocumentObject* obj2 =
|
||||
getMovingPartFromRef(this, joint, "Reference2");
|
||||
return (!isObjInSetOfObjRefs(obj1, connectedParts)
|
||||
|| !isObjInSetOfObjRefs(obj2, connectedParts));
|
||||
}),
|
||||
joints.end());
|
||||
}
|
||||
|
||||
void AssemblyObject::traverseAndMarkConnectedParts(App::DocumentObject* currentObj,
|
||||
|
||||
Reference in New Issue
Block a user