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