1 // Created on: 1992-09-02
2 // Created by: Remi GILET
3 // Copyright (c) 1992-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.
17 #include <gce_MakeParab2d.ixx>
19 #include <StdFail_NotDone.hxx>
21 gce_MakeParab2d::gce_MakeParab2d(const gp_Ax22d& A ,
22 const Standard_Real Focal )
24 if (Focal < 0.0) { TheError = gce_NullFocusLength; }
26 TheParab2d = gp_Parab2d(A,Focal);
31 gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& MirrorAxis ,
32 const Standard_Real Focal ,
33 const Standard_Boolean Sense )
35 if (Focal < 0.0) { TheError = gce_NullFocusLength; }
37 TheParab2d = gp_Parab2d(MirrorAxis,Focal,Sense);
42 gce_MakeParab2d::gce_MakeParab2d(const gp_Ax2d& D ,
44 const Standard_Boolean Sense )
46 TheParab2d = gp_Parab2d(D,F,Sense);
50 gce_MakeParab2d::gce_MakeParab2d(const gp_Ax22d& D ,
53 TheParab2d = gp_Parab2d(D,F);
57 //=========================================================================
58 // Creation d une Parabole 2d de gp de centre <Center> et de sommet +
60 // <CenterS1> donne le grand axe . +
61 // <S1> donne la focale. +
62 //=========================================================================
64 gce_MakeParab2d::gce_MakeParab2d(const gp_Pnt2d& S ,
65 const gp_Pnt2d& Center ,
66 const Standard_Boolean Sense )
68 if (S.Distance(Center) >= gp::Resolution()) {
69 gp_Dir2d XAxis(gp_XY(S.XY()-Center.XY()));
70 TheParab2d = gp_Parab2d(gp_Ax2d(Center,XAxis),S.Distance(Center),Sense);
73 else { TheError = gce_NullAxis; }
76 const gp_Parab2d& gce_MakeParab2d::Value () const
78 StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
82 const gp_Parab2d& gce_MakeParab2d::Operator() const
87 gce_MakeParab2d::operator gp_Parab2d() const