b311480e |
1 | // Created on: 1993-03-24 |
2 | // Created by: JCV |
3 | // Copyright (c) 1993-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 | |
42cf5bc1 |
17 | |
18 | #include <Geom2d_Conic.hxx> |
19 | #include <gp_Ax2d.hxx> |
20 | #include <gp_Ax22d.hxx> |
7fd59977 |
21 | #include <gp_Dir2d.hxx> |
42cf5bc1 |
22 | #include <gp_Pnt2d.hxx> |
23 | #include <Standard_ConstructionError.hxx> |
24 | #include <Standard_DomainError.hxx> |
25 | #include <Standard_Type.hxx> |
7fd59977 |
26 | |
92efcf78 |
27 | IMPLEMENT_STANDARD_RTTIEXT(Geom2d_Conic,Geom2d_Curve) |
28 | |
7fd59977 |
29 | typedef Geom2d_Conic Conic; |
7fd59977 |
30 | |
31 | typedef gp_Ax2d Ax2d; |
32 | typedef gp_Dir2d Dir2d; |
33 | typedef gp_Pnt2d Pnt2d; |
34 | typedef gp_Vec2d Vec2d; |
35 | |
7fd59977 |
36 | //======================================================================= |
37 | //function : SetAxis |
38 | //purpose : |
39 | //======================================================================= |
40 | |
41 | void Geom2d_Conic::SetAxis(const gp_Ax22d& A) |
42 | { |
43 | pos.SetAxis(A); |
44 | } |
45 | |
46 | //======================================================================= |
47 | //function : SetXAxis |
48 | //purpose : |
49 | //======================================================================= |
50 | |
51 | void Geom2d_Conic::SetXAxis (const Ax2d& A) |
52 | { |
53 | pos.SetXAxis(A); |
54 | } |
55 | |
56 | //======================================================================= |
57 | //function : SetYAxis |
58 | //purpose : |
59 | //======================================================================= |
60 | |
61 | void Geom2d_Conic::SetYAxis (const Ax2d& A) |
62 | { |
63 | pos.SetYAxis(A); |
64 | } |
65 | |
66 | //======================================================================= |
67 | //function : SetLocation |
68 | //purpose : |
69 | //======================================================================= |
70 | |
71 | void Geom2d_Conic::SetLocation (const Pnt2d& P) |
72 | { |
73 | pos.SetLocation (P); |
74 | } |
75 | |
76 | //======================================================================= |
77 | //function : XAxis |
78 | //purpose : |
79 | //======================================================================= |
80 | |
81 | Ax2d Geom2d_Conic::XAxis () const |
82 | { |
83 | return gp_Ax2d(pos.Location(), pos.XDirection()); |
84 | } |
85 | |
86 | //======================================================================= |
87 | //function : YAxis |
88 | //purpose : |
89 | //======================================================================= |
90 | |
91 | Ax2d Geom2d_Conic::YAxis () const |
92 | { |
93 | return gp_Ax2d(pos.Location(), pos.YDirection()); |
94 | } |
95 | |
96 | //======================================================================= |
97 | //function : Location |
98 | //purpose : |
99 | //======================================================================= |
100 | |
101 | Pnt2d Geom2d_Conic::Location () const |
102 | { |
103 | return pos.Location(); |
104 | } |
105 | |
106 | //======================================================================= |
107 | //function : Position |
108 | //purpose : |
109 | //======================================================================= |
110 | |
111 | const gp_Ax22d& Geom2d_Conic::Position () const |
112 | { |
113 | return pos; |
114 | } |
115 | |
116 | |
117 | //======================================================================= |
118 | //function : Reverse |
119 | //purpose : |
120 | //======================================================================= |
121 | |
122 | void Geom2d_Conic::Reverse () { |
123 | |
124 | Dir2d Temp = pos.YDirection (); |
125 | Temp.Reverse (); |
126 | pos.SetAxis(gp_Ax22d(pos.Location(), pos.XDirection(), Temp)); |
127 | } |
128 | |
129 | //======================================================================= |
130 | //function : Continuity |
131 | //purpose : |
132 | //======================================================================= |
133 | |
134 | GeomAbs_Shape Geom2d_Conic::Continuity () const |
135 | { |
136 | return GeomAbs_CN; |
137 | } |
138 | |
139 | //======================================================================= |
140 | //function : IsCN |
141 | //purpose : |
142 | //======================================================================= |
143 | |
144 | Standard_Boolean Geom2d_Conic::IsCN (const Standard_Integer ) const |
145 | { |
146 | return Standard_True; |
147 | } |