0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / BRepTopAdaptor / BRepTopAdaptor_Tool.cxx
CommitLineData
b311480e 1// Created on: 1997-10-07
2// Created by: Laurent BUCHARD
3// Copyright (c) 1997-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
7fd59977 17
7fd59977 18#include <Adaptor3d_HSurface.hxx>
42cf5bc1 19#include <BRepAdaptor_HSurface.hxx>
20#include <BRepTopAdaptor_Tool.hxx>
21#include <BRepTopAdaptor_TopolTool.hxx>
22#include <TopoDS_Face.hxx>
7fd59977 23
24BRepTopAdaptor_Tool::BRepTopAdaptor_Tool() {
25 myTopolTool = new BRepTopAdaptor_TopolTool();
26
27 myloaded=Standard_False;
28}
29
30BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const TopoDS_Face& F,
35e08fe8 31 const Standard_Real /*Tol2d*/) {
7fd59977 32 myTopolTool = new BRepTopAdaptor_TopolTool();
33
34 Handle(BRepAdaptor_HSurface) surface = new BRepAdaptor_HSurface();
35 surface->ChangeSurface().Initialize(F,Standard_True);
543a9964 36 const Handle(Adaptor3d_HSurface)& aSurf = surface; // to avoid ambiguity
37 myTopolTool->Initialize(aSurf);
7fd59977 38 myHSurface = surface;
39 myloaded=Standard_True;
40}
41
42BRepTopAdaptor_Tool::BRepTopAdaptor_Tool(const Handle(Adaptor3d_HSurface)& surface,
35e08fe8 43 const Standard_Real /*Tol2d*/)
44{
7fd59977 45 myTopolTool = new BRepTopAdaptor_TopolTool();
7fd59977 46 myTopolTool->Initialize(surface);
47 myHSurface = surface;
48 myloaded=Standard_True;
49}
50
51void BRepTopAdaptor_Tool::Init(const TopoDS_Face& F,
35e08fe8 52 const Standard_Real /*Tol2d*/)
53{
7fd59977 54 Handle(BRepAdaptor_HSurface) surface = new BRepAdaptor_HSurface();
55 surface->ChangeSurface().Initialize(F);
543a9964 56 const Handle(Adaptor3d_HSurface)& aSurf = surface; // to avoid ambiguity
57 myTopolTool->Initialize(aSurf);
7fd59977 58 myHSurface = surface;
59 myloaded=Standard_True;
60}
61
62void BRepTopAdaptor_Tool::Init(const Handle(Adaptor3d_HSurface)& surface,
35e08fe8 63 const Standard_Real /*Tol2d*/)
64{
7fd59977 65 myTopolTool->Initialize(surface);
66 myHSurface = surface;
67 myloaded=Standard_True;
68}
69
857ffd5e 70Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() {
7fd59977 71 if(myloaded) {
72 return(myTopolTool);
73 }
74 else {
0797d9d3 75#ifdef OCCT_DEBUG
857ffd5e 76 cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool()\n"<<endl;
63c629aa 77#endif
7fd59977 78 return(myTopolTool);
79 }
80}
81
857ffd5e 82Handle(Adaptor3d_HSurface) BRepTopAdaptor_Tool::GetSurface() {
7fd59977 83 if(myloaded) {
84 return(myHSurface);
85 }
86 else {
0797d9d3 87#ifdef OCCT_DEBUG
857ffd5e 88 cout<<"\n*** Error ds Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetSurface()\n"<<endl;
63c629aa 89#endif
7fd59977 90 return(myHSurface);
91 }
92}
93
94void BRepTopAdaptor_Tool::SetTopolTool(const Handle(BRepTopAdaptor_TopolTool)& TT) {
95 myTopolTool=TT;
96}
97
98void BRepTopAdaptor_Tool::Destroy() {
99 int i;
100 i=0;
101 i++;
102
103}
104