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