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
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 _TopOpeBRep_VPointInter_HeaderFile
18 #define _TopOpeBRep_VPointInter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
42 class TopOpeBRep_VPointInter
49 TopOpeBRep_VPointInter();
51 Standard_EXPORT void SetPoint (const IntPatch_Point& P);
53 void SetShapes (const Standard_Integer I1, const Standard_Integer I2);
55 void GetShapes (Standard_Integer& I1, Standard_Integer& I2) const;
57 IntSurf_Transition TransitionOnS1() const;
59 IntSurf_Transition TransitionOnS2() const;
61 IntSurf_Transition TransitionLineArc1() const;
63 IntSurf_Transition TransitionLineArc2() const;
65 Standard_Boolean IsOnDomS1() const;
67 Standard_Boolean IsOnDomS2() const;
69 void ParametersOnS1 (Standard_Real& u, Standard_Real& v) const;
71 void ParametersOnS2 (Standard_Real& u, Standard_Real& v) const;
73 const gp_Pnt& Value() const;
75 Standard_Real Tolerance() const;
77 Standard_EXPORT const TopoDS_Shape& ArcOnS1() const;
79 Standard_EXPORT const TopoDS_Shape& ArcOnS2() const;
81 Standard_Real ParameterOnLine() const;
83 Standard_Real ParameterOnArc1() const;
85 //! Returns TRUE if the point is a vertex on the initial
86 //! restriction facet of the first surface.
87 Standard_Boolean IsVertexOnS1() const;
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;
95 Standard_Real ParameterOnArc2() const;
97 //! Returns TRUE if the point is a vertex on the initial
98 //! restriction facet of the second surface.
99 Standard_Boolean IsVertexOnS2() const;
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;
107 Standard_Boolean IsInternal() const;
109 //! Returns True if the point belongs to several intersection
111 Standard_Boolean IsMultiple() const;
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;
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);
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);
125 //! get the edge of shape I (1,2) containing the point.
126 Standard_EXPORT const TopoDS_Shape& EdgeON (const Standard_Integer I) const;
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;
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;
138 //! set value of shape supporting me (0,1,2,3).
139 void ShapeIndex (const Standard_Integer I);
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;
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;
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;
152 Standard_EXPORT Standard_Boolean IsVertex (const Standard_Integer I) const;
154 Standard_EXPORT const TopoDS_Shape& Vertex (const Standard_Integer I) const;
156 //! set myKeep value according to current states.
157 Standard_EXPORT void UpdateKeep();
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;
165 //! updates VPointInter flag "keep" with <keep>.
166 void ChangeKeep (const Standard_Boolean keep);
168 //! returns <True> if the 3d points and the parameters of the
170 Standard_EXPORT Standard_Boolean EqualpP (const TopOpeBRep_VPointInter& VP) const;
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;
176 void Index (const Standard_Integer I);
178 Standard_Integer Index() const;
180 Standard_EXPORT Standard_OStream& Dump (const Standard_Integer I, const TopoDS_Face& F, Standard_OStream& OS) const;
182 Standard_EXPORT Standard_OStream& Dump (const TopoDS_Face& F1, const TopoDS_Face& F2, Standard_OStream& OS) const;
184 Standard_EXPORT TopOpeBRep_PThePointOfIntersection PThePointOfIntersectionDummy() const;
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;
217 #include <TopOpeBRep_VPointInter.lxx>
223 #endif // _TopOpeBRep_VPointInter_HeaderFile