Salome HOME
Win32 compliation.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_BuilderArea.hxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22 #ifndef _GEOMAlgo_BuilderArea_HeaderFile
23 #define _GEOMAlgo_BuilderArea_HeaderFile
24
25 #include <Basics_OCCTVersion.hxx>
26
27 #ifndef _TopTools_ListOfShape_HeaderFile
28 #include <TopTools_ListOfShape.hxx>
29 #endif
30 #ifndef _TopTools_MapOfOrientedShape_HeaderFile
31 #include <TopTools_MapOfOrientedShape.hxx>
32 #endif
33
34 #if OCC_VERSION_LARGE > 0x06050200
35 #include <Handle_IntTools_Context.hxx>
36 #else
37 #include <IntTools_PContext.hxx>
38 #endif
39
40 #ifndef _GEOMAlgo_Algo_HeaderFile
41 #include <GEOMAlgo_Algo.hxx>
42 #endif
43 class IntTools_Context;
44 class TopTools_ListOfShape;
45
46
47 #ifndef _Standard_HeaderFile
48 #include <Standard.hxx>
49 #endif
50 #ifndef _Standard_Macro_HeaderFile
51 #include <Standard_Macro.hxx>
52 #endif
53
54 //! The root class for algorithms to build <br>
55 //!          faces/solids from set of edges/faces <br>
56 class GEOMAlgo_BuilderArea  : public GEOMAlgo_Algo {
57
58 public:
59
60     void* operator new(size_t,void* anAddress) 
61       {
62         return anAddress;
63       }
64     void* operator new(size_t size) 
65       { 
66         return Standard::Allocate(size); 
67       }
68     void  operator delete(void *anAddress) 
69       { 
70         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
71       }
72
73 //! Sets cashed geometrical tools <br>
74 #if OCC_VERSION_LARGE > 0x06050200
75   Standard_EXPORT     void SetContext(const Handle(IntTools_Context)& theContext) ;
76 #else
77 Standard_EXPORT   void SetContext(const IntTools_Context& theContext) ;
78 #endif
79
80 #if OCC_VERSION_LARGE > 0x06050200
81   //! Returns cashed geometrical tools <br>
82   Standard_EXPORT    const Handle_IntTools_Context& Context() const;
83 #endif
84
85 //! Sets edges/faces to process <br>
86 Standard_EXPORT   void SetShapes(const TopTools_ListOfShape& theLS) ;
87
88 //! Returns edges/faces to process <br>
89 Standard_EXPORT  const TopTools_ListOfShape& Shapes() const;
90
91 //! Returns wires/shells that have been built <br>
92 Standard_EXPORT  const TopTools_ListOfShape& Loops() const;
93
94 //! Returns faces/solids that have been built <br>
95 Standard_EXPORT  const TopTools_ListOfShape& Areas() const;
96
97 #if OCC_VERSION_LARGE > 0x06050200
98   Standard_EXPORT   virtual  void Perform() ;
99 #endif
100
101 protected:
102
103   //!  Empty  constructor <br>
104   Standard_EXPORT   GEOMAlgo_BuilderArea();
105 Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();
106   //!  Collect the edges/faces that <br>
107 //!           a) are internal <br>
108 //!           b) are the same and have different orientation <br>
109   Standard_EXPORT virtual  void PerformShapesToAvoid() ;
110   //! Build draft faces/shells <br>
111 //!          a)myLoops - draft faces/shells that consist of <br>
112 //!                      boundary edges/faces <br>
113 //!          b)myLoopsInternal - draft faces/shells that contains <br>
114 //!                               inner edges/faces <br>
115   Standard_EXPORT virtual  void PerformLoops() ;
116   //! Build draft faces/solids that contains boundary faces <br>
117   Standard_EXPORT virtual  void PerformAreas() ;
118   //! Build finalized faces/solids with internal wires/shells <br>
119   Standard_EXPORT virtual  void PerformInternalShapes() ;
120
121
122 TopTools_ListOfShape myShapes;
123 TopTools_ListOfShape myLoops;
124 TopTools_ListOfShape myLoopsInternal;
125 TopTools_MapOfOrientedShape myShapesToAvoid;
126 TopTools_ListOfShape myAreas;
127 #if OCC_VERSION_LARGE > 0x06050200
128 Handle_IntTools_Context myContext;
129 #else
130 IntTools_PContext myContext;
131 #endif
132
133
134 private:
135
136 };
137
138
139
140
141
142 // other Inline functions and methods (like "C++: function call" methods)
143
144
145 #endif