1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,101 +0,0 @@
-- Created on: 1991-12-02
-- Created by: Laurent PAINNOT
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- 06/06/96 : JPI : ajout Variational
package AppDef
---Purpose: This package describes all the classes needed to approximate
-- points in Bezier curves. It is used in the package
-- AppParCurves.
-- The points of the same range for the approximation are
-- organised in MultiPointConstraints. These MultiPointConstraints
--
-- are organized in a MultiLine.
-- The corresponding result of a MultiLine approximation is
-- a MultiCurve (set of Bezier curves) which has the same
-- structure as a MultiLine: The MultiCurve is a set of
-- MultiPoint.
-- A point of a MultiLine can have many significations: the approximation curve
-- can go through this point or not, can have a given tangency, or can
-- have a given curvature.
-- Note: a CurvaturePoint is also a PassPoint and a TangencyPoint.
-- A TangencyPoint is also a PassPoint.
uses AppParCurves, Approx, gp, TColgp, TCollection, Standard, MMgt, math, FEmTool, TColStd, GeomAbs, PLib
is
class MultiPointConstraint;
class MultiLine;
class MyLineTool;
deferred class SmoothCriterion;
class LinearCriteria;
class Variational;
--- Classes instanciees:
class TheLeastSquares instantiates LeastSquare from AppParCurves
(MultiLine from AppDef,
MyLineTool from AppDef);
class TheResol instantiates ResolConstraint from AppParCurves
(MultiLine from AppDef,
MyLineTool from AppDef);
class TheFunction instantiates Function from AppParCurves
(MultiLine from AppDef,
MyLineTool from AppDef,
TheLeastSquares from AppDef,
TheResol from AppDef);
class TheGradient instantiates Gradient from AppParCurves
(MultiLine from AppDef,
MyLineTool from AppDef);
class Compute instantiates ComputeLine from Approx
(MultiLine from AppDef,
MyLineTool from AppDef);
class BSplineCompute instantiates BSplComputeLine from Approx
(MultiLine from AppDef,
MyLineTool from AppDef);
imported Array1OfMultiPointConstraint;
imported transient class HArray1OfMultiPointConstraint;
end AppDef;

View File

@@ -0,0 +1,74 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile
#define _AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <math_BFGS.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyBSplGradientOfBSplineCompute;
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
class math_MultipleVarFunctionWithGradient;
class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute : public math_BFGS
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint, const Standard_Real Tolerance3d, const Standard_Real Tolerance2d, const Standard_Real Eps, const Standard_Integer NbIterations = 200);
Standard_EXPORT virtual Standard_Boolean IsSolutionReached (math_MultipleVarFunctionWithGradient& F) const Standard_OVERRIDE;
protected:
private:
Standard_Real myTol3d;
Standard_Real myTol2d;
};
#endif // _AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,40 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_BSpParLeastSquare AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpParLeastSquare_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpParFunction AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpParFunction_hxx <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpGradient_BFGS AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpGradient_BFGS_hxx <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpGradient AppDef_MyBSplGradientOfBSplineCompute
#define AppParCurves_BSpGradient_hxx <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_BSpGradient_BFGS.gxx>

View File

@@ -0,0 +1,140 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile
#define _AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <math_IntegerVector.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute : public math_MultipleVarFunctionWithGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer NbPol);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
Standard_EXPORT const math_Vector& NewParameters() const;
Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue();
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex);
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT const math_IntegerVector& Index() const;
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
Standard_EXPORT void SetFirstLambda (const Standard_Real l1);
Standard_EXPORT void SetLastLambda (const Standard_Real l2);
protected:
Standard_EXPORT void Perform (const math_Vector& X);
private:
Standard_Boolean Done;
AppDef_MultiLine MyMultiLine;
AppParCurves_MultiBSpCurve MyMultiBSpCurve;
Standard_Integer nbpoles;
math_Vector myParameters;
Standard_Real FVal;
math_Vector ValGrad_F;
math_Matrix MyF;
math_Matrix PTLX;
math_Matrix PTLY;
math_Matrix PTLZ;
math_Matrix A;
math_Matrix DA;
AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute MyLeastSquare;
Standard_Boolean Contraintes;
Standard_Integer NbP;
Standard_Integer NbCu;
Standard_Integer Adeb;
Standard_Integer Afin;
Handle(TColStd_HArray1OfInteger) tabdim;
Standard_Real ERR3d;
Standard_Real ERR2d;
Standard_Integer FirstP;
Standard_Integer LastP;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
Standard_Real mylambda1;
Standard_Real mylambda2;
};
#endif // _AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,35 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define Squares AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define Squares_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpFunction AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpFunction_hxx <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_BSpFunction.gxx>

View File

@@ -0,0 +1,175 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile
#define _AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_Constraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT void Perform (const math_Vector& Parameters);
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT const math_Matrix& Distance();
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT Standard_Real FirstLambda() const;
Standard_EXPORT Standard_Real LastLambda() const;
Standard_EXPORT const math_Matrix& Points() const;
Standard_EXPORT const math_Matrix& Poles() const;
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc);
Standard_EXPORT void ComputeFunction (const math_Vector& Parameters);
Standard_EXPORT void SearchIndex (math_IntegerVector& Index);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
Standard_EXPORT void MakeTAA (math_Vector& TheA);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_LeastSquare AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define AppParCurves_LeastSquare_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_LeastSquare.gxx>

View File

@@ -0,0 +1,167 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_BSplineCompute_HeaderFile
#define _AppDef_BSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <Standard_Boolean.hxx>
#include <Approx_ParametrizationType.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <AppParCurves_Constraint.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyBSplGradientOfBSplineCompute;
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute;
class AppDef_MyGradientbisOfBSplineCompute;
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute;
class AppParCurves_MultiBSpCurve;
class AppParCurves_MultiCurve;
class AppDef_BSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_BSplineCompute(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_BSplineCompute(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT void Interpol (const AppDef_MultiLine& Line);
Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
Standard_EXPORT void SetParameters (const math_Vector& ThePar);
Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots);
Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
Standard_EXPORT void SetContinuity (const Standard_Integer C);
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const;
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue();
Standard_EXPORT const TColStd_Array1OfReal& Parameters() const;
protected:
private:
Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, const TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults);
Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const;
Standard_EXPORT Standard_Real SearchLastLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const;
Standard_EXPORT void TangencyVector (const AppDef_MultiLine& Line, const AppParCurves_MultiCurve& C, const Standard_Real U, math_Vector& V) const;
Standard_EXPORT void FirstTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
Standard_EXPORT void LastTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
Standard_EXPORT void FindRealConstraints (const AppDef_MultiLine& Line);
AppParCurves_MultiBSpCurve TheMultiBSpCurve;
Standard_Boolean alldone;
Standard_Boolean tolreached;
Approx_ParametrizationType Par;
Handle(TColStd_HArray1OfReal) myParameters;
Handle(TColStd_HArray1OfReal) myfirstParam;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
Standard_Boolean myhasknots;
Standard_Boolean myhasmults;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
Standard_Integer mydegremin;
Standard_Integer mydegremax;
Standard_Real mytol3d;
Standard_Real mytol2d;
Standard_Real currenttol3d;
Standard_Real currenttol2d;
Standard_Boolean mycut;
Standard_Boolean mysquares;
Standard_Integer myitermax;
AppParCurves_Constraint myfirstC;
AppParCurves_Constraint mylastC;
AppParCurves_Constraint realfirstC;
AppParCurves_Constraint reallastC;
Standard_Integer mycont;
Standard_Real mylambda1;
Standard_Real mylambda2;
};
#endif // _AppDef_BSplineCompute_HeaderFile

View File

@@ -0,0 +1,73 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_BSplineCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_MyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define LineTool AppDef_MyLineTool
#define LineTool_hxx <AppDef_MyLineTool.hxx>
#define Approx_MyBSplGradient AppDef_MyBSplGradientOfBSplineCompute
#define Approx_MyBSplGradient_hxx <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpParLeastSquareOfMyBSplGradient AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define Approx_BSpParLeastSquareOfMyBSplGradient_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpParFunctionOfMyBSplGradient AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
#define Approx_BSpParFunctionOfMyBSplGradient_hxx <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpGradient_BFGSOfMyBSplGradient AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute
#define Approx_BSpGradient_BFGSOfMyBSplGradient_hxx <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpParLeastSquareOfMyBSplGradient AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define Approx_BSpParLeastSquareOfMyBSplGradient_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpParFunctionOfMyBSplGradient AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
#define Approx_BSpParFunctionOfMyBSplGradient_hxx <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_BSpGradient_BFGSOfMyBSplGradient AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute
#define Approx_BSpGradient_BFGSOfMyBSplGradient_hxx <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#define Approx_MyGradientbis AppDef_MyGradientbisOfBSplineCompute
#define Approx_MyGradientbis_hxx <AppDef_MyGradientbisOfBSplineCompute.hxx>
#define Approx_ParLeastSquareOfMyGradientbis AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define Approx_ParLeastSquareOfMyGradientbis_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_ResConstraintOfMyGradientbis AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define Approx_ResConstraintOfMyGradientbis_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_ParFunctionOfMyGradientbis AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
#define Approx_ParFunctionOfMyGradientbis_hxx <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_Gradient_BFGSOfMyGradientbis AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute
#define Approx_Gradient_BFGSOfMyGradientbis_hxx <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_ParLeastSquareOfMyGradientbis AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define Approx_ParLeastSquareOfMyGradientbis_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_ResConstraintOfMyGradientbis AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define Approx_ResConstraintOfMyGradientbis_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_ParFunctionOfMyGradientbis AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
#define Approx_ParFunctionOfMyGradientbis_hxx <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_Gradient_BFGSOfMyGradientbis AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute
#define Approx_Gradient_BFGSOfMyGradientbis_hxx <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#define Approx_BSplComputeLine AppDef_BSplineCompute
#define Approx_BSplComputeLine_hxx <AppDef_BSplineCompute.hxx>
#include <Approx_BSplComputeLine.gxx>

View File

