Open CASCADE Technology  7.6.0
Public Member Functions

AppDef_Variational Class Reference

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. More...

#include <AppDef_Variational.hxx>

Public Member Functions

 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)
 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. More...
 
void Approximate ()
 Makes the approximation with the current fields. More...
 
Standard_Boolean IsCreated () const
 returns True if the creation is done and correspond to the current fields. More...
 
Standard_Boolean IsDone () const
 returns True if the approximation is ok and correspond to the current fields. More...
 
Standard_Boolean IsOverConstrained () const
 returns True if the problem is overconstrained in this case, approximation cannot be done. More...
 
AppParCurves_MultiBSpCurve Value () const
 returns all the BSpline curves approximating the MultiLine from AppDef SSP after minimization of the parameter. More...
 
Standard_Real MaxError () const
 returns the maximum of the distances between the points of the multiline and the approximation curves. More...
 
Standard_Integer MaxErrorIndex () const
 returns the index of the MultiPoint of ErrorMax More...
 
Standard_Real QuadraticError () const
 returns the quadratic average of the distances between the points of the multiline and the approximation curves. More...
 
void Distance (math_Matrix &mat)
 returns the distances between the points of the multiline and the approximation curves. More...
 
Standard_Real AverageError () const
 returns the average error between the MultiLine from AppDef and the approximation. More...
 
const Handle< TColStd_HArray1OfReal > & Parameters () const
 returns the parameters uses to the approximations More...
 
const Handle< TColStd_HArray1OfReal > & Knots () const
 returns the knots uses to the approximations More...
 
void Criterium (Standard_Real &VFirstOrder, Standard_Real &VSecondOrder, Standard_Real &VThirdOrder) const
 returns the values of the quality criterium. More...
 
void CriteriumWeight (Standard_Real &Percent1, Standard_Real &Percent2, Standard_Real &Percent3) const
 returns the Weights (as percent) associed to the criterium used in the optimization. More...
 
Standard_Integer MaxDegree () const
 returns the Maximum Degree used in the approximation More...
 
Standard_Integer MaxSegment () const
 returns the Maximum of segment used in the approximation More...
 
GeomAbs_Shape Continuity () const
 returns the Continuity used in the approximation More...
 
Standard_Boolean WithMinMax () const
 returns if the approximation search to minimize the maximum Error or not. More...
 
Standard_Boolean WithCutting () const
 returns if the approximation can insert new Knots or not. More...
 
Standard_Real Tolerance () const
 returns the tolerance used in the approximation. More...
 
Standard_Integer NbIterations () const
 returns the number of iterations used in the approximation. More...
 
void Dump (Standard_OStream &o) 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. More...
 
Standard_Boolean SetConstraints (const Handle< AppParCurves_HArray1OfConstraintCouple > &aConstrainst)
 Define the constraints to approximate If this value is incompatible with the others fields this method modify nothing and returns false. More...
 
void SetParameters (const Handle< TColStd_HArray1OfReal > &param)
 Defines the parameters used by the approximations. More...
 
Standard_Boolean SetKnots (const Handle< TColStd_HArray1OfReal > &knots)
 Defines the knots used by the approximations If this value is incompatible with the others fields this method modify nothing and returns false. More...
 
Standard_Boolean SetMaxDegree (const Standard_Integer Degree)
 Define the Maximum Degree used in the approximation If this value is incompatible with the others fields this method modify nothing and returns false. More...
 
Standard_Boolean SetMaxSegment (const Standard_Integer NbSegment)
 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. More...
 
Standard_Boolean SetContinuity (const GeomAbs_Shape C)
 Define the Continuity used in the approximation If this value is incompatible with the others fields this method modify nothing and returns false. More...
 
void SetWithMinMax (const Standard_Boolean MinMax)
 Define if the approximation search to minimize the maximum Error or not. More...
 
Standard_Boolean SetWithCutting (const Standard_Boolean Cutting)
 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. More...
 
void SetCriteriumWeight (const Standard_Real Percent1, const Standard_Real Percent2, const Standard_Real Percent3)
 define the Weights (as percent) associed to the criterium used in the optimization. More...
 
void SetCriteriumWeight (const Standard_Integer Order, const Standard_Real Percent)
 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 More...
 
void SetTolerance (const Standard_Real Tol)
 define the tolerance used in the approximation. More...
 
void SetNbIterations (const Standard_Integer Iter)
 define the number of iterations used in the approximation. if Iter < 1 More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AppDef_Variational()

AppDef_Variational::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 
)

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).

Member Function Documentation

◆ Approximate()

void AppDef_Variational::Approximate ( )

Makes the approximation with the current fields.

◆ AverageError()

Standard_Real AppDef_Variational::AverageError ( ) const

returns the average error between the MultiLine from AppDef and the approximation.

◆ Continuity()

GeomAbs_Shape AppDef_Variational::Continuity ( ) const

returns the Continuity used in the approximation

◆ Criterium()

void AppDef_Variational::Criterium ( Standard_Real VFirstOrder,
Standard_Real VSecondOrder,
Standard_Real VThirdOrder 
) const

returns the values of the quality criterium.

◆ CriteriumWeight()

