0026603: Problem with maximization and normalization document windows in Qt samples...
[occt.git] / src / Geom2dGcc / Geom2dGcc_CurveToolGeo.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15
16 #include <Adaptor3d_OffsetCurve.hxx>
17 #include <Extrema_POnCurv2d.hxx>
18 #include <Geom2d_BezierCurve.hxx>
19 #include <Geom2d_BSplineCurve.hxx>
20 #include <Geom2d_Circle.hxx>
21 #include <Geom2d_Ellipse.hxx>
22 #include <Geom2d_Hyperbola.hxx>
23 #include <Geom2d_Line.hxx>
24 #include <Geom2d_Parabola.hxx>
25 #include <Geom2dGcc_CurveToolGeo.hxx>
26 #include <GeomAbs_CurveType.hxx>
27 #include <gp.hxx>
28 #include <gp_Circ2d.hxx>
29 #include <gp_Elips2d.hxx>
30 #include <gp_Hypr2d.hxx>
31 #include <gp_Lin2d.hxx>
32 #include <gp_Parab2d.hxx>
33 #include <gp_Pnt2d.hxx>
34 #include <gp_Vec.hxx>
35 #include <gp_Vec2d.hxx>
36 #include <Standard_Failure.hxx>
37
38 GeomAbs_CurveType Geom2dGcc_CurveToolGeo::
39 TheType(const Adaptor3d_OffsetCurve& ) {
40   return GeomAbs_OtherCurve;
41 }
42
43 gp_Lin2d Geom2dGcc_CurveToolGeo::
44 Line (const Adaptor3d_OffsetCurve& ) {
45   cout << "Not implemented" << endl;
46   return gp_Lin2d();
47 }
48
49 gp_Circ2d Geom2dGcc_CurveToolGeo::
50 Circle (const Adaptor3d_OffsetCurve& ) {
51   cout << "Not implemented" << endl;
52   return gp_Circ2d();
53 }
54
55 gp_Elips2d Geom2dGcc_CurveToolGeo::
56 Ellipse (const Adaptor3d_OffsetCurve& ) {
57   cout << "Not implemented" << endl;
58   return gp_Elips2d();
59 }
60
61 gp_Parab2d Geom2dGcc_CurveToolGeo::
62 Parabola (const Adaptor3d_OffsetCurve& ) {
63   cout << "Not implemented" << endl;
64   return gp_Parab2d();
65 }
66
67 gp_Hypr2d Geom2dGcc_CurveToolGeo::
68 Hyperbola (const Adaptor3d_OffsetCurve& ) {
69   cout << "Not implemented" << endl;
70   return gp_Hypr2d();
71 }
72
73 Standard_Real 
74 Geom2dGcc_CurveToolGeo::EpsX (const Adaptor3d_OffsetCurve& /*C*/,
75                               const Standard_Real   Tol) {
76                                 return Tol;
77 }
78
79 Standard_Integer 
80 Geom2dGcc_CurveToolGeo::NbSamples (const Adaptor3d_OffsetCurve& C) {
81   GeomAbs_CurveType typC = C.GetType();
82   Standard_Integer nbs = 20;
83   if(typC == GeomAbs_Line) 
84     nbs = 2;
85   else if(typC == GeomAbs_BezierCurve) 
86     nbs = 3 + C.Bezier()->NbPoles();
87   else if(typC == GeomAbs_BSplineCurve) { 
88     Handle(Geom2d_BSplineCurve) BSC = C.BSpline();
89     nbs = BSC->NbKnots();
90     nbs*= BSC->Degree();
91     if(nbs < 2) nbs=2;
92   }
93   return(nbs);
94 }
95
96 Standard_Real 
97 Geom2dGcc_CurveToolGeo::FirstParameter (const Adaptor3d_OffsetCurve& C) {
98   return C.FirstParameter();
99 }
100
101 Standard_Real 
102 Geom2dGcc_CurveToolGeo::LastParameter (const Adaptor3d_OffsetCurve& C) {
103   return C.LastParameter();
104 }
105
106 gp_Pnt2d 
107 Geom2dGcc_CurveToolGeo::Value (const Adaptor3d_OffsetCurve& C,
108                                const Standard_Real   U) {
109
110                                  return C.Value(U);
111 }
112
113 void Geom2dGcc_CurveToolGeo::D1(const Adaptor3d_OffsetCurve& C,
114                                 const Standard_Real   U,
115                                 gp_Pnt2d&       P,
116                                 gp_Vec2d&       T) {
117                                   C.D1(U,P,T);
118 }
119
120 void Geom2dGcc_CurveToolGeo::D2(const Adaptor3d_OffsetCurve& C,
121                                 const Standard_Real U,
122                                 gp_Pnt2d&     P,
123                                 gp_Vec2d&     T,
124                                 gp_Vec2d&     N) {
125                                   C.D2(U,P,T,N);
126 }
127
128 Standard_Boolean Geom2dGcc_CurveToolGeo::
129 IsComposite (const Adaptor3d_OffsetCurve& ) {
130   return Standard_False;
131 }
132
133 Standard_Integer Geom2dGcc_CurveToolGeo::
134 GetIntervals (const Adaptor3d_OffsetCurve& ) {
135   cout << "Not implemented" << endl;
136   return 0;
137 }
138
139 void Geom2dGcc_CurveToolGeo::
140 GetInterval (const Adaptor3d_OffsetCurve&    ,
141              const Standard_Integer   ,
142              Standard_Real&     ,
143              Standard_Real&     ) {
144                cout << "Not implemented" << endl;
145 }
146
147 void Geom2dGcc_CurveToolGeo::
148 SetCurrentInterval (      Adaptor3d_OffsetCurve&   ,
149                     const Standard_Integer  ) {
150                       cout << "Not implemented" << endl;
151 }
152