]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx
Salome HOME
0021434: Boolean operations generate a shape with big vertex tolerance.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_GluerAlgo.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_GluerAlgo.cxx
23 // Author:      Peter KURNEV
24
25 #include <GEOMAlgo_GluerAlgo.hxx>
26
27 #include <Basics_OCCTVersion.hxx>
28
29 #if OCC_VERSION_LARGE > 0x06050200
30 #include <IntTools_Context.hxx>
31 #endif
32
33 //=======================================================================
34 //function : GEOMAlgo_GluerAlgo
35 //purpose  : 
36 //=======================================================================
37 GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo()
38 {
39   myTolerance=0.0001;
40   myCheckGeometry=Standard_True;
41 }
42
43 //=======================================================================
44 //function : ~GEOMAlgo_GluerAlgo
45 //purpose  : 
46 //=======================================================================
47 GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo()
48 {
49 }
50
51 //=======================================================================
52 //function : SetArgument
53 //purpose  : 
54 //=======================================================================
55 void GEOMAlgo_GluerAlgo::SetArgument(const TopoDS_Shape& theShape)
56 {
57   myArgument=theShape;
58 }
59
60 //=======================================================================
61 //function : Argument
62 //purpose  : 
63 //=======================================================================
64 const TopoDS_Shape& GEOMAlgo_GluerAlgo::Argument()const
65 {
66   return myArgument;
67 }
68
69 //=======================================================================
70 //function : SetTolerance
71 //purpose  : 
72 //=======================================================================
73 void GEOMAlgo_GluerAlgo::SetTolerance(const Standard_Real aT)
74 {
75   myTolerance=aT;
76 }
77
78 //=======================================================================
79 //function : Tolerance
80 //purpose  : 
81 //=======================================================================
82 Standard_Real GEOMAlgo_GluerAlgo::Tolerance()const
83 {
84   return myTolerance;
85 }
86
87 //=======================================================================
88 //function : SetCheckGeometry
89 //purpose  : 
90 //=======================================================================
91 void GEOMAlgo_GluerAlgo::SetCheckGeometry(const Standard_Boolean aFlag)
92 {
93   myCheckGeometry=aFlag;
94 }
95
96 //=======================================================================
97 //function : CheckGeometry
98 //purpose  : 
99 //=======================================================================
100 Standard_Boolean GEOMAlgo_GluerAlgo::CheckGeometry() const
101 {
102   return myCheckGeometry;
103 }
104
105 #if OCC_VERSION_LARGE > 0x06050200
106 //=======================================================================
107 //function : SetContext
108 //purpose  : 
109 //=======================================================================
110 void GEOMAlgo_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext)
111 {
112   myContext=theContext;
113 }
114 #endif
115
116 //=======================================================================
117 //function : Context
118 //purpose  : 
119 //=======================================================================
120 #if OCC_VERSION_LARGE > 0x06050200
121 const Handle(IntTools_Context)& GEOMAlgo_GluerAlgo::Context()
122 #else
123 IntTools_Context& GEOMAlgo_GluerAlgo::Context()
124 #endif
125 {
126   return myContext;
127 }
128
129 //=======================================================================
130 //function : Images
131 //purpose  : 
132 //=======================================================================
133 const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_GluerAlgo::Images()const
134 {
135   return myImages;
136 }
137
138 //=======================================================================
139 //function : Origins
140 //purpose  : 
141 //=======================================================================
142 const TopTools_DataMapOfShapeShape& GEOMAlgo_GluerAlgo::Origins()const
143 {
144   return myOrigins;
145 }
146
147 //=======================================================================
148 //function : Clear
149 //purpose  : 
150 //=======================================================================
151 void GEOMAlgo_GluerAlgo::Clear()
152 {
153   myImages.Clear();
154   myOrigins.Clear();
155 }
156
157 //=======================================================================
158 //function : Perform
159 //purpose  : 
160 //=======================================================================
161 void GEOMAlgo_GluerAlgo::Perform()
162 {
163 #if OCC_VERSION_LARGE > 0x06050200
164   if (myContext.IsNull()) {
165     myContext=new IntTools_Context;
166   }
167 #endif
168 }