Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:17

0001 // Created on: 1997-12-02
0002 // Created by: Philippe MANGIN
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 _GeomFill_CurveAndTrihedron_HeaderFile
0018 #define _GeomFill_CurveAndTrihedron_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <gp_Mat.hxx>
0023 #include <GeomFill_LocationLaw.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <gp_Pnt2d.hxx>
0026 #include <NCollection_Array1.hxx>
0027 #include <gp_Vec2d.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <GeomAbs_Shape.hxx>
0030 class GeomFill_TrihedronLaw;
0031 
0032 //! Define location law with an TrihedronLaw and an
0033 //! curve
0034 //! Definition Location is:
0035 //! transformed section coordinates in (Curve(v)),
0036 //! (Normal(v), BiNormal(v), Tangente(v))) systems are
0037 //! the same like section shape coordinates in
0038 //! (O,(OX, OY, OZ)) system.
0039 class GeomFill_CurveAndTrihedron : public GeomFill_LocationLaw
0040 {
0041 
0042 public:
0043   Standard_EXPORT GeomFill_CurveAndTrihedron(const occ::handle<GeomFill_TrihedronLaw>& Trihedron);
0044 
0045   //! initialize curve of trihedron law
0046   //! @return true in case if execution end correctly
0047   Standard_EXPORT bool SetCurve(const occ::handle<Adaptor3d_Curve>& C) override;
0048 
0049   Standard_EXPORT const occ::handle<Adaptor3d_Curve>& GetCurve() const override;
0050 
0051   //! Set a transformation Matrix like the law M(t) become
0052   //! Mat * M(t)
0053   Standard_EXPORT void SetTrsf(const gp_Mat& Transfo) override;
0054 
0055   Standard_EXPORT occ::handle<GeomFill_LocationLaw> Copy() const override;
0056 
0057   //! compute Location and 2d points
0058   Standard_EXPORT bool D0(const double Param, gp_Mat& M, gp_Vec& V) override;
0059 
0060   //! compute Location and 2d points
0061   Standard_EXPORT bool D0(const double                  Param,
0062                           gp_Mat&                       M,
0063                           gp_Vec&                       V,
0064                           NCollection_Array1<gp_Pnt2d>& Poles2d) override;
0065 
0066   //! compute location 2d points and associated
0067   //! first derivatives.
0068   //! Warning : It used only for C1 or C2 approximation
0069   Standard_EXPORT bool D1(const double                  Param,
0070                           gp_Mat&                       M,
0071                           gp_Vec&                       V,
0072                           gp_Mat&                       DM,
0073                           gp_Vec&                       DV,
0074                           NCollection_Array1<gp_Pnt2d>& Poles2d,
0075                           NCollection_Array1<gp_Vec2d>& DPoles2d) override;
0076 
0077   //! compute location 2d points and associated
0078   //! first and second derivatives.
0079   //! Warning : It used only for C2 approximation
0080   Standard_EXPORT bool D2(const double                  Param,
0081                           gp_Mat&                       M,
0082                           gp_Vec&                       V,
0083                           gp_Mat&                       DM,
0084                           gp_Vec&                       DV,
0085                           gp_Mat&                       D2M,
0086                           gp_Vec&                       D2V,
0087                           NCollection_Array1<gp_Pnt2d>& Poles2d,
0088                           NCollection_Array1<gp_Vec2d>& DPoles2d,
0089                           NCollection_Array1<gp_Vec2d>& D2Poles2d) override;
0090 
0091   //! Returns the number of intervals for continuity <S>.
0092   //! May be one if Continuity(me) >= <S>
0093   Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0094 
0095   //! Stores in <T> the parameters bounding the intervals
0096   //! of continuity <S>.
0097   //!
0098   //! The array must provide enough room to accommodate
0099   //! for the parameters. i.e. T.Length() > NbIntervals()
0100   Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0101                                  const GeomAbs_Shape         S) const override;
0102 
0103   //! Sets the bounds of the parametric interval on
0104   //! the function
0105   //! This determines the derivatives in these values if the
0106   //! function is not Cn.
0107   Standard_EXPORT void SetInterval(const double First, const double Last) override;
0108 
0109   //! Gets the bounds of the parametric interval on
0110   //! the function
0111   Standard_EXPORT void GetInterval(double& First, double& Last) const override;
0112 
0113   //! Gets the bounds of the function parametric domain.
0114   //! Warning: This domain it is not modified by the
0115   //! SetValue method
0116   Standard_EXPORT void GetDomain(double& First, double& Last) const override;
0117 
0118   //! Get the maximum Norm of the matrix-location part. It
0119   //! is usful to find a good Tolerance to approx M(t).
0120   Standard_EXPORT double GetMaximalNorm() override;
0121 
0122   //! Get average value of M(t) and V(t) it is useful to
0123   //! make fast approximation of rational surfaces.
0124   Standard_EXPORT void GetAverageLaw(gp_Mat& AM, gp_Vec& AV) override;
0125 
0126   //! Say if the Location Law, is an translation of Location
0127   //! The default implementation is " returns False ".
0128   Standard_EXPORT bool IsTranslation(double& Error) const override;
0129 
0130   //! Say if the Location Law, is a rotation of Location
0131   //! The default implementation is " returns False ".
0132   Standard_EXPORT bool IsRotation(double& Error) const override;
0133 
0134   Standard_EXPORT void Rotation(gp_Pnt& Center) const override;
0135 
0136   DEFINE_STANDARD_RTTIEXT(GeomFill_CurveAndTrihedron, GeomFill_LocationLaw)
0137 
0138 private:
0139   bool                               WithTrans;
0140   occ::handle<GeomFill_TrihedronLaw> myLaw;
0141   occ::handle<Adaptor3d_Curve>       myCurve;
0142   occ::handle<Adaptor3d_Curve>       myTrimmed;
0143   gp_Pnt                             Point;
0144   gp_Vec                             V1;
0145   gp_Vec                             V2;
0146   gp_Vec                             V3;
0147   gp_Mat                             Trans;
0148 };
0149 
0150 #endif // _GeomFill_CurveAndTrihedron_HeaderFile