@@ -0,0 +1,155 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_Compute_HeaderFile
#define _AppDef_Compute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_SequenceOfMultiCurve.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <Standard_Boolean.hxx>
#include <Approx_ParametrizationType.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Approx_SequenceOfHArray1OfReal.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <AppParCurves_Constraint.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array1OfReal.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyGradientOfCompute;
class AppDef_ParLeastSquareOfMyGradientOfCompute;
class AppDef_ResConstraintOfMyGradientOfCompute;
class AppDef_ParFunctionOfMyGradientOfCompute;
class AppDef_Gradient_BFGSOfMyGradientOfCompute;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class AppDef_Compute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_Compute(const AppDef_MultiLine& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_Compute(const AppDef_MultiLine& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_Compute(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT AppDef_Compute(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False);
Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
Standard_EXPORT Standard_Integer NbMultiCurves() const;
Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
protected:
private:
Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const;
Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
Standard_EXPORT Standard_Real SearchLastLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const;
Standard_EXPORT void FirstTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
Standard_EXPORT void LastTangencyVector (const AppDef_MultiLine& Line, const Standard_Integer index, math_Vector& V) const;
AppParCurves_SequenceOfMultiCurve myMultiCurves;
AppParCurves_MultiCurve TheMultiCurve;
AppParCurves_MultiBSpCurve myspline;
Standard_Boolean alldone;
Standard_Boolean tolreached;
Approx_ParametrizationType Par;
Handle(TColStd_HArray1OfReal) myParameters;
Handle(TColStd_HArray1OfReal) myfirstParam;
Approx_SequenceOfHArray1OfReal myPar;
TColStd_SequenceOfReal Tolers3d;
TColStd_SequenceOfReal Tolers2d;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
Standard_Integer mydegremin;
Standard_Integer mydegremax;
Standard_Real mytol3d;
Standard_Real mytol2d;
Standard_Real currenttol3d;
Standard_Real currenttol2d;
Standard_Boolean mycut;
Standard_Boolean mysquares;
Standard_Integer myitermax;
AppParCurves_Constraint myfirstC;
AppParCurves_Constraint mylastC;
Standard_Integer myMultiLineNb;
Standard_Boolean myIsClear;
};
#endif // _AppDef_Compute_HeaderFile

View File

@@ -0,0 +1,55 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_Compute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_MyGradientOfCompute.hxx>
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#include <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define LineTool AppDef_MyLineTool
#define LineTool_hxx <AppDef_MyLineTool.hxx>
#define Approx_MyGradient AppDef_MyGradientOfCompute
#define Approx_MyGradient_hxx <AppDef_MyGradientOfCompute.hxx>
#define Approx_ParLeastSquareOfMyGradient AppDef_ParLeastSquareOfMyGradientOfCompute
#define Approx_ParLeastSquareOfMyGradient_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#define Approx_ResConstraintOfMyGradient AppDef_ResConstraintOfMyGradientOfCompute
#define Approx_ResConstraintOfMyGradient_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#define Approx_ParFunctionOfMyGradient AppDef_ParFunctionOfMyGradientOfCompute
#define Approx_ParFunctionOfMyGradient_hxx <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#define Approx_Gradient_BFGSOfMyGradient AppDef_Gradient_BFGSOfMyGradientOfCompute
#define Approx_Gradient_BFGSOfMyGradient_hxx <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#define Approx_ParLeastSquareOfMyGradient AppDef_ParLeastSquareOfMyGradientOfCompute
#define Approx_ParLeastSquareOfMyGradient_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#define Approx_ResConstraintOfMyGradient AppDef_ResConstraintOfMyGradientOfCompute
#define Approx_ResConstraintOfMyGradient_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#define Approx_ParFunctionOfMyGradient AppDef_ParFunctionOfMyGradientOfCompute
#define Approx_ParFunctionOfMyGradient_hxx <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#define Approx_Gradient_BFGSOfMyGradient AppDef_Gradient_BFGSOfMyGradientOfCompute
#define Approx_Gradient_BFGSOfMyGradient_hxx <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#define Approx_ComputeLine AppDef_Compute
#define Approx_ComputeLine_hxx <AppDef_Compute.hxx>
#include <Approx_ComputeLine.gxx>

View File

@@ -0,0 +1,75 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_Gradient_BFGSOfMyGradientOfCompute_HeaderFile
#define _AppDef_Gradient_BFGSOfMyGradientOfCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <math_BFGS.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyGradientOfCompute;
class AppDef_ParLeastSquareOfMyGradientOfCompute;
class AppDef_ResConstraintOfMyGradientOfCompute;
class AppDef_ParFunctionOfMyGradientOfCompute;
class math_MultipleVarFunctionWithGradient;
class AppDef_Gradient_BFGSOfMyGradientOfCompute : public math_BFGS
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_Gradient_BFGSOfMyGradientOfCompute(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint, const Standard_Real Tolerance3d, const Standard_Real Tolerance2d, const Standard_Real Eps, const Standard_Integer NbIterations = 200);
Standard_EXPORT virtual Standard_Boolean IsSolutionReached (math_MultipleVarFunctionWithGradient& F) const Standard_OVERRIDE;
protected:
private:
Standard_Real myTol3d;
Standard_Real myTol2d;
};
#endif // _AppDef_Gradient_BFGSOfMyGradientOfCompute_HeaderFile

View File

@@ -0,0 +1,43 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_MyGradientOfCompute.hxx>
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientOfCompute
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientOfCompute
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientOfCompute
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientOfCompute
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#define AppParCurves_Gradient AppDef_MyGradientOfCompute
#define AppParCurves_Gradient_hxx <AppDef_MyGradientOfCompute.hxx>
#include <AppParCurves_Gradient_BFGS.gxx>

View File

@@ -0,0 +1,75 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile
#define _AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <math_BFGS.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_MyGradientbisOfBSplineCompute;
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
class math_MultipleVarFunctionWithGradient;
class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute : public math_BFGS
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint, const Standard_Real Tolerance3d, const Standard_Real Tolerance2d, const Standard_Real Eps, const Standard_Integer NbIterations = 200);
Standard_EXPORT virtual Standard_Boolean IsSolutionReached (math_MultipleVarFunctionWithGradient& F) const Standard_OVERRIDE;
protected:
private:
Standard_Real myTol3d;
Standard_Real myTol2d;
};
#endif // _AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,43 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_MyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_Gradient AppDef_MyGradientbisOfBSplineCompute
#define AppParCurves_Gradient_hxx <AppDef_MyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_Gradient_BFGS.gxx>

View File

@@ -0,0 +1,75 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_Gradient_BFGSOfTheGradient_HeaderFile
#define _AppDef_Gradient_BFGSOfTheGradient_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <math_BFGS.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_TheGradient;
class AppDef_ParLeastSquareOfTheGradient;
class AppDef_ResConstraintOfTheGradient;
class AppDef_ParFunctionOfTheGradient;
class math_MultipleVarFunctionWithGradient;
class AppDef_Gradient_BFGSOfTheGradient : public math_BFGS
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_Gradient_BFGSOfTheGradient(math_MultipleVarFunctionWithGradient& F, const math_Vector& StartingPoint, const Standard_Real Tolerance3d, const Standard_Real Tolerance2d, const Standard_Real Eps, const Standard_Integer NbIterations = 200);
Standard_EXPORT virtual Standard_Boolean IsSolutionReached (math_MultipleVarFunctionWithGradient& F) const Standard_OVERRIDE;
protected:
private:
Standard_Real myTol3d;
Standard_Real myTol2d;
};
#endif // _AppDef_Gradient_BFGSOfTheGradient_HeaderFile

View File

@@ -0,0 +1,43 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_Gradient_BFGSOfTheGradient.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_TheGradient.hxx>
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <AppDef_ResConstraintOfTheGradient.hxx>
#include <AppDef_ParFunctionOfTheGradient.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfTheGradient
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfTheGradient.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfTheGradient
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfTheGradient.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfTheGradient
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfTheGradient.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfTheGradient
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfTheGradient.hxx>
#define AppParCurves_Gradient AppDef_TheGradient
#define AppParCurves_Gradient_hxx <AppDef_TheGradient.hxx>
#include <AppParCurves_Gradient_BFGS.gxx>

View File

@@ -1,130 +0,0 @@
-- Created on: 1997-09-11
-- Created by: Philippe MANGIN
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class LinearCriteria from AppDef inherits SmoothCriterion from AppDef
---Purpose: defined an Linear Criteria to used in variational
-- Smoothing of points.
uses
Vector from math,
Matrix from math,
Curve from FEmTool,
HAssemblyTable from FEmTool,
ElementaryCriterion from FEmTool,
HArray2OfInteger from TColStd,
HArray1OfReal from TColStd,
Array1OfReal from TColStd,
MultiLine from AppDef,
MyLineTool from AppDef
raises
NotImplemented,
DomainError
is
Create(SSP: MultiLine from AppDef;
FirstPoint, LastPoint: Integer) returns LinearCriteria;
SetParameters(me : mutable; Parameters : HArray1OfReal);
SetCurve(me : mutable; C :Curve from FEmTool)
is static;
GetCurve(me; C : out Curve from FEmTool)
is static;
SetEstimation(me : mutable; E1, E2, E3 : Real)
is static;
EstLength(me : mutable)
---C++: return &
returns Real is static;
GetEstimation(me; E1, E2, E3 : out Real)
is static;
AssemblyTable(me)
returns HAssemblyTable from FEmTool
is static;
DependenceTable(me)
returns HArray2OfInteger from TColStd
is static;
QualityValues (me : mutable; J1min, J2min, J3min : Real;
J1, J2, J3 : out Real)
returns Integer is static;
ErrorValues(me : mutable;
MaxError, QuadraticError, AverageError : out Real)
is static;
Hessian(me : mutable ;
Element : Integer;
Dimension1 : Integer;
Dimension2 : Integer;
H : out Matrix from math)
raises DomainError -- If DependenceTable(Dimension1,Dimension2) is False
is static;
Gradient(me : mutable;
Element : Integer;
Dimension : Integer;
G : out Vector from math)
is static;
InputVector(me : mutable; X : Vector from math;
AssTable : HAssemblyTable from FEmTool)
---Purpose: Convert the assembly Vector in an Curve;
--
raises DomainError;
SetWeight(me: mutable;
QuadraticWeight, QualityWeight : Real;
percentJ1, percentJ2, percentJ3 : Real)
is static;
GetWeight(me; QuadraticWeight, QualityWeight : out Real)
is static;
SetWeight(me: mutable;
Weight : Array1OfReal)
is static;
BuildCache(me: mutable; E : Integer) is private;
fields
mySSP : MultiLine from AppDef;
myParameters : HArray1OfReal;
myCache : HArray1OfReal;
myCriteria : ElementaryCriterion from FEmTool[3];
myEstimation: Real[3];
myQuadraticWeight, myQualityWeight : Real;
myPercent : Real[3];
myPntWeight : Array1OfReal;
myCurve : Curve from FEmTool;
myLength : Real;
myE : Integer;
IF, IL : Integer;
end LinearCriteria;

View File

