Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:16:27

0001 // Created on: 1997-01-23
0002 // Created by: Laurent BOURESCHE
0003 // Copyright (c) 1997-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 _BRepBlend_SurfRstLineBuilder_HeaderFile
0018 #define _BRepBlend_SurfRstLineBuilder_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <math_Vector.hxx>
0022 #include <Blend_Point.hxx>
0023 #include <Blend_Status.hxx>
0024 #include <TopAbs_State.hxx>
0025 
0026 class BRepBlend_Line;
0027 class Adaptor3d_TopolTool;
0028 class Blend_SurfRstFunction;
0029 class Blend_FuncInv;
0030 class Blend_SurfPointFuncInv;
0031 class Blend_SurfCurvFuncInv;
0032 class gp_Pnt2d;
0033 class Adaptor3d_HVertex;
0034 class IntSurf_Transition;
0035 class BRepBlend_Extremity;
0036 
0037 //! This class processes data resulting from
0038 //! Blend_CSWalking taking in consideration the Surface
0039 //! supporting the curve to detect the breakpoint.
0040 //!
0041 //! The criteria of distribution of points on the line are detailed
0042 //! because it is to be used in the calculatuon of values approached
0043 //! by an approximation of functions continued basing on
0044 //! Blend_SurfRstFunction.
0045 //!
0046 //! Thus this pseudo path necessitates 3 criteria of regrouping:
0047 //!
0048 //! 1) exit of the domain of the curve
0049 //!
0050 //! 2) exit of the domain of the surface
0051 //!
0052 //! 3) stall as there is a solution to the problem
0053 //! surf/surf within the domain of the surface
0054 //! of support of the restriction.
0055 //!
0056 //! Construction of a BRepBlend_Line between a surface and
0057 //! a pcurve on surface from an approached
0058 //! starting solution. The output entries of this builder
0059 //! are of the same nature as of the traditional walking
0060 //! but the requirements on the Line are not the same
0061 //! If the determination of validity range is always
0062 //! guaranteed, the criteria of correct repartition of sections
0063 //! before smoothing are not respected. The resulting Line
0064 //! is f(t) oriented.
0065 class BRepBlend_SurfRstLineBuilder
0066 {
0067 public:
0068   DEFINE_STANDARD_ALLOC
0069 
0070   Standard_EXPORT BRepBlend_SurfRstLineBuilder(const occ::handle<Adaptor3d_Surface>&   Surf1,
0071                                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0072                                                const occ::handle<Adaptor3d_Surface>&   Surf2,
0073                                                const occ::handle<Adaptor2d_Curve2d>&   Rst,
0074                                                const occ::handle<Adaptor3d_TopolTool>& Domain2);
0075 
0076   Standard_EXPORT void Perform(Blend_SurfRstFunction&  Func,
0077                                Blend_FuncInv&          Finv,
0078                                Blend_SurfPointFuncInv& FinvP,
0079                                Blend_SurfCurvFuncInv&  FinvC,
0080                                const double            Pdep,
0081                                const double            Pmax,
0082                                const double            MaxStep,
0083                                const double            Tol3d,
0084                                const double            Tol2d,
0085                                const double            TolGuide,
0086                                const math_Vector&      Soldep,
0087                                const double            Fleche,
0088                                const bool              Appro = false);
0089 
0090   Standard_EXPORT bool PerformFirstSection(Blend_SurfRstFunction&  Func,
0091                                            Blend_FuncInv&          Finv,
0092                                            Blend_SurfPointFuncInv& FinvP,
0093                                            Blend_SurfCurvFuncInv&  FinvC,
0094                                            const double            Pdep,
0095                                            const double            Pmax,
0096                                            const math_Vector&      Soldep,
0097                                            const double            Tol3d,
0098                                            const double            Tol2d,
0099                                            const double            TolGuide,
0100                                            const bool              RecRst,
0101                                            const bool              RecP,
0102                                            const bool              RecS,
0103                                            double&                 Psol,
0104                                            math_Vector&            ParSol);
0105 
0106   Standard_EXPORT bool Complete(Blend_SurfRstFunction&  Func,
0107                                 Blend_FuncInv&          Finv,
0108                                 Blend_SurfPointFuncInv& FinvP,
0109                                 Blend_SurfCurvFuncInv&  FinvC,
0110                                 const double            Pmin);
0111 
0112   Standard_EXPORT int ArcToRecadre(const math_Vector& Sol,
0113                                    const int          PrevIndex,
0114                                    gp_Pnt2d&          pt2d,
0115                                    gp_Pnt2d&          lastpt2d,
0116                                    double&            ponarc);
0117 
0118   bool IsDone() const;
0119 
0120   const occ::handle<BRepBlend_Line>& Line() const;
0121 
0122   bool DecrochStart() const;
0123 
0124   bool DecrochEnd() const;
0125 
0126 private:
0127   Standard_EXPORT void InternalPerform(Blend_SurfRstFunction&  Func,
0128                                        Blend_FuncInv&          Finv,
0129                                        Blend_SurfPointFuncInv& FinvP,
0130                                        Blend_SurfCurvFuncInv&  FinvC,
0131                                        const double            Bound);
0132 
0133   Standard_EXPORT bool Recadre(Blend_SurfCurvFuncInv&          FinvC,
0134                                math_Vector&                    Solinv,
0135                                occ::handle<Adaptor2d_Curve2d>& Arc,
0136                                bool&                           IsVtx,
0137                                occ::handle<Adaptor3d_HVertex>& Vtx);
0138 
0139   Standard_EXPORT bool Recadre(Blend_SurfRstFunction&          Func,
0140                                Blend_FuncInv&                  Finv,
0141                                math_Vector&                    Solinv,
0142                                bool&                           IsVtx,
0143                                occ::handle<Adaptor3d_HVertex>& Vtx);
0144 
0145   Standard_EXPORT bool Recadre(Blend_SurfPointFuncInv&         FinvP,
0146                                math_Vector&                    Solinv,
0147                                bool&                           IsVtx,
0148                                occ::handle<Adaptor3d_HVertex>& Vtx);
0149 
0150   Standard_EXPORT void Transition(const bool                            OnFirst,
0151                                   const occ::handle<Adaptor2d_Curve2d>& Arc,
0152                                   const double                          Param,
0153                                   IntSurf_Transition&                   TLine,
0154                                   IntSurf_Transition&                   TArc);
0155 
0156   Standard_EXPORT void MakeExtremity(BRepBlend_Extremity&                  Extrem,
0157                                      const bool                            OnFirst,
0158                                      const occ::handle<Adaptor2d_Curve2d>& Arc,
0159                                      const double                          Param,
0160                                      const bool                            IsVtx,
0161                                      const occ::handle<Adaptor3d_HVertex>& Vtx);
0162 
0163   Standard_EXPORT Blend_Status CheckDeflectionOnSurf(const Blend_Point& CurPoint);
0164 
0165   Standard_EXPORT Blend_Status CheckDeflectionOnRst(const Blend_Point& CurPoint);
0166 
0167   Standard_EXPORT Blend_Status TestArret(Blend_SurfRstFunction& Func,
0168                                          const bool             TestDeflection,
0169                                          const Blend_Status     State);
0170 
0171   Standard_EXPORT bool CheckInside(Blend_SurfRstFunction& Func,
0172                                    TopAbs_State&          SituOnC,
0173                                    TopAbs_State&          SituOnS,
0174                                    bool&                  Decroch);
0175 
0176   bool                             done;
0177   occ::handle<BRepBlend_Line>      line;
0178   math_Vector                      sol;
0179   occ::handle<Adaptor3d_Surface>   surf1;
0180   occ::handle<Adaptor3d_TopolTool> domain1;
0181   occ::handle<Adaptor3d_Surface>   surf2;
0182   occ::handle<Adaptor2d_Curve2d>   rst;
0183   occ::handle<Adaptor3d_TopolTool> domain2;
0184   double                           tolpoint3d;
0185   double                           tolpoint2d;
0186   double                           tolgui;
0187   double                           pasmax;
0188   double                           fleche;
0189   double                           param;
0190   Blend_Point                      previousP;
0191   bool                             rebrou;
0192   bool                             iscomplete;
0193   bool                             comptra;
0194   double                           sens;
0195   bool                             decrochdeb;
0196   bool                             decrochfin;
0197 };
0198 
0199 #include <BRepBlend_SurfRstLineBuilder.lxx>
0200 
0201 #endif // _BRepBlend_SurfRstLineBuilder_HeaderFile