Fix lint issues

This commit is contained in:
Benjamin Nauck
2025-02-07 19:51:11 +01:00
parent 6ffa0817ae
commit 600b203683
3 changed files with 24 additions and 11 deletions

View File

@@ -88,7 +88,7 @@ void FCBRepAlgoAPI_BooleanOperation::RecursiveAddArguments(const TopoDS_Shape& t
if (it.Value().ShapeType() == TopAbs_COMPOUND) {
RecursiveAddArguments(it.Value());
} else {
if (!myArguments.Size()) {
if (myArguments.IsEmpty()) {
myArguments.Append(it.Value());
} else {
myTools.Append(it.Value());
@@ -102,11 +102,12 @@ void FCBRepAlgoAPI_BooleanOperation::Build() {
if (myOperation == BOPAlgo_CUT && myArguments.Size() == 1 && myTools.Size() == 1 && myTools.First().ShapeType() == TopAbs_COMPOUND) {
TopTools_ListOfShape myOriginalArguments = myArguments;
TopTools_ListOfShape myOriginalTools = myTools;
TopTools_ListOfShape currentTools, currentArguments;
TopTools_ListOfShape currentTools;
TopTools_ListOfShape currentArguments;
myArguments = currentArguments;
myTools = currentTools;
RecursiveAddArguments(myOriginalTools.First());
if (myTools.Size()) {
if (!myTools.IsEmpty()) {
myOperation = BOPAlgo_FUSE; // fuse tools together
Build();
myOperation = BOPAlgo_CUT; // restore
@@ -130,7 +131,7 @@ void FCBRepAlgoAPI_BooleanOperation::Build() {
}
}
const TopoDS_Shape FCBRepAlgoAPI_BooleanOperation::RecursiveCutCompound(const TopoDS_Shape& theArgument) {
TopoDS_Shape FCBRepAlgoAPI_BooleanOperation::RecursiveCutCompound(const TopoDS_Shape& theArgument) {
BRep_Builder builder;
TopoDS_Compound comp;
builder.MakeCompound(comp);
@@ -143,7 +144,7 @@ const TopoDS_Shape FCBRepAlgoAPI_BooleanOperation::RecursiveCutCompound(const To
if (IsDone()) {
builder.Add(comp, myShape);
} else {
return TopoDS_Shape();
return {};
}
}
return comp;

View File

@@ -49,19 +49,20 @@ public:
// set fuzzyness based on size
void setAutoFuzzy();
Standard_EXPORT virtual void Build(); // not an override - real Build() has optionals, sadly type of those optionals that are differs between OCCT versions
// not an override - real Build() has optionals, sadly type of those optionals that are differs between OCCT versions
Standard_EXPORT virtual void Build(); // NOLINT(clang-diagnostic-overloaded-virtual, -Woverloaded-virtual)
protected: //! @name Constructors
//! Constructor to perform Boolean operation on only two arguments.
//! Obsolete
Standard_EXPORT FCBRepAlgoAPI_BooleanOperation(const TopoDS_Shape& theS1,
const TopoDS_Shape& theS2,
const BOPAlgo_Operation theOperation);
const TopoDS_Shape& theS2,
BOPAlgo_Operation theOperation);
private:
Standard_EXPORT const TopoDS_Shape RecursiveCutCompound(const TopoDS_Shape& theArgument);
Standard_EXPORT TopoDS_Shape RecursiveCutCompound(const TopoDS_Shape& theArgument);
Standard_EXPORT void RecursiveAddArguments(const TopoDS_Shape& theArgument);
};
#endif

File diff suppressed because one or more lines are too long