Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:19:58

0001 // Created on: 1996-02-01
0002 // Created by: Philippe MANGIN
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _FairCurve_EnergyOfBatten_HeaderFile
0018 #define _FairCurve_EnergyOfBatten_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 #include <FairCurve_DistributionOfTension.hxx>
0026 #include <FairCurve_DistributionOfSagging.hxx>
0027 #include <FairCurve_AnalysisCode.hxx>
0028 #include <FairCurve_Energy.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <NCollection_Array1.hxx>
0031 #include <NCollection_HArray1.hxx>
0032 #include <gp_Pnt2d.hxx>
0033 #include <Standard_Boolean.hxx>
0034 #include <math_Vector.hxx>
0035 
0036 // resolve name collisions with X11 headers
0037 #ifdef Status
0038   #undef Status
0039 #endif
0040 
0041 //! Energy Criterium to minimize in Batten.
0042 class FairCurve_EnergyOfBatten : public FairCurve_Energy
0043 {
0044 public:
0045   DEFINE_STANDARD_ALLOC
0046 
0047   //! Angles correspond to the Ox axis
0048   Standard_EXPORT FairCurve_EnergyOfBatten(
0049     const int                                         BSplOrder,
0050     const occ::handle<NCollection_HArray1<double>>&   FlatKnots,
0051     const occ::handle<NCollection_HArray1<gp_Pnt2d>>& Poles,
0052     const int                                         ContrOrder1,
0053     const int                                         ContrOrder2,
0054     const FairCurve_BattenLaw&                        Law,
0055     const double                                      LengthSliding,
0056     const bool                                        FreeSliding = true,
0057     const double                                      Angle1      = 0,
0058     const double                                      Angle2      = 0);
0059 
0060   //! return the lengthSliding = P1P2 + Sliding
0061   double LengthSliding() const;
0062 
0063   //! return the status
0064   FairCurve_AnalysisCode Status() const;
0065 
0066   //! compute the variables <X> which correspond with the field <MyPoles>
0067   Standard_EXPORT bool Variable(math_Vector& X) const override;
0068 
0069 protected:
0070   //! compute the poles which correspond with the variable X
0071   Standard_EXPORT void ComputePoles(const math_Vector& X) override;
0072 
0073   //! compute the energy in intermediate format
0074   Standard_EXPORT bool Compute(const int DerivativeOrder, math_Vector& Result) override;
0075 
0076 private:
0077   double                          MyLengthSliding;
0078   double                          OriginalSliding;
0079   FairCurve_BattenLaw             MyBattenLaw;
0080   FairCurve_DistributionOfTension MyTension;
0081   FairCurve_DistributionOfSagging MySagging;
0082   FairCurve_AnalysisCode          MyStatus;
0083 };
0084 
0085 #include <FairCurve_EnergyOfBatten.lxx>
0086 
0087 #endif // _FairCurve_EnergyOfBatten_HeaderFile