// File generated by CPPExt (Value)
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _Plate_Plate_HeaderFile
#define _Plate_Plate_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Plate_SequenceOfPinpointConstraint_HeaderFile
#include <Plate_SequenceOfPinpointConstraint.hxx>
#endif
#ifndef _Plate_SequenceOfLinearXYZConstraint_HeaderFile
#include <Plate_SequenceOfLinearXYZConstraint.hxx>
#endif
#ifndef _Plate_SequenceOfLinearScalarConstraint_HeaderFile
#include <Plate_SequenceOfLinearScalarConstraint.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_TColgp_HArray2OfXYZ_HeaderFile
#include <Handle_TColgp_HArray2OfXYZ.hxx>
#endif
class Plate_PinpointConstraint;
class Plate_LinearXYZConstraint;
class Plate_LinearScalarConstraint;
class Plate_GlobalTranslationConstraint;
class Plate_LineConstraint;
class Plate_PlaneConstraint;
class Plate_SampledCurveConstraint;
class Plate_GtoCConstraint;
class Plate_FreeGtoCConstraint;
class gp_XYZ;
class gp_XY;
class TColgp_HArray2OfXYZ;
class TColgp_SequenceOfXY;
class math_Matrix;


//! This class implement a variationnal spline algorithm able <br>
//!          to define a two variable function satisfying some constraints <br>
//!          and minimizing an energy like criterion. <br>
class Plate_Plate  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
  Standard_EXPORT   Plate_Plate();
  
  Standard_EXPORT   Plate_Plate(const Plate_Plate& Ref);
  
  Standard_EXPORT     Plate_Plate& Copy(const Plate_Plate& Ref) ;
    Plate_Plate& operator=(const Plate_Plate& Ref) 
{
  return Copy(Ref);
}
  
  Standard_EXPORT     void Load(const Plate_PinpointConstraint& PConst) ;
  
  Standard_EXPORT     void Load(const Plate_LinearXYZConstraint& LXYZConst) ;
  
  Standard_EXPORT     void Load(const Plate_LinearScalarConstraint& LScalarConst) ;
  
  Standard_EXPORT     void Load(const Plate_GlobalTranslationConstraint& GTConst) ;
  
  Standard_EXPORT     void Load(const Plate_LineConstraint& LConst) ;
  
  Standard_EXPORT     void Load(const Plate_PlaneConstraint& PConst) ;
  
  Standard_EXPORT     void Load(const Plate_SampledCurveConstraint& SCConst) ;
  
  Standard_EXPORT     void Load(const Plate_GtoCConstraint& GtoCConst) ;
  
  Standard_EXPORT     void Load(const Plate_FreeGtoCConstraint& FGtoCConst) ;
  
  Standard_EXPORT     void SolveTI(const Standard_Integer ord = 4,const Standard_Real anisotropie = 1.0) ;
  //! returns True if all has been correctly done. <br>
  Standard_EXPORT     Standard_Boolean IsDone() const;
  
  Standard_EXPORT     void destroy() ;
~Plate_Plate()
{
  destroy();
}
  //! reset the Plate in the initial state <br>
//!           ( same as after Create()) <br>
  Standard_EXPORT     void Init() ;
  
  Standard_EXPORT     gp_XYZ Evaluate(const gp_XY& point2d) const;
  
  Standard_EXPORT     gp_XYZ EvaluateDerivative(const gp_XY& point2d,const Standard_Integer iu,const Standard_Integer iv) const;
  
  Standard_EXPORT     void CoefPol(Handle(TColgp_HArray2OfXYZ)& Coefs) const;
  
  Standard_EXPORT     void SetPolynomialPartOnly(const Standard_Boolean PPOnly = Standard_True) ;
  
  Standard_EXPORT     Standard_Integer Continuity() const;
  
  Standard_EXPORT     void UVBox(Standard_Real& UMin,Standard_Real& UMax,Standard_Real& VMin,Standard_Real& VMax) const;
  
  Standard_EXPORT     void UVConstraints(TColgp_SequenceOfXY& Seq) const;





protected:





private:

  
  Standard_EXPORT     Standard_Real SolEm(const gp_XY& point2d,const Standard_Integer iu,const Standard_Integer iv) const;
  
        Standard_Real Polm(const gp_XY& point2d,const Standard_Integer iu,const Standard_Integer iv,const Standard_Integer idu,const Standard_Integer idv) const;
  
        Standard_Integer& Deru(const Standard_Integer index) const;
  
        Standard_Integer& Derv(const Standard_Integer index) const;
  
        gp_XYZ& Solution(const Standard_Integer index) const;
  
        gp_XY& Points(const Standard_Integer index) const;
  
  Standard_EXPORT     void SolveTI1(const Standard_Integer IterationNumber) ;
  
  Standard_EXPORT     void SolveTI2(const Standard_Integer IterationNumber) ;
  
  Standard_EXPORT     void SolveTI3(const Standard_Integer IterationNumber) ;
  
  Standard_EXPORT     void fillXYZmatrix(math_Matrix& mat,const Standard_Integer i0,const Standard_Integer j0,const Standard_Integer ncc1,const Standard_Integer ncc2) const;


Standard_Integer order;
Standard_Integer n_el;
Standard_Integer n_dim;
Standard_Address solution;
Standard_Address points;
Standard_Address deru;
Standard_Address derv;
Standard_Boolean OK;
Plate_SequenceOfPinpointConstraint myConstraints;
Plate_SequenceOfLinearXYZConstraint myLXYZConstraints;
Plate_SequenceOfLinearScalarConstraint myLScalarConstraints;
Standard_Real ddu[10];
Standard_Real ddv[10];
Standard_Integer maxConstraintOrder;
Standard_Boolean PolynomialPartOnly;
Standard_Real Uold;
Standard_Real Vold;
Standard_Real U2;
Standard_Real R;
Standard_Real L;


};


#include <Plate_Plate.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif
