// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _AppDef_TheVariational_HeaderFile
#define _AppDef_TheVariational_HeaderFile

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

#ifndef _AppDef_MultiLine_HeaderFile
#include <AppDef_MultiLine.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfReal_HeaderFile
#include <Handle_TColStd_HArray1OfReal.hxx>
#endif
#ifndef _Handle_AppParCurves_HArray1OfConstraintCouple_HeaderFile
#include <Handle_AppParCurves_HArray1OfConstraintCouple.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfInteger_HeaderFile
#include <Handle_TColStd_HArray1OfInteger.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_AppParCurves_SmoothCriterion_HeaderFile
#include <Handle_AppParCurves_SmoothCriterion.hxx>
#endif
#ifndef _AppParCurves_MultiBSpCurve_HeaderFile
#include <AppParCurves_MultiBSpCurve.hxx>
#endif
#ifndef _Handle_AppDef_MyCriterionOfTheVariational_HeaderFile
#include <Handle_AppDef_MyCriterionOfTheVariational.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
#ifndef _Handle_FEmTool_Curve_HeaderFile
#include <Handle_FEmTool_Curve.hxx>
#endif
#ifndef _Handle_PLib_Base_HeaderFile
#include <Handle_PLib_Base.hxx>
#endif
#ifndef _AppParCurves_Constraint_HeaderFile
#include <AppParCurves_Constraint.hxx>
#endif
class TColStd_HArray1OfReal;
class AppParCurves_HArray1OfConstraintCouple;
class TColStd_HArray1OfInteger;
class AppParCurves_SmoothCriterion;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class gp_VectorWithNullMagnitude;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyCriterionOfTheVariational;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class FEmTool_Curve;
class TColStd_Array1OfReal;
class FEmTool_Assembly;
class math_Vector;
class PLib_Base;



class AppDef_TheVariational  {
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   AppDef_TheVariational(const AppDef_MultiLine& SSP,const Standard_Integer FirstPoint,const Standard_Integer LastPoint,const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints,const Standard_Integer MaxDegree = 14,const Standard_Integer MaxSegment = 100,const GeomAbs_Shape Continuity = GeomAbs_C2,const Standard_Boolean WithMinMax = Standard_False,const Standard_Boolean WithCutting = Standard_True,const Standard_Real Tolerance = 1.0,const Standard_Integer NbIterations = 2);
  
  Standard_EXPORT     void Approximate() ;
  
  Standard_EXPORT     Standard_Boolean IsCreated() const;
  
  Standard_EXPORT     Standard_Boolean IsDone() const;
  
  Standard_EXPORT     Standard_Boolean IsOverConstrained() const;
  
  Standard_EXPORT     AppParCurves_MultiBSpCurve Value() const;
  
  Standard_EXPORT     Standard_Real MaxError() const;
  
  Standard_EXPORT     Standard_Integer MaxErrorIndex() const;
  
  Standard_EXPORT     Standard_Real QuadraticError() const;
  
  Standard_EXPORT     void Distance(math_Matrix& mat) ;
  
  Standard_EXPORT     Standard_Real AverageError() const;
  
  Standard_EXPORT    const Handle_TColStd_HArray1OfReal& Parameters() const;
  
  Standard_EXPORT    const Handle_TColStd_HArray1OfReal& Knots() const;
  
  Standard_EXPORT     void Criterium(Standard_Real& VFirstOrder,Standard_Real& VSecondOrder,Standard_Real& VThirdOrder) const;
  
  Standard_EXPORT     void CriteriumWeight(Standard_Real& Percent1,Standard_Real& Percent2,Standard_Real& Percent3) const;
  
  Standard_EXPORT     Standard_Integer MaxDegree() const;
  
  Standard_EXPORT     Standard_Integer MaxSegment() const;
  
  Standard_EXPORT     GeomAbs_Shape Continuity() const;
  
  Standard_EXPORT     Standard_Boolean WithMinMax() const;
  
  Standard_EXPORT     Standard_Boolean WithCutting() const;
  
  Standard_EXPORT     Standard_Real Tolerance() const;
  
  Standard_EXPORT     Standard_Integer NbIterations() const;
  
  Standard_EXPORT     void Dump(Standard_OStream& o) const;
  
  Standard_EXPORT     Standard_Boolean SetConstraints(const Handle(AppParCurves_HArray1OfConstraintCouple)& aConstrainst) ;
  
  Standard_EXPORT     void SetParameters(const Handle(TColStd_HArray1OfReal)& param) ;
  
  Standard_EXPORT     Standard_Boolean SetKnots(const Handle(TColStd_HArray1OfReal)& knots) ;
  
  Standard_EXPORT     Standard_Boolean SetMaxDegree(const Standard_Integer Degree) ;
  
  Standard_EXPORT     Standard_Boolean SetMaxSegment(const Standard_Integer NbSegment) ;
  
  Standard_EXPORT     Standard_Boolean SetContinuity(const GeomAbs_Shape C) ;
  
  Standard_EXPORT     void SetWithMinMax(const Standard_Boolean MinMax) ;
  
  Standard_EXPORT     Standard_Boolean SetWithCutting(const Standard_Boolean Cutting) ;
  
