0024595: STEP import missing surfaces
[occt.git] / src / IntPatch / IntPatch_RLine.hxx
CommitLineData
42cf5bc1 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_RLine_HeaderFile
18#define _IntPatch_RLine_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Boolean.hxx>
24#include <Standard_Real.hxx>
25#include <Standard_Integer.hxx>
26#include <IntPatch_SequenceOfPoint.hxx>
27#include <IntPatch_PointLine.hxx>
28#include <IntSurf_TypeTrans.hxx>
29#include <IntSurf_Situation.hxx>
30class Adaptor2d_HCurve2d;
31class IntSurf_LineOn2S;
32class Standard_DomainError;
33class Standard_OutOfRange;
34class IntPatch_Point;
35class IntSurf_PntOn2S;
36
37
38class IntPatch_RLine;
39DEFINE_STANDARD_HANDLE(IntPatch_RLine, IntPatch_PointLine)
40
41//! Implementation of an intersection line described by a
42//! restriction line on one of the surfaces.
43class IntPatch_RLine : public IntPatch_PointLine
44{
45
46public:
47
48
49 //! Creates a restriction as an intersection line
50 //! when the transitions are In or Out.
51 Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
52
53 //! Creates a restriction as an intersection line
54 //! when the transitions are Touch.
55 Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
56
57 //! Creates a restriction as an intersection line
58 //! when the transitions are Undecided.
59 Standard_EXPORT IntPatch_RLine(const Standard_Boolean Tang);
60
61 //! To add a vertex in the list.
62 void AddVertex (const IntPatch_Point& Pnt);
63
64 //! Replaces the element of range Index in the list
65 //! of points.
66 void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
67
68 void SetFirstPoint (const Standard_Integer IndFirst);
69
70 void SetLastPoint (const Standard_Integer IndLast);
71
72 void Add (const Handle(IntSurf_LineOn2S)& L);
73
74 //! Returns True if the intersection is on the domain of the
75 //! first patch.
76 //! Returns False if the intersection is on the domain of
77 //! the second patch.
78 Standard_Boolean IsArcOnS1() const;
79
80 //! Returns True if the intersection is on the domain of the
81 //! first patch.
82 //! Returns False if the intersection is on the domain of
83 //! the second patch.
84 Standard_Boolean IsArcOnS2() const;
85
86 Standard_EXPORT void SetArcOnS1 (const Handle(Adaptor2d_HCurve2d)& A);
87
88 Standard_EXPORT void SetArcOnS2 (const Handle(Adaptor2d_HCurve2d)& A);
89
90 Standard_EXPORT void SetParamOnS1 (const Standard_Real p1, const Standard_Real p2);
91
92 Standard_EXPORT void SetParamOnS2 (Standard_Real& p1, Standard_Real& p2);
93
94 //! Returns the concerned arc.
95 const Handle(Adaptor2d_HCurve2d)& ArcOnS1() const;
96
97 //! Returns the concerned arc.
98 const Handle(Adaptor2d_HCurve2d)& ArcOnS2() const;
99
100 Standard_EXPORT void ParamOnS1 (Standard_Real& p1, Standard_Real& p2) const;
101
102 Standard_EXPORT void ParamOnS2 (Standard_Real& p1, Standard_Real& p2) const;
103
104 //! Returns True if the line has a known First point.
105 //! This point is given by the method FirstPoint().
106 Standard_Boolean HasFirstPoint() const;
107
108 //! Returns True if the line has a known Last point.
109 //! This point is given by the method LastPoint().
110 Standard_Boolean HasLastPoint() const;
111
112 //! Returns the IntPoint corresponding to the FirstPoint.
113 //! An exception is raised when HasFirstPoint returns False.
114 const IntPatch_Point& FirstPoint() const;
115
116 //! Returns the IntPoint corresponding to the LastPoint.
117 //! An exception is raised when HasLastPoint returns False.
118 const IntPatch_Point& LastPoint() const;
119
120 Standard_Integer NbVertex() const;
121
122 //! Returns the vertex of range Index on the line.
123 const IntPatch_Point& Vertex (const Standard_Integer Index) const;
124
125 Standard_Boolean HasPolygon() const;
126
127 //! Returns the number of intersection points.
79104795 128 Standard_Integer NbPnts() const Standard_OVERRIDE;
42cf5bc1 129
130 //! Returns the intersection point of range Index.
79104795 131 const IntSurf_PntOn2S& Point (const Standard_Integer Index) const Standard_OVERRIDE;
42cf5bc1 132
133 //! Set the Point of index <Index> in the LineOn2S
134 Standard_EXPORT void SetPoint (const Standard_Integer Index, const IntPatch_Point& Pnt);
135
136 //! Set the parameters of all the vertex on the line.
137 //! if a vertex is already in the line,
138 //! its parameter is modified
139 //! else a new point in the line is inserted.
140 Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
141
142
143
144
92efcf78 145 DEFINE_STANDARD_RTTIEXT(IntPatch_RLine,IntPatch_PointLine)
42cf5bc1 146
147protected:
148
149
150
151
152private:
153
154
155 Handle(Adaptor2d_HCurve2d) theArcOnS1;
156 Handle(Adaptor2d_HCurve2d) theArcOnS2;
157 Standard_Boolean onS1;
158 Standard_Boolean onS2;
159 Standard_Real ParamInf1;
160 Standard_Real ParamSup1;
161 Standard_Real ParamInf2;
162 Standard_Real ParamSup2;
163 Handle(IntSurf_LineOn2S) curv;
164 Standard_Boolean fipt;
165 Standard_Boolean lapt;
166 Standard_Integer indf;
167 Standard_Integer indl;
168 IntPatch_SequenceOfPoint svtx;
169
170
171};
172
173
174#include <IntPatch_RLine.lxx>
175
176
177
178
179
180#endif // _IntPatch_RLine_HeaderFile