1 // Created on: 1991-03-28 2 // Created by: Jacques GOUSSARD 3 // Copyright (c) 1991-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 _IntWalk_TheInt2S_HeaderFile 18 #define _IntWalk_TheInt2S_HeaderFile 19 20 #include <Adaptor3d_Surface.hxx> 21 #include <IntSurf_PntOn2S.hxx> 22 #include <gp_Dir.hxx> 23 #include <gp_Dir2d.hxx> 24 #include <IntWalk_TheFunctionOfTheInt2S.hxx> 25 #include <Standard_Real.hxx> 26 #include <TColStd_Array1OfReal.hxx> 27 #include <IntImp_ConstIsoparametric.hxx> 28 29 class Adaptor3d_HSurfaceTool; 30 class math_FunctionSetRoot; 31 32 class IntWalk_TheInt2S 33 { 34 public: 35 36 DEFINE_STANDARD_ALLOC 37 38 //! compute the solution point with the close point 39 Standard_EXPORT IntWalk_TheInt2S(const TColStd_Array1OfReal& Param, const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_Surface)& S2, const Standard_Real TolTangency); 40 41 //! initialize the parameters to compute the solution point 42 //! it 's possible to write to optimize: 43 //! IntImp_Int2S inter(S1,S2,Func,TolTangency); 44 //! math_FunctionSetRoot rsnld(inter.Function()); 45 //! while ...{ 46 //! Param(1)=... 47 //! Param(2)=... 48 //! param(3)=... 49 //! inter.Perform(Param,rsnld); 50 //! } 51 Standard_EXPORT IntWalk_TheInt2S(const Handle(Adaptor3d_Surface)& S1, const Handle(Adaptor3d_Surface)& S2, const Standard_Real TolTangency); 52 53 //! returns the best constant isoparametric to find 54 //! the next intersection's point +stores the solution 55 //! point (the solution point is found with the close point 56 //! to intersect the isoparametric with the other patch; 57 //! the choice of the isoparametic is calculated) 58 Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld); 59 60 //! returns the best constant isoparametric to find 61 //! the next intersection's point +stores the solution 62 //! point (the solution point is found with the close point 63 //! to intersect the isoparametric with the other patch; 64 //! the choice of the isoparametic is given by ChoixIso) 65 Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld, const IntImp_ConstIsoparametric ChoixIso); 66 67 //! Returns TRUE if the creation completed without failure. 68 Standard_Boolean IsDone() const; 69 70 //! Returns TRUE when there is no solution to the problem. 71 Standard_Boolean IsEmpty() const; 72 73 //! Returns the intersection point. 74 const IntSurf_PntOn2S& Point() const; 75 76 //! Returns True if the surfaces are tangent at the 77 //! intersection point. 78 Standard_Boolean IsTangent() const; 79 80 //! Returns the tangent at the intersection line. 81 const gp_Dir& Direction() const; 82 83 //! Returns the tangent at the intersection line in the 84 //! parametric space of the first surface. 85 const gp_Dir2d& DirectionOnS1() const; 86 87 //! Returns the tangent at the intersection line in the 88 //! parametric space of the second surface. 89 const gp_Dir2d& DirectionOnS2() const; 90 91 //! return the math function which 92 //! is used to compute the intersection 93 IntWalk_TheFunctionOfTheInt2S& Function(); 94 95 //! return the intersection point which is 96 //! enable for changing. 97 IntSurf_PntOn2S& ChangePoint(); 98 99 100 101 102 protected: 103 104 105 106 107 108 private: 109 110 111 112 Standard_Boolean done; 113 Standard_Boolean empty; 114 IntSurf_PntOn2S pint; 115 Standard_Boolean tangent; 116 gp_Dir d3d; 117 gp_Dir2d d2d1; 118 gp_Dir2d d2d2; 119 IntWalk_TheFunctionOfTheInt2S myZerParFunc; 120 Standard_Real tol; 121 Standard_Real ua0; 122 Standard_Real va0; 123 Standard_Real ua1; 124 Standard_Real va1; 125 Standard_Real ub0; 126 Standard_Real vb0; 127 Standard_Real ub1; 128 Standard_Real vb1; 129 Standard_Real ures1; 130 Standard_Real ures2; 131 Standard_Real vres1; 132 Standard_Real vres2; 133 134 135 }; 136 137 #define ThePSurface Handle(Adaptor3d_Surface) 138 #define ThePSurface_hxx <Adaptor3d_Surface.hxx> 139 #define ThePSurfaceTool Adaptor3d_HSurfaceTool 140 #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx> 141 #define IntImp_TheFunction IntWalk_TheFunctionOfTheInt2S 142 #define IntImp_TheFunction_hxx <IntWalk_TheFunctionOfTheInt2S.hxx> 143 #define IntImp_Int2S IntWalk_TheInt2S 144 #define IntImp_Int2S_hxx <IntWalk_TheInt2S.hxx> 145 146 #include <IntImp_Int2S.lxx> 147 148 #undef ThePSurface 149 #undef ThePSurface_hxx 150 #undef ThePSurfaceTool 151 #undef ThePSurfaceTool_hxx 152 #undef IntImp_TheFunction 153 #undef IntImp_TheFunction_hxx 154 #undef IntImp_Int2S 155 #undef IntImp_Int2S_hxx 156 157 158 159 160 #endif // _IntWalk_TheInt2S_HeaderFile 161