Salome HOME
Copyright update 2022
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_ShapeAlgo.cxx
1 // Copyright (C) 2007-2022  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
23 // File:        GEOMAlgo_ShapeAlgo.cxx
24 // Created:     Tue Dec  7 12:06:54 2004
25 // Author:      Peter KURNEV
26 //              <pkv@irinox>
27 //
28 #include <GEOMAlgo_ShapeAlgo.hxx>
29 #include <IntTools_Context.hxx>
30
31 //=======================================================================
32 //function : GEOMAlgo_ShapeAlgo
33 //purpose  :
34 //=======================================================================
35 GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo()
36 :
37   GEOMAlgo_Algo()
38 {
39   myTolerance=0.0001;
40 }
41
42 //=======================================================================
43 //function : ~
44 //purpose  :
45 //=======================================================================
46 GEOMAlgo_ShapeAlgo::~GEOMAlgo_ShapeAlgo()
47 {
48 }
49 //=======================================================================
50 //function : SetContext
51 //purpose  :
52 //=======================================================================
53 void GEOMAlgo_ShapeAlgo::SetContext(const Handle(IntTools_Context)& theContext)
54 {
55   myContext=theContext;
56 }
57 //=======================================================================
58 //function : Context
59 //purpose  :
60 //=======================================================================
61 const Handle(IntTools_Context)& GEOMAlgo_ShapeAlgo::Context()const
62 {
63   return myContext;
64 }
65 //=======================================================================
66 //function : SetShape
67 //purpose  :
68 //=======================================================================
69 void GEOMAlgo_ShapeAlgo::SetShape(const TopoDS_Shape& aS)
70 {
71   myShape=aS;
72 }
73 //=======================================================================
74 //function : Shape
75 //purpose  :
76 //=======================================================================
77 const TopoDS_Shape& GEOMAlgo_ShapeAlgo::Shape()const
78 {
79   return myShape;
80 }
81 //=======================================================================
82 //function : SetTolerance
83 //purpose  :
84 //=======================================================================
85 void GEOMAlgo_ShapeAlgo::SetTolerance(const Standard_Real aT)
86 {
87   myTolerance=aT;
88 }
89 //=======================================================================
90 //function : Tolerance
91 //purpose  :
92 //=======================================================================
93 Standard_Real GEOMAlgo_ShapeAlgo::Tolerance()const
94 {
95   return myTolerance;
96 }
97 //=======================================================================
98 //function : Result
99 //purpose  :
100 //=======================================================================
101 const TopoDS_Shape& GEOMAlgo_ShapeAlgo::Result()const
102 {
103   return myResult;
104 }
105 //=======================================================================
106 //function : Perform
107 //purpose  :
108 //=======================================================================
109 void GEOMAlgo_ShapeAlgo::Perform()
110 {
111   if (myContext.IsNull()) {
112     myContext=new IntTools_Context;
113   }
114 }