1 // Created on: 2013-02-05
2 // Created by: Julia GERASIMOVA
3 // Copyright (c) 2001-2013 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _GeomFill_DiscreteTrihedron_HeaderFile
17 #define _GeomFill_DiscreteTrihedron_HeaderFile
19 #include <Standard.hxx>
21 #include <GeomFill_HSequenceOfAx2.hxx>
22 #include <TColStd_HSequenceOfReal.hxx>
23 #include <GeomFill_TrihedronLaw.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <GeomAbs_Shape.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 class GeomFill_Frenet;
32 class GeomFill_DiscreteTrihedron;
33 DEFINE_STANDARD_HANDLE(GeomFill_DiscreteTrihedron, GeomFill_TrihedronLaw)
35 //! Defined Discrete Trihedron Law.
36 //! The requirement for path curve is only G1.
37 //! The result is C0-continuous surface
38 //! that can be later approximated to C1.
39 class GeomFill_DiscreteTrihedron : public GeomFill_TrihedronLaw
45 Standard_EXPORT GeomFill_DiscreteTrihedron();
47 Standard_EXPORT virtual Handle(GeomFill_TrihedronLaw) Copy() const Standard_OVERRIDE;
49 Standard_EXPORT void Init();
51 //! initialize curve of trihedron law
52 //! @return Standard_True in case if execution end correctly
53 Standard_EXPORT virtual Standard_Boolean SetCurve (const Handle(Adaptor3d_Curve)& C) Standard_OVERRIDE;
55 //! compute Trihedron 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 Trihedron and derivative Trihedron on curve
59 //! at parameter <Param>
60 //! Warning : It used only for C1 or C2 approximation
61 //! For the moment it returns null values for DTangent, DNormal
63 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;
65 //! compute Trihedron on curve
66 //! first and seconde derivatives.
67 //! Warning : It used only for C2 approximation
68 //! For the moment it returns null values for DTangent, DNormal
69 //! DBiNormal, D2Tangent, D2Normal, D2BiNormal.
70 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;
72 //! Returns the number of intervals for continuity
74 //! May be one if Continuity(me) >= <S>
75 Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
77 //! Stores in <T> the parameters bounding the intervals
78 //! of continuity <S>.
80 //! The array must provide enough room to accommodate
81 //! for the parameters. i.e. T.Length() > NbIntervals()
82 Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
84 //! Get average value of Tangent(t) and Normal(t) it is usful to
85 //! make fast approximation of rational surfaces.
86 Standard_EXPORT virtual void GetAverageLaw (gp_Vec& ATangent, gp_Vec& ANormal, gp_Vec& ABiNormal) Standard_OVERRIDE;
88 //! Say if the law is Constant.
89 Standard_EXPORT virtual Standard_Boolean IsConstant() const Standard_OVERRIDE;
92 Standard_EXPORT virtual Standard_Boolean IsOnlyBy3dCurve() const Standard_OVERRIDE;
97 DEFINE_STANDARD_RTTIEXT(GeomFill_DiscreteTrihedron,GeomFill_TrihedronLaw)
108 Handle(GeomFill_HSequenceOfAx2) myTrihedrons;
109 Handle(TColStd_HSequenceOfReal) myKnots;
110 Handle(GeomFill_Frenet) myFrenet;
111 Standard_Boolean myUseFrenet;
122 #endif // _GeomFill_DiscreteTrihedron_HeaderFile