Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:23:40

0001 // Created on: 1995-10-18
0002 // Created by: Andre LIEUTIER
0003 // Copyright (c) 1995-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 _Plate_Plate_HeaderFile
0018 #define _Plate_Plate_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <Plate_PinpointConstraint.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <Plate_LinearXYZConstraint.hxx>
0028 #include <Plate_LinearScalarConstraint.hxx>
0029 #include <gp_XYZ.hxx>
0030 #include <NCollection_Array2.hxx>
0031 #include <NCollection_HArray2.hxx>
0032 #include <gp_XY.hxx>
0033 #include <Message_ProgressScope.hxx>
0034 
0035 class Plate_PinpointConstraint;
0036 class Plate_LinearXYZConstraint;
0037 class Plate_LinearScalarConstraint;
0038 class Plate_GlobalTranslationConstraint;
0039 class Plate_LineConstraint;
0040 class Plate_PlaneConstraint;
0041 class Plate_SampledCurveConstraint;
0042 class Plate_GtoCConstraint;
0043 class Plate_FreeGtoCConstraint;
0044 class gp_XYZ;
0045 class gp_XY;
0046 class math_Matrix;
0047 
0048 //! This class implement a variational spline algorithm able
0049 //! to define a two variable function satisfying some constraints
0050 //! and minimizing an energy like criterion.
0051 class Plate_Plate
0052 {
0053 public:
0054   DEFINE_STANDARD_ALLOC
0055 
0056   Standard_EXPORT Plate_Plate();
0057 
0058   Standard_EXPORT Plate_Plate(const Plate_Plate& Ref);
0059 
0060   Standard_EXPORT Plate_Plate& Copy(const Plate_Plate& Ref);
0061 
0062   Plate_Plate& operator=(const Plate_Plate& Ref) { return Copy(Ref); }
0063 
0064   Standard_EXPORT void Load(const Plate_PinpointConstraint& PConst);
0065 
0066   Standard_EXPORT void Load(const Plate_LinearXYZConstraint& LXYZConst);
0067 
0068   Standard_EXPORT void Load(const Plate_LinearScalarConstraint& LScalarConst);
0069 
0070   Standard_EXPORT void Load(const Plate_GlobalTranslationConstraint& GTConst);
0071 
0072   Standard_EXPORT void Load(const Plate_LineConstraint& LConst);
0073 
0074   Standard_EXPORT void Load(const Plate_PlaneConstraint& PConst);
0075 
0076   Standard_EXPORT void Load(const Plate_SampledCurveConstraint& SCConst);
0077 
0078   Standard_EXPORT void Load(const Plate_GtoCConstraint& GtoCConst);
0079 
0080   Standard_EXPORT void Load(const Plate_FreeGtoCConstraint& FGtoCConst);
0081 
0082   Standard_EXPORT void SolveTI(const int                    ord         = 4,
0083                                const double                 anisotropie = 1.0,
0084                                const Message_ProgressRange& theProgress = Message_ProgressRange());
0085 
0086   //! returns True if all has been correctly done.
0087   Standard_EXPORT bool IsDone() const;
0088 
0089   Standard_EXPORT void destroy();
0090 
0091   ~Plate_Plate() { destroy(); }
0092 
0093   //! reset the Plate in the initial state
0094   //! ( same as after Create())
0095   Standard_EXPORT void Init();
0096 
0097   Standard_EXPORT gp_XYZ Evaluate(const gp_XY& point2d) const;
0098 
0099   Standard_EXPORT gp_XYZ EvaluateDerivative(const gp_XY& point2d, const int iu, const int iv) const;
0100 
0101   //! Returns the coefficients of the polynomial part of the Plate function.
0102   //! @return 2D array of polynomial coefficients as XYZ values
0103   [[nodiscard]] Standard_EXPORT occ::handle<NCollection_HArray2<gp_XYZ>> CoefPol() const;
0104 
0105   //! @deprecated Use CoefPol() returning handle by value instead.
0106   Standard_DEPRECATED("Use CoefPol() returning handle by value instead")
0107   Standard_EXPORT void CoefPol(occ::handle<NCollection_HArray2<gp_XYZ>>& Coefs) const;
0108 
0109   Standard_EXPORT void SetPolynomialPartOnly(const bool PPOnly = true);
0110 
0111   Standard_EXPORT int Continuity() const;
0112 
0113   Standard_EXPORT void UVBox(double& UMin, double& UMax, double& VMin, double& VMax) const;
0114 
0115   Standard_EXPORT void UVConstraints(NCollection_Sequence<gp_XY>& Seq) const;
0116 
0117 private:
0118   Standard_EXPORT double SolEm(const gp_XY& point2d, const int iu, const int iv) const;
0119 
0120   double Polm(const gp_XY& point2d, const int iu, const int iv, const int idu, const int idv) const;
0121 
0122   int& Deru(const int index) const;
0123 
0124   int& Derv(const int index) const;
0125 
0126   gp_XYZ& Solution(const int index) const;
0127 
0128   gp_XY& Points(const int index) const;
0129 
0130   Standard_EXPORT void SolveTI1(const int                    IterationNumber,
0131                                 const Message_ProgressRange& theProgress = Message_ProgressRange());
0132 
0133   Standard_EXPORT void SolveTI2(const int                    IterationNumber,
0134                                 const Message_ProgressRange& theProgress = Message_ProgressRange());
0135 
0136   Standard_EXPORT void SolveTI3(const int                    IterationNumber,
0137                                 const Message_ProgressRange& theProgress = Message_ProgressRange());
0138 
0139   Standard_EXPORT void fillXYZmatrix(math_Matrix& mat,
0140                                      const int    i0,
0141                                      const int    j0,
0142                                      const int    ncc1,
0143                                      const int    ncc2) const;
0144 
0145   int                                                order;
0146   int                                                n_el;
0147   int                                                n_dim;
0148   void*                                              solution;
0149   void*                                              points;
0150   void*                                              deru;
0151   void*                                              derv;
0152   bool                                               OK;
0153   NCollection_Sequence<Plate_PinpointConstraint>     myConstraints;
0154   NCollection_Sequence<Plate_LinearXYZConstraint>    myLXYZConstraints;
0155   NCollection_Sequence<Plate_LinearScalarConstraint> myLScalarConstraints;
0156   double                                             ddu[10];
0157   double                                             ddv[10];
0158   int                                                maxConstraintOrder;
0159   bool                                               PolynomialPartOnly;
0160   double                                             Uold;
0161   double                                             Vold;
0162   double                                             U2;
0163   double                                             R;
0164   double                                             L;
0165 };
0166 
0167 #include <Plate_Plate.lxx>
0168 
0169 #endif // _Plate_Plate_HeaderFile