Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:11:32

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_RstRstLineBuilder_HeaderFile
0018 #define _BRepBlend_RstRstLineBuilder_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <math_Vector.hxx>
0022 #include <Blend_Point.hxx>
0023 #include <Blend_DecrochStatus.hxx>
0024 #include <Blend_Status.hxx>
0025 #include <TopAbs_State.hxx>
0026 
0027 class BRepBlend_Line;
0028 class Adaptor3d_TopolTool;
0029 class Blend_RstRstFunction;
0030 class Blend_SurfCurvFuncInv;
0031 class Blend_CurvPointFuncInv;
0032 class Adaptor3d_HVertex;
0033 class IntSurf_Transition;
0034 class BRepBlend_Extremity;
0035 
0036 //! This class processes the data resulting from
0037 //! Blend_CSWalking but it takes in consideration the Surface
0038 //! supporting the curve to detect the breakpoint.
0039 //!
0040 //! As a result, the criteria of distribution of
0041 //! points on the line become more flexible because it
0042 //! should calculate values approached
0043 //! by an approximation of continued functions based on the
0044 //! Blend_RstRstFunction.
0045 //!
0046 //! Thus this pseudo path necessitates 3 criteria of
0047 //! regrouping:
0048 //!
0049 //! 1) exit of the domain of the curve
0050 //!
0051 //! 2) exit of the domain of the surface
0052 //!
0053 //! 3) stall as there is a solution of problem
0054 //! surf/surf within the domain of the surface
0055 //! of support of the restriction.
0056 //!
0057 //! Construction of a BRepBlend_Line between two pcurves
0058 //! from an approached starting solution. The output
0059 //! entries of this builder are of the same nature
0060 //! as of a traditional walking, but the requirements
0061 //! to the Line are not the same. 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_RstRstLineBuilder
0066 {
0067 public:
0068   DEFINE_STANDARD_ALLOC
0069 
0070   Standard_EXPORT BRepBlend_RstRstLineBuilder(const occ::handle<Adaptor3d_Surface>&   Surf1,
0071                                               const occ::handle<Adaptor2d_Curve2d>&   Rst1,
0072                                               const occ::handle<Adaptor3d_TopolTool>& Domain1,
0073                                               const occ::handle<Adaptor3d_Surface>&   Surf2,
0074                                               const occ::handle<Adaptor2d_Curve2d>&   Rst2,
0075                                               const occ::handle<Adaptor3d_TopolTool>& Domain2);
0076 
0077   Standard_EXPORT void Perform(Blend_RstRstFunction&   Func,
0078                                Blend_SurfCurvFuncInv&  Finv1,
0079                                Blend_CurvPointFuncInv& FinvP1,
0080                                Blend_SurfCurvFuncInv&  Finv2,
0081                                Blend_CurvPointFuncInv& FinvP2,
0082                                const double            Pdep,
0083                                const double            Pmax,
0084                                const double            MaxStep,
0085                                const double            Tol3d,
0086                                const double            TolGuide,
0087                                const math_Vector&      Soldep,
0088                                const double            Fleche,
0089                                const bool              Appro = false);
0090 
0091   Standard_EXPORT bool PerformFirstSection(Blend_RstRstFunction&   Func,
0092                                            Blend_SurfCurvFuncInv&  Finv1,
0093                                            Blend_CurvPointFuncInv& FinvP1,
0094                                            Blend_SurfCurvFuncInv&  Finv2,
0095                                            Blend_CurvPointFuncInv& FinvP2,
0096                                            const double            Pdep,
0097                                            const double            Pmax,
0098                                            const math_Vector&      Soldep,
0099                                            const double            Tol3d,
0100                                            const double            TolGuide,
0101                                            const bool              RecRst1,
0102                                            const bool              RecP1,
0103                                            const bool              RecRst2,
0104                                            const bool              RecP2,
0105                                            double&                 Psol,
0106                                            math_Vector&            ParSol);
0107 
0108   Standard_EXPORT bool Complete(Blend_RstRstFunction&   Func,
0109                                 Blend_SurfCurvFuncInv&  Finv1,
0110                                 Blend_CurvPointFuncInv& FinvP1,
0111                                 Blend_SurfCurvFuncInv&  Finv2,
0112                                 Blend_CurvPointFuncInv& FinvP2,
0113                                 const double            Pmin);
0114 
0115   bool IsDone() const;
0116 
0117   const occ::handle<BRepBlend_Line>& Line() const;
0118 
0119   bool Decroch1Start() const;
0120 
0121   bool Decroch1End() const;
0122 
0123   bool Decroch2Start() const;
0124 
0125   bool Decroch2End() const;
0126 
0127 private:
0128   Standard_EXPORT void InternalPerform(Blend_RstRstFunction&   Func,
0129                                        Blend_SurfCurvFuncInv&  Finv1,
0130                                        Blend_CurvPointFuncInv& FinvP1,
0131                                        Blend_SurfCurvFuncInv&  Finv2,
0132                                        Blend_CurvPointFuncInv& FinvP2,
0133                                        const double            Bound);
0134 
0135   Standard_EXPORT bool Recadre1(Blend_RstRstFunction&           Func,
0136                                 Blend_SurfCurvFuncInv&          Finv,
0137                                 math_Vector&                    Solinv,
0138                                 bool&                           IsVtx,
0139                                 occ::handle<Adaptor3d_HVertex>& Vtx);
0140 
0141   Standard_EXPORT bool Recadre2(Blend_RstRstFunction&           Func,
0142                                 Blend_SurfCurvFuncInv&          Finv,
0143                                 math_Vector&                    Solinv,
0144                                 bool&                           IsVtx,
0145                                 occ::handle<Adaptor3d_HVertex>& Vtx);
0146 
0147   Standard_EXPORT bool Recadre1(Blend_CurvPointFuncInv&         FinvP,
0148                                 math_Vector&                    Solinv,
0149                                 bool&                           IsVtx,
0150                                 occ::handle<Adaptor3d_HVertex>& Vtx);
0151 
0152   Standard_EXPORT bool Recadre2(Blend_CurvPointFuncInv&         FinvP,
0153                                 math_Vector&                    Solinv,
0154                                 bool&                           IsVtx,
0155                                 occ::handle<Adaptor3d_HVertex>& Vtx);
0156 
0157   Standard_EXPORT void Transition(const bool                            OnFirst,
0158                                   const occ::handle<Adaptor2d_Curve2d>& Arc,
0159                                   const double                          Param,
0160                                   IntSurf_Transition&                   TLine,
0161                                   IntSurf_Transition&                   TArc);
0162 
0163   Standard_EXPORT void MakeExtremity(BRepBlend_Extremity&                  Extrem,
0164                                      const bool                            OnFirst,
0165                                      const occ::handle<Adaptor2d_Curve2d>& Arc,
0166                                      const double                          Param,
0167                                      const bool                            IsVtx,
0168                                      const occ::handle<Adaptor3d_HVertex>& Vtx);
0169 
0170   Standard_EXPORT Blend_Status CheckDeflectionOnRst1(const Blend_Point& CurPoint);
0171 
0172   Standard_EXPORT Blend_Status CheckDeflectionOnRst2(const Blend_Point& CurPoint);
0173 
0174   Standard_EXPORT Blend_Status TestArret(Blend_RstRstFunction& Func,
0175                                          const bool            TestDeflection,
0176                                          const Blend_Status    State);
0177 
0178   Standard_EXPORT bool CheckInside(Blend_RstRstFunction& Func,
0179                                    TopAbs_State&         SituOnC1,
0180                                    TopAbs_State&         SituOnC2,
0181                                    Blend_DecrochStatus&  Decroch);
0182 
0183   bool                             done;
0184   occ::handle<BRepBlend_Line>      line;
0185   math_Vector                      sol;
0186   occ::handle<Adaptor3d_Surface>   surf1;
0187   occ::handle<Adaptor3d_TopolTool> domain1;
0188   occ::handle<Adaptor3d_Surface>   surf2;
0189   occ::handle<Adaptor3d_TopolTool> domain2;
0190   occ::handle<Adaptor2d_Curve2d>   rst1;
0191   occ::handle<Adaptor2d_Curve2d>   rst2;
0192   double                           tolpoint3d;
0193   double                           tolgui;
0194   double                           pasmax;
0195   double                           fleche;
0196   double                           param;
0197   Blend_Point                      previousP;
0198   bool                             rebrou;
0199   bool                             iscomplete;
0200   bool                             comptra;
0201   double                           sens;
0202   Blend_DecrochStatus              decrochdeb;
0203   Blend_DecrochStatus              decrochfin;
0204 };
0205 
0206 #include <BRepBlend_RstRstLineBuilder.lxx>
0207 
0208 #endif // _BRepBlend_RstRstLineBuilder_HeaderFile