1 // Created on: 1993-03-24
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Geom2d_Conic.hxx>
19 #include <gp_Ax2d.hxx>
20 #include <gp_Ax22d.hxx>
21 #include <gp_Dir2d.hxx>
22 #include <gp_Pnt2d.hxx>
23 #include <Standard_ConstructionError.hxx>
24 #include <Standard_DomainError.hxx>
25 #include <Standard_Type.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(Geom2d_Conic,Geom2d_Curve)
29 typedef Geom2d_Conic Conic;
32 typedef gp_Dir2d Dir2d;
33 typedef gp_Pnt2d Pnt2d;
34 typedef gp_Vec2d Vec2d;
36 //=======================================================================
39 //=======================================================================
41 void Geom2d_Conic::SetAxis(const gp_Ax22d& A)
46 //=======================================================================
49 //=======================================================================
51 void Geom2d_Conic::SetXAxis (const Ax2d& A)
56 //=======================================================================
59 //=======================================================================
61 void Geom2d_Conic::SetYAxis (const Ax2d& A)
66 //=======================================================================
67 //function : SetLocation
69 //=======================================================================
71 void Geom2d_Conic::SetLocation (const Pnt2d& P)
76 //=======================================================================
79 //=======================================================================
81 Ax2d Geom2d_Conic::XAxis () const
83 return gp_Ax2d(pos.Location(), pos.XDirection());
86 //=======================================================================
89 //=======================================================================
91 Ax2d Geom2d_Conic::YAxis () const
93 return gp_Ax2d(pos.Location(), pos.YDirection());
96 //=======================================================================
99 //=======================================================================
101 Pnt2d Geom2d_Conic::Location () const
103 return pos.Location();
106 //=======================================================================
107 //function : Position
109 //=======================================================================
111 const gp_Ax22d& Geom2d_Conic::Position () const
117 //=======================================================================
120 //=======================================================================
122 void Geom2d_Conic::Reverse () {
124 Dir2d Temp = pos.YDirection ();
126 pos.SetAxis(gp_Ax22d(pos.Location(), pos.XDirection(), Temp));
129 //=======================================================================
130 //function : Continuity
132 //=======================================================================
134 GeomAbs_Shape Geom2d_Conic::Continuity () const
139 //=======================================================================
142 //=======================================================================
144 Standard_Boolean Geom2d_Conic::IsCN (const Standard_Integer ) const
146 return Standard_True;