0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / IntPatch / IntPatch_Line.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-05-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_Line_HeaderFile
18#define _IntPatch_Line_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <IntPatch_IType.hxx>
24#include <Standard_Boolean.hxx>
25#include <IntSurf_TypeTrans.hxx>
26#include <IntSurf_Situation.hxx>
25e59720 27#include <Standard_Transient.hxx>
42cf5bc1 28class Standard_DomainError;
29class Standard_OutOfRange;
30
31
32class IntPatch_Line;
25e59720 33DEFINE_STANDARD_HANDLE(IntPatch_Line, Standard_Transient)
42cf5bc1 34
35//! Definition of an intersection line between two
36//! surfaces.
37//! A line may be either geometric : line, circle, ellipse,
38//! parabola, hyperbola, as defined in the class GLine,
39//! or analytic, as defined in the class ALine, or defined
40//! by a set of points (coming from a walking algorithm) as
41//! defined in the class WLine.
25e59720 42class IntPatch_Line : public Standard_Transient
42cf5bc1 43{
44
45public:
46
47
48 //! To set the values returned by IsUIsoS1,....
49 //! The default values are False.
50 void SetValue (const Standard_Boolean Uiso1, const Standard_Boolean Viso1, const Standard_Boolean Uiso2, const Standard_Boolean Viso2);
51
52 //! Returns the type of geometry 3d (Line, Circle, Parabola,
53 //! Hyperbola, Ellipse, Analytic, Walking, Restriction)
54 IntPatch_IType ArcType() const;
55
56 //! Returns TRUE if the intersection is a line of tangency
57 //! between the 2 patches.
58 Standard_Boolean IsTangent() const;
59
60 //! Returns the type of the transition of the line
61 //! for the first surface. The transition is "constant"
62 //! along the line.
63 //! The transition is IN if the line is oriented in such
64 //! a way that the system of vector (N1,N2,T) is right-handed,
65 //! where N1 is the normal to the first surface at a point P,
66 //! N2 is the normal to the second surface at a point P,
67 //! T is the tangent to the intersection line at P.
68 //! If the system of vector is left-handed, the transition
69 //! is OUT.
70 //! When N1 and N2 are colinear all along the intersection
71 //! line, the transition will be
72 //! - TOUCH, if it is possible to use the 2nd derivatives
73 //! to determine the position of one surafce compared
74 //! to the other (see Situation)
75 //! - UNDECIDED otherwise.
76 //!
77 //! If one of the transition is TOUCH or UNDECIDED, the other
78 //! one has got the same value.
79 IntSurf_TypeTrans TransitionOnS1() const;
80
81 //! Returns the type of the transition of the line
82 //! for the second surface. The transition is "constant"
83 //! along the line.
84 IntSurf_TypeTrans TransitionOnS2() const;
85
86 //! Returns the situation (INSIDE/OUTSIDE/UNKNOWN) of
87 //! the first patch compared to the second one, when
88 //! TransitionOnS1 or TransitionOnS2 returns TOUCH.
89 //! Otherwise, an exception is raised.
90 IntSurf_Situation SituationS1() const;
91
92 //! Returns the situation (INSIDE/OUTSIDE/UNKNOWN) of
93 //! the second patch compared to the first one, when
94 //! TransitionOnS1 or TransitionOnS2 returns TOUCH.
95 //! Otherwise, an exception is raised.
96 IntSurf_Situation SituationS2() const;
97
98 //! Returns TRUE if the intersection is a U isoparametric curve
99 //! on the first patch.
100 Standard_Boolean IsUIsoOnS1() const;
101
102 //! Returns TRUE if the intersection is a V isoparametric curve
103 //! on the first patch.
104 Standard_Boolean IsVIsoOnS1() const;
105
106 //! Returns TRUE if the intersection is a U isoparametric curve
107 //! on the second patch.
108 Standard_Boolean IsUIsoOnS2() const;
109
110 //! Returns TRUE if the intersection is a V isoparametric curve
111 //! on the second patch.
112 Standard_Boolean IsVIsoOnS2() const;
113
114
115
116
25e59720 117 DEFINE_STANDARD_RTTIEXT(IntPatch_Line,Standard_Transient)
42cf5bc1 118
119protected:
120
121
122 //! To initialize the fields, when the transitions
123 //! are In or Out.
124 Standard_EXPORT IntPatch_Line(const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
125
126 //! To initialize the fields, when the transitions
127 //! are Touch.
128 Standard_EXPORT IntPatch_Line(const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
129
130 //! To initialize the fields, when the transitions
131 //! are Undecided.
132 Standard_EXPORT IntPatch_Line(const Standard_Boolean Tang);
133
134 IntPatch_IType typ;
135
136
137private:
138
139
140 Standard_Boolean tg;
141 IntSurf_TypeTrans tS1;
142 IntSurf_TypeTrans tS2;
143 IntSurf_Situation sit1;
144 IntSurf_Situation sit2;
145 Standard_Boolean uS1;
146 Standard_Boolean vS1;
147 Standard_Boolean uS2;
148 Standard_Boolean vS2;
149
150
151};
152
153
154#include <IntPatch_Line.lxx>
155
156
157
158
159
160#endif // _IntPatch_Line_HeaderFile