0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / IntPatch / IntPatch_GLine.hxx
1 // Created on: 1992-04-06
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IntPatch_GLine_HeaderFile
18 #define _IntPatch_GLine_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <gp_Ax2.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 #include <IntPatch_SequenceOfPoint.hxx>
28 #include <IntPatch_Line.hxx>
29 #include <IntSurf_TypeTrans.hxx>
30 #include <IntSurf_Situation.hxx>
31 #include <gp_Lin.hxx>
32 #include <gp_Circ.hxx>
33 #include <gp_Elips.hxx>
34 #include <gp_Parab.hxx>
35 #include <gp_Hypr.hxx>
36 class Standard_DomainError;
37 class Standard_OutOfRange;
38 class gp_Lin;
39 class gp_Circ;
40 class gp_Elips;
41 class gp_Parab;
42 class gp_Hypr;
43 class IntPatch_Point;
44
45
46 class IntPatch_GLine;
47 DEFINE_STANDARD_HANDLE(IntPatch_GLine, IntPatch_Line)
48
49 //! Implementation of an intersection line represented
50 //! by a conic.
51 class IntPatch_GLine : public IntPatch_Line
52 {
53
54 public:
55
56   
57   //! Creates a Line as intersection line
58   //! when the transitions are In or Out.
59   Standard_EXPORT IntPatch_GLine(const gp_Lin& L, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
60   
61   //! Creates a Line as intersection line
62   //! when the transitions are Touch.
63   Standard_EXPORT IntPatch_GLine(const gp_Lin& L, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
64   
65   //! Creates a Line as intersection line
66   //! when the transitions are Undecided.
67   Standard_EXPORT IntPatch_GLine(const gp_Lin& L, const Standard_Boolean Tang);
68   
69   //! Creates a circle as intersection line
70   //! when the transitions are In or Out.
71   Standard_EXPORT IntPatch_GLine(const gp_Circ& C, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
72   
73   //! Creates a circle as intersection line
74   //! when the transitions are Touch.
75   Standard_EXPORT IntPatch_GLine(const gp_Circ& C, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
76   
77   //! Creates a circle as intersection line
78   //! when the transitions are Undecided.
79   Standard_EXPORT IntPatch_GLine(const gp_Circ& C, const Standard_Boolean Tang);
80   
81   //! Creates an ellipse as intersection line
82   //! when the transitions are In or Out.
83   Standard_EXPORT IntPatch_GLine(const gp_Elips& E, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
84   
85   //! Creates an ellispe as intersection line
86   //! when the transitions are Touch.
87   Standard_EXPORT IntPatch_GLine(const gp_Elips& E, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
88   
89   //! Creates an ellipse as intersection line
90   //! when the transitions are Undecided.
91   Standard_EXPORT IntPatch_GLine(const gp_Elips& E, const Standard_Boolean Tang);
92   
93   //! Creates a parabola as intersection line
94   //! when the transitions are In or Out.
95   Standard_EXPORT IntPatch_GLine(const gp_Parab& P, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
96   
97   //! Creates a parabola as intersection line
98   //! when the transitions are Touch.
99   Standard_EXPORT IntPatch_GLine(const gp_Parab& P, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
100   
101   //! Creates a parabola as intersection line
102   //! when the transitions are Undecided.
103   Standard_EXPORT IntPatch_GLine(const gp_Parab& P, const Standard_Boolean Tang);
104   
105   //! Creates an hyperbola as intersection line
106   //! when the transitions are In or Out.
107   Standard_EXPORT IntPatch_GLine(const gp_Hypr& H, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
108   
109   //! Creates an hyperbola as intersection line
110   //! when the transitions are Touch.
111   Standard_EXPORT IntPatch_GLine(const gp_Hypr& H, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
112   
113   //! Creates an hyperbola as  intersection line
114   //! when the transitions are Undecided.
115   Standard_EXPORT IntPatch_GLine(const gp_Hypr& H, const Standard_Boolean Tang);
116   
117   //! To add a vertex in the list.
118   Standard_EXPORT void AddVertex (const IntPatch_Point& Pnt);
119   
120   //! To replace the element of range Index in the list
121   //! of points.
122   Standard_EXPORT void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
123   
124     void SetFirstPoint (const Standard_Integer IndFirst);
125   
126     void SetLastPoint (const Standard_Integer IndLast);
127   
128   //! Returns the Lin from gp corresponding to the intersection
129   //! when ArcType returns IntPatch_Line.
130     gp_Lin Line() const;
131   
132   //! Returns the Circ from gp corrsponding to the intersection
133   //! when ArcType returns IntPatch_Circle.
134     gp_Circ Circle() const;
135   
136   //! Returns the Elips from gp corrsponding to the intersection
137   //! when ArcType returns IntPatch_Ellipse.
138     gp_Elips Ellipse() const;
139   
140   //! Returns the Parab from gp corrsponding to the intersection
141   //! when ArcType returns IntPatch_Parabola.
142     gp_Parab Parabola() const;
143   
144   //! Returns the Hypr from gp corrsponding to the intersection
145   //! when ArcType returns IntPatch_Hyperbola.
146     gp_Hypr Hyperbola() const;
147   
148   //! Returns True if the line has a known First point.
149   //! This point is given by the method FirstPoint().
150     Standard_Boolean HasFirstPoint() const;
151   
152   //! Returns True if the line has a known Last point.
153   //! This point is given by the method LastPoint().
154     Standard_Boolean HasLastPoint() const;
155   
156   //! Returns the IntPoint corresponding to the FirstPoint.
157   //! An exception is raised when HasFirstPoint returns False.
158     const IntPatch_Point& FirstPoint() const;
159   
160   //! Returns the IntPoint corresponding to the LastPoint.
161   //! An exception is raised when HasLastPoint returns False.
162     const IntPatch_Point& LastPoint() const;
163   
164     Standard_Integer NbVertex() const;
165   
166   //! Returns the vertex of range Index on the line.
167     const IntPatch_Point& Vertex (const Standard_Integer Index) const;
168   
169   //! Set the parameters of all the vertex on the line.
170   //! if a vertex is already in the line,
171   //! its parameter is modified
172   //! else a new point in the line is inserted.
173   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
174
175
176
177
178   DEFINE_STANDARD_RTTIEXT(IntPatch_GLine,IntPatch_Line)
179
180 protected:
181
182
183
184
185 private:
186
187
188   gp_Ax2 pos;
189   Standard_Real par1;
190   Standard_Real par2;
191   Standard_Boolean fipt;
192   Standard_Boolean lapt;
193   Standard_Integer indf;
194   Standard_Integer indl;
195   IntPatch_SequenceOfPoint svtx;
196
197
198 };
199
200
201 #include <IntPatch_GLine.lxx>
202
203
204
205
206
207 #endif // _IntPatch_GLine_HeaderFile