Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:59:46

0001 // Created on: 1995-12-21
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TopOpeBRepBuild_AreaBuilder_HeaderFile
0018 #define _TopOpeBRepBuild_AreaBuilder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopOpeBRepBuild_Loop.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <TopAbs_State.hxx>
0028 #include <TopOpeBRepBuild_LoopEnum.hxx>
0029 #include <Standard_Integer.hxx>
0030 class TopOpeBRepBuild_LoopSet;
0031 class TopOpeBRepBuild_LoopClassifier;
0032 class TopOpeBRepBuild_Loop;
0033 
0034 //! The AreaBuilder algorithm is used to
0035 //! reconstruct complex topological objects as Faces
0036 //! or Solids.
0037 //! * Loop is the composite topological object of
0038 //! the boundary. Wire for a Face. Shell for a Solid.
0039 //! * LoopSet is a tool describing the object to
0040 //! build. It gives an iteration on Loops. For each
0041 //! Loop it tells if it is on the boundary or if it is
0042 //! an interference.
0043 //! * LoopClassifier is an algorithm used to test
0044 //! if a Loop is inside another Loop.
0045 //! The result of the reconstruction is an iteration
0046 //! on the reconstructed areas. An area is described
0047 //! by a set of Loops.
0048 //! A AreaBuilder is built with:
0049 //! - a LoopSet describing the object to reconstruct.
0050 //! - a LoopClassifier providing the classification algorithm.
0051 class TopOpeBRepBuild_AreaBuilder
0052 {
0053 public:
0054   DEFINE_STANDARD_ALLOC
0055 
0056   Standard_EXPORT TopOpeBRepBuild_AreaBuilder();
0057 
0058   //! Creates a AreaBuilder to build the areas on
0059   //! the shapes described by <LS> using the classifier <LC>.
0060   Standard_EXPORT TopOpeBRepBuild_AreaBuilder(TopOpeBRepBuild_LoopSet&        LS,
0061                                               TopOpeBRepBuild_LoopClassifier& LC,
0062                                               const bool                      ForceClass = false);
0063 
0064   Standard_EXPORT virtual ~TopOpeBRepBuild_AreaBuilder();
0065 
0066   //! Sets a AreaBuilder to find the areas on
0067   //! the shapes described by <LS> using the classifier <LC>.
0068   Standard_EXPORT virtual void InitAreaBuilder(TopOpeBRepBuild_LoopSet&        LS,
0069                                                TopOpeBRepBuild_LoopClassifier& LC,
0070                                                const bool                      ForceClass = false);
0071 
0072   //! Initialize iteration on areas.
0073   Standard_EXPORT int InitArea();
0074 
0075   Standard_EXPORT bool MoreArea() const;
0076 
0077   Standard_EXPORT void NextArea();
0078 
0079   //! Initialize iteration on loops of current Area.
0080   Standard_EXPORT int InitLoop();
0081 
0082   Standard_EXPORT bool MoreLoop() const;
0083 
0084   Standard_EXPORT void NextLoop();
0085 
0086   //! Returns the current Loop in the current area.
0087   Standard_EXPORT const occ::handle<TopOpeBRepBuild_Loop>& Loop() const;
0088 
0089   Standard_EXPORT virtual void ADD_Loop_TO_LISTOFLoop(
0090     const occ::handle<TopOpeBRepBuild_Loop>&             L,
0091     NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>& LOL,
0092     void* const                                          s = nullptr) const;
0093 
0094   Standard_EXPORT virtual void REM_Loop_FROM_LISTOFLoop(
0095     NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>::Iterator& ITLOL,
0096     NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>&           LOL,
0097     void* const                                                    s = nullptr) const;
0098 
0099   Standard_EXPORT virtual void ADD_LISTOFLoop_TO_LISTOFLoop(
0100     NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>& LOL1,
0101     NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>& LOL2,
0102     void* const                                          s  = nullptr,
0103     void* const                                          s1 = nullptr,
0104     void* const                                          s2 = nullptr) const;
0105 
0106 protected:
0107   Standard_EXPORT TopAbs_State
0108     CompareLoopWithListOfLoop(TopOpeBRepBuild_LoopClassifier&                            LC,
0109                               const occ::handle<TopOpeBRepBuild_Loop>&                   L,
0110                               const NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>& LOL,
0111                               const TopOpeBRepBuild_LoopEnum                             le) const;
0112 
0113   Standard_EXPORT void Atomize(TopAbs_State& state, const TopAbs_State newstate) const;
0114 
0115   NCollection_List<NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>>           myArea;
0116   NCollection_List<NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>>::Iterator myAreaIterator;
0117   NCollection_List<occ::handle<TopOpeBRepBuild_Loop>>::Iterator                   myLoopIterator;
0118   bool                                                                            myUNKNOWNRaise;
0119 };
0120 
0121 #endif // _TopOpeBRepBuild_AreaBuilder_HeaderFile