42cf5bc1 |
1 | // Created on: 1996-02-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_EnergyOfBatten_HeaderFile |
18 | #define _FairCurve_EnergyOfBatten_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_AnalysisCode.hxx> |
29 | #include <FairCurve_Energy.hxx> |
30 | #include <Standard_Integer.hxx> |
31 | #include <TColStd_HArray1OfReal.hxx> |
32 | #include <TColgp_HArray1OfPnt2d.hxx> |
33 | #include <Standard_Boolean.hxx> |
34 | #include <math_Vector.hxx> |
42cf5bc1 |
35 | |
9fd2d2c3 |
36 | // resolve name collisions with X11 headers |
37 | #ifdef Status |
38 | #undef Status |
39 | #endif |
42cf5bc1 |
40 | |
41 | //! Energy Criterium to minimize in Batten. |
42 | class FairCurve_EnergyOfBatten : public FairCurve_Energy |
43 | { |
44 | public: |
45 | |
46 | DEFINE_STANDARD_ALLOC |
47 | |
48 | |
49 | //! Angles corresspond to the Ox axis |
50 | Standard_EXPORT FairCurve_EnergyOfBatten(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 LengthSliding, const Standard_Boolean FreeSliding = Standard_True, const Standard_Real Angle1 = 0, const Standard_Real Angle2 = 0); |
51 | |
52 | //! return the lengthSliding = P1P2 + Sliding |
53 | Standard_Real LengthSliding() const; |
54 | |
55 | //! return the status |
56 | FairCurve_AnalysisCode Status() const; |
57 | |
58 | //! compute the variables <X> wich correspond with the field <MyPoles> |
59 | Standard_EXPORT virtual Standard_Boolean Variable (math_Vector& X) const Standard_OVERRIDE; |
60 | |
61 | |
62 | |
63 | |
64 | protected: |
65 | |
66 | |
67 | //! compute the poles wich correspond with the variable X |
68 | Standard_EXPORT virtual void ComputePoles (const math_Vector& X) Standard_OVERRIDE; |
69 | |
70 | //! compute the energy in intermediat format |
71 | Standard_EXPORT virtual Standard_Boolean Compute (const Standard_Integer DerivativeOrder, math_Vector& Result) Standard_OVERRIDE; |
72 | |
73 | |
74 | |
75 | |
76 | private: |
77 | |
78 | |
79 | |
80 | Standard_Real MyLengthSliding; |
81 | Standard_Real OriginalSliding; |
82 | FairCurve_BattenLaw MyBattenLaw; |
83 | FairCurve_DistributionOfTension MyTension; |
84 | FairCurve_DistributionOfSagging MySagging; |
85 | FairCurve_AnalysisCode MyStatus; |
86 | |
87 | |
88 | }; |
89 | |
90 | |
91 | #include <FairCurve_EnergyOfBatten.lxx> |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | #endif // _FairCurve_EnergyOfBatten_HeaderFile |