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_ALine_HeaderFile
18 #define _IntPatch_ALine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
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>
32 class Standard_DomainError;
33 class Standard_OutOfRange;
41 DEFINE_STANDARD_HANDLE(IntPatch_ALine, IntPatch_Line)
43 //! Implementation of an intersection line described by a
44 //! parametrised curve.
45 class IntPatch_ALine : public IntPatch_Line
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);
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);
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);
63 //! To add a vertex in the list.
64 Standard_EXPORT void AddVertex (const IntPatch_Point& Pnt);
66 //! Replaces the element of range Index in the list
68 void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
70 void SetFirstPoint (const Standard_Integer IndFirst);
72 void SetLastPoint (const Standard_Integer IndLast);
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
79 Standard_Real FirstParameter (Standard_Boolean& IsIncluded) const;
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;
87 //! Returns the point of parameter U on the analytic
88 //! intersection line.
89 gp_Pnt Value (const Standard_Real U);
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
98 Standard_Boolean D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& Du);
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
106 Standard_Boolean FindParameter (const gp_Pnt& P, Standard_Real& Para) const;
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;
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;
116 //! Returns the IntPoint corresponding to the FirstPoint.
117 //! An exception is raised when HasFirstPoint returns False.
118 const IntPatch_Point& FirstPoint() const;
120 //! Returns the IntPoint corresponding to the LastPoint.
121 //! An exception is raised when HasLastPoint returns False.
122 const IntPatch_Point& LastPoint() const;
124 Standard_Integer NbVertex() const;
126 //! Returns the vertex of range Index on the line.
127 const IntPatch_Point& Vertex (const Standard_Integer Index) const;
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);
135 Standard_EXPORT const IntAna_Curve& Curve() const;
140 DEFINE_STANDARD_RTTIEXT(IntPatch_ALine,IntPatch_Line)
151 Standard_Boolean fipt;
152 Standard_Boolean lapt;
153 Standard_Integer indf;
154 Standard_Integer indl;
155 IntPatch_SequenceOfPoint svtx;
161 #include <IntPatch_ALine.lxx>
167 #endif // _IntPatch_ALine_HeaderFile