mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0026595: Lost some comments in OCCT-code after cdl elimination
Recovered comments for instance classes from CDL generic classes.
This commit is contained in:
@@ -51,30 +51,59 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has <NbPol> control points.
|
||||
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);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiBSpCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex);
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiBSpCurve.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiBSpCurve.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! multiline.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used to approximate the
|
||||
//! multiline.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& Index() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
|
||||
@@ -91,6 +120,8 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform (const math_Vector& X);
|
||||
|
||||
|
||||
|
@@ -52,46 +52,120 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! NbPol is the number of control points wanted
|
||||
//! for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the Bernstein matrix computed with the
|
||||
//! parameters, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! Deg is the degree wanted for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the BSpline functions matrix computed with
|
||||
//! <parameters>, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! The case "CurvaturePoint" is not treated in this method.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
//! <V1c> is the tangent vector at the first point.
|
||||
//! <V2c> is the tangent vector at the last point.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! set.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used
|
||||
//! to approximate the set.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances. Grad is the derivative vector of the
|
||||
//! function F.
|
||||
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the distances between the points of the
|
||||
//! multiline and the approximation curves.
|
||||
Standard_EXPORT const math_Matrix& Distance();
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances.
|
||||
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real LastLambda() const;
|
||||
|
||||
//! returns the matrix of points value.
|
||||
Standard_EXPORT const math_Matrix& Points() const;
|
||||
|
||||
//! returns the matrix of resulting control points value.
|
||||
Standard_EXPORT const math_Matrix& Poles() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& KIndex() const;
|
||||
|
||||
|
||||
@@ -100,24 +174,33 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used by the constuctors above.
|
||||
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
|
||||
|
||||
//! returns the last point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
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);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
|
||||
|
||||
|
||||
|
@@ -56,44 +56,86 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! The MultiLine <Line> will be approximated until tolerances
|
||||
//! will be reached.
|
||||
//! The approximation will be done from degreemin to degreemax
|
||||
//! with a cutting if the corresponding boolean is True.
|
||||
//! If <Squares> is True, the computation will be done with
|
||||
//! no iteration at all.
|
||||
//!
|
||||
//! The multiplicities of the internal knots is set by
|
||||
//! default.
|
||||
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);
|
||||
|
||||
//! The MultiLine <Line> will be approximated until tolerances
|
||||
//! will be reached.
|
||||
//! The approximation will be done from degreemin to degreemax
|
||||
//! with a cutting if the corresponding boolean is True.
|
||||
//! If <Squares> is True, the computation will be done with
|
||||
//! no iteration at all.
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! Constructs an interpolation of the MultiLine <Line>
|
||||
//! The result will be a C2 curve of degree 3.
|
||||
Standard_EXPORT void Interpol (const AppDef_MultiLine& Line);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! runs the algorithm after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
|
||||
|
||||
//! The approximation will begin with the
|
||||
//! set of parameters <ThePar>.
|
||||
Standard_EXPORT void SetParameters (const math_Vector& ThePar);
|
||||
|
||||
//! The approximation will be done with the
|
||||
//! set of knots <Knots>. The multiplicities will be set
|
||||
//! with the degree and the desired continuity.
|
||||
Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots);
|
||||
|
||||
//! The approximation will be done with the
|
||||
//! set of knots <Knots> and the multiplicities <Mults>.
|
||||
Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
|
||||
|
||||
//! changes the degrees of the approximation.
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
|
||||
//! Changes the tolerances of the approximation.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
|
||||
//! sets the continuity of the spline.
|
||||
//! if C = 2, the spline will be C2.
|
||||
Standard_EXPORT void SetContinuity (const Standard_Integer C);
|
||||
|
||||
//! changes the first and the last constraint points.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
|
||||
//! returns False if the status NoPointsAdded has been sent.
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
|
||||
//! returns the tolerances 2d and 3d of the MultiBSpCurve.
|
||||
Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const;
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue();
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the MultiBSpCurve.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters() const;
|
||||
|
||||
|
||||
@@ -108,10 +150,13 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
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);
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
|
||||
|
||||
//! computes new parameters between firstP and lastP.
|
||||
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;
|
||||
|
@@ -54,40 +54,72 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! The MultiLine <Line> will be approximated until tolerances
|
||||
//! will be reached.
|
||||
//! The approximation will be done from degreemin to degreemax
|
||||
//! with a cutting if the corresponding boolean is True.
|
||||
//! If <Squares> is True, the computation will be done with
|
||||
//! no iteration at all.
|
||||
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);
|
||||
|
||||
//! The MultiLine <Line> will be approximated until tolerances
|
||||
//! will be reached.
|
||||
//! The approximation will be done from degreemin to degreemax
|
||||
//! with a cutting if the corresponding boolean is True.
|
||||
//! If <Squares> is True, the computation will be done with
|
||||
//! no iteration at all.
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the algorithm.
|
||||
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);
|
||||
|
||||
//! runs the algorithm after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
|
||||
|
||||
//! changes the degrees of the approximation.
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
|
||||
//! Changes the tolerances of the approximation.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
|
||||
//! changes the first and the last constraint points.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
|
||||
//! returns False if the status NoPointsAdded has been sent.
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
|
||||
//! returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
|
||||
//! Returns the number of MultiCurve doing the approximation
|
||||
//! of the MultiLine.
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
|
||||
|
||||
//! returns the type of parametrization
|
||||
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the multicurve <Index>.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
|
||||
|
||||
|
||||
@@ -102,10 +134,13 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
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);
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
|
||||
|
||||
//! computes new parameters between firstP and lastP.
|
||||
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;
|
||||
|
@@ -47,20 +47,45 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating BSpline curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
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);
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating BSpline curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns all the BSpline curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiBSpCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real AverageError() const;
|
||||
|
||||
|
||||
|
@@ -46,18 +46,37 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating Bezier curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns all the Bezier curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real AverageError() const;
|
||||
|
||||
|
||||
|
@@ -46,18 +46,37 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating Bezier curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns all the Bezier curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real AverageError() const;
|
||||
|
||||
|
||||
|
@@ -48,24 +48,45 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
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);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
|
||||
@@ -78,6 +99,8 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform (const math_Vector& X);
|
||||
|
||||
|
||||
|
@@ -48,24 +48,45 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
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);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
|
||||
@@ -78,6 +99,8 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform (const math_Vector& X);
|
||||
|
||||
|
||||
|
@@ -48,24 +48,45 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
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);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
|
||||
@@ -78,6 +99,8 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform (const math_Vector& X);
|
||||
|
||||
|
||||
|
@@ -52,46 +52,120 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! NbPol is the number of control points wanted
|
||||
//! for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the Bernstein matrix computed with the
|
||||
//! parameters, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! Deg is the degree wanted for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the BSpline functions matrix computed with
|
||||
//! <parameters>, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! The case "CurvaturePoint" is not treated in this method.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
//! <V1c> is the tangent vector at the first point.
|
||||
//! <V2c> is the tangent vector at the last point.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! set.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used
|
||||
//! to approximate the set.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances. Grad is the derivative vector of the
|
||||
//! function F.
|
||||
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the distances between the points of the
|
||||
//! multiline and the approximation curves.
|
||||
Standard_EXPORT const math_Matrix& Distance();
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances.
|
||||
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real LastLambda() const;
|
||||
|
||||
//! returns the matrix of points value.
|
||||
Standard_EXPORT const math_Matrix& Points() const;
|
||||
|
||||
//! returns the matrix of resulting control points value.
|
||||
Standard_EXPORT const math_Matrix& Poles() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& KIndex() const;
|
||||
|
||||
|
||||
@@ -100,24 +174,33 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used by the constuctors above.
|
||||
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
|
||||
|
||||
//! returns the last point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
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);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
|
||||
|
||||
|
||||
|
@@ -52,46 +52,120 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! NbPol is the number of control points wanted
|
||||
//! for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the Bernstein matrix computed with the
|
||||
//! parameters, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! Deg is the degree wanted for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the BSpline functions matrix computed with
|
||||
//! <parameters>, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! The case "CurvaturePoint" is not treated in this method.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
//! <V1c> is the tangent vector at the first point.
|
||||
//! <V2c> is the tangent vector at the last point.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! set.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used
|
||||
//! to approximate the set.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances. Grad is the derivative vector of the
|
||||
//! function F.
|
||||
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the distances between the points of the
|
||||
//! multiline and the approximation curves.
|
||||
Standard_EXPORT const math_Matrix& Distance();
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances.
|
||||
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real LastLambda() const;
|
||||
|
||||
//! returns the matrix of points value.
|
||||
Standard_EXPORT const math_Matrix& Points() const;
|
||||
|
||||
//! returns the matrix of resulting control points value.
|
||||
Standard_EXPORT const math_Matrix& Poles() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& KIndex() const;
|
||||
|
||||
|
||||
@@ -100,24 +174,33 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used by the constuctors above.
|
||||
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
|
||||
|
||||
//! returns the last point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
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);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
|
||||
|
||||
|
||||
|
@@ -52,46 +52,120 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! NbPol is the number of control points wanted
|
||||
//! for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the Bernstein matrix computed with the
|
||||
//! parameters, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! Deg is the degree wanted for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the BSpline functions matrix computed with
|
||||
//! <parameters>, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! The case "CurvaturePoint" is not treated in this method.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
//! <V1c> is the tangent vector at the first point.
|
||||
//! <V2c> is the tangent vector at the last point.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! set.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used
|
||||
//! to approximate the set.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances. Grad is the derivative vector of the
|
||||
//! function F.
|
||||
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the distances between the points of the
|
||||
//! multiline and the approximation curves.
|
||||
Standard_EXPORT const math_Matrix& Distance();
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances.
|
||||
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real LastLambda() const;
|
||||
|
||||
//! returns the matrix of points value.
|
||||
Standard_EXPORT const math_Matrix& Points() const;
|
||||
|
||||
//! returns the matrix of resulting control points value.
|
||||
Standard_EXPORT const math_Matrix& Poles() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& KIndex() const;
|
||||
|
||||
|
||||
@@ -100,24 +174,33 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used by the constuctors above.
|
||||
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
|
||||
|
||||
//! returns the last point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
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);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
|
||||
|
||||
|
||||
|
@@ -43,18 +43,35 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT Standard_Real Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
|
||||
@@ -63,8 +80,10 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
|
||||
|
||||
|
||||
|
@@ -43,18 +43,35 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT Standard_Real Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
|
||||
@@ -63,8 +80,10 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
|
||||
|
||||
|
||||
|
@@ -43,18 +43,35 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT Standard_Real Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
|
||||
@@ -63,8 +80,10 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
|
||||
|
||||
|
||||
|
@@ -48,24 +48,45 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! initializes the fields of the function. The approximating
|
||||
//! curve has the desired degree Deg.
|
||||
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);
|
||||
|
||||
//! returns the number of variables of the function. It
|
||||
//! corresponds to the number of MultiPoints.
|
||||
Standard_EXPORT Standard_Integer NbVariables() const;
|
||||
|
||||
//! this method computes the new approximation of the
|
||||
//! MultiLine
|
||||
//! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
|
||||
//! point of the MultiLine.
|
||||
Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
|
||||
|
||||
//! returns the gradient G of the sum above for the
|
||||
//! parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
|
||||
|
||||
//! returns the value F=sum(||Pui - Bi*Pi||)2.
|
||||
//! returns the value G = grad(F) for the parameters Xi.
|
||||
Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
|
||||
|
||||
//! returns the new parameters of the MultiLine.
|
||||
Standard_EXPORT const math_Vector& NewParameters() const;
|
||||
|
||||
//! returns the MultiCurve approximating the set after
|
||||
//! computing the value F or Grad(F).
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
|
||||
|
||||
//! returns the distance between the MultiPoint of range
|
||||
//! IPoint and the curve CurveIndex.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum distance between the points
|
||||
//! and the MultiCurve.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
|
||||
@@ -78,6 +99,8 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! this method is used each time Value or Gradient is
|
||||
//! needed.
|
||||
Standard_EXPORT void Perform (const math_Vector& X);
|
||||
|
||||
|
||||
|
@@ -46,18 +46,37 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Tries to minimize the sum (square(||Qui - Bi*Pi||))
|
||||
//! where Pui describe the approximating Bezier curves'Poles
|
||||
//! and Qi the MultiLine points with a parameter ui.
|
||||
//! In this algorithm, the parameters ui are the unknowns.
|
||||
//! The tolerance required on this sum is given by Tol.
|
||||
//! The desired degree of the resulting curve is Deg.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns all the Bezier curves approximating the
|
||||
//! MultiLine SSP after minimization of the parameter.
|
||||
Standard_EXPORT AppParCurves_MultiCurve Value() const;
|
||||
|
||||
//! returns the difference between the old and the new
|
||||
//! approximation.
|
||||
//! An exception is raised if NotDone.
|
||||
//! An exception is raised if Index<1 or Index>NbParameters.
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError3d() const;
|
||||
|
||||
//! returns the maximum difference between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real MaxError2d() const;
|
||||
|
||||
//! returns the average error between the old and the
|
||||
//! new approximation.
|
||||
Standard_EXPORT Standard_Real AverageError() const;
|
||||
|
||||
|
||||
|
@@ -52,46 +52,120 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! NbPol is the number of control points wanted
|
||||
//! for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the Bernstein matrix computed with the
|
||||
//! parameters, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! given a MultiLine, this algorithm computes the least
|
||||
//! square resolution using the Householder-QR method.
|
||||
//! If the first and/or the last point is a constraint
|
||||
//! point, the value of the tangency or curvature is
|
||||
//! computed in the resolution.
|
||||
//! Deg is the degree wanted for the approximating curves.
|
||||
//! The system to solve is the following:
|
||||
//! A X = B.
|
||||
//! Where A is the BSpline functions matrix computed with
|
||||
//! <parameters>, B the points coordinates and X the poles
|
||||
//! solutions.
|
||||
//! The matrix A is the same for each coordinate x, y and z
|
||||
//! and is also the same for each MultiLine point because
|
||||
//! they are approximated in parallel(so with the same
|
||||
//! parameter, only the vector B changes).
|
||||
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);
|
||||
|
||||
//! Initializes the fields of the object.
|
||||
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);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! The case "CurvaturePoint" is not treated in this method.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2);
|
||||
|
||||
//! Is used after having initialized the fields.
|
||||
//! <V1t> is the tangent vector at the first point.
|
||||
//! <V2t> is the tangent vector at the last point.
|
||||
//! <V1c> is the tangent vector at the first point.
|
||||
//! <V2c> is the tangent vector at the last point.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT AppParCurves_MultiCurve BezierValue();
|
||||
|
||||
//! returns the result of the approximation, i.e. all the
|
||||
//! Curves.
|
||||
//! An exception is raised if NotDone.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue();
|
||||
|
||||
//! returns the function matrix used to approximate the
|
||||
//! set.
|
||||
Standard_EXPORT const math_Matrix& FunctionMatrix() const;
|
||||
|
||||
//! returns the derivative function matrix used
|
||||
//! to approximate the set.
|
||||
Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const;
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances. Grad is the derivative vector of the
|
||||
//! function F.
|
||||
Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the distances between the points of the
|
||||
//! multiline and the approximation curves.
|
||||
Standard_EXPORT const math_Matrix& Distance();
|
||||
|
||||
//! returns the maximum errors between the MultiLine
|
||||
//! and the approximation curves. F is the sum of the square
|
||||
//! distances.
|
||||
Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d);
|
||||
|
||||
//! returns the value (P2 - P1)/ V1 if the first point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real FirstLambda() const;
|
||||
|
||||
//! returns the value (PN - PN-1)/ VN if the last point
|
||||
//! was a tangency point.
|
||||
Standard_EXPORT Standard_Real LastLambda() const;
|
||||
|
||||
//! returns the matrix of points value.
|
||||
Standard_EXPORT const math_Matrix& Points() const;
|
||||
|
||||
//! returns the matrix of resulting control points value.
|
||||
Standard_EXPORT const math_Matrix& Poles() const;
|
||||
|
||||
//! Returns the indexes of the first non null values of
|
||||
//! A and DA.
|
||||
//! The values are non null from Index(ieme point) +1
|
||||
//! to Index(ieme point) + degree +1.
|
||||
Standard_EXPORT const math_IntegerVector& KIndex() const;
|
||||
|
||||
|
||||
@@ -100,24 +174,33 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used by the constuctors above.
|
||||
Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint);
|
||||
|
||||
//! returns the number of second member columns.
|
||||
//! Is used internally to initialize the fields.
|
||||
Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const;
|
||||
|
||||
//! returns the first point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const;
|
||||
|
||||
//! returns the last point beeing fitted.
|
||||
Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const;
|
||||
|
||||
//! Affects the fields in the case of a constraint point.
|
||||
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);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA);
|
||||
|
||||
//! computes internal matrixes for the resolution
|
||||
Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB);
|
||||
|
||||
|
||||
|
@@ -43,18 +43,35 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Given a MultiLine SSP with constraints points, this
|
||||
//! algorithm finds the best curve solution to approximate it.
|
||||
//! The poles from SCurv issued for example from the least
|
||||
//! squares are used as a guess solution for the uzawa
|
||||
//! algorithm. The tolerance used in the Uzawa algorithms
|
||||
//! is Tolerance.
|
||||
//! A is the Bernstein matrix associated to the MultiLine
|
||||
//! and DA is the derivative bernstein matrix.(They can come
|
||||
//! from an approximation with ParLeastSquare.)
|
||||
//! The MultiCurve is modified. New MultiPoles are given.
|
||||
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);
|
||||
|
||||
//! returns True if all has been correctly done.
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns the maximum difference value between the curve
|
||||
//! and the given points.
|
||||
Standard_EXPORT Standard_Real Error() const;
|
||||
|
||||
Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
|
||||
|
||||
//! returns the duale variables of the system.
|
||||
Standard_EXPORT const math_Vector& Duale() const;
|
||||
|
||||
//! Returns the derivative of the constraint matrix.
|
||||
Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
|
||||
|
||||
//! returns the Inverse of Cont*Transposed(Cont), where
|
||||
//! Cont is the constraint matrix for the algorithm.
|
||||
Standard_EXPORT const math_Matrix& InverseMatrix() const;
|
||||
|
||||
|
||||
@@ -63,8 +80,10 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
//! is used internally to create the fields.
|
||||
Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
|
||||
|
||||
//! is internally used for the fields creation.
|
||||
Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user