@@ -14,23 +14,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_LinearCriteria.ixx>
#include <PLib_Base.hxx>
#include <PLib_JacobiPolynomial.hxx>
#include <PLib_HermitJacobi.hxx>
#include <GeomAbs_Shape.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <FEmTool_LinearTension.hxx>
#include <AppDef_LinearCriteria.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <FEmTool_Curve.hxx>
#include <FEmTool_ElementaryCriterion.hxx>
#include <FEmTool_LinearFlexion.hxx>
#include <FEmTool_LinearJerk.hxx>
#include <FEmTool_LinearTension.hxx>
#include <GeomAbs_Shape.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <math_Gauss.hxx>
#include <math_Matrix.hxx>
#include <PLib_Base.hxx>
#include <PLib_HermitJacobi.hxx>
#include <PLib_JacobiPolynomial.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Pnt.hxx>
#include <math_Matrix.hxx>
#include <math_Gauss.hxx>
#include <AppDef_MyLineTool.hxx>
#include <TColStd_HArray2OfReal.hxx>
static Standard_Integer order(const Handle(PLib_Base)& B)
{

View File

@@ -0,0 +1,125 @@
// Created on: 1997-09-11
// Created by: Philippe MANGIN
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_LinearCriteria_HeaderFile
#define _AppDef_LinearCriteria_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AppDef_MultiLine.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Standard_Real.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Standard_Integer.hxx>
#include <AppDef_SmoothCriterion.hxx>
#include <FEmTool_HAssemblyTable.hxx>
#include <TColStd_HArray2OfInteger.hxx>
#include <math_Vector.hxx>
class FEmTool_ElementaryCriterion;
class FEmTool_Curve;
class Standard_NotImplemented;
class Standard_DomainError;
class AppDef_MultiLine;
class math_Matrix;
class AppDef_LinearCriteria;
DEFINE_STANDARD_HANDLE(AppDef_LinearCriteria, AppDef_SmoothCriterion)
//! defined an Linear Criteria to used in variational
//! Smoothing of points.
class AppDef_LinearCriteria : public AppDef_SmoothCriterion
{
public:
Standard_EXPORT AppDef_LinearCriteria(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& Parameters);
Standard_EXPORT void SetCurve (const Handle(FEmTool_Curve)& C);
Standard_EXPORT void GetCurve (Handle(FEmTool_Curve)& C) const;
Standard_EXPORT void SetEstimation (const Standard_Real E1, const Standard_Real E2, const Standard_Real E3);
Standard_EXPORT Standard_Real& EstLength();
Standard_EXPORT void GetEstimation (Standard_Real& E1, Standard_Real& E2, Standard_Real& E3) const;
Standard_EXPORT Handle(FEmTool_HAssemblyTable) AssemblyTable() const;
Standard_EXPORT Handle(TColStd_HArray2OfInteger) DependenceTable() const;
Standard_EXPORT Standard_Integer QualityValues (const Standard_Real J1min, const Standard_Real J2min, const Standard_Real J3min, Standard_Real& J1, Standard_Real& J2, Standard_Real& J3);
Standard_EXPORT void ErrorValues (Standard_Real& MaxError, Standard_Real& QuadraticError, Standard_Real& AverageError);
Standard_EXPORT void Hessian (const Standard_Integer Element, const Standard_Integer Dimension1, const Standard_Integer Dimension2, math_Matrix& H);
Standard_EXPORT void Gradient (const Standard_Integer Element, const Standard_Integer Dimension, math_Vector& G);
//! Convert the assembly Vector in an Curve;
Standard_EXPORT void InputVector (const math_Vector& X, const Handle(FEmTool_HAssemblyTable)& AssTable);
Standard_EXPORT void SetWeight (const Standard_Real QuadraticWeight, const Standard_Real QualityWeight, const Standard_Real percentJ1, const Standard_Real percentJ2, const Standard_Real percentJ3);
Standard_EXPORT void GetWeight (Standard_Real& QuadraticWeight, Standard_Real& QualityWeight) const;
Standard_EXPORT void SetWeight (const TColStd_Array1OfReal& Weight);
DEFINE_STANDARD_RTTI(AppDef_LinearCriteria,AppDef_SmoothCriterion)
protected:
private:
Standard_EXPORT void BuildCache (const Standard_Integer E);
AppDef_MultiLine mySSP;
Handle(TColStd_HArray1OfReal) myParameters;
Handle(TColStd_HArray1OfReal) myCache;
Handle(FEmTool_ElementaryCriterion) myCriteria[3];
Standard_Real myEstimation[3];
Standard_Real myQuadraticWeight;
Standard_Real myQualityWeight;
Standard_Real myPercent[3];
TColStd_Array1OfReal myPntWeight;
Handle(FEmTool_Curve) myCurve;
Standard_Real myLength;
Standard_Integer myE;
Standard_Integer IF;
Standard_Integer IL;
};
#endif // _AppDef_LinearCriteria_HeaderFile

View File

@@ -1,161 +0,0 @@
-- Created on: 1991-12-02
-- Created by: Laurent PAINNOT
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class MultiLine from AppDef
---Purpose: This class describes the organized set of points used in the
-- approximations. A MultiLine is composed of n
-- MultiPointConstraints.
-- The approximation of the MultiLine will be done in the order
-- of the given n MultiPointConstraints.
--
--
-- Example of a MultiLine composed of MultiPointConstraints:
--
-- P1______P2_____P3______P4________........_____PNbMult
--
-- Q1______Q2_____Q3______Q4________........_____QNbMult
-- . .
-- . .
-- . .
-- R1______R2_____R3______R4________........_____RNbMult
--
--
-- Pi, Qi, ..., Ri are points of dimension 2 or 3.
--
-- (P1, Q1, ...R1), ...(Pn, Qn, ...Rn) n= 1,...NbMult are
-- MultiPointConstraints.
-- There are NbPoints points in each MultiPointConstraint.
uses MultiPointConstraint from AppDef,
HArray1OfMultiPointConstraint from AppDef,
Array1OfMultiPointConstraint from AppDef,
Array1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
OStream from Standard
raises ConstructionError from Standard,
DimensionError from Standard,
OutOfRange from Standard
is
Create
---Purpose: creates an undefined MultiLine.
returns MultiLine from AppDef;
Create(NbMult: Integer)
---Purpose: given the number NbMult of MultiPointConstraints of this
-- MultiLine , it initializes all the fields.SetValue must be
-- called in order for the values of the multipoint
-- constraint to be taken into account.
-- An exception is raised if NbMult < 0.
returns MultiLine from AppDef
raises ConstructionError from Standard;
Create(tabMultiP: Array1OfMultiPointConstraint)
---Purpose: Constructs a MultiLine with an array of MultiPointConstraints.
returns MultiLine from AppDef
raises ConstructionError from Standard;
Create(tabP3d: Array1OfPnt)
---Purpose: The MultiLine constructed will have one line of
-- 3d points without their tangencies.
returns MultiLine from AppDef
raises ConstructionError from Standard;
Create(tabP2d: Array1OfPnt2d)
---Purpose: The MultiLine constructed will have one line of
-- 2d points without their tangencies.
returns MultiLine from AppDef
raises ConstructionError from Standard;
NbMultiPoints(me)
---Purpose: returns the number of MultiPointConstraints of the
-- MultiLine.
returns Integer
is static;
NbPoints(me)
---Purpose: returns the number of Points from MultiPoints composing
-- the MultiLine.
returns Integer
is static;
SetParameter(me: in out; Index: Integer; U: Real)
---Purpose: Sets the value of the parameter for the
-- MultiPointConstraint at position Index.
-- Exceptions
-- - Standard_OutOfRange if Index is less
-- than 0 or Index is greater than the number
-- of Multipoint constraints in the MultiLine.
raises OutOfRange from Standard
is static;
SetValue(me: in out; Index: Integer; MPoint: MultiPointConstraint)
---Purpose: It sets the MultiPointConstraint of range Index to the
-- value MPoint.
-- An exception is raised if Index < 0 or Index> MPoint.
-- An exception is raised if the dimensions of the
-- MultiPoints are different.
raises OutOfRange from Standard,
DimensionError from Standard
is static;
Value(me; Index: Integer)
---Purpose: returns the MultiPointConstraint of range Index
-- An exception is raised if Index<0 or Index>MPoint.
returns MultiPointConstraint from AppDef
raises OutOfRange from Standard
is static;
Dump(me; o: in out OStream)
---Purpose: Prints on the stream o information on the current
-- state of the object.
-- Is used to redefine the operator <<.
is static;
fields
tabMult: HArray1OfMultiPointConstraint from AppDef is protected;
end MultiLine from AppDef;

View File

@@ -14,11 +14,12 @@
// Lpa, le 3/12/91
#include <AppDef_MultiLine.ixx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_Array1OfMultiPointConstraint.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MultiPointConstraint.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_OutOfRange.hxx>
AppDef_MultiLine::AppDef_MultiLine(){}

View File

@@ -0,0 +1,142 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MultiLine_HeaderFile
#define _AppDef_MultiLine_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppDef_HArray1OfMultiPointConstraint.hxx>
#include <Standard_Integer.hxx>
#include <AppDef_Array1OfMultiPointConstraint.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_OStream.hxx>
class Standard_ConstructionError;
class Standard_DimensionError;
class Standard_OutOfRange;
class AppDef_MultiPointConstraint;
//! This class describes the organized set of points used in the
//! approximations. A MultiLine is composed of n
//! MultiPointConstraints.
//! The approximation of the MultiLine will be done in the order
//! of the given n MultiPointConstraints.
//!
//! Example of a MultiLine composed of MultiPointConstraints:
//!
//! P1______P2_____P3______P4________........_____PNbMult
//!
//! Q1______Q2_____Q3______Q4________........_____QNbMult
//! . .
//! . .
//! . .
//! R1______R2_____R3______R4________........_____RNbMult
//!
//! Pi, Qi, ..., Ri are points of dimension 2 or 3.
//!
//! (P1, Q1, ...R1), ...(Pn, Qn, ...Rn) n= 1,...NbMult are
//! MultiPointConstraints.
//! There are NbPoints points in each MultiPointConstraint.
class AppDef_MultiLine
{
public:
DEFINE_STANDARD_ALLOC
//! creates an undefined MultiLine.
Standard_EXPORT AppDef_MultiLine();
//! given the number NbMult of MultiPointConstraints of this
//! MultiLine , it initializes all the fields.SetValue must be
//! called in order for the values of the multipoint
//! constraint to be taken into account.
//! An exception is raised if NbMult < 0.
Standard_EXPORT AppDef_MultiLine(const Standard_Integer NbMult);
//! Constructs a MultiLine with an array of MultiPointConstraints.
Standard_EXPORT AppDef_MultiLine(const AppDef_Array1OfMultiPointConstraint& tabMultiP);
//! The MultiLine constructed will have one line of
//! 3d points without their tangencies.
Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt& tabP3d);
//! The MultiLine constructed will have one line of
//! 2d points without their tangencies.
Standard_EXPORT AppDef_MultiLine(const TColgp_Array1OfPnt2d& tabP2d);
//! returns the number of MultiPointConstraints of the
//! MultiLine.
Standard_EXPORT Standard_Integer NbMultiPoints() const;
//! returns the number of Points from MultiPoints composing
//! the MultiLine.
Standard_EXPORT Standard_Integer NbPoints() const;
//! Sets the value of the parameter for the
//! MultiPointConstraint at position Index.
//! Exceptions
//! - Standard_OutOfRange if Index is less
//! than 0 or Index is greater than the number
//! of Multipoint constraints in the MultiLine.
Standard_EXPORT void SetParameter (const Standard_Integer Index, const Standard_Real U);
//! It sets the MultiPointConstraint of range Index to the
//! value MPoint.
//! An exception is raised if Index < 0 or Index> MPoint.
//! An exception is raised if the dimensions of the
//! MultiPoints are different.
Standard_EXPORT void SetValue (const Standard_Integer Index, const AppDef_MultiPointConstraint& MPoint);
//! returns the MultiPointConstraint of range Index
//! An exception is raised if Index<0 or Index>MPoint.
Standard_EXPORT AppDef_MultiPointConstraint Value (const Standard_Integer Index) const;
//! Prints on the stream o information on the current
//! state of the object.
//! Is used to redefine the operator <<.
Standard_EXPORT void Dump (Standard_OStream& o) const;
protected:
Handle(AppDef_HArray1OfMultiPointConstraint) tabMult;
private:
};
#endif // _AppDef_MultiLine_HeaderFile

View File

@@ -1,293 +0,0 @@
-- Created on: 1991-12-02
-- Created by: Laurent PAINNOT
-- Copyright (c) 1991-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class MultiPointConstraint from AppDef
inherits MultiPoint from AppParCurves
---Purpose: Describes a MultiPointConstraint used in a
-- Multiline. MultiPointConstraints are composed
-- of several two or three-dimensional points.
-- The purpose is to define the corresponding
-- points that share a common constraint in order
-- to compute the approximation of several lines in parallel.
-- Notes:
-- - The order of points of a MultiPointConstraints is very important.
-- Users must give 3D points first, and then 2D points.
-- - The constraints for the points included in a
-- MultiPointConstraint are always identical for
-- all points, including the parameter.
-- - If a MultiPointConstraint is a "tangency"
-- point, the point is also a "passing" point.
uses Pnt from gp,
Pnt2d from gp,
Vec from gp,
Vec2d from gp,
Array1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec from TColgp,
Array1OfVec2d from TColgp,
Constraint from AppParCurves,
OStream from Standard,
TShared from MMgt
raises OutOfRange from Standard,
ConstructionError from Standard,
DimensionError from Standard
is
Create
---Purpose: creates an undefined MultiPointConstraint.
returns MultiPointConstraint from AppDef;
Create(NbPoints, NbPoints2d: Integer)
---Purpose: constructs a set of Points used to approximate a Multiline.
-- These Points can be of 2 or 3 dimensions.
-- Points will be initialized with SetPoint and SetPoint2d.
returns MultiPointConstraint from AppDef;
Create(tabP: Array1OfPnt)
---Purpose: creates a MultiPoint only composed of 3D points.
returns MultiPointConstraint from AppDef;
Create(tabP: Array1OfPnt2d)
---Purpose: creates a MultiPoint only composed of 2D points.
returns MultiPointConstraint from AppDef;
Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d)
---Purpose: constructs a set of Points used to approximate a Multiline.
-- These Points can be of 2 or 3 dimensions.
-- Points will be initialized with SetPoint and SetPoint2d.
returns MultiPointConstraint from AppDef;
Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d;
tabVec: Array1OfVec; tabVec2d: Array1OfVec2d;
tabCur: Array1OfVec; tabCur2d: Array1OfVec2d)
---Purpose: creates a MultiPointConstraint with a constraint of
-- Curvature.
-- An exception is raised if
-- (length of <tabP> + length of <tabP2d> ) is different
-- from (length of <tabVec> + length of <tabVec2d> ) or
-- from (length of <tabCur> + length of <tabCur2d> )
returns MultiPointConstraint from AppDef
raises ConstructionError from Standard;
Create(tabP: Array1OfPnt; tabP2d: Array1OfPnt2d;
tabVec: Array1OfVec; tabVec2d: Array1OfVec2d)
---Purpose: creates a MultiPointConstraint with a constraint of
-- Tangency.
-- An exception is raised if
-- (length of <tabP> + length of <tabP2d> ) is different
-- from (length of <tabVec> + length of <tabVec2d> )
returns MultiPointConstraint from AppDef
raises ConstructionError from Standard;
Create(tabP: Array1OfPnt; tabVec: Array1OfVec; tabCur: Array1OfVec)
---Purpose: creates a MultiPointConstraint only composed of 3d points
-- with constraints of curvature.
-- An exception is raised if the length of tabP is different
-- from the length of tabVec or from tabCur.
returns MultiPointConstraint from AppDef
raises ConstructionError;
Create(tabP: Array1OfPnt; tabVec: Array1OfVec)
---Purpose: creates a MultiPointConstraint only composed of 3d points
-- with constraints of tangency.
-- An exception is raised if the length of tabP is different
-- from the length of tabVec.
returns MultiPointConstraint
raises ConstructionError;
Create(tabP2d: Array1OfPnt2d; tabVec2d: Array1OfVec2d)
---Purpose: creates a MultiPointConstraint only composed of 2d points
-- with constraints of tangency.
-- An exception is raised if the length of tabP is different
-- from the length of tabVec2d.
returns MultiPointConstraint from AppDef
raises ConstructionError from Standard;
Create(tabP2d: Array1OfPnt2d;
tabVec2d: Array1OfVec2d;
tabCur2d: Array1OfVec2d)
---Purpose: creates a MultiPointConstraint only composed of 2d points
-- with constraints of curvature.
-- An exception is raised if the length of tabP is different
-- from the length of tabVec2d or from tabCur2d.
returns MultiPointConstraint from AppDef
raises ConstructionError from Standard;
SetTang(me: in out; Index: Integer; Tang: Vec)
---Purpose: sets the value of the tangency of the point of range
-- Index.
-- An exception is raised if Index <0 or if Index > number
-- of 3d points.
-- An exception is raised if Tang has an incorrect number of
-- dimensions.
raises OutOfRange from Standard,
DimensionError from Standard
is static;
Tang(me; Index: Integer)
---Purpose: returns the tangency value of the point of range Index.
-- An exception is raised if Index < 0 or if Index > number
-- of 3d points.
returns Vec from gp
raises OutOfRange from Standard
is static;
SetTang2d(me: in out; Index: Integer; Tang2d: Vec2d)
---Purpose: sets the value of the tangency of the point of range
-- Index.
-- An exception is raised if Index <number of 3d points or if
-- Index > total number of Points
-- An exception is raised if Tang has an incorrect number of
-- dimensions.
raises OutOfRange from Standard,
DimensionError from Standard
is static;
Tang2d(me; Index: Integer)
---Purpose: returns the tangency value of the point of range Index.
-- An exception is raised if Index < number of 3d points or
-- if Index > total number of points.
returns Vec2d from gp
raises OutOfRange from Standard
is static;
SetCurv(me: in out; Index: Integer; Curv: Vec)
---Purpose: Vec sets the value of the normal vector at the
-- point of index Index. The norm of the normal
-- vector at the point of position Index is set to the normal curvature.
-- An exception is raised if Index <0 or if Index > number
-- of 3d points.
-- An exception is raised if Curv has an incorrect number of
-- dimensions.
raises OutOfRange from Standard,
DimensionError from Standard
is static;
Curv(me; Index: Integer)
---Purpose: returns the normal vector at the point of range Index.
-- An exception is raised if Index < 0 or if Index > number
-- of 3d points.
returns Vec from gp
raises OutOfRange from Standard
is static;
SetCurv2d(me: in out; Index: Integer; Curv2d: Vec2d)
---Purpose: Vec sets the value of the normal vector at the
-- point of index Index. The norm of the normal
-- vector at the point of position Index is set to the normal curvature.
-- An exception is raised if Index <0 or if Index > number
-- of 3d points.
-- An exception is raised if Curv has an incorrect number of
-- dimensions.
raises OutOfRange from Standard,
DimensionError from Standard
is static;
Curv2d(me; Index: Integer)
---Purpose: returns the normal vector at the point of range Index.
-- An exception is raised if Index < 0 or if Index > number
-- of 3d points.
returns Vec2d from gp
is static;
IsTangencyPoint(me)
---Purpose: returns True if the MultiPoint has a tangency value.
returns Boolean
raises OutOfRange from Standard
is static;
IsCurvaturePoint(me)
---Purpose: returns True if the MultiPoint has a curvature value.
returns Boolean
raises OutOfRange from Standard
is static;
Dump(me; o: in out OStream)
---Purpose: Prints on the stream o information on the current
-- state of the object.
-- Is used to redefine the operator <<.
is redefined;
fields
ttabTang: TShared from MMgt;
ttabCurv: TShared from MMgt;
ttabTang2d: TShared from MMgt;
ttabCurv2d: TShared from MMgt;
end MultiPointConstraint from AppDef;

