Warnings on vc14 were eliminated
[occt.git] / src / IntPatch / IntPatch_ALine.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_ALine_HeaderFile
18 #define _IntPatch_ALine_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <IntAna_Curve.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <IntPatch_SequenceOfPoint.hxx>
27 #include <IntPatch_Line.hxx>
28 #include <IntSurf_TypeTrans.hxx>
29 #include <IntSurf_Situation.hxx>
30 #include <Standard_Real.hxx>
31 #include <gp_Pnt.hxx>
32 class Standard_DomainError;
33 class Standard_OutOfRange;
34 class IntAna_Curve;
35 class IntPatch_Point;
36 class gp_Pnt;
37 class gp_Vec;
38
39
40 class IntPatch_ALine;
41 DEFINE_STANDARD_HANDLE(IntPatch_ALine, IntPatch_Line)
42
43 //! Implementation of an intersection line described by a
44 //! parametrised curve.
45 class IntPatch_ALine : public IntPatch_Line
46 {
47
48 public:
49
50   
51   //! Creates an analytic intersection line
52   //! when the transitions are In or Out.
53   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
54   
55   //! Creates an analytic intersection line
56   //! when the transitions are Touch.
57   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
58   
59   //! Creates an analytic intersection line
60   //! when the transitions are Undecided.
61   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang);
62   
63   //! To add a vertex in the list.
64   Standard_EXPORT void AddVertex (const IntPatch_Point& Pnt);
65   
66   //! Replaces the element of range Index in the list
67   //! of points.
68     void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
69   
70     void SetFirstPoint (const Standard_Integer IndFirst);
71   
72     void SetLastPoint (const Standard_Integer IndLast);
73   
74   //! Returns the first parameter on the intersection line.
75   //! If IsIncluded returns True, Value and D1 methods can
76   //! be call with a parameter equal to FirstParamater.
77   //! Otherwise, the parameter must be greater than
78   //! FirstParameter.
79     Standard_Real FirstParameter (Standard_Boolean& IsIncluded) const;
80   
81   //! Returns the last parameter on the intersection line.
82   //! If IsIncluded returns True, Value and D1 methods can
83   //! be call with a parameter equal to LastParamater.
84   //! Otherwise, the parameter must be less than LastParameter.
85     Standard_Real LastParameter (Standard_Boolean& IsIncluded) const;
86   
87   //! Returns the point of parameter U on the analytic
88   //! intersection line.
89     gp_Pnt Value (const Standard_Real U);
90   
91   //! Returns Standard_True when the derivative at parameter U
92   //! is defined on the analytic intersection line.
93   //! In that case, Du is the derivative.
94   //! Returns Standard_False when it is not possible to
95   //! evaluate the derivative.
96   //! In both cases, P is the point at parameter U on the
97   //! intersection.
98     Standard_Boolean D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& Du);
99   
100   //! Tries to find the parameter of the point P on the curve.
101   //! If the method returns False, the "projection" is
102   //! impossible, and the value of Para is not significant.
103   //! If the method returns True, Para is the parameter of the
104   //! nearest intersection between the curve and the iso-theta
105   //! containing P.
106     Standard_Boolean FindParameter (const gp_Pnt& P, Standard_Real& Para) const;
107   
108   //! Returns True if the line has a known First point.
109   //! This point is given by the method FirstPoint().
110     Standard_Boolean HasFirstPoint() const;
111   
112   //! Returns True if the line has a known Last point.
113   //! This point is given by the method LastPoint().
114     Standard_Boolean HasLastPoint() const;
115   
116   //! Returns the IntPoint corresponding to the FirstPoint.
117   //! An exception is raised when HasFirstPoint returns False.
118     const IntPatch_Point& FirstPoint() const;
119   
120   //! Returns the IntPoint corresponding to the LastPoint.
121   //! An exception is raised when HasLastPoint returns False.
122     const IntPatch_Point& LastPoint() const;
123   
124     Standard_Integer NbVertex() const;
125   
126   //! Returns the vertex of range Index on the line.
127     const IntPatch_Point& Vertex (const Standard_Integer Index) const;
128   
129   //! Set the parameters of all the vertex on the line.
130   //! if a vertex is already in the line,
131   //! its parameter is modified
132   //! else a new point in the line is inserted.
133   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
134   
135   Standard_EXPORT const IntAna_Curve& Curve() const;
136
137
138
139
140   DEFINE_STANDARD_RTTIEXT(IntPatch_ALine,IntPatch_Line)
141
142 protected:
143
144
145
146
147 private:
148
149
150   IntAna_Curve curv;
151   Standard_Boolean fipt;
152   Standard_Boolean lapt;
153   Standard_Integer indf;
154   Standard_Integer indl;
155   IntPatch_SequenceOfPoint svtx;
156
157
158 };
159
160
161 #include <IntPatch_ALine.lxx>
162
163
164
165
166
167 #endif // _IntPatch_ALine_HeaderFile