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
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 #ifndef _IntPatch_GLine_HeaderFile
18 #define _IntPatch_GLine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.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>
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;
47 DEFINE_STANDARD_HANDLE(IntPatch_GLine, IntPatch_Line)
49 //! Implementation of an intersection line represented
51 class IntPatch_GLine : public IntPatch_Line
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
117 //! To add a vertex in the list.
118 Standard_EXPORT void AddVertex (const IntPatch_Point& Pnt);
120 //! To replace the element of range Index in the list
122 Standard_EXPORT void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
124 void SetFirstPoint (const Standard_Integer IndFirst);
126 void SetLastPoint (const Standard_Integer IndLast);
128 //! Returns the Lin from gp corresponding to the intersection
129 //! when ArcType returns IntPatch_Line.
132 //! Returns the Circ from gp corrsponding to the intersection
133 //! when ArcType returns IntPatch_Circle.
134 gp_Circ Circle() const;
136 //! Returns the Elips from gp corrsponding to the intersection
137 //! when ArcType returns IntPatch_Ellipse.
138 gp_Elips Ellipse() const;
140 //! Returns the Parab from gp corrsponding to the intersection
141 //! when ArcType returns IntPatch_Parabola.
142 gp_Parab Parabola() const;
144 //! Returns the Hypr from gp corrsponding to the intersection
145 //! when ArcType returns IntPatch_Hyperbola.
146 gp_Hypr Hyperbola() const;
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;
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;
156 //! Returns the IntPoint corresponding to the FirstPoint.
157 //! An exception is raised when HasFirstPoint returns False.
158 const IntPatch_Point& FirstPoint() const;
160 //! Returns the IntPoint corresponding to the LastPoint.
161 //! An exception is raised when HasLastPoint returns False.
162 const IntPatch_Point& LastPoint() const;
164 Standard_Integer NbVertex() const;
166 //! Returns the vertex of range Index on the line.
167 const IntPatch_Point& Vertex (const Standard_Integer Index) const;
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);
178 DEFINE_STANDARD_RTTIEXT(IntPatch_GLine,IntPatch_Line)
191 Standard_Boolean fipt;
192 Standard_Boolean lapt;
193 Standard_Integer indf;
194 Standard_Integer indl;
195 IntPatch_SequenceOfPoint svtx;
201 #include <IntPatch_GLine.lxx>
207 #endif // _IntPatch_GLine_HeaderFile