Salome HOME
Copyrights update 2015.
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_GluerAlgo.cxx
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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 // Created:
24 // Author:      Peter KURNEV
25 //              <peter@PREFEX>
26 //
27 #include <GEOMAlgo_GluerAlgo.hxx>
28 #if OCC_VERSION_LARGE > 0x06070100
29 #include <IntTools_Context.hxx>
30 #else
31 #include <BOPInt_Context.hxx>
32 #endif
33
34
35 //=======================================================================
36 //function : GEOMAlgo_GluerAlgo
37 //purpose  :
38 //=======================================================================
39 GEOMAlgo_GluerAlgo::GEOMAlgo_GluerAlgo()
40 {
41   myTolerance=0.0001;
42   myCheckGeometry=Standard_True;
43 }
44 //=======================================================================
45 //function : ~GEOMAlgo_GluerAlgo
46 //purpose  :
47 //=======================================================================
48 GEOMAlgo_GluerAlgo::~GEOMAlgo_GluerAlgo()
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 //function : Argument
61 //purpose  :
62 //=======================================================================
63 const TopoDS_Shape& GEOMAlgo_GluerAlgo::Argument()const
64 {
65   return myArgument;
66 }
67 //=======================================================================
68 //function : SetTolerance
69 //purpose  :
70 //=======================================================================
71 void GEOMAlgo_GluerAlgo::SetTolerance(const Standard_Real aT)
72 {
73   myTolerance=aT;
74 }
75 //=======================================================================
76 //function : Tolerance
77 //purpose  :
78 //=======================================================================
79 Standard_Real GEOMAlgo_GluerAlgo::Tolerance()const
80 {
81   return myTolerance;
82 }
83
84 //=======================================================================
85 //function : SetCheckGeometry
86 //purpose  :
87 //=======================================================================
88 void GEOMAlgo_GluerAlgo::SetCheckGeometry(const Standard_Boolean aFlag)
89 {
90   myCheckGeometry=aFlag;
91 }
92 //=======================================================================
93 //function : CheckGeometry
94 //purpose  :
95 //=======================================================================
96 Standard_Boolean GEOMAlgo_GluerAlgo::CheckGeometry() const
97 {
98   return myCheckGeometry;
99 }
100 //=======================================================================
101 //function : SetContext
102 //purpose  :
103 //=======================================================================
104 #if OCC_VERSION_LARGE > 0x06070100
105 void GEOMAlgo_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext)
106 #else
107 void GEOMAlgo_GluerAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
108 #endif
109 {
110   myContext=theContext;
111 }
112 //=======================================================================
113 //function : Context
114 //purpose  :
115 //=======================================================================
116 #if OCC_VERSION_LARGE > 0x06070100
117 const Handle(IntTools_Context)& GEOMAlgo_GluerAlgo::Context()
118 #else
119 const Handle(BOPInt_Context)& GEOMAlgo_GluerAlgo::Context()
120 #endif
121 {
122   return myContext;
123 }
124 //=======================================================================
125 //function : Images
126 //purpose  :
127 //=======================================================================
128 const TopTools_DataMapOfShapeListOfShape& GEOMAlgo_GluerAlgo::Images()const
129 {
130   return myImages;
131 }
132 //=======================================================================
133 //function : Origins
134 //purpose  :
135 //=======================================================================
136 const TopTools_DataMapOfShapeShape& GEOMAlgo_GluerAlgo::Origins()const
137 {
138   return myOrigins;
139 }
140 //=======================================================================
141 //function : Clear
142 //purpose  :
143 //=======================================================================
144 void GEOMAlgo_GluerAlgo::Clear()
145 {
146   myImages.Clear();
147   myOrigins.Clear();
148 }
149 //=======================================================================
150 //function : Perform
151 //purpose  :
152 //=======================================================================
153 void GEOMAlgo_GluerAlgo::Perform()
154 {
155   if (myContext.IsNull()) {
156 #if OCC_VERSION_LARGE > 0x06070100
157     myContext=new IntTools_Context;
158 #else
159     myContext=new BOPInt_Context;
160 #endif
161   }
162 }