Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:22:14

0001 // Created on: 2013-02-05
0002 // Created by: Julia GERASIMOVA
0003 // Copyright (c) 2001-2013 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _GeomFill_DiscreteTrihedron_HeaderFile
0017 #define _GeomFill_DiscreteTrihedron_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <gp_Ax2.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <NCollection_HSequence.hxx>
0024 #include <GeomFill_TrihedronLaw.hxx>
0025 #include <Standard_Real.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <NCollection_Array1.hxx>
0029 class GeomFill_Frenet;
0030 class gp_Vec;
0031 
0032 //! Defined Discrete Trihedron Law.
0033 //! The requirement for path curve is only G1.
0034 //! The result is C0-continuous surface
0035 //! that can be later approximated to C1.
0036 class GeomFill_DiscreteTrihedron : public GeomFill_TrihedronLaw
0037 {
0038 
0039 public:
0040   Standard_EXPORT GeomFill_DiscreteTrihedron();
0041 
0042   Standard_EXPORT occ::handle<GeomFill_TrihedronLaw> Copy() const override;
0043 
0044   Standard_EXPORT void Init();
0045 
0046   //! initialize curve of trihedron law
0047   //! @return true in case if execution end correctly
0048   Standard_EXPORT bool SetCurve(const occ::handle<Adaptor3d_Curve>& C) override;
0049 
0050   //! compute Trihedron on curve at parameter <Param>
0051   Standard_EXPORT bool D0(const double Param,
0052                           gp_Vec&      Tangent,
0053                           gp_Vec&      Normal,
0054                           gp_Vec&      BiNormal) override;
0055 
0056   //! compute Trihedron and derivative Trihedron on curve
0057   //! at parameter <Param>
0058   //! Warning : It used only for C1 or C2 approximation
0059   //! For the moment it returns null values for DTangent, DNormal
0060   //! and DBiNormal.
0061   Standard_EXPORT bool D1(const double Param,
0062                           gp_Vec&      Tangent,
0063                           gp_Vec&      DTangent,
0064                           gp_Vec&      Normal,
0065                           gp_Vec&      DNormal,
0066                           gp_Vec&      BiNormal,
0067                           gp_Vec&      DBiNormal) override;
0068 
0069   //! compute Trihedron on curve
0070   //! first and second derivatives.
0071   //! Warning : It used only for C2 approximation
0072   //! For the moment it returns null values for DTangent, DNormal
0073   //! DBiNormal, D2Tangent, D2Normal, D2BiNormal.
0074   Standard_EXPORT bool D2(const double Param,
0075                           gp_Vec&      Tangent,
0076                           gp_Vec&      DTangent,
0077                           gp_Vec&      D2Tangent,
0078                           gp_Vec&      Normal,
0079                           gp_Vec&      DNormal,
0080                           gp_Vec&      D2Normal,
0081                           gp_Vec&      BiNormal,
0082                           gp_Vec&      DBiNormal,
0083                           gp_Vec&      D2BiNormal) override;
0084 
0085   //! Returns the number of intervals for continuity
0086   //! <S>.
0087   //! May be one if Continuity(me) >= <S>
0088   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0089 
0090   //! Stores in <T> the parameters bounding the intervals
0091   //! of continuity <S>.
0092   //!
0093   //! The array must provide enough room to accommodate
0094   //! for the parameters. i.e. T.Length() > NbIntervals()
0095   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0096                                  const GeomAbs_Shape         S) const override;
0097 
0098   //! Get average value of Tangent(t) and Normal(t) it is usful to
0099   //! make fast approximation of rational surfaces.
0100   Standard_EXPORT void GetAverageLaw(gp_Vec& ATangent, gp_Vec& ANormal, gp_Vec& ABiNormal) override;
0101 
0102   //! Say if the law is Constant.
0103   Standard_EXPORT bool IsConstant() const override;
0104 
0105   //! Return True.
0106   Standard_EXPORT bool IsOnlyBy3dCurve() const override;
0107 
0108   DEFINE_STANDARD_RTTIEXT(GeomFill_DiscreteTrihedron, GeomFill_TrihedronLaw)
0109 
0110 private:
0111   gp_Pnt                                     myPoint;
0112   occ::handle<NCollection_HSequence<gp_Ax2>> myTrihedrons;
0113   occ::handle<NCollection_HSequence<double>> myKnots;
0114   occ::handle<GeomFill_Frenet>               myFrenet;
0115   bool                                       myUseFrenet;
0116 };
0117 
0118 #endif // _GeomFill_DiscreteTrihedron_HeaderFile