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;
34 class Adaptor3d_HCurve;
38 class GeomFill_Frenet;
39 DEFINE_STANDARD_HANDLE(GeomFill_Frenet, GeomFill_TrihedronLaw)
41 //! Defined Frenet Trihedron Law
42 class GeomFill_Frenet : public GeomFill_TrihedronLaw
48 Standard_EXPORT GeomFill_Frenet();
50 Standard_EXPORT virtual Handle(GeomFill_TrihedronLaw) Copy() const Standard_OVERRIDE;
52 Standard_EXPORT void Init();
54 Standard_EXPORT virtual void SetCurve (const Handle(Adaptor3d_HCurve)& C) Standard_OVERRIDE;
56 //! compute Triedrhon on curve at parameter <Param>
57 Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal) Standard_OVERRIDE;
59 //! compute Triedrhon and derivative Trihedron on curve
60 //! at parameter <Param>
61 //! Warning : It used only for C1 or C2 aproximation
62 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;
64 //! compute Trihedron on curve
65 //! first and seconde derivatives.
66 //! Warning : It used only for C2 aproximation
67 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;
69 //! Returns the number of intervals for continuity
71 //! May be one if Continuity(me) >= <S>
72 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
74 //! Stores in <T> the parameters bounding the intervals
75 //! of continuity <S>.
77 //! The array must provide enough room to accomodate
78 //! for the parameters. i.e. T.Length() > NbIntervals()
79 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
81 //! Get average value of Tangent(t) and Normal(t) it is usfull to
82 //! make fast approximation of rational surfaces.
83 Standard_EXPORT virtual void GetAverageLaw (gp_Vec& ATangent, gp_Vec& ANormal, gp_Vec& ABiNormal) Standard_OVERRIDE;
85 //! Say if the law is Constant.
86 Standard_EXPORT virtual Standard_Boolean IsConstant() const Standard_OVERRIDE;
89 Standard_EXPORT virtual Standard_Boolean IsOnlyBy3dCurve() const Standard_OVERRIDE;
94 DEFINE_STANDARD_RTTIEXT(GeomFill_Frenet,GeomFill_TrihedronLaw)
104 Standard_EXPORT Standard_Boolean IsSingular (const Standard_Real U, Standard_Integer& Index) const;
106 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);
108 //! computes Triedrhon on curve at parameter <Param>
109 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);
111 //! computes Triedrhon and derivative Trihedron on curve
112 //! at parameter <Param>
113 //! Warning : It used only for C1 or C2 aproximation
114 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);
116 //! computes Trihedron on curve
117 //! first and seconde derivatives.
118 //! Warning : It used only for C2 aproximation
119 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);
121 //! revolves the trihedron (which is determined
122 //! of given "Tangent", "Normal" and "BiNormal" vectors)
123 //! to coincide "Tangent" and "NewTangent" axes.
124 Standard_EXPORT Standard_Boolean RotateTrihedron (gp_Vec& Tangent, gp_Vec& Normal, gp_Vec& BiNormal, const gp_Vec& NewTangent) const;
127 Handle(TColStd_HArray1OfReal) mySngl;
128 Handle(TColStd_HArray1OfReal) mySnglLen;
129 Standard_Boolean isSngl;
140 #endif // _GeomFill_Frenet_HeaderFile