View File

@@ -14,16 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_MultiPointConstraint.ixx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_MultiPointConstraint.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HArray1OfVec2d.hxx>
#define tabTang Handle(TColgp_HArray1OfVec)::DownCast (ttabTang)
#define tabCurv Handle(TColgp_HArray1OfVec)::DownCast (ttabCurv)
#define tabTang2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabTang2d)

View File

@@ -0,0 +1,211 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MultiPointConstraint_HeaderFile
#define _AppDef_MultiPointConstraint_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiPoint.hxx>
#include <Standard_Integer.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_Array1OfVec2d.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
class MMgt_TShared;
class Standard_OutOfRange;
class Standard_ConstructionError;
class Standard_DimensionError;
class gp_Vec;
class gp_Vec2d;
//! Describes a MultiPointConstraint used in a
//! Multiline. MultiPointConstraints are composed
//! of several two or three-dimensional points.
//! The purpose is to define the corresponding
//! points that share a common constraint in order
//! to compute the approximation of several lines in parallel.
//! Notes:
//! - The order of points of a MultiPointConstraints is very important.
//! Users must give 3D points first, and then 2D points.
//! - The constraints for the points included in a
//! MultiPointConstraint are always identical for
//! all points, including the parameter.
//! - If a MultiPointConstraint is a "tangency"
//! point, the point is also a "passing" point.
class AppDef_MultiPointConstraint : public AppParCurves_MultiPoint
{
public:
DEFINE_STANDARD_ALLOC
//! creates an undefined MultiPointConstraint.
Standard_EXPORT AppDef_MultiPointConstraint();
//! constructs a set of Points used to approximate a Multiline.
//! These Points can be of 2 or 3 dimensions.
//! Points will be initialized with SetPoint and SetPoint2d.
Standard_EXPORT AppDef_MultiPointConstraint(const Standard_Integer NbPoints, const Standard_Integer NbPoints2d);
//! creates a MultiPoint only composed of 3D points.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP);
//! creates a MultiPoint only composed of 2D points.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP);
//! constructs a set of Points used to approximate a Multiline.
//! These Points can be of 2 or 3 dimensions.
//! Points will be initialized with SetPoint and SetPoint2d.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d);
//! creates a MultiPointConstraint with a constraint of
//! Curvature.
//! An exception is raised if
//! (length of <tabP> + length of <tabP2d> ) is different
//! from (length of <tabVec> + length of <tabVec2d> ) or
//! from (length of <tabCur> + length of <tabCur2d> )
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec2d& tabVec2d, const TColgp_Array1OfVec& tabCur, const TColgp_Array1OfVec2d& tabCur2d);
//! creates a MultiPointConstraint with a constraint of
//! Tangency.
//! An exception is raised if
//! (length of <tabP> + length of <tabP2d> ) is different
//! from (length of <tabVec> + length of <tabVec2d> )
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec2d& tabVec2d);
//! creates a MultiPointConstraint only composed of 3d points
//! with constraints of curvature.
//! An exception is raised if the length of tabP is different
//! from the length of tabVec or from tabCur.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfVec& tabVec, const TColgp_Array1OfVec& tabCur);
//! creates a MultiPointConstraint only composed of 3d points
//! with constraints of tangency.
//! An exception is raised if the length of tabP is different
//! from the length of tabVec.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt& tabP, const TColgp_Array1OfVec& tabVec);
//! creates a MultiPointConstraint only composed of 2d points
//! with constraints of tangency.
//! An exception is raised if the length of tabP is different
//! from the length of tabVec2d.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec2d& tabVec2d);
//! creates a MultiPointConstraint only composed of 2d points
//! with constraints of curvature.
//! An exception is raised if the length of tabP is different
//! from the length of tabVec2d or from tabCur2d.
Standard_EXPORT AppDef_MultiPointConstraint(const TColgp_Array1OfPnt2d& tabP2d, const TColgp_Array1OfVec2d& tabVec2d, const TColgp_Array1OfVec2d& tabCur2d);
//! sets the value of the tangency of the point of range
//! Index.
//! An exception is raised if Index <0 or if Index > number
//! of 3d points.
//! An exception is raised if Tang has an incorrect number of
//! dimensions.
Standard_EXPORT void SetTang (const Standard_Integer Index, const gp_Vec& Tang);
//! returns the tangency value of the point of range Index.
//! An exception is raised if Index < 0 or if Index > number
//! of 3d points.
Standard_EXPORT gp_Vec Tang (const Standard_Integer Index) const;
//! sets the value of the tangency of the point of range
//! Index.
//! An exception is raised if Index <number of 3d points or if
//! Index > total number of Points
//! An exception is raised if Tang has an incorrect number of
//! dimensions.
Standard_EXPORT void SetTang2d (const Standard_Integer Index, const gp_Vec2d& Tang2d);
//! returns the tangency value of the point of range Index.
//! An exception is raised if Index < number of 3d points or
//! if Index > total number of points.
Standard_EXPORT gp_Vec2d Tang2d (const Standard_Integer Index) const;
//! Vec sets the value of the normal vector at the
//! point of index Index. The norm of the normal
//! vector at the point of position Index is set to the normal curvature.
//! An exception is raised if Index <0 or if Index > number
//! of 3d points.
//! An exception is raised if Curv has an incorrect number of
//! dimensions.
Standard_EXPORT void SetCurv (const Standard_Integer Index, const gp_Vec& Curv);
//! returns the normal vector at the point of range Index.
//! An exception is raised if Index < 0 or if Index > number
//! of 3d points.
Standard_EXPORT gp_Vec Curv (const Standard_Integer Index) const;
//! Vec sets the value of the normal vector at the
//! point of index Index. The norm of the normal
//! vector at the point of position Index is set to the normal curvature.
//! An exception is raised if Index <0 or if Index > number
//! of 3d points.
//! An exception is raised if Curv has an incorrect number of
//! dimensions.
Standard_EXPORT void SetCurv2d (const Standard_Integer Index, const gp_Vec2d& Curv2d);
//! returns the normal vector at the point of range Index.
//! An exception is raised if Index < 0 or if Index > number
//! of 3d points.
Standard_EXPORT gp_Vec2d Curv2d (const Standard_Integer Index) const;
//! returns True if the MultiPoint has a tangency value.
Standard_EXPORT Standard_Boolean IsTangencyPoint() const;
//! returns True if the MultiPoint has a curvature value.
Standard_EXPORT Standard_Boolean IsCurvaturePoint() const;
//! Prints on the stream o information on the current
//! state of the object.
//! Is used to redefine the operator <<.
Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE;
protected:
private:
Handle(MMgt_TShared) ttabTang;
Handle(MMgt_TShared) ttabCurv;
Handle(MMgt_TShared) ttabTang2d;
Handle(MMgt_TShared) ttabCurv2d;
};
#endif // _AppDef_MultiPointConstraint_HeaderFile

View File

@@ -0,0 +1,100 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MyBSplGradientOfBSplineCompute_HeaderFile
#define _AppDef_MyBSplGradientOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class Standard_OutOfRange;
class StdFail_NotDone;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute;
class AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute;
class AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute;
class AppParCurves_MultiBSpCurve;
class AppDef_MyBSplGradientOfBSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 1);
Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations, const Standard_Real lambda1, const Standard_Real lambda2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiBSpCurve Value() const;
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT Standard_Real AverageError() const;
protected:
Standard_EXPORT void Perform (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200);
private:
AppParCurves_MultiBSpCurve SCU;
math_Vector ParError;
Standard_Real AvError;
Standard_Real MError3d;
Standard_Real MError2d;
Standard_Real mylambda1;
Standard_Real mylambda2;
Standard_Boolean myIsLambdaDefined;
Standard_Boolean Done;
};
#endif // _AppDef_MyBSplGradientOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,42 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_BSpParLeastSquare AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpParLeastSquare_hxx <AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpParFunction AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpParFunction_hxx <AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpGradient_BFGS AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute
#define AppParCurves_BSpGradient_BFGS_hxx <AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx>
#define AppParCurves_BSpGradient AppDef_MyBSplGradientOfBSplineCompute
#define AppParCurves_BSpGradient_hxx <AppDef_MyBSplGradientOfBSplineCompute.hxx>
#include <AppParCurves_BSpGradient.gxx>

View File

@@ -0,0 +1,92 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MyGradientOfCompute_HeaderFile
#define _AppDef_MyGradientOfCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class StdFail_NotDone;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfMyGradientOfCompute;
class AppDef_ResConstraintOfMyGradientOfCompute;
class AppDef_ParFunctionOfMyGradientOfCompute;
class AppDef_Gradient_BFGSOfMyGradientOfCompute;
class AppParCurves_MultiCurve;
class AppDef_MyGradientOfCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_MyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve Value() const;
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT Standard_Real AverageError() const;
protected:
private:
AppParCurves_MultiCurve SCU;
math_Vector ParError;
Standard_Real AvError;
Standard_Real MError3d;
Standard_Real MError2d;
Standard_Boolean Done;
};
#endif // _AppDef_MyGradientOfCompute_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_MyGradientOfCompute.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#include <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientOfCompute
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientOfCompute
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientOfCompute
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientOfCompute
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx>
#define AppParCurves_Gradient AppDef_MyGradientOfCompute
#define AppParCurves_Gradient_hxx <AppDef_MyGradientOfCompute.hxx>
#include <AppParCurves_Gradient.gxx>

View File

@@ -0,0 +1,92 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MyGradientbisOfBSplineCompute_HeaderFile
#define _AppDef_MyGradientbisOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class StdFail_NotDone;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute;
class AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute;
class AppParCurves_MultiCurve;
class AppDef_MyGradientbisOfBSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_MyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve Value() const;
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT Standard_Real AverageError() const;
protected:
private:
AppParCurves_MultiCurve SCU;
math_Vector ParError;
Standard_Real AvError;
Standard_Real MError3d;
Standard_Real MError2d;
Standard_Boolean Done;
};
#endif // _AppDef_MyGradientbisOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_MyGradientbisOfBSplineCompute.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_Gradient AppDef_MyGradientbisOfBSplineCompute
#define AppParCurves_Gradient_hxx <AppDef_MyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_Gradient.gxx>

View File

