0032641: Coding - get rid of unused forward declarations [IGESAppli to LDOM]
[occt.git] / src / IntPatch / IntPatch_WLine.hxx
1 // Created on: 1991-05-27
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-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_WLine_HeaderFile
18 #define _IntPatch_WLine_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Integer.hxx>
25 #include <IntPatch_SequenceOfPoint.hxx>
26 #include <Standard_Real.hxx>
27 #include <IntPatch_PointLine.hxx>
28 #include <IntSurf_LineOn2S.hxx>
29 #include <IntSurf_Situation.hxx>
30 #include <IntSurf_TypeTrans.hxx>
31
32 class IntPatch_Point;
33 class IntSurf_PntOn2S;
34 class gp_Pnt2d;
35 class gp_Pnt;
36
37
38 class IntPatch_WLine;
39 DEFINE_STANDARD_HANDLE(IntPatch_WLine, IntPatch_PointLine)
40
41 //! Definition of set of points as a result of the intersection
42 //! between 2 parametrised patches.
43 class IntPatch_WLine : public IntPatch_PointLine
44 {
45
46 public:
47
48   //! Enumeration of ways of WLine creation.
49   enum IntPatch_WLType
50   {
51     IntPatch_WLUnknown,
52     IntPatch_WLImpImp,
53     IntPatch_WLImpPrm,
54     IntPatch_WLPrmPrm
55   };
56   
57   //! Creates a WLine as an intersection when the
58   //! transitions are In or Out.
59   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
60   
61   //! Creates a WLine as an intersection when the
62   //! transitions are Touch.
63   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
64   
65   //! Creates a WLine as an intersection when the
66   //! transitions are Undecided.
67   Standard_EXPORT IntPatch_WLine(const Handle(IntSurf_LineOn2S)& Line, const Standard_Boolean Tang);
68   
69   //! Adds a vertex in the list. If theIsPrepend == TRUE the new
70   //! vertex will be added before the first element of vertices sequence.
71   //! Otherwise, to the end of the sequence
72   virtual void AddVertex (const IntPatch_Point& Pnt,
73                     const Standard_Boolean theIsPrepend = Standard_False) Standard_OVERRIDE;
74   
75   //! Set the Point of index <Index> in the LineOn2S
76   Standard_EXPORT void SetPoint (const Standard_Integer Index, const IntPatch_Point& Pnt);
77   
78   //! Replaces the element of range Index in the list
79   //! of points.
80   //! The exception OutOfRange is raised when
81   //! Index <= 0 or Index > NbVertex.
82     void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
83   
84     void SetFirstPoint (const Standard_Integer IndFirst);
85   
86     void SetLastPoint (const Standard_Integer IndLast);
87   
88   //! Returns the number of intersection points.
89   virtual Standard_Integer NbPnts() const Standard_OVERRIDE;
90   
91   //! Returns the intersection point of range Index.
92   virtual const IntSurf_PntOn2S& Point (const Standard_Integer Index) const Standard_OVERRIDE;
93   
94   //! Returns True if the line has a known First point.
95   //! This point is given by the method FirstPoint().
96     Standard_Boolean HasFirstPoint() const;
97   
98   //! Returns True if the line has a known Last point.
99   //! This point is given by the method LastPoint().
100     Standard_Boolean HasLastPoint() const;
101   
102   //! Returns the Point corresponding to the FirstPoint.
103     const IntPatch_Point& FirstPoint() const;
104   
105   //! Returns the Point corresponding to the LastPoint.
106     const IntPatch_Point& LastPoint() const;
107   
108   //! Returns the Point corresponding to the FirstPoint.
109   //! Indfirst is the index of the first in the list
110   //! of vertices.
111     const IntPatch_Point& FirstPoint (Standard_Integer& Indfirst) const;
112   
113   //! Returns the Point corresponding to the LastPoint.
114   //! Indlast is the index of the last in the list
115   //! of vertices.
116     const IntPatch_Point& LastPoint (Standard_Integer& Indlast) const;
117   
118   //! Returns number of vertices (IntPatch_Point) of the line
119   virtual Standard_Integer NbVertex() const Standard_OVERRIDE;
120   
121   //! Returns the vertex of range Index on the line.
122   virtual const IntPatch_Point& Vertex (const Standard_Integer Index) const Standard_OVERRIDE;
123
124   //! Returns the vertex of range Index on the line.
125   virtual IntPatch_Point& ChangeVertex (const Standard_Integer Index) Standard_OVERRIDE;
126   
127   //! Set the parameters of all the vertex on the line.
128   //! if a vertex is already in the line,
129   //! its parameter is modified
130   //! else a new point in the line is inserted.
131   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
132   
133   //! Returns set of intersection points
134   Standard_EXPORT virtual Handle(IntSurf_LineOn2S) Curve() const Standard_OVERRIDE;
135   
136   //! Returns TRUE if theP is out of the box built from
137   //! the points on 1st surface
138   Standard_Boolean IsOutSurf1Box (const gp_Pnt2d& theP) const Standard_OVERRIDE
139   {
140     return curv->IsOutSurf1Box(theP);
141   }
142   
143   //! Returns TRUE if theP is out of the box built from
144   //! the points on 2nd surface
145   Standard_Boolean IsOutSurf2Box(const gp_Pnt2d& theP) const Standard_OVERRIDE
146   {
147     return curv->IsOutSurf2Box(theP);
148   }
149   
150   //! Returns TRUE if theP is out of the box built from 3D-points.
151   Standard_Boolean IsOutBox(const gp_Pnt& theP) const Standard_OVERRIDE
152   {
153     return curv->IsOutBox(theP);
154   }
155
156   Standard_EXPORT void SetPeriod (const Standard_Real pu1, const Standard_Real pv1, const Standard_Real pu2, const Standard_Real pv2);
157   
158   Standard_EXPORT Standard_Real U1Period() const;
159   
160   Standard_EXPORT Standard_Real V1Period() const;
161   
162   Standard_EXPORT Standard_Real U2Period() const;
163   
164   Standard_EXPORT Standard_Real V2Period() const;
165   
166   Standard_EXPORT void SetArcOnS1 (const Handle(Adaptor2d_Curve2d)& A);
167   
168   Standard_EXPORT Standard_Boolean HasArcOnS1() const;
169   
170   Standard_EXPORT const Handle(Adaptor2d_Curve2d)& GetArcOnS1() const;
171   
172   Standard_EXPORT void SetArcOnS2 (const Handle(Adaptor2d_Curve2d)& A);
173   
174   Standard_EXPORT Standard_Boolean HasArcOnS2() const;
175   
176   Standard_EXPORT const Handle(Adaptor2d_Curve2d)& GetArcOnS2() const;
177   
178   //! Removes vertices from the line (i.e. cleans svtx member)
179   virtual void ClearVertexes() Standard_OVERRIDE;
180   
181   //! Removes single vertex from the line
182   virtual void RemoveVertex (const Standard_Integer theIndex) Standard_OVERRIDE;
183   
184   void InsertVertexBefore (const Standard_Integer theIndex, const IntPatch_Point& thePnt);
185   
186   //! if (theMode == 0) then prints the information about WLine
187   //! if (theMode == 1) then prints the list of 3d-points
188   //! if (theMode == 2) then prints the list of 2d-points on the 1st surface
189   //! Otherwise,             prints list of 2d-points on the 2nd surface
190   Standard_EXPORT void Dump(const Standard_Integer theMode) const;
191
192   //! Allows or forbids purging of existing WLine
193   void EnablePurging(const Standard_Boolean theIsEnabled)
194   {
195     myIsPurgerAllowed = theIsEnabled;
196   }
197
198   //! Returns TRUE if purging is allowed or forbidden for existing WLine
199   Standard_Boolean IsPurgingAllowed()
200   {
201     return myIsPurgerAllowed;
202   }
203
204   //! Returns the way of <*this> creation.
205   IntPatch_WLType GetCreatingWay() const
206   {
207     return myCreationWay;
208   }
209
210   //! Sets the info about the way of <*this> creation.
211   void SetCreatingWayInfo(IntPatch_WLType theAlgo)
212   {
213     myCreationWay = theAlgo;
214   }
215
216
217   DEFINE_STANDARD_RTTIEXT(IntPatch_WLine,IntPatch_PointLine)
218
219 protected:
220
221
222
223
224 private:
225
226
227   Handle(IntSurf_LineOn2S) curv;
228   Standard_Boolean fipt;
229   Standard_Boolean lapt;
230   Standard_Integer indf;
231   Standard_Integer indl;
232   IntPatch_SequenceOfPoint svtx;
233   Standard_Real u1period;
234   Standard_Real v1period;
235   Standard_Real u2period;
236   Standard_Real v2period;
237   Standard_Boolean hasArcOnS1;
238   Handle(Adaptor2d_Curve2d) theArcOnS1;
239   Standard_Boolean hasArcOnS2;
240   Handle(Adaptor2d_Curve2d) theArcOnS2;
241   Standard_Boolean myIsPurgerAllowed;
242
243   //! identifies the way of <*this> creation
244   IntPatch_WLType myCreationWay;
245
246 };
247
248
249 #include <IntPatch_WLine.lxx>
250
251
252
253
254
255 #endif // _IntPatch_WLine_HeaderFile