42cf5bc1 |
1 | // Created on: 1996-04-01 |
2 | // Created by: Philippe MANGIN |
3 | // Copyright (c) 1996-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 _FairCurve_EnergyOfMVC_HeaderFile |
18 | #define _FairCurve_EnergyOfMVC_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | #include <FairCurve_BattenLaw.hxx> |
26 | #include <FairCurve_DistributionOfTension.hxx> |
27 | #include <FairCurve_DistributionOfSagging.hxx> |
28 | #include <FairCurve_DistributionOfJerk.hxx> |
29 | #include <FairCurve_AnalysisCode.hxx> |
30 | #include <FairCurve_Energy.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <TColStd_HArray1OfReal.hxx> |
33 | #include <TColgp_HArray1OfPnt2d.hxx> |
34 | #include <Standard_Boolean.hxx> |
35 | #include <math_Vector.hxx> |
42cf5bc1 |
36 | |
9fd2d2c3 |
37 | // resolve name collisions with X11 headers |
38 | #ifdef Status |
39 | #undef Status |
40 | #endif |
42cf5bc1 |
41 | |
42 | //! Energy Criterium to minimize in MinimalVariationCurve. |
43 | class FairCurve_EnergyOfMVC : public FairCurve_Energy |
44 | { |
45 | public: |
46 | |
47 | DEFINE_STANDARD_ALLOC |
48 | |
49 | |
50 | //! Angles corresspond to the Ox axis |
51 | Standard_EXPORT FairCurve_EnergyOfMVC(const Standard_Integer BSplOrder, const Handle(TColStd_HArray1OfReal)& FlatKnots, const Handle(TColgp_HArray1OfPnt2d)& Poles, const Standard_Integer ContrOrder1, const Standard_Integer ContrOrder2, const FairCurve_BattenLaw& Law, const Standard_Real PhysicalRatio, const Standard_Real LengthSliding, const Standard_Boolean FreeSliding = Standard_True, const Standard_Real Angle1 = 0, const Standard_Real Angle2 = 0, const Standard_Real Curvature1 = 0, const Standard_Real Curvature2 = 0); |
52 | |
53 | //! return the lengthSliding = P1P2 + Sliding |
54 | Standard_Real LengthSliding() const; |
55 | |
56 | //! return the status |
57 | FairCurve_AnalysisCode Status() const; |
58 | |
21c7c457 |
59 | //! compute the variables <X> which correspond with the field <MyPoles> |
42cf5bc1 |
60 | Standard_EXPORT virtual Standard_Boolean Variable (math_Vector& X) const Standard_OVERRIDE; |
61 | |
62 | |
63 | |
64 | |
65 | protected: |
66 | |
67 | |
21c7c457 |
68 | //! compute the poles which correspond with the variable X |
42cf5bc1 |
69 | Standard_EXPORT virtual void ComputePoles (const math_Vector& X) Standard_OVERRIDE; |
70 | |
71 | //! compute the energy in intermediat format |
72 | Standard_EXPORT virtual Standard_Boolean Compute (const Standard_Integer DerivativeOrder, math_Vector& Result) Standard_OVERRIDE; |
73 | |
74 | |
75 | |
76 | |
77 | private: |
78 | |
79 | |
80 | |
81 | Standard_Real MyLengthSliding; |
82 | Standard_Real OriginalSliding; |
83 | FairCurve_BattenLaw MyBattenLaw; |
84 | Standard_Real MyPhysicalRatio; |
85 | FairCurve_DistributionOfTension MyTension; |
86 | FairCurve_DistributionOfSagging MySagging; |
87 | FairCurve_DistributionOfJerk MyJerk; |
88 | FairCurve_AnalysisCode MyStatus; |
89 | |
90 | |
91 | }; |
92 | |
93 | |
94 | #include <FairCurve_EnergyOfMVC.lxx> |
95 | |
96 | |
97 | |
98 | |
99 | |
100 | #endif // _FairCurve_EnergyOfMVC_HeaderFile |