42cf5bc1 |
1 | // Created on: 1993-04-07 |
2 | // Created by: Laurent BUCHARD |
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 _IntCurveSurface_TheExactHInter_HeaderFile |
18 | #define _IntCurveSurface_TheExactHInter_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <IntCurveSurface_TheCSFunctionOfHInter.hxx> |
26 | #include <Standard_Real.hxx> |
27 | class StdFail_NotDone; |
28 | class Standard_DomainError; |
29 | class Adaptor3d_HSurface; |
30 | class Adaptor3d_HSurfaceTool; |
31 | class Adaptor3d_HCurve; |
32 | class IntCurveSurface_TheHCurveTool; |
33 | class IntCurveSurface_TheCSFunctionOfHInter; |
34 | class math_FunctionSetRoot; |
35 | class gp_Pnt; |
36 | |
37 | |
38 | |
39 | class IntCurveSurface_TheExactHInter |
40 | { |
41 | public: |
42 | |
43 | DEFINE_STANDARD_ALLOC |
44 | |
45 | |
36b9ff75 |
46 | //! compute the solution point with the close point |
47 | //! MarginCoef is the coefficient for extension of UV bounds. |
48 | //! Ex., UFirst -= MarginCoef*(ULast-UFirst) |
42cf5bc1 |
49 | Standard_EXPORT IntCurveSurface_TheExactHInter(const Standard_Real U, const Standard_Real V, const Standard_Real W, const IntCurveSurface_TheCSFunctionOfHInter& F, const Standard_Real TolTangency, const Standard_Real MarginCoef = 0.0); |
50 | |
36b9ff75 |
51 | //! initialize the parameters to compute the solution |
42cf5bc1 |
52 | Standard_EXPORT IntCurveSurface_TheExactHInter(const IntCurveSurface_TheCSFunctionOfHInter& F, const Standard_Real TolTangency); |
53 | |
36b9ff75 |
54 | //! compute the solution |
55 | //! it's possible to write to optimize: |
56 | //! IntImp_IntCS inter(S1,C1,Toltangency) |
57 | //! math_FunctionSetRoot rsnld(Inter.function()) |
58 | //! while ...{ |
59 | //! u=... |
60 | //! v=... |
61 | //! w=... |
62 | //! inter.Perform(u,v,w,rsnld) |
63 | //! } |
64 | //! or |
65 | //! IntImp_IntCS inter(Toltangency) |
66 | //! inter.SetSurface(S); |
67 | //! math_FunctionSetRoot rsnld(Inter.function()) |
68 | //! while ...{ |
69 | //! C=... |
70 | //! inter.SetCurve(C); |
71 | //! u=... |
72 | //! v=... |
73 | //! w=... |
74 | //! inter.Perform(u,v,w,rsnld) |
75 | //! } |
42cf5bc1 |
76 | Standard_EXPORT void Perform (const Standard_Real U, const Standard_Real V, const Standard_Real W, math_FunctionSetRoot& Rsnld, const Standard_Real u0, const Standard_Real v0, const Standard_Real u1, const Standard_Real v1, const Standard_Real w0, const Standard_Real w1); |
77 | |
36b9ff75 |
78 | //! Returns TRUE if the creation completed without failure. |
42cf5bc1 |
79 | Standard_EXPORT Standard_Boolean IsDone() const; |
80 | |
81 | Standard_EXPORT Standard_Boolean IsEmpty() const; |
82 | |
36b9ff75 |
83 | //! returns the intersection point |
84 | //! The exception NotDone is raised if IsDone is false. |
85 | //! The exception DomainError is raised if IsEmpty is true. |
42cf5bc1 |
86 | Standard_EXPORT const gp_Pnt& Point() const; |
87 | |
88 | Standard_EXPORT Standard_Real ParameterOnCurve() const; |
89 | |
90 | Standard_EXPORT void ParameterOnSurface (Standard_Real& U, Standard_Real& V) const; |
91 | |
36b9ff75 |
92 | //! return the math function which |
93 | //! is used to compute the intersection |
42cf5bc1 |
94 | Standard_EXPORT IntCurveSurface_TheCSFunctionOfHInter& Function(); |
95 | |
96 | |
97 | |
98 | |
99 | protected: |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | private: |
106 | |
107 | |
108 | |
109 | Standard_Boolean done; |
110 | Standard_Boolean empty; |
111 | IntCurveSurface_TheCSFunctionOfHInter myFunction; |
112 | Standard_Real w; |
113 | Standard_Real u; |
114 | Standard_Real v; |
115 | Standard_Real tol; |
116 | |
117 | |
118 | }; |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | #endif // _IntCurveSurface_TheExactHInter_HeaderFile |