Gui: Add ability to disable single-solid rule by default

This commit is contained in:
Kacper Donat
2024-05-11 16:46:32 +02:00
committed by Adrián Insaurralde Avalos
parent e4ed0d883f
commit 302706be38
4 changed files with 56 additions and 7 deletions

View File

@@ -180,6 +180,12 @@ bool Feature::isSingleSolidRuleSatisfied(const TopoDS_Shape& shape, TopAbs_Shape
Feature::SingleSolidRuleMode Feature::singleSolidRuleMode()
{
auto body = getFeatureBody();
// When the feature is not part of an body (which should not happen) let's stay with the default
if (!body) {
return SingleSolidRuleMode::Enforced;
}
auto areCompoundSolidsAllowed = body->AllowCompound.getValue();
return areCompoundSolidsAllowed ? SingleSolidRuleMode::Disabled : SingleSolidRuleMode::Enforced;