1 // Created on: 1997-12-19
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GeomFill_Frenet_HeaderFile
18 #define _GeomFill_Frenet_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
24 #include <TColStd_HArray1OfReal.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <GeomFill_TrihedronLaw.hxx>
27 #include <Standard_Real.hxx>
28 #include <Standard_Integer.hxx>
29 #include <GeomAbs_Shape.hxx>
30 #include <TColStd_Array1OfReal.hxx>
31 class Standard_OutOfRange;
32 class Standard_ConstructionError;
33 class GeomFill_TrihedronLaw;
37 class GeomFill_Frenet;
38 DEFINE_STANDARD_HANDLE(GeomFill_Frenet, GeomFill_TrihedronLaw)
40 //! Defined Frenet Trihedron Law
41 class GeomFill_Frenet : public GeomFill_TrihedronLaw
47 Standard_EXPORT GeomFill_Frenet();
49 Standard_EXPORT virtual Handle(GeomFill_TrihedronLaw) Copy() const Standard_OVERRIDE;
51 Standard_EXPORT void Init();
53 Standard_EXPORT virtual void SetCurve (const Handle(Adaptor3d_Curve)& C) Standard_OVERRIDE;
55 //! compute Triedrhon on curve at parameter <Param>
56 Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal) Standard_OVERRIDE;
58 //! compute Triedrhon and derivative Trihedron on curve
59 //! at parameter <Param>
60 //! Warning : It used only for C1 or C2 approximation
61 Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& BiNormal, gp_Vec& DBiNormal) Standard_OVERRIDE;
63 //! compute Trihedron on curve
64 //! first and seconde derivatives.
65 //! Warning : It used only for C2 approximation
66 Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& D2Tangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& D2Normal, gp_Vec& BiNormal, gp_Vec& DBiNormal, gp_Vec& D2BiNormal) Standard_OVERRIDE;
68 //! Returns the number of intervals for continuity
70 //! May be one if Continuity(me) >= <S>
71 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
73 //! Stores in <T> the parameters bounding the intervals
74 //! of continuity <S>.
76 //! The array must provide enough room to accommodate
77 //! for the parameters. i.e. T.Length() > NbIntervals()
78 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
80 //! Get average value of Tangent(t) and Normal(t) it is usfull to
81 //! make fast approximation of rational surfaces.
82 Standard_EXPORT virtual void GetAverageLaw (gp_Vec& ATangent, gp_Vec& ANormal, gp_Vec& ABiNormal) Standard_OVERRIDE;
84 //! Say if the law is Constant.
85 Standard_EXPORT virtual Standard_Boolean IsConstant() const Standard_OVERRIDE;
88 Standard_EXPORT virtual Standard_Boolean IsOnlyBy3dCurve() const Standard_OVERRIDE;
93 DEFINE_STANDARD_RTTIEXT(GeomFill_Frenet,GeomFill_TrihedronLaw)
103 Standard_EXPORT Standard_Boolean IsSingular (const Standard_Real U, Standard_Integer& Index) const;
105 Standard_EXPORT Standard_Boolean DoSingular (const Standard_Real U, const Standard_Integer Index, gp_Vec& Tangent, gp_Vec& BiNormal, Standard_Integer& n, Standard_Integer& k, Standard_Integer& TFlag, Standard_Integer& BNFlag, Standard_Real& Delta);
107 //! computes Triedrhon on curve at parameter <Param>
108 Standard_EXPORT Standard_Boolean SingularD0 (const Standard_Real Param, const Standard_Integer Index, gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal, Standard_Real& Delta);
110 //! computes Triedrhon and derivative Trihedron on curve
111 //! at parameter <Param>
112 //! Warning : It used only for C1 or C2 approximation
113 Standard_EXPORT Standard_Boolean SingularD1 (const Standard_Real Param, const Standard_Integer Index, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& BiNormal, gp_Vec& DBiNormal, Standard_Real& Delta);
115 //! computes Trihedron on curve
116 //! first and seconde derivatives.
117 //! Warning : It used only for C2 approximation
118 Standard_EXPORT Standard_Boolean SingularD2 (const Standard_Real Param, const Standard_Integer Index, gp_Vec& Tangent, gp_Vec& DTangent, gp_Vec& D2Tangent, gp_Vec& Normal, gp_Vec& DNormal, gp_Vec& D2Normal, gp_Vec& BiNormal, gp_Vec& DBiNormal, gp_Vec& D2BiNormal, Standard_Real& Delta);
120 //! revolves the trihedron (which is determined
121 //! of given "Tangent", "Normal" and "BiNormal" vectors)
122 //! to coincide "Tangent" and "NewTangent" axes.
123 Standard_EXPORT Standard_Boolean RotateTrihedron (gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal, const gp_Vec& NewTangent) const;
126 Handle(TColStd_HArray1OfReal) mySngl;
127 Handle(TColStd_HArray1OfReal) mySnglLen;
128 Standard_Boolean isSngl;
139 #endif // _GeomFill_Frenet_HeaderFile