From 068aa6ae9f68af65512c784b595f4b4a416f099e Mon Sep 17 00:00:00 2001 From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:42:02 +0100 Subject: [PATCH] Modelling - Add option to not build history in BRepFill_PipeShell (#632) - Adds `myIsBuildHistory` boolean member to `BRepFill_PipeShell` with default value `true` - Implements getter/setter methods in both `BRepFill_PipeShell` and `BRepOffsetAPI_MakePipeShell` interfaces - Conditionally calls `BuildHistory()` method based on the flag value --- .../TKBool/BRepFill/BRepFill_PipeShell.cxx | 8 ++++++-- .../TKBool/BRepFill/BRepFill_PipeShell.hxx | 13 +++++++++++++ .../BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx | 13 ++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx index 6ccc821273..bc01045d71 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx @@ -213,7 +213,8 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine) myIsAutomaticLaw(Standard_False), myTrihedron(GeomFill_IsCorrectedFrenet), myTransition(BRepFill_Modified), - myStatus(GeomFill_PipeOk) + myStatus(GeomFill_PipeOk), + myIsBuildHistory(Standard_True) { myLocation.Nullify(); mySection.Nullify(); @@ -785,7 +786,10 @@ Standard_Boolean BRepFill_PipeShell::Build() myShape.Closed(Standard_True); } - BuildHistory(MkSw); + if (myIsBuildHistory) + { + BuildHistory(MkSw); + } } else { diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.hxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.hxx index f4eb55fc57..6443d49a4e 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.hxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.hxx @@ -122,6 +122,18 @@ public: //! spine Standard_EXPORT void SetForceApproxC1(const Standard_Boolean ForceApproxC1); + //! Sets the build history flag. + //! If set to True, the pipe shell will store the history of the sections + //! and the spine, which can be used for further modifications or analysis. + inline void SetIsBuildHistory(const Standard_Boolean theIsBuildHistory) + { + myIsBuildHistory = theIsBuildHistory; + } + + //! Returns the build history flag. + //! If True, the pipe shell stores the history of the sections and the spine. + inline bool IsBuildHistory() const { return myIsBuildHistory; } + //! Set an section. The correspondence with the spine, will be automatically performed. Standard_EXPORT void Add(const TopoDS_Shape& Profile, const Standard_Boolean WithContact = Standard_False, @@ -246,6 +258,7 @@ private: BRepFill_TransitionStyle myTransition; GeomFill_PipeError myStatus; Standard_Real myErrorOnSurf; + Standard_Boolean myIsBuildHistory; }; #endif // _BRepFill_PipeShell_HeaderFile diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx index 10a288339d..e0466d38be 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx @@ -274,13 +274,24 @@ public: Standard_EXPORT Standard_Real ErrorOnSurface() const; + //! Sets the build history flag. + //! If set to True, the pipe shell will store the history of the sections + //! and the spine, which can be used for further modifications or analysis. + inline void SetIsBuildHistory(const Standard_Boolean theIsBuildHistory) + { + myPipe->SetIsBuildHistory(theIsBuildHistory); + } + + //! Returns the build history flag. + //! If True, the pipe shell stores the history of the sections and the spine. + inline bool IsBuildHistory() const { return myPipe->IsBuildHistory(); } + //! Returns the list of original profiles void Profiles(TopTools_ListOfShape& theProfiles) { myPipe->Profiles(theProfiles); } //! Returns the spine const TopoDS_Wire& Spine() { return myPipe->Spine(); } -protected: private: Handle(BRepFill_PipeShell) myPipe; };