@@ -1,122 +0,0 @@
-- Created on: 1993-01-20
-- Created by: Laurent PAINNOT
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class MyLineTool from AppDef
---Purpose: example of MultiLine tool corresponding to the tools of the packages
-- AppParCurves and Approx. For Approx, the tool will not addd points
-- if the algorithms want some.
uses MultiLine from AppDef,
Pnt from gp,
Pnt2d from gp,
Vec from gp,
Vec2d from gp,
Array1OfPnt from TColgp,
Array1OfPnt2d from TColgp,
Array1OfVec from TColgp,
Array1OfVec2d from TColgp,
Status from Approx
is
FirstPoint(myclass; ML: MultiLine) returns Integer;
---Purpose: Returns the first index of multipoints of the MultiLine.
LastPoint(myclass; ML: MultiLine) returns Integer;
---Purpose: Returns the last index of multipoints of the MultiLine.
NbP2d(myclass; ML: MultiLine) returns Integer;
---Purpose: Returns the number of 2d points of a MultiLine.
NbP3d(myclass; ML: MultiLine) returns Integer;
---Purpose: Returns the number of 3d points of a MultiLine.
Value(myclass; ML: MultiLine; MPointIndex: Integer;
tabPt: out Array1OfPnt);
---Purpose: returns the 3d points of the multipoint <MPointIndex>
-- when only 3d points exist.
Value(myclass; ML: MultiLine; MPointIndex: Integer;
tabPt2d: out Array1OfPnt2d);
---Purpose: returns the 2d points of the multipoint <MPointIndex>
-- when only 2d points exist.
Value(myclass; ML: MultiLine; MPointIndex: Integer;
tabPt: out Array1OfPnt; tabPt2d: out Array1OfPnt2d);
---Purpose: returns the 3d and 2d points of the multipoint
-- <MPointIndex>.
Tangency(myclass; ML: MultiLine; MPointIndex: Integer;
tabV: out Array1OfVec) returns Boolean;
---Purpose: returns the 3d points of the multipoint <MPointIndex>
-- when only 3d points exist.
Tangency(myclass; ML: MultiLine; MPointIndex: Integer;
tabV2d: out Array1OfVec2d) returns Boolean;
---Purpose: returns the 2d tangency points of the multipoint
-- <MPointIndex> only when 2d points exist.
Tangency(myclass; ML: MultiLine; MPointIndex: Integer;
tabV: out Array1OfVec; tabV2d: out Array1OfVec2d)
returns Boolean;
---Purpose: returns the 3d and 2d points of the multipoint
-- <MPointIndex>.
Curvature(myclass; ML: MultiLine; MPointIndex: Integer;
tabV: out Array1OfVec) returns Boolean;
---Purpose: returns the 3d curvatures of the multipoint <MPointIndex>
-- when only 3d points exist.
Curvature(myclass; ML: MultiLine; MPointIndex: Integer;
tabV2d: out Array1OfVec2d) returns Boolean;
---Purpose: returns the 2d curvatures of the multipoint
-- <MPointIndex> only when 2d points exist.
Curvature(myclass; ML: MultiLine; MPointIndex: Integer;
tabV: out Array1OfVec; tabV2d: out Array1OfVec2d)
returns Boolean;
---Purpose: returns the 3d and 2d curvatures of the multipoint
-- <MPointIndex>.
WhatStatus(myclass; ML: MultiLine; I1, I2: Integer)
returns Status from Approx;
---Purpose: returns NoPointsAdded
MakeMLBetween(myclass; ML: MultiLine; I1, I2: Integer;
NbPMin: Integer)
returns MultiLine;
---Purpose: Is never called in the algorithms.
-- Nothing is done.
---C++: return &
end MyLineTool;

View File

@@ -14,8 +14,9 @@
// AppDef_MyLineTool.cxx
#include <AppDef_MyLineTool.ixx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MultiPointConstraint.hxx>
#include <AppDef_MyLineTool.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>

View File

@@ -0,0 +1,122 @@
// Created on: 1993-01-20
// Created by: Laurent PAINNOT
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_MyLineTool_HeaderFile
#define _AppDef_MyLineTool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Boolean.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_Array1OfVec2d.hxx>
#include <Approx_Status.hxx>
class AppDef_MultiLine;
//! example of MultiLine tool corresponding to the tools of the packages
//! AppParCurves and Approx. For Approx, the tool will not addd points
//! if the algorithms want some.
class AppDef_MyLineTool
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the first index of multipoints of the MultiLine.
Standard_EXPORT static Standard_Integer FirstPoint (const AppDef_MultiLine& ML);
//! Returns the last index of multipoints of the MultiLine.
Standard_EXPORT static Standard_Integer LastPoint (const AppDef_MultiLine& ML);
//! Returns the number of 2d points of a MultiLine.
Standard_EXPORT static Standard_Integer NbP2d (const AppDef_MultiLine& ML);
//! Returns the number of 3d points of a MultiLine.
Standard_EXPORT static Standard_Integer NbP3d (const AppDef_MultiLine& ML);
//! returns the 3d points of the multipoint <MPointIndex>
//! when only 3d points exist.
Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt);
//! returns the 2d points of the multipoint <MPointIndex>
//! when only 2d points exist.
Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d);
//! returns the 3d and 2d points of the multipoint
//! <MPointIndex>.
Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d);
//! returns the 3d points of the multipoint <MPointIndex>
//! when only 3d points exist.
Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV);
//! returns the 2d tangency points of the multipoint
//! <MPointIndex> only when 2d points exist.
Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d);
//! returns the 3d and 2d points of the multipoint
//! <MPointIndex>.
Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d);
//! returns the 3d curvatures of the multipoint <MPointIndex>
//! when only 3d points exist.
Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV);
//! returns the 2d curvatures of the multipoint
//! <MPointIndex> only when 2d points exist.
Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d);
//! returns the 3d and 2d curvatures of the multipoint
//! <MPointIndex>.
Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d);
//! returns NoPointsAdded
Standard_EXPORT static Approx_Status WhatStatus (const AppDef_MultiLine& ML, const Standard_Integer I1, const Standard_Integer I2);
//! Is never called in the algorithms.
//! Nothing is done.
Standard_EXPORT static AppDef_MultiLine& MakeMLBetween (const AppDef_MultiLine& ML, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer NbPMin);
protected:
private:
};
#endif // _AppDef_MyLineTool_HeaderFile

View File

@@ -0,0 +1,125 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParFunctionOfMyGradientOfCompute_HeaderFile
#define _AppDef_ParFunctionOfMyGradientOfCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfMyGradientOfCompute;
class AppDef_ResConstraintOfMyGradientOfCompute;
class AppParCurves_MultiCurve;
class AppDef_ParFunctionOfMyGradientOfCompute : public math_MultipleVarFunctionWithGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParFunctionOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
Standard_EXPORT const math_Vector& NewParameters() const;
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
protected:
Standard_EXPORT void Perform (const math_Vector& X);
private:
Standard_Boolean Done;
AppDef_MultiLine MyMultiLine;
AppParCurves_MultiCurve MyMultiCurve;
Standard_Integer Degre;
math_Vector myParameters;
Standard_Real FVal;
math_Vector ValGrad_F;
math_Matrix MyF;
math_Matrix PTLX;
math_Matrix PTLY;
math_Matrix PTLZ;
math_Matrix A;
math_Matrix DA;
AppDef_ParLeastSquareOfMyGradientOfCompute MyLeastSquare;
Standard_Boolean Contraintes;
Standard_Integer NbP;
Standard_Integer NbCu;
Standard_Integer Adeb;
Standard_Integer Afin;
Handle(TColStd_HArray1OfInteger) tabdim;
Standard_Real ERR3d;
Standard_Real ERR2d;
Standard_Integer FirstP;
Standard_Integer LastP;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
};
#endif // _AppDef_ParFunctionOfMyGradientOfCompute_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define Squares AppDef_ParLeastSquareOfMyGradientOfCompute
#define Squares_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#define ResolCons AppDef_ResConstraintOfMyGradientOfCompute
#define ResolCons_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#define AppParCurves_Function AppDef_ParFunctionOfMyGradientOfCompute
#define AppParCurves_Function_hxx <AppDef_ParFunctionOfMyGradientOfCompute.hxx>
#include <AppParCurves_Function.gxx>

View File

@@ -0,0 +1,125 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile
#define _AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute;
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute;
class AppParCurves_MultiCurve;
class AppDef_ParFunctionOfMyGradientbisOfBSplineCompute : public math_MultipleVarFunctionWithGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParFunctionOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
Standard_EXPORT const math_Vector& NewParameters() const;
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
protected:
Standard_EXPORT void Perform (const math_Vector& X);
private:
Standard_Boolean Done;
AppDef_MultiLine MyMultiLine;
AppParCurves_MultiCurve MyMultiCurve;
Standard_Integer Degre;
math_Vector myParameters;
Standard_Real FVal;
math_Vector ValGrad_F;
math_Matrix MyF;
math_Matrix PTLX;
math_Matrix PTLY;
math_Matrix PTLZ;
math_Matrix A;
math_Matrix DA;
AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute MyLeastSquare;
Standard_Boolean Contraintes;
Standard_Integer NbP;
Standard_Integer NbCu;
Standard_Integer Adeb;
Standard_Integer Afin;
Handle(TColStd_HArray1OfInteger) tabdim;
Standard_Real ERR3d;
Standard_Real ERR2d;
Standard_Integer FirstP;
Standard_Integer LastP;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
};
#endif // _AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define Squares AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define Squares_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#define ResolCons AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define ResolCons_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#define AppParCurves_Function AppDef_ParFunctionOfMyGradientbisOfBSplineCompute
#define AppParCurves_Function_hxx <AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_Function.gxx>

View File

@@ -0,0 +1,125 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParFunctionOfTheGradient_HeaderFile
#define _AppDef_ParFunctionOfTheGradient_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfTheGradient;
class AppDef_ResConstraintOfTheGradient;
class AppParCurves_MultiCurve;
class AppDef_ParFunctionOfTheGradient : public math_MultipleVarFunctionWithGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParFunctionOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
Standard_EXPORT const math_Vector& NewParameters() const;
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
protected:
Standard_EXPORT void Perform (const math_Vector& X);
private:
Standard_Boolean Done;
AppDef_MultiLine MyMultiLine;
AppParCurves_MultiCurve MyMultiCurve;
Standard_Integer Degre;
math_Vector myParameters;
Standard_Real FVal;
math_Vector ValGrad_F;
math_Matrix MyF;
math_Matrix PTLX;
math_Matrix PTLY;
math_Matrix PTLZ;
math_Matrix A;
math_Matrix DA;
AppDef_ParLeastSquareOfTheGradient MyLeastSquare;
Standard_Boolean Contraintes;
Standard_Integer NbP;
Standard_Integer NbCu;
Standard_Integer Adeb;
Standard_Integer Afin;
Handle(TColStd_HArray1OfInteger) tabdim;
Standard_Real ERR3d;
Standard_Real ERR2d;
Standard_Integer FirstP;
Standard_Integer LastP;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
};
#endif // _AppDef_ParFunctionOfTheGradient_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParFunctionOfTheGradient.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <AppDef_ResConstraintOfTheGradient.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define Squares AppDef_ParLeastSquareOfTheGradient
#define Squares_hxx <AppDef_ParLeastSquareOfTheGradient.hxx>
#define ResolCons AppDef_ResConstraintOfTheGradient
#define ResolCons_hxx <AppDef_ResConstraintOfTheGradient.hxx>
#define AppParCurves_Function AppDef_ParFunctionOfTheGradient
#define AppParCurves_Function_hxx <AppDef_ParFunctionOfTheGradient.hxx>
#include <AppParCurves_Function.gxx>

View File

@@ -0,0 +1,175 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParLeastSquareOfMyGradientOfCompute_HeaderFile
#define _AppDef_ParLeastSquareOfMyGradientOfCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_Constraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_ParLeastSquareOfMyGradientOfCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT void Perform (const math_Vector& Parameters);
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT const math_Matrix& Distance();
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT Standard_Real FirstLambda() const;
Standard_EXPORT Standard_Real LastLambda() const;
Standard_EXPORT const math_Matrix& Points() const;
Standard_EXPORT const math_Matrix& Poles() const;
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc);
Standard_EXPORT void ComputeFunction (const math_Vector& Parameters);
Standard_EXPORT void SearchIndex (math_IntegerVector& Index);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
Standard_EXPORT void MakeTAA (math_Vector& TheA);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_ParLeastSquareOfMyGradientOfCompute_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_LeastSquare AppDef_ParLeastSquareOfMyGradientOfCompute
#define AppParCurves_LeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientOfCompute.hxx>
#include <AppParCurves_LeastSquare.gxx>

View File

@@ -0,0 +1,175 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile
#define _AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_Constraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT void Perform (const math_Vector& Parameters);
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT const math_Matrix& Distance();
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT Standard_Real FirstLambda() const;
Standard_EXPORT Standard_Real LastLambda() const;
Standard_EXPORT const math_Matrix& Points() const;
Standard_EXPORT const math_Matrix& Poles() const;
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc);
Standard_EXPORT void ComputeFunction (const math_Vector& Parameters);
Standard_EXPORT void SearchIndex (math_IntegerVector& Index);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
Standard_EXPORT void MakeTAA (math_Vector& TheA);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_LeastSquare AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute
#define AppParCurves_LeastSquare_hxx <AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_LeastSquare.gxx>

View File

@@ -0,0 +1,175 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ParLeastSquareOfTheGradient_HeaderFile
#define _AppDef_ParLeastSquareOfTheGradient_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_Constraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_ParLeastSquareOfTheGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT void Perform (const math_Vector& Parameters);
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT const math_Matrix& Distance();
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT Standard_Real FirstLambda() const;
Standard_EXPORT Standard_Real LastLambda() const;
Standard_EXPORT const math_Matrix& Points() const;
Standard_EXPORT const math_Matrix& Poles() const;
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc);
Standard_EXPORT void ComputeFunction (const math_Vector& Parameters);
Standard_EXPORT void SearchIndex (math_IntegerVector& Index);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
Standard_EXPORT void MakeTAA (math_Vector& TheA);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_ParLeastSquareOfTheGradient_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_LeastSquare AppDef_ParLeastSquareOfTheGradient
#define AppParCurves_LeastSquare_hxx <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <AppParCurves_LeastSquare.gxx>

View File

@@ -0,0 +1,100 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
#define _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class math_Matrix;
class AppDef_ResConstraintOfMyGradientOfCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ResConstraintOfMyGradientOfCompute(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Real Error() const;
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
Standard_EXPORT const math_Vector& Duale() const;
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
Standard_EXPORT const math_Matrix& InverseMatrix() const;
protected:
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
private:
Standard_Boolean Done;
Standard_Real Err;
math_Matrix Cont;
math_Matrix DeCont;
math_Vector Secont;
math_Matrix CTCinv;
math_Vector Vardua;
Standard_Integer IncPass;
Standard_Integer IncTan;
Standard_Integer IncCurv;
TColStd_Array1OfInteger IPas;
TColStd_Array1OfInteger ITan;
TColStd_Array1OfInteger ICurv;
};
#endif // _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile

View File

@@ -0,0 +1,33 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ResolConstraint AppDef_ResConstraintOfMyGradientOfCompute
#define AppParCurves_ResolConstraint_hxx <AppDef_ResConstraintOfMyGradientOfCompute.hxx>
#include <AppParCurves_ResolConstraint.gxx>

View File

@@ -0,0 +1,100 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile
#define _AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class math_Matrix;
class AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ResConstraintOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Real Error() const;
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
Standard_EXPORT const math_Vector& Duale() const;
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
Standard_EXPORT const math_Matrix& InverseMatrix() const;
protected:
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
private:
Standard_Boolean Done;
Standard_Real Err;
math_Matrix Cont;
math_Matrix DeCont;
math_Vector Secont;
math_Matrix CTCinv;
math_Vector Vardua;
Standard_Integer IncPass;
Standard_Integer IncTan;
Standard_Integer IncCurv;
TColStd_Array1OfInteger IPas;
TColStd_Array1OfInteger ITan;
TColStd_Array1OfInteger ICurv;
};
#endif // _AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_HeaderFile

View File

@@ -0,0 +1,33 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ResolConstraint AppDef_ResConstraintOfMyGradientbisOfBSplineCompute
#define AppParCurves_ResolConstraint_hxx <AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx>
#include <AppParCurves_ResolConstraint.gxx>

View File

@@ -0,0 +1,100 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_ResConstraintOfTheGradient_HeaderFile
#define _AppDef_ResConstraintOfTheGradient_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class math_Matrix;
class AppDef_ResConstraintOfTheGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_ResConstraintOfTheGradient(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Real Error() const;
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
Standard_EXPORT const math_Vector& Duale() const;
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
Standard_EXPORT const math_Matrix& InverseMatrix() const;
protected:
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
private:
Standard_Boolean Done;
Standard_Real Err;
math_Matrix Cont;
math_Matrix DeCont;
math_Vector Secont;
math_Matrix CTCinv;
math_Vector Vardua;
Standard_Integer IncPass;
Standard_Integer IncTan;
Standard_Integer IncCurv;
TColStd_Array1OfInteger IPas;
TColStd_Array1OfInteger ITan;
TColStd_Array1OfInteger ICurv;
};
#endif // _AppDef_ResConstraintOfTheGradient_HeaderFile

View File

@@ -0,0 +1,33 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_ResConstraintOfTheGradient.hxx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ResolConstraint AppDef_ResConstraintOfTheGradient
#define AppParCurves_ResolConstraint_hxx <AppDef_ResConstraintOfTheGradient.hxx>
#include <AppParCurves_ResolConstraint.gxx>

View File

@@ -1,109 +0,0 @@
-- Created on: 1997-09-11
-- Created by: Philippe MANGIN
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class SmoothCriterion from AppDef
inherits TShared from MMgt
---Purpose: defined criterion to smooth points in curve
uses
Vector from math,
Matrix from math,
Curve from FEmTool,
HAssemblyTable from FEmTool,
HArray2OfInteger from TColStd,
HArray1OfReal from TColStd,
Array1OfReal from TColStd
raises
NotImplemented,
DomainError
is
SetParameters(me : mutable; Parameters : HArray1OfReal)
is deferred;
SetCurve(me : mutable; C :Curve from FEmTool)
is deferred;
GetCurve(me; C : out Curve from FEmTool)
is deferred;
SetEstimation(me : mutable; E1, E2, E3 : Real)
is deferred;
EstLength(me : mutable)
---C++: return &
returns Real is deferred;
GetEstimation(me; E1, E2, E3 : out Real)
is deferred;
AssemblyTable(me)
returns HAssemblyTable from FEmTool
is deferred;
DependenceTable(me)
returns HArray2OfInteger from TColStd
is deferred;
QualityValues (me : mutable; J1min, J2min, J3min : Real;
J1, J2, J3 : out Real)
returns Integer is deferred;
ErrorValues(me : mutable;
MaxError, QuadraticError, AverageError : out Real)
is deferred;
Hessian(me : mutable ;
Element : Integer;
Dimension1 : Integer;
Dimension2 : Integer;
H : out Matrix from math)
raises DomainError -- If DependenceTable(Dimension1,Dimension2) is False
is deferred;
Gradient(me : mutable;
Element : Integer;
Dimension : Integer;
G : out Vector from math)
is deferred;
InputVector(me : mutable; X : Vector from math;
AssTable : HAssemblyTable from FEmTool)
---Purpose: Convert the assembly Vector in an Curve;
--
raises DomainError is deferred;
SetWeight(me: mutable;
QuadraticWeight, QualityWeight : Real;
percentJ1, percentJ2, percentJ3 : Real)
is deferred;
GetWeight(me; QuadraticWeight, QualityWeight : out Real)
is deferred;
SetWeight(me: mutable;
Weight : Array1OfReal)
is deferred;
end SmoothCriterion;

View File

@@ -14,4 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_SmoothCriterion.ixx>
#include <AppDef_SmoothCriterion.hxx>
#include <FEmTool_Curve.hxx>
#include <math_Matrix.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>

View File

@@ -0,0 +1,103 @@
// Created on: 1997-09-11
// Created by: Philippe MANGIN
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_SmoothCriterion_HeaderFile
#define _AppDef_SmoothCriterion_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Standard_Real.hxx>
#include <FEmTool_HAssemblyTable.hxx>
#include <TColStd_HArray2OfInteger.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_NotImplemented;
class Standard_DomainError;
class FEmTool_Curve;
class math_Matrix;
class AppDef_SmoothCriterion;
DEFINE_STANDARD_HANDLE(AppDef_SmoothCriterion, MMgt_TShared)
//! defined criterion to smooth points in curve
class AppDef_SmoothCriterion : public MMgt_TShared
{
public:
Standard_EXPORT virtual void SetParameters (const Handle(TColStd_HArray1OfReal)& Parameters) = 0;
Standard_EXPORT virtual void SetCurve (const Handle(FEmTool_Curve)& C) = 0;
Standard_EXPORT virtual void GetCurve (Handle(FEmTool_Curve)& C) const = 0;
Standard_EXPORT virtual void SetEstimation (const Standard_Real E1, const Standard_Real E2, const Standard_Real E3) = 0;
Standard_EXPORT virtual Standard_Real& EstLength() = 0;
Standard_EXPORT virtual void GetEstimation (Standard_Real& E1, Standard_Real& E2, Standard_Real& E3) const = 0;
Standard_EXPORT virtual Handle(FEmTool_HAssemblyTable) AssemblyTable() const = 0;
Standard_EXPORT virtual Handle(TColStd_HArray2OfInteger) DependenceTable() const = 0;
Standard_EXPORT virtual Standard_Integer QualityValues (const Standard_Real J1min, const Standard_Real J2min, const Standard_Real J3min, Standard_Real& J1, Standard_Real& J2, Standard_Real& J3) = 0;
Standard_EXPORT virtual void ErrorValues (Standard_Real& MaxError, Standard_Real& QuadraticError, Standard_Real& AverageError) = 0;
Standard_EXPORT virtual void Hessian (const Standard_Integer Element, const Standard_Integer Dimension1, const Standard_Integer Dimension2, math_Matrix& H) = 0;
Standard_EXPORT virtual void Gradient (const Standard_Integer Element, const Standard_Integer Dimension, math_Vector& G) = 0;
//! Convert the assembly Vector in an Curve;
Standard_EXPORT virtual void InputVector (const math_Vector& X, const Handle(FEmTool_HAssemblyTable)& AssTable) = 0;
Standard_EXPORT virtual void SetWeight (const Standard_Real QuadraticWeight, const Standard_Real QualityWeight, const Standard_Real percentJ1, const Standard_Real percentJ2, const Standard_Real percentJ3) = 0;
Standard_EXPORT virtual void GetWeight (Standard_Real& QuadraticWeight, Standard_Real& QualityWeight) const = 0;
Standard_EXPORT virtual void SetWeight (const TColStd_Array1OfReal& Weight) = 0;
DEFINE_STANDARD_RTTI(AppDef_SmoothCriterion,MMgt_TShared)
protected:
private:
};
#endif // _AppDef_SmoothCriterion_HeaderFile

View File

@@ -0,0 +1,125 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_TheFunction_HeaderFile
#define _AppDef_TheFunction_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <Standard_Integer.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <AppDef_TheLeastSquares.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <math_MultipleVarFunctionWithGradient.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_TheLeastSquares;
class AppDef_TheResol;
class AppParCurves_MultiCurve;
class AppDef_TheFunction : public math_MultipleVarFunctionWithGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_TheFunction(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg);
Standard_EXPORT Standard_Integer NbVariables() const;
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
Standard_EXPORT const math_Vector& NewParameters() const;
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
protected:
Standard_EXPORT void Perform (const math_Vector& X);
private:
Standard_Boolean Done;
AppDef_MultiLine MyMultiLine;
AppParCurves_MultiCurve MyMultiCurve;
Standard_Integer Degre;
math_Vector myParameters;
Standard_Real FVal;
math_Vector ValGrad_F;
math_Matrix MyF;
math_Matrix PTLX;
math_Matrix PTLY;
math_Matrix PTLZ;
math_Matrix A;
math_Matrix DA;
AppDef_TheLeastSquares MyLeastSquare;
Standard_Boolean Contraintes;
Standard_Integer NbP;
Standard_Integer NbCu;
Standard_Integer Adeb;
Standard_Integer Afin;
Handle(TColStd_HArray1OfInteger) tabdim;
Standard_Real ERR3d;
Standard_Real ERR2d;
Standard_Integer FirstP;
Standard_Integer LastP;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
};
#endif // _AppDef_TheFunction_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_TheFunction.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_TheLeastSquares.hxx>
#include <AppDef_TheResol.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define Squares AppDef_TheLeastSquares
#define Squares_hxx <AppDef_TheLeastSquares.hxx>
#define ResolCons AppDef_TheResol
#define ResolCons_hxx <AppDef_TheResol.hxx>
#define AppParCurves_Function AppDef_TheFunction
#define AppParCurves_Function_hxx <AppDef_TheFunction.hxx>
#include <AppParCurves_Function.gxx>

View File

@@ -0,0 +1,92 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_TheGradient_HeaderFile
#define _AppDef_TheGradient_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Vector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class StdFail_NotDone;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppDef_ParLeastSquareOfTheGradient;
class AppDef_ResConstraintOfTheGradient;
class AppDef_ParFunctionOfTheGradient;
class AppDef_Gradient_BFGSOfTheGradient;
class AppParCurves_MultiCurve;
class AppDef_TheGradient
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_TheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve Value() const;
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
Standard_EXPORT Standard_Real MaxError3d() const;
Standard_EXPORT Standard_Real MaxError2d() const;
Standard_EXPORT Standard_Real AverageError() const;
protected:
private:
AppParCurves_MultiCurve SCU;
math_Vector ParError;
Standard_Real AvError;
Standard_Real MError3d;
Standard_Real MError2d;
Standard_Boolean Done;
};
#endif // _AppDef_TheGradient_HeaderFile

View File

@@ -0,0 +1,45 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_TheGradient.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppDef_ParLeastSquareOfTheGradient.hxx>
#include <AppDef_ResConstraintOfTheGradient.hxx>
#include <AppDef_ParFunctionOfTheGradient.hxx>
#include <AppDef_Gradient_BFGSOfTheGradient.hxx>
#include <AppParCurves_MultiCurve.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfTheGradient
#define AppParCurves_ParLeastSquare_hxx <AppDef_ParLeastSquareOfTheGradient.hxx>
#define AppParCurves_ResConstraint AppDef_ResConstraintOfTheGradient
#define AppParCurves_ResConstraint_hxx <AppDef_ResConstraintOfTheGradient.hxx>
#define AppParCurves_ParFunction AppDef_ParFunctionOfTheGradient
#define AppParCurves_ParFunction_hxx <AppDef_ParFunctionOfTheGradient.hxx>
#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfTheGradient
#define AppParCurves_Gradient_BFGS_hxx <AppDef_Gradient_BFGSOfTheGradient.hxx>
#define AppParCurves_Gradient AppDef_TheGradient
#define AppParCurves_Gradient_hxx <AppDef_TheGradient.hxx>
#include <AppParCurves_Gradient.gxx>

