7fd59977 |
1 | // File: DrawTrSurf_Debug.cxx |
2 | // Created: Mon Jul 25 18:59:42 1994 |
3 | // Author: Remi LEQUETTE |
4 | // <rle@bravox> |
5 | |
6 | |
7 | #include <DrawTrSurf.hxx> |
8 | #include <GeomTools.hxx> |
9 | #include <GeomTools_SurfaceSet.hxx> |
10 | #include <GeomTools_CurveSet.hxx> |
11 | #include <GeomTools_Curve2dSet.hxx> |
12 | #include <gp_Pnt.hxx> |
13 | #include <gp_Pnt2d.hxx> |
14 | |
15 | // |
16 | // method to call with dbx |
17 | // |
18 | |
19 | |
20 | void DrawTrSurf_Set(char* name, const Handle(Standard_Transient)& G) |
21 | { |
22 | Handle(Geom_Geometry) GG = Handle(Geom_Geometry)::DownCast(G); |
23 | if (!GG.IsNull()) { |
24 | DrawTrSurf::Set(name,GG); |
25 | return; |
26 | } |
27 | Handle(Geom2d_Curve) GC = Handle(Geom2d_Curve)::DownCast(G); |
28 | if (!GC.IsNull()) { |
29 | DrawTrSurf::Set(name,GC); |
30 | return; |
31 | } |
32 | |
33 | cout << "*** Not a geometric object ***" << endl; |
34 | } |
35 | |
36 | void DrawTrSurf_Get(const char* name, Handle(Standard_Transient)& G) |
37 | { |
38 | Handle(Geom_Geometry) GG = DrawTrSurf::Get(name); |
39 | cout << "Nom : " << name << endl; |
40 | if (!GG.IsNull()) { |
41 | G = GG; |
42 | return; |
43 | } |
44 | |
45 | Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(name); |
46 | if (!GC.IsNull()) { |
47 | G = GC; |
48 | return; |
49 | } |
50 | |
51 | cout << "*** Not a geometric object ***" << endl; |
52 | } |
53 | |
54 | void DrawTrSurf_Dump(const Handle(Standard_Transient)& G) |
55 | { |
56 | cout << "\n\n"; |
57 | |
58 | Handle(Geom_Surface) GS = Handle(Geom_Surface)::DownCast(G); |
59 | if (!GS.IsNull()) { |
60 | GeomTools_SurfaceSet::PrintSurface(GS,cout); |
61 | cout << endl; |
62 | return; |
63 | } |
64 | |
65 | Handle(Geom_Curve) GC = Handle(Geom_Curve)::DownCast(G); |
66 | if (!GC.IsNull()) { |
67 | GeomTools_CurveSet::PrintCurve(GC,cout); |
68 | cout << endl; |
69 | return; |
70 | } |
71 | |
72 | Handle(Geom2d_Curve) GC2d = Handle(Geom2d_Curve)::DownCast(G); |
73 | if (!GC2d.IsNull()) { |
74 | GeomTools_Curve2dSet::PrintCurve2d(GC2d,cout); |
75 | cout << endl; |
76 | return; |
77 | } |
78 | } |
79 | |
80 | void DrawTrSurf_Set(char* name, const gp_Pnt& P) |
81 | { |
82 | cout<<"point "<<name<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl; |
83 | DrawTrSurf::Set(name,P); |
84 | } |
85 | |
86 | void DrawTrSurf_Set(char* name, const gp_Pnt2d& P) |
87 | { |
88 | cout<<"point "<<name<<" "<<P.X()<<" "<<P.Y()<<endl; |
89 | DrawTrSurf::Set(name,P); |
90 | } |