0031303: Different calculation of offset direction in Adaptor2d_OffsetCurve and Geom2...
[occt.git] / src / Geom2dEvaluator / Geom2dEvaluator.hxx
1 // Created on: 1992-08-28
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1992-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 _Geom2dEvaluator_HeaderFile
18 #define _Geom2dEvaluator_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Real.hxx>
23 #include <Standard_Integer.hxx>
24
25 class gp_Pnt2d;
26 class gp_Vec2d;
27
28 //! The Geom2dEvaluator package provides  utilities for .
29 //! calculating value and derivatives of offset curve
30 //! using corresponding values of base curve
31
32 class Geom2dEvaluator
33 {
34 public:
35
36   DEFINE_STANDARD_ALLOC
37
38   
39   //! Recalculate D1 values of base curve into D0 value of offset curve
40   Standard_EXPORT static void CalculateD0(gp_Pnt2d& theValue,
41                                           const gp_Vec2d& theD1, const Standard_Real theOffset);
42   
43   //! Recalculate D2 values of base curve into D1 values of offset curve
44   Standard_EXPORT static  void CalculateD1(gp_Pnt2d& theValue,
45                                            gp_Vec2d& theD1,
46                                            const gp_Vec2d& theD2, const Standard_Real theOffset);
47
48   
49   //! Recalculate D3 values of base curve into D2 values of offset curve
50   Standard_EXPORT static   void CalculateD2(gp_Pnt2d& theValue,
51                                             gp_Vec2d& theD1,
52                                             gp_Vec2d& theD2,
53                                             const gp_Vec2d& theD3, const Standard_Boolean theIsDirChange, 
54                                             const Standard_Real theOffset);
55
56   
57   //! Recalculate D3 values of base curve into D3 values of offset curve
58   Standard_EXPORT static void CalculateD3(gp_Pnt2d& theValue,
59                                           gp_Vec2d& theD1,
60                                           gp_Vec2d& theD2,
61                                           gp_Vec2d& theD3,
62                                           const gp_Vec2d& theD4, const Standard_Boolean theIsDirChange,
63                                           const Standard_Real theOffset); 
64
65   
66   //! Recalculate derivatives in the singular point
67   //! Returns true if the direction of derivatives is changed
68   Standard_EXPORT static Standard_Boolean AdjustDerivative(const Standard_Integer theMaxDerivative,
69                                                            const Standard_Real theU,
70                                                            gp_Vec2d& theD1,
71                                                            gp_Vec2d& theD2,
72                                                            gp_Vec2d& theD3,
73                                                            gp_Vec2d& theD4);
74   
75   
76 protected:
77
78
79
80
81
82 private:
83
84 };
85
86
87 #endif // _Geom2dEvaluator_HeaderFile