void AppDef_Variational::CriteriumWeight ( Standard_Real Percent1,
Standard_Real Percent2,
Standard_Real Percent3 
) const

returns the Weights (as percent) associed to the criterium used in the optimization.

◆ Distance()

void AppDef_Variational::Distance ( math_Matrix mat)

returns the distances between the points of the multiline and the approximation curves.

◆ Dump()

void AppDef_Variational::Dump ( Standard_OStream o) 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.

◆ IsCreated()

Standard_Boolean AppDef_Variational::IsCreated ( ) const

returns True if the creation is done and correspond to the current fields.

◆ IsDone()

Standard_Boolean AppDef_Variational::IsDone ( ) const

returns True if the approximation is ok and correspond to the current fields.

◆ IsOverConstrained()

Standard_Boolean AppDef_Variational::IsOverConstrained ( ) const

returns True if the problem is overconstrained in this case, approximation cannot be done.

◆ Knots()

const Handle< TColStd_HArray1OfReal >& AppDef_Variational::Knots ( ) const

returns the knots uses to the approximations

◆ MaxDegree()

Standard_Integer AppDef_Variational::MaxDegree ( ) const

returns the Maximum Degree used in the approximation

◆ MaxError()

Standard_Real AppDef_Variational::MaxError ( ) const

returns the maximum of the distances between the points of the multiline and the approximation curves.

◆ MaxErrorIndex()

Standard_Integer AppDef_Variational::MaxErrorIndex ( ) const

returns the index of the MultiPoint of ErrorMax

◆ MaxSegment()

Standard_Integer AppDef_Variational::MaxSegment ( ) const

returns the Maximum of segment used in the approximation

◆ NbIterations()

Standard_Integer AppDef_Variational::NbIterations ( ) const

returns the number of iterations used in the approximation.

◆ Parameters()

const Handle< TColStd_HArray1OfReal >& AppDef_Variational::Parameters ( ) const

returns the parameters uses to the approximations

◆ QuadraticError()

Standard_Real AppDef_Variational::QuadraticError ( ) const

returns the quadratic average of the distances between the points of the multiline and the approximation curves.

◆ SetConstraints()

Standard_Boolean AppDef_Variational::SetConstraints ( const Handle< AppParCurves_HArray1OfConstraintCouple > &  aConstrainst)

Define the constraints to approximate If this value is incompatible with the others fields this method modify nothing and returns false.

◆ SetContinuity()

Standard_Boolean AppDef_Variational::SetContinuity ( const GeomAbs_Shape  C)

Define the Continuity used in the approximation If this value is incompatible with the others fields this method modify nothing and returns false.

◆ SetCriteriumWeight() [1/2]

void AppDef_Variational::SetCriteriumWeight ( const Standard_Integer  Order,
const Standard_Real  Percent 
)

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

◆ SetCriteriumWeight() [2/2]

void AppDef_Variational::SetCriteriumWeight ( const Standard_Real  Percent1,
const Standard_Real  Percent2,
const Standard_Real  Percent3 
)

define the Weights (as percent) associed to the criterium used in the optimization.

if Percent <= 0

◆ SetKnots()

Standard_Boolean AppDef_Variational::SetKnots ( const Handle< TColStd_HArray1OfReal > &  knots)

Defines the knots used by the approximations If this value is incompatible with the others fields this method modify nothing and returns false.

◆ SetMaxDegree()

Standard_Boolean AppDef_Variational::SetMaxDegree ( const Standard_Integer  Degree)

Define the Maximum Degree used in the approximation If this value is incompatible with the others fields this method modify nothing and returns false.

◆ SetMaxSegment()

Standard_Boolean AppDef_Variational::SetMaxSegment ( const Standard_Integer  NbSegment)

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.

◆ SetNbIterations()

void AppDef_Variational::SetNbIterations ( const Standard_Integer  Iter)

define the number of iterations used in the approximation. if Iter < 1

◆ SetParameters()

void AppDef_Variational::SetParameters ( const Handle< TColStd_HArray1OfReal > &  param)

Defines the parameters used by the approximations.

◆ SetTolerance()

void AppDef_Variational::SetTolerance ( const Standard_Real  Tol)

define the tolerance used in the approximation.

◆ SetWithCutting()

Standard_Boolean AppDef_Variational::SetWithCutting ( const Standard_Boolean  Cutting)

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.

◆ SetWithMinMax()

void AppDef_Variational::SetWithMinMax ( const Standard_Boolean  MinMax)

Define if the approximation search to minimize the maximum Error or not.

◆ Tolerance()

Standard_Real AppDef_Variational::Tolerance ( ) const

returns the tolerance used in the approximation.

◆ Value()

AppParCurves_MultiBSpCurve AppDef_Variational::Value ( ) const

returns all the BSpline curves approximating the MultiLine from AppDef SSP after minimization of the parameter.

◆ WithCutting()

Standard_Boolean AppDef_Variational::WithCutting ( ) const

returns if the approximation can insert new Knots or not.

◆ WithMinMax()

Standard_Boolean AppDef_Variational::WithMinMax ( ) const

returns if the approximation search to minimize the maximum Error or not.


The documentation for this class was generated from the following file: