Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:42

0001 // Created on: 1995-01-27
0002 // Created by: Jacques GOUSSARD
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 _GeomInt_WLApprox_HeaderFile
0018 #define _GeomInt_WLApprox_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <NCollection_DynamicArray.hxx>
0022 #include <GeomInt_TheComputeLineOfWLApprox.hxx>
0023 #include <GeomInt_TheComputeLineBezierOfWLApprox.hxx>
0024 #include <Approx_MCurvesToBSpCurve.hxx>
0025 #include <Approx_ParametrizationType.hxx>
0026 
0027 class Adaptor3d_HSurfaceTool;
0028 class IntSurf_Quadric;
0029 class IntSurf_QuadricTool;
0030 class IntPatch_WLine;
0031 class GeomInt_ThePrmPrmSvSurfacesOfWLApprox;
0032 class GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox;
0033 class GeomInt_TheImpPrmSvSurfacesOfWLApprox;
0034 class GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox;
0035 class GeomInt_TheMultiLineOfWLApprox;
0036 class GeomInt_TheMultiLineToolOfWLApprox;
0037 class GeomInt_TheComputeLineOfWLApprox;
0038 class GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox;
0039 class GeomInt_MyGradientbisOfTheComputeLineOfWLApprox;
0040 class GeomInt_TheComputeLineBezierOfWLApprox;
0041 class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox;
0042 class AppParCurves_MultiBSpCurve;
0043 
0044 class GeomInt_WLApprox
0045 {
0046 private:
0047   struct Approx_Data
0048   {
0049     Approx_Data()
0050         : myBezierApprox(true),
0051           Xo(0.0),
0052           Yo(0.0),
0053           Zo(0.0),
0054           U1o(0.0),
0055           V1o(0.0),
0056           U2o(0.0),
0057           V2o(0.0),
0058           ApproxXYZ(true),
0059           ApproxU1V1(true),
0060           ApproxU2V2(true),
0061           indicemin(0),
0062           indicemax(0),
0063           myNbPntMax(30),
0064           parametrization(Approx_ChordLength)
0065     {
0066     }
0067 
0068     bool                       myBezierApprox;
0069     double                     Xo, Yo, Zo, U1o, V1o, U2o, V2o;
0070     bool                       ApproxXYZ, ApproxU1V1, ApproxU2V2;
0071     int                        indicemin, indicemax, myNbPntMax;
0072     Approx_ParametrizationType parametrization;
0073   };
0074 
0075 public:
0076   DEFINE_STANDARD_ALLOC
0077 
0078   Standard_EXPORT GeomInt_WLApprox();
0079 
0080   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>& Surf1,
0081                                const occ::handle<Adaptor3d_Surface>& Surf2,
0082                                const occ::handle<IntPatch_WLine>&    aLine,
0083                                const bool                            ApproxXYZ  = true,
0084                                const bool                            ApproxU1V1 = true,
0085                                const bool                            ApproxU2V2 = true,
0086                                const int                             indicemin  = 0,
0087                                const int                             indicemax  = 0);
0088 
0089   Standard_EXPORT void Perform(const occ::handle<IntPatch_WLine>& aLine,
0090                                const bool                         ApproxXYZ  = true,
0091                                const bool                         ApproxU1V1 = true,
0092                                const bool                         ApproxU2V2 = true,
0093                                const int                          indicemin  = 0,
0094                                const int                          indicemax  = 0);
0095 
0096   Standard_EXPORT void SetParameters(
0097     const double                     Tol3d,
0098     const double                     Tol2d,
0099     const int                        DegMin,
0100     const int                        DegMax,
0101     const int                        NbIterMax,
0102     const int                        NbPntMax           = 30,
0103     const bool                       ApproxWithTangency = true,
0104     const Approx_ParametrizationType Parametrization    = Approx_ChordLength);
0105   Standard_EXPORT void Perform();
0106 
0107   Standard_EXPORT double TolReached3d() const;
0108 
0109   Standard_EXPORT double TolReached2d() const;
0110 
0111   Standard_EXPORT bool IsDone() const;
0112 
0113   Standard_EXPORT int NbMultiCurves() const;
0114 
0115   Standard_EXPORT const AppParCurves_MultiBSpCurve& Value(const int Index) const;
0116 
0117   Standard_EXPORT static void Parameters(const GeomInt_TheMultiLineOfWLApprox& Line,
0118                                          const int                             firstP,
0119                                          const int                             lastP,
0120                                          const Approx_ParametrizationType      Par,
0121                                          math_Vector&                          TheParameters);
0122 
0123 private:
0124   Standard_EXPORT void Perform(const IntSurf_Quadric&                Surf1,
0125                                const occ::handle<Adaptor3d_Surface>& Surf2,
0126                                const occ::handle<IntPatch_WLine>&    aLine,
0127                                const bool                            ApproxXYZ,
0128                                const bool                            ApproxU1V1,
0129                                const bool                            ApproxU2V2,
0130                                const int                             indicemin,
0131                                const int                             indicemax,
0132                                const bool                            isTheQuadFirst);
0133 
0134   Standard_EXPORT void UpdateTolReached();
0135 
0136   //! Fill data structure for intersection approximation.
0137   Standard_EXPORT void fillData(const occ::handle<IntPatch_WLine>& theLine);
0138 
0139   //! Prepare data structure for further computations.
0140   Standard_EXPORT void prepareDS(const bool theApproxXYZ,
0141                                  const bool theApproxU1V1,
0142                                  const bool theApproxU2V2,
0143                                  const int  indicemin,
0144                                  const int  indicemax);
0145 
0146   //! Build knot sequence.
0147   Standard_EXPORT void buildKnots(const occ::handle<IntPatch_WLine>& theline,
0148                                   void* const                        thePtrSVSurf);
0149 
0150   //! Build curve.
0151   Standard_EXPORT void buildCurve(const occ::handle<IntPatch_WLine>& theline,
0152                                   void* const                        thePtrSVSurf);
0153 
0154   GeomInt_TheComputeLineOfWLApprox       myComputeLine;
0155   GeomInt_TheComputeLineBezierOfWLApprox myComputeLineBezier;
0156   Approx_MCurvesToBSpCurve               myBezToBSpl;
0157   bool                                   myWithTangency;
0158   double                                 myTol3d;
0159   double                                 myTol2d;
0160   int                                    myDegMin;
0161   int                                    myDegMax;
0162   int                                    myNbIterMax;
0163   double                                 myTolReached3d;
0164   double                                 myTolReached2d;
0165   Approx_Data                            myData;
0166   NCollection_DynamicArray<int>          myKnots;
0167 };
0168 
0169 #endif // _GeomInt_WLApprox_HeaderFile