b311480e |
1 | // Created on: 1992-04-06 |
2 | // Created by: Jacques GOUSSARD |
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 <Standard_DomainError.hxx> |
18 | |
19 | #include <gp_Lin.hxx> |
20 | #include <gp_Circ.hxx> |
21 | #include <gp_Elips.hxx> |
22 | #include <gp_Parab.hxx> |
23 | #include <gp_Hypr.hxx> |
24 | |
25 | #include <Precision.hxx> |
26 | |
27 | |
28 | inline void IntPatch_GLine::SetFirstPoint (const Standard_Integer IndFirst) |
29 | { |
30 | fipt = Standard_True; |
31 | indf = IndFirst; |
32 | } |
33 | |
34 | |
35 | inline void IntPatch_GLine::SetLastPoint (const Standard_Integer IndLast) |
36 | { |
37 | lapt = Standard_True; |
38 | indl = IndLast; |
39 | } |
40 | |
41 | |
42 | inline gp_Lin IntPatch_GLine::Line () const |
43 | { |
9775fa61 |
44 | if (typ != IntPatch_Lin) {throw Standard_DomainError();} |
7fd59977 |
45 | return gp_Lin(pos.Axis()); |
46 | } |
47 | |
48 | |
49 | inline gp_Circ IntPatch_GLine::Circle () const |
50 | { |
9775fa61 |
51 | if (typ != IntPatch_Circle) {throw Standard_DomainError();} |
7fd59977 |
52 | return gp_Circ(pos,par1); |
53 | } |
54 | |
55 | |
56 | inline gp_Elips IntPatch_GLine::Ellipse () const |
57 | { |
9775fa61 |
58 | if (typ != IntPatch_Ellipse) {throw Standard_DomainError();} |
7fd59977 |
59 | return gp_Elips(pos,par1,par2); |
60 | } |
61 | |
62 | |
63 | inline gp_Parab IntPatch_GLine::Parabola () const |
64 | { |
9775fa61 |
65 | if (typ != IntPatch_Parabola) {throw Standard_DomainError();} |
7fd59977 |
66 | return gp_Parab(pos,par1); |
67 | } |
68 | |
69 | |
70 | inline gp_Hypr IntPatch_GLine::Hyperbola () const |
71 | { |
9775fa61 |
72 | if (typ != IntPatch_Hyperbola) {throw Standard_DomainError();} |
7fd59977 |
73 | return gp_Hypr(pos,par1,par2); |
74 | } |
75 | |
76 | |
77 | inline Standard_Boolean IntPatch_GLine::HasFirstPoint () const |
78 | { |
79 | return fipt; |
80 | } |
81 | |
82 | |
83 | inline Standard_Boolean IntPatch_GLine::HasLastPoint () const |
84 | { |
85 | return lapt; |
86 | } |
87 | |
88 | |
89 | inline const IntPatch_Point& IntPatch_GLine::FirstPoint () const |
90 | { |
9775fa61 |
91 | if (!fipt) {throw Standard_DomainError();} |
7fd59977 |
92 | return svtx(indf); |
93 | } |
94 | |
95 | |
96 | inline const IntPatch_Point& IntPatch_GLine::LastPoint () const |
97 | { |
9775fa61 |
98 | if (!lapt) {throw Standard_DomainError();} |
7fd59977 |
99 | return svtx(indl); |
100 | } |
101 | |
102 | |
103 | inline Standard_Integer IntPatch_GLine::NbVertex () const |
104 | { |
105 | return svtx.Length(); |
106 | } |
107 | |
108 | |
109 | inline const IntPatch_Point& IntPatch_GLine::Vertex (const Standard_Integer Index) const |
110 | { |
111 | return svtx(Index); |
112 | } |