  Standard_EXPORT     void SetCriteriumWeight(const Standard_Real Percent1,const Standard_Real Percent2,const Standard_Real Percent3) ;
  
  Standard_EXPORT     void SetCriteriumWeight(const Standard_Integer Order,const Standard_Real Percent) ;
  
  Standard_EXPORT     void SetTolerance(const Standard_Real Tol) ;
  
  Standard_EXPORT     void SetNbIterations(const Standard_Integer Iter) ;





protected:





private:

  
  Standard_EXPORT     void TheMotor(Handle(AppParCurves_SmoothCriterion)& J,const Standard_Real WQuadratic,const Standard_Real WQuality,Handle(FEmTool_Curve)& TheCurve,TColStd_Array1OfReal& Ecarts) ;
  
  Standard_EXPORT     void Adjusting(Handle(AppParCurves_SmoothCriterion)& J,Standard_Real& WQuadratic,Standard_Real& WQuality,Handle(FEmTool_Curve)& TheCurve,TColStd_Array1OfReal& Ecarts) ;
  
  Standard_EXPORT     void Optimization(Handle(AppParCurves_SmoothCriterion)& J,FEmTool_Assembly& A,const Standard_Boolean ToAssemble,const Standard_Real EpsDeg,Handle(FEmTool_Curve)& Curve,const TColStd_Array1OfReal& Parameters) const;
  
  Standard_EXPORT     void Project(const Handle(FEmTool_Curve)& C,const TColStd_Array1OfReal& Ti,TColStd_Array1OfReal& ProjTi,TColStd_Array1OfReal& Distance,Standard_Integer& NumPoints,Standard_Real& MaxErr,Standard_Real& QuaErr,Standard_Real& AveErr,const Standard_Integer NbIterations = 2) const;
  
  Standard_EXPORT     void ACR(Handle(FEmTool_Curve)& Curve,TColStd_Array1OfReal& Ti,const Standard_Integer Decima) const;
  
  Standard_EXPORT     void SplitCurve(const Handle(FEmTool_Curve)& InCurve,const TColStd_Array1OfReal& Ti,const Standard_Real CurveTol,Handle(FEmTool_Curve)& OutCurve,Standard_Boolean& iscut) const;
  
  Standard_EXPORT     void Init() ;
  
  Standard_EXPORT     void InitSmoothCriterion() ;
  
  Standard_EXPORT     void InitParameters(Standard_Real& Length) ;
  
  Standard_EXPORT     void InitCriterionEstimations(const Standard_Real Length,Standard_Real& J1,Standard_Real& J2,Standard_Real& J3) const;
  
  Standard_EXPORT     void EstTangent(const Standard_Integer ipnt,math_Vector& VTang) const;
  
  Standard_EXPORT     void EstSecnd(const Standard_Integer ipnt,const math_Vector& VTang1,const math_Vector& VTang2,const Standard_Real Length,math_Vector& VScnd) const;
  
  Standard_EXPORT     void InitCutting(const Handle(PLib_Base)& aBase,const Standard_Real CurvTol,Handle(FEmTool_Curve)& aCurve) const;
  
  Standard_EXPORT     void AssemblingConstraints(const Handle(FEmTool_Curve)& Curve,const TColStd_Array1OfReal& Parameters,const Standard_Real CBLONG,FEmTool_Assembly& A) const;
  
  Standard_EXPORT     Standard_Boolean InitTthetaF(const Standard_Integer ndimen,const AppParCurves_Constraint typcon,const Standard_Integer begin,const Standard_Integer jndex) ;


AppDef_MultiLine mySSP;
Standard_Integer myNbP3d;
Standard_Integer myNbP2d;
Standard_Integer myDimension;
Standard_Integer myFirstPoint;
Standard_Integer myLastPoint;
Standard_Integer myNbPoints;
Handle_TColStd_HArray1OfReal myTabPoints;
Handle_AppParCurves_HArray1OfConstraintCouple myConstraints;
Standard_Integer myNbConstraints;
Handle_TColStd_HArray1OfReal myTabConstraints;
Standard_Integer myNbPassPoints;
Standard_Integer myNbTangPoints;
Standard_Integer myNbCurvPoints;
Handle_TColStd_HArray1OfInteger myTypConstraints;
Handle_TColStd_HArray1OfReal myTtheta;
Handle_TColStd_HArray1OfReal myTfthet;
Standard_Integer myMaxDegree;
Standard_Integer myMaxSegment;
Standard_Integer myNbIterations;
Standard_Real myTolerance;
GeomAbs_Shape myContinuity;
Standard_Integer myNivCont;
Standard_Boolean myWithMinMax;
Standard_Boolean myWithCutting;
Standard_Real myPercent[3];
Standard_Real myCriterium[4];
Handle_AppParCurves_SmoothCriterion mySmoothCriterion;
Handle_TColStd_HArray1OfReal myParameters;
Handle_TColStd_HArray1OfReal myKnots;
AppParCurves_MultiBSpCurve myMBSpCurve;
Standard_Real myMaxError;
Standard_Integer myMaxErrorIndex;
Standard_Real myAverageError;
Standard_Boolean myIsCreated;
Standard_Boolean myIsDone;
Standard_Boolean myIsOverConstr;


};





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


#endif
