Gui: Correct linter problems

This commit is contained in:
tetektoza
2025-09-06 17:13:05 +02:00
parent a4f851c501
commit 06f0a6a428
2 changed files with 17 additions and 10 deletions

View File

@@ -4011,12 +4011,13 @@ void StdCmdClarifySelection::activated(int iMsg)
SoRayPickAction pickAction(viewer->getSoRenderManager()->getViewportRegion());
pickAction.setPoint(point);
float clarifyRadiusMultiplier = App::GetApplication()
constexpr double defaultMultiplier = 5.0F;
double clarifyRadiusMultiplier = App::GetApplication()
.GetParameterGroupByPath("User parameter:BaseApp/Preferences/View")
->GetFloat("ClarifySelectionRadiusMultiplier", 5.0f);
->GetFloat("ClarifySelectionRadiusMultiplier", defaultMultiplier);
pickAction.setRadius(viewer->getPickRadius() * clarifyRadiusMultiplier);
pickAction.setPickAll(true); // Get all objects under cursor
pickAction.setPickAll(static_cast<SbBool>(true)); // Get all objects under cursor
pickAction.apply(viewer->getSoRenderManager()->getSceneGraph());
const SoPickedPointList& pplist = pickAction.getPickedPointList();
@@ -4029,22 +4030,26 @@ void StdCmdClarifySelection::activated(int iMsg)
for (int i = 0; i < pplist.getLength(); ++i) {
SoPickedPoint* pp = pplist[i];
if (!pp || !pp->getPath())
if (!pp || !pp->getPath()) {
continue;
}
ViewProvider* vp = viewer->getViewProviderByPath(pp->getPath());
if (!vp)
if (!vp) {
continue;
}
// Cast to ViewProviderDocumentObject to get the object
auto vpDoc = freecad_cast<Gui::ViewProviderDocumentObject*>(vp);
if (!vpDoc)
if (!vpDoc) {
continue;
}
App::DocumentObject* obj = vpDoc->getObject();
if (!obj)
if (!obj) {
continue;
}
// Get element information - handle sub-objects like Assembly parts
std::string elementName = vp->getElement(pp->getDetail());
std::string subName;

View File

@@ -67,7 +67,7 @@ SoPathList SoDelayedAnnotationsElement::getDelayedPaths(SoState* state)
auto elt = static_cast<SoDelayedAnnotationsElement*>(state->getElementNoPush(classStackIndex));
if (elt->paths.empty()) {
return SoPathList();
return {};
}
// sort by priority (lower numbers render first)
@@ -91,7 +91,9 @@ void SoDelayedAnnotationsElement::processDelayedPathsWithPriority(SoState* state
{
auto elt = static_cast<SoDelayedAnnotationsElement*>(state->getElementNoPush(classStackIndex));
if (elt->paths.empty()) return;
if (elt->paths.empty()) {
return;
}
std::stable_sort(elt->paths.begin(), elt->paths.end(),
[](const PriorityPath& a, const PriorityPath& b) {