Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:21:25

0001 // Created on: 1995-06-06
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox_HeaderFile
0018 #define _BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <IntSurf_PntOn2S.hxx>
0024 #include <gp_Dir.hxx>
0025 #include <gp_Dir2d.hxx>
0026 #include <BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <IntImp_ConstIsoparametric.hxx>
0029 class StdFail_NotDone;
0030 class Standard_DomainError;
0031 class Standard_ConstructionError;
0032 class StdFail_UndefinedDerivative;
0033 class BRepAdaptor_Surface;
0034 class BRepApprox_SurfaceTool;
0035 class BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox;
0036 class math_FunctionSetRoot;
0037 class IntSurf_PntOn2S;
0038 class gp_Dir;
0039 class gp_Dir2d;
0040 
0041 class BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! compute the solution point with the close point
0047   Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(
0048     const NCollection_Array1<double>& Param,
0049     const BRepAdaptor_Surface&        S1,
0050     const BRepAdaptor_Surface&        S2,
0051     const double                      TolTangency);
0052 
0053   //! initialize the parameters to compute the solution point
0054   //! it 's possible to write to optimize:
0055   //! IntImp_Int2S inter(S1,S2,Func,TolTangency);
0056   //! math_FunctionSetRoot rsnld(inter.Function());
0057   //! while ...{
0058   //! Param(1)=...
0059   //! Param(2)=...
0060   //! param(3)=...
0061   //! inter.Perform(Param,rsnld);
0062   //! }
0063   Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1,
0064                                                                    const BRepAdaptor_Surface& S2,
0065                                                                    const double TolTangency);
0066 
0067   //! returns the best constant isoparametric to find
0068   //! the next intersection's point +stores the solution
0069   //! point (the solution point is found with the close point
0070   //! to intersect the isoparametric with the other patch;
0071   //! the choice of the isoparametic is calculated)
0072   Standard_EXPORT IntImp_ConstIsoparametric Perform(const NCollection_Array1<double>& Param,
0073                                                     math_FunctionSetRoot&             Rsnld);
0074 
0075   //! returns the best constant isoparametric to find
0076   //! the next intersection's point +stores the solution
0077   //! point (the solution point is found with the close point
0078   //! to intersect the isoparametric with the other patch;
0079   //! the choice of the isoparametic is given by ChoixIso)
0080   Standard_EXPORT IntImp_ConstIsoparametric Perform(const NCollection_Array1<double>& Param,
0081                                                     math_FunctionSetRoot&             Rsnld,
0082                                                     const IntImp_ConstIsoparametric   ChoixIso);
0083 
0084   //! Returns TRUE if the creation completed without failure.
0085   bool IsDone() const;
0086 
0087   //! Returns TRUE when there is no solution to the problem.
0088   bool IsEmpty() const;
0089 
0090   //! Returns the intersection point.
0091   const IntSurf_PntOn2S& Point() const;
0092 
0093   //! Returns True if the surfaces are tangent at the
0094   //! intersection point.
0095   bool IsTangent() const;
0096 
0097   //! Returns the tangent at the intersection line.
0098   const gp_Dir& Direction() const;
0099 
0100   //! Returns the tangent at the intersection line in the
0101   //! parametric space of the first surface.
0102   const gp_Dir2d& DirectionOnS1() const;
0103 
0104   //! Returns the tangent at the intersection line in the
0105   //! parametric space of the second surface.
0106   const gp_Dir2d& DirectionOnS2() const;
0107 
0108   //! return the math function which
0109   //! is used to compute the intersection
0110   BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox& Function();
0111 
0112   //! return the intersection point which is
0113   //! enable for changing.
0114   IntSurf_PntOn2S& ChangePoint();
0115 
0116 private:
0117   bool                                                          done;
0118   bool                                                          empty;
0119   IntSurf_PntOn2S                                               pint;
0120   bool                                                          tangent;
0121   gp_Dir                                                        d3d;
0122   gp_Dir2d                                                      d2d1;
0123   gp_Dir2d                                                      d2d2;
0124   BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox myZerParFunc;
0125   double                                                        tol;
0126   double                                                        ua0;
0127   double                                                        va0;
0128   double                                                        ua1;
0129   double                                                        va1;
0130   double                                                        ub0;
0131   double                                                        vb0;
0132   double                                                        ub1;
0133   double                                                        vb1;
0134   double                                                        ures1;
0135   double                                                        ures2;
0136   double                                                        vres1;
0137   double                                                        vres2;
0138 };
0139 
0140 #define ThePSurface BRepAdaptor_Surface
0141 #define ThePSurface_hxx <BRepAdaptor_Surface.hxx>
0142 #define ThePSurfaceTool BRepApprox_SurfaceTool
0143 #define ThePSurfaceTool_hxx <BRepApprox_SurfaceTool.hxx>
0144 #define IntImp_TheFunction BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox
0145 #define IntImp_TheFunction_hxx <BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx>
0146 #define IntImp_Int2S BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox
0147 #define IntImp_Int2S_hxx <BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx>
0148 
0149 #include <IntImp_Int2S.lxx>
0150 
0151 #undef ThePSurface
0152 #undef ThePSurface_hxx
0153 #undef ThePSurfaceTool
0154 #undef ThePSurfaceTool_hxx
0155 #undef IntImp_TheFunction
0156 #undef IntImp_TheFunction_hxx
0157 #undef IntImp_Int2S
0158 #undef IntImp_Int2S_hxx
0159 
0160 #endif // _BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox_HeaderFile