0024893: CLang warnings -Wlogical-not-parentheses for gce_Done comparisons
[occt.git] / src / GC / GC_MakeArcOfHyperbola.cxx
CommitLineData
b311480e 1// Created on: 1992-10-02
2// Created by: Remi GILET
3// Copyright (c) 1992-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
17#include <GC_MakeArcOfHyperbola.ixx>
18#include <Geom_Hyperbola.hxx>
19#include <StdFail_NotDone.hxx>
20#include <ElCLib.hxx>
21
22GC_MakeArcOfHyperbola::
23 GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
24 const gp_Pnt& P1 ,
25 const gp_Pnt& P2 ,
26 const Standard_Boolean Sense )
27{
28 Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1);
29 Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2);
30 Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
31 TheArc = new Geom_TrimmedCurve(H,Alpha1,Alpha2,Sense);
32 TheError = gce_Done;
33}
34
35GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
36 const gp_Pnt& P ,
37 const Standard_Real Alpha ,
38 const Standard_Boolean Sense )
39{
40 Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P);
41 Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
42 TheArc = new Geom_TrimmedCurve(H,Alphafirst,Alpha,Sense);
43 TheError = gce_Done;
44}
45
46GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
47 const Standard_Real Alpha1 ,
48 const Standard_Real Alpha2 ,
49 const Standard_Boolean Sense )
50{
51 Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
52 TheArc = new Geom_TrimmedCurve(H,Alpha1,Alpha2,Sense);
53 TheError = gce_Done;
54}
55
56const Handle(Geom_TrimmedCurve)& GC_MakeArcOfHyperbola::Value() const
57{
82fc327c 58 StdFail_NotDone_Raise_if(TheError != gce_Done,"");
7fd59977 59 return TheArc;
60}
61
62const Handle(Geom_TrimmedCurve)& GC_MakeArcOfHyperbola::Operator() const
63{
64 return Value();
65}
66
67GC_MakeArcOfHyperbola::operator Handle(Geom_TrimmedCurve) () const
68{
69 return Value();
70}
71