0024624: Lost word in license statement in source files
[occt.git] / src / DrawTrSurf / DrawTrSurf_Debug.cxx
1 // Created on: 1994-07-25
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1994-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 <DrawTrSurf.hxx>
18 #include <GeomTools.hxx>
19 #include <GeomTools_SurfaceSet.hxx>
20 #include <GeomTools_CurveSet.hxx>
21 #include <GeomTools_Curve2dSet.hxx>
22 #include <gp_Pnt.hxx>
23 #include <gp_Pnt2d.hxx>
24
25 // method to call with dbx
26
27
28 void DrawTrSurf_Set(char* name, const Handle(Standard_Transient)& G)
29 {
30   Handle(Geom_Geometry) GG = Handle(Geom_Geometry)::DownCast(G);
31   if (!GG.IsNull()) {
32     DrawTrSurf::Set(name,GG);
33       return;
34     }
35   Handle(Geom2d_Curve) GC = Handle(Geom2d_Curve)::DownCast(G);
36   if (!GC.IsNull()) {
37     DrawTrSurf::Set(name,GC);
38       return;
39     }
40
41   cout << "*** Not a geometric object ***" << endl;
42 }
43
44 void DrawTrSurf_Get(const char* name, Handle(Standard_Transient)& G)
45 {
46   Handle(Geom_Geometry) GG = DrawTrSurf::Get(name);
47   cout << "Nom : " << name << endl;
48   if (!GG.IsNull()) {
49     G = GG;
50     return;
51   }
52
53   Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(name);
54   if (!GC.IsNull()) {
55     G = GC;
56     return;
57   }
58
59   cout << "*** Not a geometric object ***" << endl;
60 }
61
62 void DrawTrSurf_Dump(const Handle(Standard_Transient)& G)
63 {
64   cout << "\n\n";
65
66   Handle(Geom_Surface) GS = Handle(Geom_Surface)::DownCast(G);
67   if (!GS.IsNull()) {
68     GeomTools_SurfaceSet::PrintSurface(GS,cout);
69     cout << endl;
70       return;
71     }
72
73   Handle(Geom_Curve) GC = Handle(Geom_Curve)::DownCast(G);
74   if (!GC.IsNull()) {
75     GeomTools_CurveSet::PrintCurve(GC,cout);
76     cout << endl;
77       return;
78     }
79
80   Handle(Geom2d_Curve) GC2d = Handle(Geom2d_Curve)::DownCast(G);
81   if (!GC2d.IsNull()) {
82     GeomTools_Curve2dSet::PrintCurve2d(GC2d,cout);
83     cout << endl;
84       return;
85     }
86 }
87
88 void DrawTrSurf_Set(char* name, const gp_Pnt& P)
89 {
90   cout<<"point "<<name<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl;
91   DrawTrSurf::Set(name,P);
92 }
93
94 void DrawTrSurf_Set(char* name, const gp_Pnt2d& P)
95 {
96   cout<<"point "<<name<<" "<<P.X()<<" "<<P.Y()<<endl;
97   DrawTrSurf::Set(name,P);
98 }