0023604: Uninitialized variables in debug mode
[occt.git] / src / IntCurve / IntCurve_PConicTool.cxx
1 // Created on: 1992-03-30
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22
23
24 #include <IntCurve_PConicTool.ixx>
25 #include <ElCLib.hxx>
26
27 //----------------------------------------------------------------------
28 gp_Pnt2d IntCurve_PConicTool::Value(const IntCurve_PConic& PConic,
29                                   const Standard_Real X) {
30   switch(PConic.TypeCurve()) {
31
32   case GeomAbs_Line:
33     return(ElCLib::LineValue(X,PConic.Axis2().XAxis())); 
34
35
36   case GeomAbs_Circle:
37     return(ElCLib::CircleValue(X,PConic.Axis2(),PConic.Param1())); 
38
39
40   case GeomAbs_Ellipse:
41     return(ElCLib::EllipseValue(X,PConic.Axis2(),
42                                PConic.Param1(),
43                                PConic.Param2()));
44
45
46   case GeomAbs_Parabola:
47     return(ElCLib::ParabolaValue(X,PConic.Axis2(),PConic.Param1()));
48
49
50   default:    //-- case GeomAbs_Hyperbola:
51     return(ElCLib::HyperbolaValue(X,PConic.Axis2(),PConic.Param1(),
52                                  PConic.Param2()));
53
54   }
55 }
56
57 //----------------------------------------------------------------------
58 void IntCurve_PConicTool::D1(const IntCurve_PConic& PConic,
59                             const Standard_Real U,
60                             gp_Pnt2d& Pt,
61                             gp_Vec2d& Tan)  { 
62
63   switch(PConic.TypeCurve()) {
64
65   case GeomAbs_Line:
66     ElCLib::LineD1(U,PConic.Axis2().XAxis(),Pt,Tan);
67     break;
68
69   case GeomAbs_Circle:
70     ElCLib::CircleD1(U,PConic.Axis2(),PConic.Param1(),Pt,Tan);
71     break;
72
73   case GeomAbs_Ellipse:
74     ElCLib::EllipseD1(U,PConic.Axis2(),PConic.Param1(),
75                      PConic.Param2(),Pt,Tan);
76     break;
77
78   case GeomAbs_Parabola:
79     ElCLib::ParabolaD1(U,PConic.Axis2(),PConic.Param1(),Pt,Tan);  
80     break;
81
82   case GeomAbs_Hyperbola:
83     ElCLib::HyperbolaD1(U,PConic.Axis2(),PConic.Param1(),
84                        PConic.Param2(),Pt,Tan);
85     break;
86   default:
87     break;
88   }
89 }
90
91 //----------------------------------------------------------------------
92 void IntCurve_PConicTool::D2(const IntCurve_PConic& PConic,
93                             const Standard_Real U,
94                             gp_Pnt2d& Pt,
95                             gp_Vec2d& Tan,
96                             gp_Vec2d& Norm)  { 
97
98   switch(PConic.TypeCurve()) {
99
100   case GeomAbs_Line:
101     Tan.SetCoord(0.0,0.0);
102     ElCLib::LineD1(U,PConic.Axis2().XAxis(),Pt,Tan);
103     break;
104
105   case GeomAbs_Circle:
106     ElCLib::CircleD2(U,PConic.Axis2(),PConic.Param1(),Pt,Tan,Norm);
107     break;
108
109   case GeomAbs_Ellipse:
110     ElCLib::EllipseD2(U,PConic.Axis2(),PConic.Param1(),PConic.Param2(),
111                      Pt,Tan,Norm);
112     break;
113
114   case GeomAbs_Parabola:
115     ElCLib::ParabolaD2(U,PConic.Axis2(),PConic.Param1(),Pt,Tan,Norm);  
116     break;
117
118   case GeomAbs_Hyperbola:
119     ElCLib::HyperbolaD2(U,PConic.Axis2(),PConic.Param1(),
120                        PConic.Param2(),Pt,Tan,Norm);
121     break;
122   default:
123     break;
124   }
125
126
127
128 Standard_Real IntCurve_PConicTool::EpsX(const IntCurve_PConic& PConic) {
129   return(PConic.EpsX());
130 }
131
132 Standard_Integer IntCurve_PConicTool::NbSamples(const IntCurve_PConic& PConic) {
133   return(PConic.Accuracy());
134 }
135
136 //Standard_Integer IntCurve_PConicTool::NbSamples(const IntCurve_PConic& PConic,const Standard_Real U0,const Standard_Real U1) {
137 Standard_Integer IntCurve_PConicTool::NbSamples(const IntCurve_PConic& PConic,const Standard_Real ,const Standard_Real ) {
138   return(PConic.Accuracy());
139 }
140
141
142