View File

@@ -0,0 +1,175 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_TheLeastSquares_HeaderFile
#define _AppDef_TheLeastSquares_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppParCurves_Constraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
class StdFail_NotDone;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_NoSuchObject;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class AppDef_TheLeastSquares
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol);
Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol);
Standard_EXPORT void Perform (const math_Vector& Parameters);
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT const math_Matrix& Distance();
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
Standard_EXPORT Standard_Real FirstLambda() const;
Standard_EXPORT Standard_Real LastLambda() const;
Standard_EXPORT const math_Matrix& Points() const;
Standard_EXPORT const math_Matrix& Poles() const;
Standard_EXPORT const math_IntegerVector& KIndex() const;
protected:
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc);
Standard_EXPORT void ComputeFunction (const math_Vector& Parameters);
Standard_EXPORT void SearchIndex (math_IntegerVector& Index);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
Standard_EXPORT void MakeTAA (math_Vector& TheA);
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
private:
AppParCurves_Constraint FirstConstraint;
AppParCurves_Constraint LastConstraint;
AppParCurves_MultiBSpCurve SCU;
Handle(TColStd_HArray1OfReal) myknots;
Handle(TColStd_HArray1OfInteger) mymults;
math_Matrix mypoles;
math_Matrix A;
math_Matrix DA;
math_Matrix B2;
math_Matrix mypoints;
math_Vector Vflatknots;
math_Vector Vec1t;
math_Vector Vec1c;
math_Vector Vec2t;
math_Vector Vec2c;
math_Matrix theError;
math_IntegerVector myindex;
Standard_Real lambda1;
Standard_Real lambda2;
Standard_Integer FirstP;
Standard_Integer LastP;
Standard_Integer Nlignes;
Standard_Integer Ninc;
Standard_Integer NA;
Standard_Integer myfirstp;
Standard_Integer mylastp;
Standard_Integer resinit;
Standard_Integer resfin;
Standard_Integer nbP2d;
Standard_Integer nbP;
Standard_Integer nbpoles;
Standard_Integer deg;
Standard_Boolean done;
Standard_Boolean iscalculated;
Standard_Boolean isready;
};
#endif // _AppDef_TheLeastSquares_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_TheLeastSquares.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_LeastSquare AppDef_TheLeastSquares
#define AppParCurves_LeastSquare_hxx <AppDef_TheLeastSquares.hxx>
#include <AppParCurves_LeastSquare.gxx>

View File

@@ -0,0 +1,100 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_TheResol_HeaderFile
#define _AppDef_TheResol_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <math_Matrix.hxx>
#include <math_Vector.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
class Standard_OutOfRange;
class AppDef_MultiLine;
class AppDef_MyLineTool;
class AppParCurves_MultiCurve;
class math_Matrix;
class AppDef_TheResol
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT AppDef_TheResol(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10);
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT Standard_Real Error() const;
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
Standard_EXPORT const math_Vector& Duale() const;
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
Standard_EXPORT const math_Matrix& InverseMatrix() const;
protected:
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
private:
Standard_Boolean Done;
Standard_Real Err;
math_Matrix Cont;
math_Matrix DeCont;
math_Vector Secont;
math_Matrix CTCinv;
math_Vector Vardua;
Standard_Integer IncPass;
Standard_Integer IncTan;
Standard_Integer IncCurv;
TColStd_Array1OfInteger IPas;
TColStd_Array1OfInteger ITan;
TColStd_Array1OfInteger ICurv;
};
#endif // _AppDef_TheResol_HeaderFile

View File

@@ -0,0 +1,33 @@
// Created on: 1991-12-02
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppDef_TheResol.hxx>
#include <Standard_OutOfRange.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <math_Matrix.hxx>
#define MultiLine AppDef_MultiLine
#define MultiLine_hxx <AppDef_MultiLine.hxx>
#define ToolLine AppDef_MyLineTool
#define ToolLine_hxx <AppDef_MyLineTool.hxx>
#define AppParCurves_ResolConstraint AppDef_TheResol
#define AppParCurves_ResolConstraint_hxx <AppDef_TheResol.hxx>
#include <AppParCurves_ResolConstraint.gxx>

View File

@@ -1,441 +0,0 @@
-- Created on: 1996-05-14
-- Created by: Philippe MANGIN / Jeannine PANCIATICI
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- Igor FEOKTISTOV - correction 14/12/98
class Variational from AppDef
---Purpose: This class is used to smooth N points with constraints
-- by minimization of quadratic criterium but also
-- variational criterium in order to obtain " fair Curve "
-- Computes the approximation of a Multiline by
-- Variational optimization.
uses Matrix from math,
Vector from math,
HArray1OfReal from TColStd,
Array1OfReal from TColStd,
HArray1OfInteger from TColStd,
Shape from GeomAbs,
HArray1OfConstraintCouple from AppParCurves,
MultiBSpCurve from AppParCurves,
SmoothCriterion from AppDef,
Curve from FEmTool,
Assembly from FEmTool,
Base from PLib,
Constraint from AppParCurves,
MultiLine from AppDef,
MyLineTool from AppDef
raises OutOfRange from Standard,
DimensionError from Standard,
DomainError from Standard,
ConstructionError from Standard,
NotDone from StdFail,
VectorWithNullMagnitude from gp
is
Create(SSP: MultiLine from AppDef;
FirstPoint, LastPoint: Integer;
TheConstraints: HArray1OfConstraintCouple;
MaxDegree: Integer = 14;
MaxSegment: Integer = 100;
Continuity : Shape from GeomAbs = GeomAbs_C2;
WithMinMax : Boolean = Standard_False;
WithCutting: Boolean = Standard_True;
Tolerance : Real = 1.0;
NbIterations: Integer = 2)
---Purpose: Constructor.
-- Initialization of the fields.
-- warning : Nc0 : number of PassagePoint consraints
-- Nc2 : number of TangencyPoint constraints
-- Nc3 : number of CurvaturePoint constraints
-- if
-- ((MaxDegree-Continuity)*MaxSegment -Nc0 - 2*Nc1
-- -3*Nc2)
-- is negative
-- The problem is over-constrained.
--
-- Limitation : The MultiLine from AppDef has to be composed by
-- only one Line ( Dimension 2 or 3).
returns Variational from AppDef;
Approximate(me : in out)
---Purpose: Makes the approximation with the current fields.
raises NotDone from StdFail
is static;
-- ==================== The Selectors ===========================
IsCreated(me)
---Purpose: returns True if the creation is done
-- and correspond to the current fields.
returns Boolean
is static;
IsDone(me)
---Purpose: returns True if the approximation is ok
-- and correspond to the current fields.
returns Boolean
is static;
IsOverConstrained(me)
---Purpose: returns True if the problem is overconstrained
-- in this case, approximation cannot be done.
returns Boolean
is static;
Value(me)
---Purpose: returns all the BSpline curves approximating the
-- MultiLine from AppDef SSP after minimization of the parameter.
returns MultiBSpCurve from AppParCurves
raises NotDone from StdFail
is static;
MaxError(me)
---Purpose: returns the maximum of the distances between
-- the points of the multiline and the approximation
-- curves.
returns Real
raises NotDone from StdFail
is static;
MaxErrorIndex(me)
---Purpose: returns the index of the MultiPoint of ErrorMax
returns Integer
raises NotDone from StdFail
is static;
QuadraticError(me)
---Purpose: returns the quadratic average of the distances between
-- the points of the multiline and the approximation
-- curves.
returns Real
raises NotDone from StdFail
is static;
Distance(me : in out ; mat : out Matrix from math)
---Purpose: returns the distances between the points of the
-- multiline and the approximation curves.
raises NotDone from StdFail
is static;
AverageError(me)
---Purpose: returns the average error between
-- the MultiLine from AppDef and the approximation.
returns Real
raises NotDone from StdFail
is static;
Parameters(me)
---Purpose: returns the parameters uses to the approximations
---C++: return const&
returns HArray1OfReal
raises NotDone from StdFail
is static;
Knots(me)
---Purpose: returns the knots uses to the approximations
---C++: return const&
returns HArray1OfReal
raises NotDone from StdFail
is static;
Criterium(me; VFirstOrder,
VSecondOrder,
VThirdOrder : out Real)
---Purpose: returns the values of the quality criterium.
raises NotDone from StdFail
is static;
CriteriumWeight(me ;
Percent1, Percent2, Percent3 : out Real)
---Purpose: returns the Weights (as percent) associed to the criterium used in
-- the optimization.
is static;
MaxDegree(me)
---Purpose: returns the Maximum Degree used in the approximation
returns Integer
is static;
MaxSegment(me)
---Purpose: returns the Maximum of segment used in the approximation
returns Integer
is static;
Continuity(me)
---Purpose: returns the Continuity used in the approximation
returns Shape from GeomAbs
is static;
WithMinMax(me)
---Purpose: returns if the approximation search to minimize the
-- maximum Error or not.
returns Boolean
is static;
WithCutting(me)
---Purpose: returns if the approximation can insert new Knots or not.
returns Boolean
is static;
Tolerance(me)
---Purpose: returns the tolerance used in the approximation.
returns Real
is static;
NbIterations(me)
---Purpose: returns the number of iterations used in the approximation.
returns Integer
is static;
Dump(me ; o : in out OStream)
---Purpose: Prints on the stream o information on the current state
-- of the object.
-- MaxError,MaxErrorIndex,AverageError,QuadraticError,Criterium
-- Distances,Degre,Nombre de poles, parametres, noeuds
is static;
SetConstraints(me:in out; aConstrainst:HArray1OfConstraintCouple)
---Purpose: Define the constraints to approximate
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
is static;
SetParameters(me:in out; param : HArray1OfReal)
---Purpose: Defines the parameters used by the approximations.
raises DimensionError
is static;
SetKnots(me:in out; knots : HArray1OfReal)
---Purpose: Defines the knots used by the approximations
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
raises DimensionError,
DomainError
is static;
SetMaxDegree(me: in out; Degree : Integer)
---Purpose: Define the Maximum Degree used in the approximation
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
is static;
SetMaxSegment(me: in out; NbSegment : Integer)
---Purpose: Define the maximum number of segments used in the approximation
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
is static;
SetContinuity(me: in out; C : Shape from GeomAbs)
---Purpose: Define the Continuity used in the approximation
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
raises ConstructionError from Standard
is static;
SetWithMinMax(me: in out; MinMax : Boolean)
---Purpose: Define if the approximation search to minimize the
-- maximum Error or not.
is static;
SetWithCutting(me : in out; Cutting : Boolean )
---Purpose: Define if the approximation can insert new Knots or not.
-- If this value is incompatible with the others fields
-- this method modify nothing and returns false
returns Boolean
is static;
SetCriteriumWeight(me : in out;
Percent1, Percent2, Percent3 : Real)
---Purpose: define the Weights (as percent) associed to the criterium used in
-- the optimization.
--
raises DomainError -- if Percent <= 0
is static;
SetCriteriumWeight(me : in out;
Order : Integer;
Percent : Real)
---Purpose: define the Weight (as percent) associed to the
-- criterium Order used in the optimization : Others
-- weights are updated.
raises DomainError, -- if Percent < 0
OutOfRange -- if Order < 1 or Order > 3
is static;
SetTolerance(me:in out; Tol : Real)
---Purpose: define the tolerance used in the approximation.
is static;
SetNbIterations(me:in out; Iter : Integer)
---Purpose: define the number of iterations used in the approximation.
raises DomainError -- if Iter < 1
is static;
-- ====================== The Private methods ======================
TheMotor(me : in out;
J : in out SmoothCriterion from AppDef;
WQuadratic, WQuality : Real;
TheCurve : in out Curve from FEmTool;
Ecarts : out Array1OfReal from TColStd) is private;
Adjusting(me : in out;
J : in out SmoothCriterion from AppDef;
WQuadratic, WQuality : in out Real;
TheCurve : in out Curve from FEmTool;
Ecarts : out Array1OfReal from TColStd) is private;
Optimization(me;
J : in out SmoothCriterion from AppDef;
A : in out Assembly from FEmTool;
ToAssemble : in Boolean;
EpsDeg : Real;
Curve : out Curve from FEmTool;
Parameters : Array1OfReal from TColStd) is private;
Project(me; C : Curve from FEmTool;
Ti : Array1OfReal from TColStd;
ProjTi : out Array1OfReal from TColStd;
Distance : out Array1OfReal from TColStd;
NumPoints : out Integer;
MaxErr, QuaErr, AveErr : out Real;
NbIterations: Integer=2) is private;
ACR(me; Curve : in out Curve from FEmTool;
Ti : in out Array1OfReal from TColStd;
Decima: Integer) is private;
SplitCurve(me; InCurve : Curve from FEmTool;
Ti : Array1OfReal from TColStd;
CurveTol: Real;
OutCurve: out Curve from FEmTool;
iscut : out Boolean) is private;
Init(me : in out)
raises NotDone from StdFail,
ConstructionError from Standard,
DimensionError from Standard
is private;
InitSmoothCriterion(me : in out)
is private;
InitParameters(me : in out; Length : out Real)
raises ConstructionError from Standard
is private;
InitCriterionEstimations(me; Length : Real; J1, J2, J3 : out Real)
is private;
EstTangent(me; ipnt : Integer; VTang : out Vector from math)
is private;
EstSecnd(me; ipnt : Integer; VTang1, VTang2 : Vector from math;
Length : Real; VScnd : out Vector from math)
is private;
InitCutting(me; aBase : Base from PLib; CurvTol : Real;
aCurve : out Curve from FEmTool)
raises ConstructionError from Standard
is private;
AssemblingConstraints(me; Curve : Curve from FEmTool;
Parameters : Array1OfReal from TColStd;
CBLONG : Real from Standard;
A : out Assembly from FEmTool)
is private;
InitTthetaF(me : in out; ndimen : Integer from Standard;
typcon : Constraint from AppParCurves;
begin : Integer from Standard;
jndex : Integer from Standard)
returns Boolean
is private;
fields
-- Description of the points to smooth and the constraints
mySSP : MultiLine from AppDef;
myNbP3d : Integer;
myNbP2d : Integer;
myDimension : Integer;
myFirstPoint : Integer;
myLastPoint : Integer;
myNbPoints : Integer;
myTabPoints : HArray1OfReal;
myConstraints : HArray1OfConstraintCouple;
myNbConstraints : Integer;
myTabConstraints : HArray1OfReal;
myNbPassPoints : Integer;
myNbTangPoints : Integer;
myNbCurvPoints : Integer;
myTypConstraints : HArray1OfInteger;
myTtheta : HArray1OfReal;
myTfthet : HArray1OfReal;
-- Context parameters
myMaxDegree : Integer;
myMaxSegment : Integer;
myNbIterations: Integer;
myTolerance : Real;
-- Options
myContinuity : Shape from GeomAbs;
myNivCont : Integer;
myWithMinMax : Boolean;
myWithCutting: Boolean;
myPercent : Real[3];
myCriterium : Real[4];
mySmoothCriterion : SmoothCriterion from AppDef;
-- output
myParameters : HArray1OfReal;
myKnots : HArray1OfReal;
myMBSpCurve : MultiBSpCurve;
myMaxError : Real;
myMaxErrorIndex: Integer;
myAverageError : Real;
myIsCreated : Boolean;
myIsDone : Boolean;
myIsOverConstr : Boolean;
end Variational;

