0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / GeomFill / GeomFill_ConstantBiNormal.hxx
1 // Created on: 1997-12-09
2 // Created by: Philippe MANGIN
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GeomFill_ConstantBiNormal_HeaderFile
18 #define _GeomFill_ConstantBiNormal_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <gp_Vec.hxx>
24 #include <GeomFill_TrihedronLaw.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Integer.hxx>
28 #include <GeomAbs_Shape.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 class GeomFill_Frenet;
31 class Standard_OutOfRange;
32 class Standard_ConstructionError;
33 class gp_Dir;
34 class GeomFill_TrihedronLaw;
35 class Adaptor3d_HCurve;
36 class gp_Vec;
37
38
39 class GeomFill_ConstantBiNormal;
40 DEFINE_STANDARD_HANDLE(GeomFill_ConstantBiNormal, GeomFill_TrihedronLaw)
41
42 //! Defined an Trihedron Law  where the BiNormal, is fixed
43 class GeomFill_ConstantBiNormal : public GeomFill_TrihedronLaw
44 {
45
46 public:
47
48   
49   Standard_EXPORT GeomFill_ConstantBiNormal(const gp_Dir& BiNormal);
50   
51   Standard_EXPORT virtual Handle(GeomFill_TrihedronLaw) Copy() const Standard_OVERRIDE;
52   
53   Standard_EXPORT virtual void SetCurve (const Handle(Adaptor3d_HCurve)& C) Standard_OVERRIDE;
54   
55   //! Computes 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;
57   
58   //! Computes Triedrhon and  derivative Trihedron  on curve
59   //! at parameter <Param>
60   //! Warning : It used only for C1 or C2 aproximation
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;
62   
63   //! compute  Trihedron on curve
64   //! first and seconde  derivatives.
65   //! Warning : It used only for C2 aproximation
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;
67   
68   //! Returns  the number  of  intervals for  continuity
69   //! <S>.
70   //! May be one if Continuity(me) >= <S>
71   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
72   
73   //! Stores in <T> the  parameters bounding the intervals
74   //! of continuity <S>.
75   //!
76   //! The array must provide  enough room to  accomodate
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;
79   
80   //! Gets 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;
83   
84   //! Says if the law is Constant.
85   Standard_EXPORT virtual Standard_Boolean IsConstant() const Standard_OVERRIDE;
86   
87   //! Return True.
88   Standard_EXPORT virtual Standard_Boolean IsOnlyBy3dCurve() const Standard_OVERRIDE;
89
90
91
92
93   DEFINE_STANDARD_RTTIEXT(GeomFill_ConstantBiNormal,GeomFill_TrihedronLaw)
94
95 protected:
96
97
98
99
100 private:
101
102
103   gp_Vec BN;
104   Handle(GeomFill_Frenet) frenet;
105
106
107 };
108
109
110
111
112
113
114
115 #endif // _GeomFill_ConstantBiNormal_HeaderFile