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