Warnings on vc14 were eliminated
[occt.git] / src / TopOpeBRep / TopOpeBRep_VPointInter.hxx
1 // Created on: 1993-11-10
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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 _TopOpeBRep_VPointInter_HeaderFile
18 #define _TopOpeBRep_VPointInter_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopOpeBRep_PThePointOfIntersection.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TopAbs_State.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <Standard_Real.hxx>
30 #include <IntSurf_Transition.hxx>
31 #include <Standard_OStream.hxx>
32 class Standard_DomainError;
33 class IntPatch_Point;
34 class gp_Pnt;
35 class TopoDS_Shape;
36 class gp_Pnt2d;
37 class TopoDS_Edge;
38 class TopoDS_Face;
39
40
41
42 class TopOpeBRep_VPointInter 
43 {
44 public:
45
46   DEFINE_STANDARD_ALLOC
47
48   
49     TopOpeBRep_VPointInter();
50   
51   Standard_EXPORT void SetPoint (const IntPatch_Point& P);
52   
53     void SetShapes (const Standard_Integer I1, const Standard_Integer I2);
54   
55     void GetShapes (Standard_Integer& I1, Standard_Integer& I2) const;
56   
57     IntSurf_Transition TransitionOnS1() const;
58   
59     IntSurf_Transition TransitionOnS2() const;
60   
61     IntSurf_Transition TransitionLineArc1() const;
62   
63     IntSurf_Transition TransitionLineArc2() const;
64   
65     Standard_Boolean IsOnDomS1() const;
66   
67     Standard_Boolean IsOnDomS2() const;
68   
69     void ParametersOnS1 (Standard_Real& u, Standard_Real& v) const;
70   
71     void ParametersOnS2 (Standard_Real& u, Standard_Real& v) const;
72   
73     const gp_Pnt& Value() const;
74   
75     Standard_Real Tolerance() const;
76   
77   Standard_EXPORT const TopoDS_Shape& ArcOnS1() const;
78   
79   Standard_EXPORT const TopoDS_Shape& ArcOnS2() const;
80   
81     Standard_Real ParameterOnLine() const;
82   
83     Standard_Real ParameterOnArc1() const;
84   
85   //! Returns TRUE if the point is a vertex on the initial
86   //! restriction facet of the first surface.
87     Standard_Boolean IsVertexOnS1() const;
88   
89   //! Returns the information about the point when it is
90   //! on the domain of the first patch, i-e when the function
91   //! IsVertexOnS1 returns True.
92   //! Otherwise, an exception is raised.
93   Standard_EXPORT const TopoDS_Shape& VertexOnS1() const;
94   
95     Standard_Real ParameterOnArc2() const;
96   
97   //! Returns TRUE if the point is a vertex on the initial
98   //! restriction facet of the second surface.
99     Standard_Boolean IsVertexOnS2() const;
100   
101   //! Returns the information about the point when it is
102   //! on the domain of the second patch, i-e when the function
103   //! IsVertexOnS2 returns True.
104   //! Otherwise, an exception is raised.
105   Standard_EXPORT const TopoDS_Shape& VertexOnS2() const;
106   
107     Standard_Boolean IsInternal() const;
108   
109   //! Returns True if the point belongs to several intersection
110   //! lines.
111     Standard_Boolean IsMultiple() const;
112   
113   //! get state of VPoint within the domain of geometric shape
114   //! domain <I> (= 1 or 2).
115   Standard_EXPORT TopAbs_State State (const Standard_Integer I) const;
116   
117   //! Set the state of VPoint within the  domain of
118   //! the geometric shape <I> (= 1 or 2).
119   Standard_EXPORT void State (const TopAbs_State S, const Standard_Integer I);
120   
121   //! set the shape Eon of shape I (1,2) containing the point,
122   //! and parameter <Par> of point on <Eon>.
123   Standard_EXPORT void EdgeON (const TopoDS_Shape& Eon, const Standard_Real Par, const Standard_Integer I);
124   
125   //! get the edge of shape I (1,2) containing the point.
126   Standard_EXPORT const TopoDS_Shape& EdgeON (const Standard_Integer I) const;
127   
128   //! get the parameter on edge of shape I (1,2) containing the point.
129   Standard_EXPORT Standard_Real EdgeONParameter (const Standard_Integer I) const;
130   
131   //! returns value of filed myShapeIndex = 0,1,2,3
132   //! 0 means the VPoint is on no restriction
133   //! 1 means the VPoint is on the restriction 1
134   //! 2 means the VPoint is on the restriction 2
135   //! 3 means the VPoint is on the restrictions 1 and 2
136     Standard_Integer ShapeIndex() const;
137   
138   //! set value of shape supporting me (0,1,2,3).
139     void ShapeIndex (const Standard_Integer I);
140   
141   //! get the edge of shape I (1,2) containing the point.
142   //! Returned shape is null if the VPoint is not on an edge
143   //! of shape I (1,2).
144   Standard_EXPORT const TopoDS_Shape& Edge (const Standard_Integer I) const;
145   
146   //! get the parameter on edge of shape I (1,2) containing the point
147   Standard_EXPORT Standard_Real EdgeParameter (const Standard_Integer I) const;
148   
149   //! get the parameter on surface of shape I (1,2) containing the point
150   Standard_EXPORT gp_Pnt2d SurfaceParameters (const Standard_Integer I) const;
151   
152   Standard_EXPORT Standard_Boolean IsVertex (const Standard_Integer I) const;
153   
154   Standard_EXPORT const TopoDS_Shape& Vertex (const Standard_Integer I) const;
155   
156   //! set myKeep value according to current states.
157   Standard_EXPORT void UpdateKeep();
158   
159
160   //! Returns value of myKeep (does not evaluate states)
161   //! False at creation of VPoint.
162   //! Updated by State(State from TopAbs,Integer from Standard)
163     Standard_Boolean Keep() const;
164   
165   //! updates VPointInter flag "keep" with <keep>.
166     void ChangeKeep (const Standard_Boolean keep);
167   
168   //! returns <True> if the 3d points and the parameters of the
169   //! VPoints are same
170   Standard_EXPORT Standard_Boolean EqualpP (const TopOpeBRep_VPointInter& VP) const;
171   
172   //! returns <false> if the vpoint is not given on arc <E>,
173   //! else returns <par> parameter on <E>
174   Standard_EXPORT Standard_Boolean ParonE (const TopoDS_Edge& E, Standard_Real& par) const;
175   
176     void Index (const Standard_Integer I);
177   
178     Standard_Integer Index() const;
179   
180   Standard_EXPORT Standard_OStream& Dump (const Standard_Integer I, const TopoDS_Face& F, Standard_OStream& OS) const;
181   
182   Standard_EXPORT Standard_OStream& Dump (const TopoDS_Face& F1, const TopoDS_Face& F2, Standard_OStream& OS) const;
183   
184   Standard_EXPORT TopOpeBRep_PThePointOfIntersection PThePointOfIntersectionDummy() const;
185
186
187
188
189 protected:
190
191
192
193
194
195 private:
196
197
198
199   TopOpeBRep_PThePointOfIntersection myPPOI;
200   Standard_Integer myShapeIndex;
201   TopAbs_State myState1;
202   TopAbs_State myState2;
203   Standard_Boolean myKeep;
204   TopoDS_Shape myEdgeON1;
205   TopoDS_Shape myEdgeON2;
206   Standard_Real myEdgeONPar1;
207   Standard_Real myEdgeONPar2;
208   Standard_Integer myIndex;
209   TopoDS_Shape myNullShape;
210   Standard_Integer myS1;
211   Standard_Integer myS2;
212
213
214 };
215
216
217 #include <TopOpeBRep_VPointInter.lxx>
218
219
220
221
222
223 #endif // _TopOpeBRep_VPointInter_HeaderFile