View File

@@ -17,7 +17,20 @@
// Approximation d une MultiLine de points decrite par le tool MLineTool.
// avec criteres variationnels
#include <AppDef_Variational.ixx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_SmoothCriterion.hxx>
#include <AppDef_Variational.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <FEmTool_Assembly.hxx>
#include <FEmTool_Curve.hxx>
#include <gp_VectorWithNullMagnitude.hxx>
#include <math_Matrix.hxx>
#include <PLib_Base.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DimensionError.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#define No_Standard_RangeError
#define No_Standard_OutOfRange

View File

@@ -0,0 +1,307 @@
// Created on: 1996-05-14
// Created by: Philippe MANGIN / Jeannine PANCIATICI
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AppDef_Variational_HeaderFile
#define _AppDef_Variational_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <AppDef_MultiLine.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Boolean.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <Standard_OStream.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <math_Vector.hxx>
#include <AppParCurves_Constraint.hxx>
class AppDef_SmoothCriterion;
class Standard_OutOfRange;
class Standard_DimensionError;
class Standard_DomainError;
class Standard_ConstructionError;
class StdFail_NotDone;
class gp_VectorWithNullMagnitude;
class AppDef_MultiLine;
class AppParCurves_MultiBSpCurve;
class math_Matrix;
class FEmTool_Curve;
class FEmTool_Assembly;
class PLib_Base;
//! This class is used to smooth N points with constraints
//! by minimization of quadratic criterium but also
//! variational criterium in order to obtain " fair Curve "
//! Computes the approximation of a Multiline by
//! Variational optimization.
class AppDef_Variational
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor.
//! Initialization of the fields.
//! warning : Nc0 : number of PassagePoint consraints
//! Nc2 : number of TangencyPoint constraints
//! Nc3 : number of CurvaturePoint constraints
//! if
//! ((MaxDegree-Continuity)*MaxSegment -Nc0 - 2*Nc1
//! -3*Nc2)
//! is negative
//! The problem is over-constrained.
//!
//! Limitation : The MultiLine from AppDef has to be composed by
//! only one Line ( Dimension 2 or 3).
Standard_EXPORT AppDef_Variational(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);
//! Makes the approximation with the current fields.
Standard_EXPORT void Approximate();
//! returns True if the creation is done
//! and correspond to the current fields.
Standard_EXPORT Standard_Boolean IsCreated() const;
//! returns True if the approximation is ok
//! and correspond to the current fields.
Standard_EXPORT Standard_Boolean IsDone() const;
//! returns True if the problem is overconstrained
//! in this case, approximation cannot be done.
Standard_EXPORT Standard_Boolean IsOverConstrained() const;
//! returns all the BSpline curves approximating the
//! MultiLine from AppDef SSP after minimization of the parameter.
Standard_EXPORT AppParCurves_MultiBSpCurve Value() const;
//! returns the maximum of the distances between
//! the points of the multiline and the approximation
//! curves.
Standard_EXPORT Standard_Real MaxError() const;
//! returns the index of the MultiPoint of ErrorMax
Standard_EXPORT Standard_Integer MaxErrorIndex() const;
//! returns the quadratic average of the distances between
//! the points of the multiline and the approximation
//! curves.
Standard_EXPORT Standard_Real QuadraticError() const;
//! returns the distances between the points of the
//! multiline and the approximation curves.
Standard_EXPORT void Distance (math_Matrix& mat);
//! returns the average error between
//! the MultiLine from AppDef and the approximation.
Standard_EXPORT Standard_Real AverageError() const;
//! returns the parameters uses to the approximations
Standard_EXPORT const Handle(TColStd_HArray1OfReal)& Parameters() const;
//! returns the knots uses to the approximations
Standard_EXPORT const Handle(TColStd_HArray1OfReal)& Knots() const;
//! returns the values of the quality criterium.
Standard_EXPORT void Criterium (Standard_Real& VFirstOrder, Standard_Real& VSecondOrder, Standard_Real& VThirdOrder) const;
//! returns the Weights (as percent) associed to the criterium used in
//! the optimization.
Standard_EXPORT void CriteriumWeight (Standard_Real& Percent1, Standard_Real& Percent2, Standard_Real& Percent3) const;
//! returns the Maximum Degree used in the approximation
Standard_EXPORT Standard_Integer MaxDegree() const;
//! returns the Maximum of segment used in the approximation
Standard_EXPORT Standard_Integer MaxSegment() const;
//! returns the Continuity used in the approximation
Standard_EXPORT GeomAbs_Shape Continuity() const;
//! returns if the approximation search to minimize the
//! maximum Error or not.
Standard_EXPORT Standard_Boolean WithMinMax() const;
//! returns if the approximation can insert new Knots or not.
Standard_EXPORT Standard_Boolean WithCutting() const;
//! returns the tolerance used in the approximation.
Standard_EXPORT Standard_Real Tolerance() const;
//! returns the number of iterations used in the approximation.
Standard_EXPORT Standard_Integer NbIterations() const;
//! Prints on the stream o information on the current state
//! of the object.
//! MaxError,MaxErrorIndex,AverageError,QuadraticError,Criterium
//! Distances,Degre,Nombre de poles, parametres, noeuds
Standard_EXPORT void Dump (Standard_OStream& o) const;
//! Define the constraints to approximate
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetConstraints (const Handle(AppParCurves_HArray1OfConstraintCouple)& aConstrainst);
//! Defines the parameters used by the approximations.
Standard_EXPORT void SetParameters (const Handle(TColStd_HArray1OfReal)& param);
//! Defines the knots used by the approximations
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetKnots (const Handle(TColStd_HArray1OfReal)& knots);
//! Define the Maximum Degree used in the approximation
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetMaxDegree (const Standard_Integer Degree);
//! Define the maximum number of segments used in the approximation
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetMaxSegment (const Standard_Integer NbSegment);
//! Define the Continuity used in the approximation
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetContinuity (const GeomAbs_Shape C);
//! Define if the approximation search to minimize the
//! maximum Error or not.
Standard_EXPORT void SetWithMinMax (const Standard_Boolean MinMax);
//! Define if the approximation can insert new Knots or not.
//! If this value is incompatible with the others fields
//! this method modify nothing and returns false
Standard_EXPORT Standard_Boolean SetWithCutting (const Standard_Boolean Cutting);
//! define the Weights (as percent) associed to the criterium used in
//! the optimization.
//!
//! if Percent <= 0
Standard_EXPORT void SetCriteriumWeight (const Standard_Real Percent1, const Standard_Real Percent2, const Standard_Real Percent3);
//! define the Weight (as percent) associed to the
//! criterium Order used in the optimization : Others
//! weights are updated.
//! if Percent < 0
//! if Order < 1 or Order > 3
Standard_EXPORT void SetCriteriumWeight (const Standard_Integer Order, const Standard_Real Percent);
//! define the tolerance used in the approximation.
Standard_EXPORT void SetTolerance (const Standard_Real Tol);
//! define the number of iterations used in the approximation.
//! if Iter < 1
Standard_EXPORT void SetNbIterations (const Standard_Integer Iter);
protected:
private:
Standard_EXPORT void TheMotor (Handle(AppDef_SmoothCriterion)& J, const Standard_Real WQuadratic, const Standard_Real WQuality, Handle(FEmTool_Curve)& TheCurve, TColStd_Array1OfReal& Ecarts);
Standard_EXPORT void Adjusting (Handle(AppDef_SmoothCriterion)& J, Standard_Real& WQuadratic, Standard_Real& WQuality, Handle(FEmTool_Curve)& TheCurve, TColStd_Array1OfReal& Ecarts);
Standard_EXPORT void Optimization (Handle(AppDef_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(AppDef_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;
};
#endif // _AppDef_Variational_HeaderFile

View File

@@ -1,2 +1,62 @@
AppDef_Array1OfMultiPointConstraint.hxx
AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute.hxx
AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_0.cxx
AppDef_BSplineCompute.hxx
AppDef_BSplineCompute_0.cxx
AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx
AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute_0.cxx
AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx
AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute_0.cxx
AppDef_Compute.hxx
AppDef_Compute_0.cxx
AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute.hxx
AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_0.cxx
AppDef_Gradient_BFGSOfMyGradientOfCompute.hxx
AppDef_Gradient_BFGSOfMyGradientOfCompute_0.cxx
AppDef_Gradient_BFGSOfTheGradient.hxx
AppDef_Gradient_BFGSOfTheGradient_0.cxx
AppDef_HArray1OfMultiPointConstraint.hxx
AppDef_LinearCriteria.cxx
AppDef_LinearCriteria.hxx
AppDef_MultiLine.cxx
AppDef_MultiLine.hxx
AppDef_MultiPointConstraint.cxx
AppDef_MultiPointConstraint.hxx
AppDef_MyBSplGradientOfBSplineCompute.hxx
AppDef_MyBSplGradientOfBSplineCompute_0.cxx
AppDef_MyGradientbisOfBSplineCompute.hxx
AppDef_MyGradientbisOfBSplineCompute_0.cxx
AppDef_MyGradientOfCompute.hxx
AppDef_MyGradientOfCompute_0.cxx
AppDef_MyLineTool.cxx
AppDef_MyLineTool.hxx
AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx
AppDef_ParFunctionOfMyGradientbisOfBSplineCompute_0.cxx
AppDef_ParFunctionOfMyGradientOfCompute.hxx
AppDef_ParFunctionOfMyGradientOfCompute_0.cxx
AppDef_ParFunctionOfTheGradient.hxx
AppDef_ParFunctionOfTheGradient_0.cxx
AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx
AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute_0.cxx
AppDef_ParLeastSquareOfMyGradientOfCompute.hxx
AppDef_ParLeastSquareOfMyGradientOfCompute_0.cxx
AppDef_ParLeastSquareOfTheGradient.hxx
AppDef_ParLeastSquareOfTheGradient_0.cxx
AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx
AppDef_ResConstraintOfMyGradientbisOfBSplineCompute_0.cxx
AppDef_ResConstraintOfMyGradientOfCompute.hxx
AppDef_ResConstraintOfMyGradientOfCompute_0.cxx
AppDef_ResConstraintOfTheGradient.hxx
AppDef_ResConstraintOfTheGradient_0.cxx
AppDef_SmoothCriterion.cxx
AppDef_SmoothCriterion.hxx
AppDef_TheFunction.hxx
AppDef_TheFunction_0.cxx
AppDef_TheGradient.hxx
AppDef_TheGradient_0.cxx
AppDef_TheLeastSquares.hxx
AppDef_TheLeastSquares_0.cxx
AppDef_TheResol.hxx
AppDef_TheResol_0.cxx
AppDef_Variational.cxx
AppDef_Variational.hxx