Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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 int FirstPoint, const int LastPoint, const occ::handle< NCollection_HArray1< AppParCurves_ConstraintCouple > > &TheConstraints, const int MaxDegree=14, const int MaxSegment=100, const GeomAbs_Shape Continuity=GeomAbs_C2, const bool WithMinMax=false, const bool WithCutting=true, const double Tolerance=1.0, const int 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.
 
void Approximate ()
 Makes the approximation with the current fields.
 
bool IsCreated () const
 returns True if the creation is done and correspond to the current fields.
 
bool IsDone () const
 returns True if the approximation is ok and correspond to the current fields.
 
bool IsOverConstrained () const
 returns True if the problem is overconstrained in this case, approximation cannot be done.
 
AppParCurves_MultiBSpCurve Value () const
 returns all the BSpline curves approximating the MultiLine from AppDef SSP after minimization of the parameter.
 
double MaxError () const
 returns the maximum of the distances between the points of the multiline and the approximation curves.
 
int MaxErrorIndex () const
 returns the index of the MultiPoint of ErrorMax
 
double QuadraticError () const
 returns the quadratic average of the distances between the points of the multiline and the approximation curves.
 
void Distance (math_Matrix &mat)
 returns the distances between the points of the multiline and the approximation curves.
 
double AverageError () const
 returns the average error between the MultiLine from AppDef and the approximation.
 
const occ::handle< NCollection_HArray1< double > > & Parameters () const
 returns the parameters uses to the approximations
 
const occ::handle< NCollection_HArray1< double > > & Knots () const
 returns the knots uses to the approximations
 
void Criterium (double &VFirstOrder, double &VSecondOrder, double &VThirdOrder) const
 returns the values of the quality criterium.
 
void CriteriumWeight (double &Percent1, double &Percent2, double &Percent3) const
 returns the Weights (as percent) associed to the criterium used in the optimization.
 
int MaxDegree () const
 returns the Maximum Degree used in the approximation
 
int MaxSegment () const
 returns the Maximum of segment used in the approximation
 
GeomAbs_Shape Continuity () const
 returns the Continuity used in the approximation
 
bool WithMinMax () const
 returns if the approximation search to minimize the maximum Error or not.
 
bool WithCutting () const
 returns if the approximation can insert new Knots or not.
 
double Tolerance () const
 returns the tolerance used in the approximation.
 
int NbIterations () const
 returns the number of iterations used in the approximation.
 
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.
 
bool SetConstraints (const occ::handle< NCollection_HArray1< AppParCurves_ConstraintCouple > > &aConstrainst)
 Define the constraints to approximate If this value is incompatible with the others fields this method modify nothing and returns false.
 
void SetParameters (const occ::handle< NCollection_HArray1< double > > &param)
 Defines the parameters used by the approximations.
 
bool SetKnots (const occ::handle< NCollection_HArray1< double > > &knots)
 Defines the knots used by the approximations If this value is incompatible with the others fields this method modify nothing and returns false.
 
bool SetMaxDegree (const int 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.
 
bool SetMaxSegment (const int 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.
 
bool 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.
 
void SetWithMinMax (const bool MinMax)
 Define if the approximation search to minimize the maximum Error or not.
 
bool SetWithCutting (const bool 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.
 
void SetCriteriumWeight (const double Percent1, const double Percent2, const double Percent3)
 define the Weights (as percent) associed to the criterium used in the optimization.
 
void SetCriteriumWeight (const int Order, const double 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
 
void SetTolerance (const double Tol)
 define the tolerance used in the approximation.
 
void SetNbIterations (const int Iter)
 define the number of iterations used in the approximation. if Iter < 1
 

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 int FirstPoint,
const int LastPoint,
const occ::handle< NCollection_HArray1< AppParCurves_ConstraintCouple > > & TheConstraints,
const int MaxDegree = 14,
const int MaxSegment = 100,
const GeomAbs_Shape Continuity = GeomAbs_C2,
const bool WithMinMax = false,
const bool WithCutting = true,
const double Tolerance = 1.0,
const int 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()

double 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 ( double & VFirstOrder,
double & VSecondOrder,
double & VThirdOrder ) const

returns the values of the quality criterium.

◆ CriteriumWeight()

void AppDef_Variational::CriteriumWeight ( double & Percent1,
double & Percent2,
double & 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()

bool AppDef_Variational::IsCreated ( ) const

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

◆ IsDone()

bool AppDef_Variational::IsDone ( ) const

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

◆ IsOverConstrained()

bool AppDef_Variational::IsOverConstrained ( ) const

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

◆ Knots()

const occ::handle< NCollection_HArray1< double > > & AppDef_Variational::Knots ( ) const

returns the knots uses to the approximations

◆ MaxDegree()

int AppDef_Variational::MaxDegree ( ) const

returns the Maximum Degree used in the approximation

◆ MaxError()

double AppDef_Variational::MaxError ( ) const

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

◆ MaxErrorIndex()

int AppDef_Variational::MaxErrorIndex ( ) const

returns the index of the MultiPoint of ErrorMax

◆ MaxSegment()

int AppDef_Variational::MaxSegment ( ) const

returns the Maximum of segment used in the approximation

◆ NbIterations()

int AppDef_Variational::NbIterations ( ) const

returns the number of iterations used in the approximation.

◆ Parameters()

const occ::handle< NCollection_HArray1< double > > & AppDef_Variational::Parameters ( ) const

returns the parameters uses to the approximations

◆ QuadraticError()

double AppDef_Variational::QuadraticError ( ) const

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

◆ SetConstraints()

bool AppDef_Variational::SetConstraints ( const occ::handle< NCollection_HArray1< AppParCurves_ConstraintCouple > > & aConstrainst)

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

◆ SetContinuity()

bool 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 double Percent1,
const double Percent2,
const double Percent3 )

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

if Percent <= 0

◆ SetCriteriumWeight() [2/2]

void AppDef_Variational::SetCriteriumWeight ( const int Order,
const double 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

◆ SetKnots()

bool AppDef_Variational::SetKnots ( const occ::handle< NCollection_HArray1< double > > & 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()

bool AppDef_Variational::SetMaxDegree ( const int 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()

bool AppDef_Variational::SetMaxSegment ( const int 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 int Iter)

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

◆ SetParameters()

void AppDef_Variational::SetParameters ( const occ::handle< NCollection_HArray1< double > > & param)

Defines the parameters used by the approximations.

◆ SetTolerance()

void AppDef_Variational::SetTolerance ( const double Tol)

define the tolerance used in the approximation.

◆ SetWithCutting()

bool AppDef_Variational::SetWithCutting ( const bool 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 bool MinMax)

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

◆ Tolerance()

double 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()

bool AppDef_Variational::WithCutting ( ) const

returns if the approximation can insert new Knots or not.

◆ WithMinMax()

bool 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: