0025418: Debug output to be limited to OCC development environment
[occt.git] / src / BRepTopAdaptor / BRepTopAdaptor_Tool.cxx
1 // Created on: 1997-10-07
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <BRepTopAdaptor_Tool.ixx>
18
19 #include <BRepTopAdaptor_TopolTool.hxx>
20 #include <BRepAdaptor_HSurface.hxx>
21 #include <Adaptor3d_HSurface.hxx>
22
23
24 BRepTopAdaptor_Tool::BRepTopAdaptor_Tool() { 
25   myTopolTool = new BRepTopAdaptor_TopolTool();
26
27   myloaded=Standard_False;
28 }
29
30 BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const TopoDS_Face& F,
31                                          const Standard_Real /*Tol2d*/) { 
32   myTopolTool = new BRepTopAdaptor_TopolTool();
33
34   Handle(BRepAdaptor_HSurface) surface = new BRepAdaptor_HSurface();
35   surface->ChangeSurface().Initialize(F,Standard_True);
36   myTopolTool->Initialize(surface);
37   myHSurface = surface;
38   myloaded=Standard_True;
39 }
40
41 BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const Handle(Adaptor3d_HSurface)& surface,
42                                          const Standard_Real /*Tol2d*/)
43
44   myTopolTool = new BRepTopAdaptor_TopolTool();
45   myTopolTool->Initialize(surface);
46   myHSurface = surface;
47   myloaded=Standard_True;
48 }
49
50 void BRepTopAdaptor_Tool::Init(const TopoDS_Face& F,
51                                const Standard_Real /*Tol2d*/) 
52
53   Handle(BRepAdaptor_HSurface) surface = new BRepAdaptor_HSurface();
54   surface->ChangeSurface().Initialize(F);
55   myTopolTool->Initialize(surface);
56   myHSurface = surface;
57   myloaded=Standard_True;
58 }
59
60 void BRepTopAdaptor_Tool::Init(const Handle(Adaptor3d_HSurface)& surface,
61                                const Standard_Real /*Tol2d*/) 
62
63   myTopolTool->Initialize(surface);
64   myHSurface = surface;
65   myloaded=Standard_True;
66 }
67
68 Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() { 
69   if(myloaded) { 
70     return(myTopolTool);
71   }
72   else { 
73 #ifdef OCCT_DEBUG
74     cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool()\n"<<endl;
75 #endif
76     return(myTopolTool);
77   }
78 }
79
80 Handle(Adaptor3d_HSurface)  BRepTopAdaptor_Tool::GetSurface() { 
81   if(myloaded) { 
82     return(myHSurface);
83   }
84   else { 
85 #ifdef OCCT_DEBUG
86     cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetSurface()\n"<<endl;
87 #endif
88     return(myHSurface);
89   }
90 }
91
92 void BRepTopAdaptor_Tool::SetTopolTool(const Handle(BRepTopAdaptor_TopolTool)& TT) { 
93   myTopolTool=TT;
94 }
95
96 void BRepTopAdaptor_Tool::Destroy() { 
97   int i;
98   i=0;
99   i++;
100   
101 }
102