]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx
Salome HOME
0021434: Boolean operations generate a shape with big vertex tolerance.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_BuilderArea.cxx
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 // File:        GEOMAlgo_BuilderArea.cxx
23 // Author:      Peter KURNEV
24
25 #include <GEOMAlgo_BuilderArea.ixx>
26
27 #include <Basics_OCCTVersion.hxx>
28
29 #include <TopTools_ListIteratorOfListOfShape.hxx>
30
31 #include <TopoDS_Shape.hxx>
32
33 #include <IntTools_Context.hxx>
34
35 //=======================================================================
36 //function :
37 //purpose  :
38 //=======================================================================
39 GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea()
40   : GEOMAlgo_Algo()
41 {
42 #if OCC_VERSION_LARGE <= 0x06050200
43   myContext=NULL;
44 #endif
45 }
46 //=======================================================================
47 //function : ~
48 //purpose  :
49 //=======================================================================
50 GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea()
51 {
52 }
53 //=======================================================================
54 //function : SetContext
55 //purpose  :
56 //=======================================================================
57 #if OCC_VERSION_LARGE > 0x06050200
58 void GEOMAlgo_BuilderArea::SetContext(const Handle(IntTools_Context)& theContext)
59 #else
60 void GEOMAlgo_BuilderArea::SetContext(const IntTools_Context& theContext)
61 #endif
62 {
63 #if OCC_VERSION_LARGE > 0x06050200
64   myContext=theContext;
65 #else
66   myContext=(IntTools_Context*)&theContext;
67 #endif
68 }
69
70 #if OCC_VERSION_LARGE > 0x06050200
71 //=======================================================================
72 //function : Context
73 //purpose  :
74 //=======================================================================
75 const Handle(IntTools_Context)& GEOMAlgo_BuilderArea::Context()const
76 {
77   return myContext;
78 }
79 //=======================================================================
80 //function : Perform
81 //purpose  :
82 //=======================================================================
83 void GEOMAlgo_BuilderArea::Perform()
84 {
85   if (myContext.IsNull()) {
86     myContext=new IntTools_Context;
87   }
88 }
89 #endif
90
91 //=======================================================================
92 //function : SetShapes
93 //purpose  :
94 //=======================================================================
95 void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF)
96 {
97   TopTools_ListIteratorOfListOfShape aIt;
98   //
99   myShapes.Clear();
100   aIt.Initialize(theLF);
101   for(; aIt.More(); aIt.Next()) {
102     const TopoDS_Shape& aF=aIt.Value();
103     myShapes.Append(aF);
104   }
105 }
106 //=======================================================================
107 //function : Shapes
108 //purpose  :
109 //=======================================================================
110 const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const
111 {
112   return myShapes;
113 }
114 //=======================================================================
115 //function : Loops
116 //purpose  :
117 //=======================================================================
118 const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const
119 {
120   return myLoops;
121 }
122 //=======================================================================
123 //function : Areas
124 //purpose  :
125 //=======================================================================
126 const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const
127 {
128   return myAreas;
129 }
130 //=======================================================================
131 //function :PerformShapesToAvoid
132 //purpose  :
133 //=======================================================================
134 void GEOMAlgo_BuilderArea::PerformShapesToAvoid()
135 {
136 }
137 //=======================================================================
138 //function : PerformLoops
139 //purpose  :
140 //=======================================================================
141 void GEOMAlgo_BuilderArea::PerformLoops()
142 {
143 }
144 //=======================================================================
145 //function : PerformAreas
146 //purpose  :
147 //=======================================================================
148 void GEOMAlgo_BuilderArea::PerformAreas()
149 {
150 }
151 //=======================================================================
152 //function : PerformInternalShapes
153 //purpose  :
154 //=======================================================================
155 void GEOMAlgo_BuilderArea::PerformInternalShapes()
156 {
157 }