Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:02

0001 // Created by: Julia GERASIMOVA
0002 // Copyright (c) 2015 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _BlendFunc_GenChamfer_HeaderFile
0016 #define _BlendFunc_GenChamfer_HeaderFile
0017 
0018 #include <Adaptor3d_Surface.hxx>
0019 #include <Blend_Function.hxx>
0020 #include <math_Vector.hxx>
0021 #include <TColStd_Array1OfReal.hxx>
0022 #include <GeomAbs_Shape.hxx>
0023 #include <TColStd_Array1OfInteger.hxx>
0024 #include <TColgp_Array1OfPnt.hxx>
0025 #include <TColgp_Array1OfVec.hxx>
0026 #include <TColgp_Array1OfPnt2d.hxx>
0027 #include <TColgp_Array1OfVec2d.hxx>
0028 
0029 class math_Matrix;
0030 class gp_Lin;
0031 class Blend_Point;
0032 
0033 //! Deferred class for a function used to compute a general chamfer
0034 class BlendFunc_GenChamfer  : public Blend_Function
0035 {
0036 public:
0037 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   Standard_EXPORT BlendFunc_GenChamfer(const Handle(Adaptor3d_Surface)& S1,
0041                                        const Handle(Adaptor3d_Surface)& S2,
0042                                        const Handle(Adaptor3d_Curve)& CG);
0043   
0044   //! returns the number of equations of the function.
0045   Standard_EXPORT Standard_Integer NbEquations() const Standard_OVERRIDE;
0046   
0047   //! returns the values <F> of the functions and the derivatives
0048   //! <D> for the variable <X>.
0049   //! Returns True if the computation was done successfully,
0050   //! False otherwise.
0051   Standard_EXPORT Standard_Boolean Values (const math_Vector& X,
0052                                            math_Vector& F,
0053                                            math_Matrix& D) Standard_OVERRIDE;
0054   
0055   //! Sets the value of the parameter along the guide line.
0056   //! This determines the plane in which the solution has
0057   //! to be found.
0058   Standard_EXPORT void Set (const Standard_Real Param) Standard_OVERRIDE = 0;
0059   
0060   //! Sets the bounds of the parametric interval on
0061   //! the guide line.
0062   //! This determines the derivatives in these values if the
0063   //! function is not Cn.
0064   Standard_EXPORT void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0065   
0066   Standard_EXPORT void GetTolerance (math_Vector& Tolerance,
0067                                      const Standard_Real Tol) const Standard_OVERRIDE;
0068   
0069   Standard_EXPORT void GetBounds (math_Vector& InfBound,
0070                                   math_Vector& SupBound) const Standard_OVERRIDE;
0071   
0072   //! Returns   the    minimal  Distance  between   two
0073   //! extremities of calculated sections.
0074   Standard_EXPORT Standard_Real GetMinimalDistance() const Standard_OVERRIDE;
0075   
0076   //! Sets the distances and the "quadrant".
0077   Standard_EXPORT virtual void Set (const Standard_Real Dist1,
0078                                     const Standard_Real Dist2,
0079                                     const Standard_Integer Choix) = 0;
0080   
0081   //! Returns False
0082   Standard_EXPORT Standard_Boolean IsRational() const Standard_OVERRIDE;
0083   
0084   //! Compute the minimal value of weight for each poles
0085   //! of all sections.
0086   Standard_EXPORT void GetMinimalWeight (TColStd_Array1OfReal& Weigths) const Standard_OVERRIDE;
0087   
0088   //! Returns  the number  of  intervals for  continuity
0089   //! <S>. May be one if Continuity(me) >= <S>
0090   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0091   
0092   //! Stores in <T> the  parameters bounding the intervals
0093   //! of continuity <S>.
0094   //!
0095   //! The array must provide  enough room to  accommodate
0096   //! for the parameters. i.e. T.Length() > NbIntervals()
0097   //! raises
0098   //! OutOfRange from Standard
0099   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T,
0100                                   const GeomAbs_Shape S) const Standard_OVERRIDE;
0101   
0102   Standard_EXPORT void GetShape (Standard_Integer& NbPoles,
0103                                  Standard_Integer& NbKnots,
0104                                  Standard_Integer& Degree,
0105                                  Standard_Integer& NbPoles2d) Standard_OVERRIDE;
0106   
0107   //! Returns the tolerance to reach in approximation
0108   //! to respecte
0109   //! BoundTol error at the Boundary
0110   //! AngleTol tangent error at the Boundary
0111   //! SurfTol error inside the surface.
0112   Standard_EXPORT void GetTolerance (const Standard_Real BoundTol,
0113                                      const Standard_Real SurfTol,
0114                                      const Standard_Real AngleTol,
0115                                      math_Vector& Tol3d,
0116                                      math_Vector& Tol1D) const Standard_OVERRIDE;
0117   
0118   Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE;
0119   
0120   Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE;
0121   
0122   //! Obsolete method
0123   Standard_EXPORT void Section (const Standard_Real Param,
0124                                 const Standard_Real U1,
0125                                 const Standard_Real V1,
0126                                 const Standard_Real U2,
0127                                 const Standard_Real V2,
0128                                 Standard_Real& Pdeb,
0129                                 Standard_Real& Pfin,
0130                                 gp_Lin& C);
0131   
0132   //! Used for the first and last section
0133   Standard_EXPORT Standard_Boolean Section (const Blend_Point& P,
0134                                             TColgp_Array1OfPnt& Poles,
0135                                             TColgp_Array1OfVec& DPoles,
0136                                             TColgp_Array1OfVec& D2Poles,
0137                                             TColgp_Array1OfPnt2d& Poles2d,
0138                                             TColgp_Array1OfVec2d& DPoles2d,
0139                                             TColgp_Array1OfVec2d& D2Poles2d,
0140                                             TColStd_Array1OfReal& Weigths,
0141                                             TColStd_Array1OfReal& DWeigths,
0142                                             TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
0143   
0144   //! Used for the first and last section
0145   Standard_EXPORT Standard_Boolean Section (const Blend_Point& P,
0146                                             TColgp_Array1OfPnt& Poles,
0147                                             TColgp_Array1OfVec& DPoles,
0148                                             TColgp_Array1OfPnt2d& Poles2d,
0149                                             TColgp_Array1OfVec2d& DPoles2d,
0150                                             TColStd_Array1OfReal& Weigths,
0151                                             TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE;
0152   
0153   Standard_EXPORT void Section (const Blend_Point& P,
0154                                 TColgp_Array1OfPnt& Poles,
0155                                 TColgp_Array1OfPnt2d& Poles2d,
0156                                 TColStd_Array1OfReal& Weigths) Standard_OVERRIDE;
0157   
0158   Standard_EXPORT void Resolution (const Standard_Integer IC2d,
0159                                    const Standard_Real Tol,
0160                                    Standard_Real& TolU,
0161                                    Standard_Real& TolV) const Standard_OVERRIDE;
0162 
0163 
0164 
0165 
0166 protected:
0167 
0168   Handle(Adaptor3d_Surface) surf1;
0169   Handle(Adaptor3d_Surface) surf2;
0170   Handle(Adaptor3d_Curve) curv;
0171   Standard_Integer choix;
0172   Standard_Real tol;
0173   Standard_Real distmin;
0174 
0175 
0176 private:
0177 
0178 
0179 };
0180 
0181 
0182 
0183 
0184 
0185 
0186 
0187 #endif // _BlendFunc_GenChamfer_HeaderFile