mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
0024660: Removing unused "generic" classes. Part 1
In scope of this issue next unused generic classes will be removed: 1) AppBlend_Line 2) AppBlend_SectionGenerator 3) AppCont_SurfLeastSquare 4) AppCont_TheLineTool 5) AppCont_TheSurfTool 6) AppParCurves_MLineToo 7) AppParCurves_Projection 8) ApproxInt_WLine 9) Approx_ComputeCSurface 10) Approx_TheLineTool 11) Blend_Iterator 12) Contap_ArcTool 13) Contap_SurfaceTool 14) Contap_TopolTool 15) Dynamic_EnumerationParameter 16) Dynamic_MethodInstance 17) Extrema_ExtPSOfRev 18) GProp_CurveTool 19) GProp_DomainTool 20) GProp_FaceTool
This commit is contained in:
@@ -39,11 +39,6 @@ is
|
||||
-- - CurvaturePoint: this point has a curvature constraint.
|
||||
|
||||
|
||||
|
||||
|
||||
deferred generic class MLineTool; --- Template
|
||||
|
||||
|
||||
class MultiPoint;
|
||||
|
||||
class MultiCurve;
|
||||
@@ -87,11 +82,6 @@ is
|
||||
-- sum||C(ui)-Qi||2 with a gradient method.
|
||||
-- The Result is a Bspline set.
|
||||
|
||||
|
||||
generic class Projection, ProLeastSquare, ProConstraint, ProFunction;
|
||||
---Purpose: computes the approximation of a Multiline by
|
||||
-- searching for a new parameter with a projection
|
||||
-- method.
|
||||
|
||||
deferred class SmoothCriterion;
|
||||
generic class LinearCriteria;
|
||||
|
@@ -1,93 +0,0 @@
|
||||
-- Created on: 1993-01-20
|
||||
-- Created by: Laurent PAINNOT
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred generic class MLineTool from AppParCurves (MLine as any)
|
||||
|
||||
---Purpose: Template which defines all the services relative to
|
||||
-- a MultiLine for approximation algorithms.
|
||||
|
||||
|
||||
uses Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
Vec from gp,
|
||||
Vec2d from gp,
|
||||
Array1OfPnt from TColgp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Array1OfVec from TColgp,
|
||||
Array1OfVec2d from TColgp
|
||||
|
||||
is
|
||||
|
||||
|
||||
FirstPoint(myclass; ML: MLine) returns Integer;
|
||||
---Purpose: Returns the first index of multipoints of the MLine.
|
||||
|
||||
|
||||
LastPoint(myclass; ML: MLine) returns Integer;
|
||||
---Purpose: Returns the last index of multipoints of the MLine.
|
||||
|
||||
|
||||
|
||||
NbP2d(myclass; ML: MLine) returns Integer;
|
||||
---Purpose: Returns the number of 2d points of a MLine.
|
||||
|
||||
|
||||
NbP3d(myclass; ML: MLine) returns Integer;
|
||||
---Purpose: Returns the number of 3d points of a MLine.
|
||||
|
||||
|
||||
|
||||
Value(myclass; ML: MLine; MPointIndex: Integer; tabPt: out Array1OfPnt);
|
||||
---Purpose: returns the 3d points of the multipoint <MPointIndex>
|
||||
-- when only 3d points exist.
|
||||
|
||||
|
||||
Value(myclass; ML: MLine; MPointIndex: Integer;
|
||||
tabPt2d: out Array1OfPnt2d);
|
||||
---Purpose: returns the 2d points of the multipoint <MPointIndex>
|
||||
-- when only 2d points exist.
|
||||
|
||||
|
||||
Value(myclass; ML: MLine; MPointIndex: Integer;
|
||||
tabPt: out Array1OfPnt; tabPt2d: out Array1OfPnt2d);
|
||||
---Purpose: returns the 3d and 2d points of the multipoint
|
||||
-- <MPointIndex>.
|
||||
|
||||
|
||||
Tangency(myclass; ML: MLine; MPointIndex: Integer; tabV: out Array1OfVec)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 3d points of the multipoint <MPointIndex>
|
||||
-- when only 3d points exist.
|
||||
|
||||
|
||||
Tangency(myclass; ML: MLine; MPointIndex: Integer;
|
||||
tabV2d: out Array1OfVec2d)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 2d tangency points of the multipoint
|
||||
-- <MPointIndex> only when 2d points exist.
|
||||
|
||||
|
||||
Tangency(myclass; ML: MLine; MPointIndex: Integer;
|
||||
tabV: out Array1OfVec; tabV2d: out Array1OfVec2d)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 3d and 2d points of the multipoint
|
||||
-- <MPointIndex>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end MLineTool;
|
@@ -1,13 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
@@ -1,129 +0,0 @@
|
||||
-- Created on: 1993-06-24
|
||||
-- Created by: Modelistation
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class Projection from AppParCurves
|
||||
(MultiLine as any;
|
||||
ToolLine as any) -- as ToolLine(MultiLine)
|
||||
|
||||
|
||||
---Purpose: This algorithm uses the algorithms LeastSquare,
|
||||
-- ResConstraint and a Projection method to approximate a set
|
||||
-- of points (AppDef_MultiLine) with a minimization of the
|
||||
-- sum(square(|F(i)-Qi|)) by changing the parameter.
|
||||
|
||||
|
||||
|
||||
uses Vector from math,
|
||||
MultiCurve from AppParCurves,
|
||||
HArray1OfConstraintCouple from AppParCurves
|
||||
|
||||
|
||||
raises OutOfRange from Standard,
|
||||
NotDone from StdFail
|
||||
|
||||
|
||||
private class ProLeastSquare instantiates LeastSquare from AppParCurves
|
||||
(MultiLine, ToolLine);
|
||||
|
||||
private class ProConstraint instantiates ResolConstraint from AppParCurves
|
||||
(MultiLine, ToolLine);
|
||||
|
||||
private class ProFunction instantiates Function from AppParCurves
|
||||
(MultiLine, ToolLine, ProLeastSquare, ProConstraint);
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create(SSP: MultiLine; FirstPoint, LastPoint: Integer;
|
||||
TheConstraints: HArray1OfConstraintCouple;
|
||||
Parameters: in out Vector; Deg: Integer;
|
||||
Tol3d, Tol2d: Real; NbIterations: Integer = 200)
|
||||
---Purpose: 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.
|
||||
-- SSP is returned with the new parameter.
|
||||
|
||||
returns Projection from AppParCurves;
|
||||
|
||||
|
||||
IsDone(me)
|
||||
---Purpose: returns True if all has been correctly done.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Value(me)
|
||||
---Purpose: returns all the Bezier curves approximating the
|
||||
-- MultiLine SSP after minimization of the parameter.
|
||||
|
||||
returns MultiCurve from AppParCurves
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Error(me; Index: Integer)
|
||||
---Purpose: 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.
|
||||
|
||||
returns Real
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
MaxError3d(me)
|
||||
---Purpose: returns the maximum difference between the old and the
|
||||
-- new approximation.
|
||||
|
||||
returns Real
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
MaxError2d(me)
|
||||
---Purpose: returns the maximum difference between the old and the
|
||||
-- new approximation.
|
||||
|
||||
returns Real
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
AverageError(me)
|
||||
---Purpose: returns the average error between the old and the
|
||||
-- new approximation.
|
||||
|
||||
returns Real
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
SCU: MultiCurve from AppParCurves;
|
||||
ParError: Vector from math;
|
||||
AvError: Real;
|
||||
MError3d: Real;
|
||||
MError2d: Real;
|
||||
Done: Boolean;
|
||||
|
||||
end Projection from AppParCurves;
|
@@ -1,236 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// lpa, le 11/09/91
|
||||
|
||||
|
||||
|
||||
#define No_Standard_RangeError
|
||||
#define No_Standard_OutOfRange
|
||||
|
||||
#include <AppParCurves_Constraint.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
#include <PLib.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AppParCurves_Projection::
|
||||
AppParCurves_Projection(const 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):
|
||||
ParError(FirstPoint, LastPoint,0.0) {
|
||||
|
||||
Standard_Boolean grad = Standard_True;
|
||||
Standard_Integer i, j, k, i2, l;
|
||||
Standard_Real UF, DU, Fval = 0.0, FU, DFU;
|
||||
Standard_Real MErr3d=0.0, MErr2d=0.0,
|
||||
Gain3d = Tol3d, Gain2d=Tol2d;
|
||||
Standard_Real EC, ECmax = 1.e10, Errsov3d, Errsov2d;
|
||||
Standard_Integer nbP3d = ToolLine::NbP3d(SSP);
|
||||
Standard_Integer nbP2d = ToolLine::NbP2d(SSP);
|
||||
Standard_Integer mynbP3d=nbP3d, mynbP2d=nbP2d;
|
||||
Standard_Integer nbP = nbP3d + nbP2d;
|
||||
gp_Pnt Pt, P1, P2;
|
||||
gp_Pnt2d Pt2d, P12d, P22d;
|
||||
gp_Vec V1, V2, MyV;
|
||||
gp_Vec2d V12d, V22d, MyV2d;
|
||||
|
||||
if (nbP3d == 0) mynbP3d = 1;
|
||||
if (nbP2d == 0) mynbP2d = 1;
|
||||
TColgp_Array1OfPnt TabP(1, mynbP3d);
|
||||
TColgp_Array1OfPnt2d TabP2d(1, mynbP2d);
|
||||
TColgp_Array1OfVec TabV(1, mynbP3d);
|
||||
TColgp_Array1OfVec2d TabV2d(1, mynbP2d);
|
||||
|
||||
// Calcul de la fonction F= somme(||C(ui)-Ptli||2):
|
||||
// Appel a une fonction heritant de MultipleVarFunctionWithGradient
|
||||
// pour calculer F et grad_F.
|
||||
// ================================================================
|
||||
|
||||
AppParCurves_ProFunction MyF(SSP, FirstPoint,LastPoint, TheConstraints, Parameters, Deg);
|
||||
|
||||
|
||||
ECmax = 0.0;
|
||||
// Projection:
|
||||
// ===========
|
||||
MyF.Value(Parameters, Fval);
|
||||
SCU = MyF.CurveValue();
|
||||
Standard_Integer deg = SCU.Degree();
|
||||
TColgp_Array1OfPnt TabPole(1, deg+1), TabCoef(1, deg+1);
|
||||
TColgp_Array1OfPnt2d TabPole2d(1, deg+1), TabCoef2d(1, deg+1);
|
||||
TColgp_Array1OfPnt TheCoef(1, (deg+1)*mynbP3d);
|
||||
TColgp_Array1OfPnt2d TheCoef2d(1, (deg+1)*mynbP2d);
|
||||
|
||||
|
||||
for (i = 1; i <= NbIterations; i++) {
|
||||
|
||||
// Stockage des Poles des courbes:
|
||||
// ===============================
|
||||
i2 = 0;
|
||||
for (k = 1; k <= nbP3d; k++) {
|
||||
SCU.Curve(k, TabPole);
|
||||
BSplCLib::PolesCoefficients(TabPole, PLib::NoWeights(),
|
||||
TabCoef, PLib::NoWeights());
|
||||
for (j=1; j<=deg+1; j++) TheCoef(j+i2) = TabCoef(j);
|
||||
i2 += deg+1;
|
||||
}
|
||||
i2 = 0;
|
||||
for (k = 1; k <= nbP2d; k++) {
|
||||
SCU.Curve(nbP3d+k, TabPole2d);
|
||||
BSplCLib::PolesCoefficients(TabPole2d, PLib::NoWeights(),
|
||||
TabCoef2d, PLib::NoWeights());
|
||||
for (j=1; j<=deg+1; j++) TheCoef2d(j+i2) = TabCoef2d(j);
|
||||
i2 += deg+1;
|
||||
}
|
||||
for (j = FirstPoint+1; j <= LastPoint-1; j++) {
|
||||
UF = Parameters(j);
|
||||
if (nbP != 0 && nbP2d != 0) ToolLine::Value(SSP, j, TabP, TabP2d);
|
||||
else if (nbP2d != 0) ToolLine::Value(SSP, j, TabP2d);
|
||||
else ToolLine::Value(SSP, j, TabP);
|
||||
|
||||
FU = 0.0;
|
||||
DFU = 0.0;
|
||||
i2 = 0;
|
||||
for (k = 1; k <= nbP3d; k++) {
|
||||
for (l=1; l<=deg+1; l++) TabCoef(l) = TheCoef(l+i2);
|
||||
i2 += deg+1;
|
||||
BSplCLib::CoefsD2(UF, TabCoef, PLib::NoWeights(), Pt, V1, V2);
|
||||
MyV = gp_Vec(Pt, TabP(k));
|
||||
FU += MyV*V1;
|
||||
DFU += V1.SquareMagnitude() + MyV*V2;
|
||||
}
|
||||
i2 = 0;
|
||||
for (k = 1; k <= nbP2d; k++) {
|
||||
for (l=1; l<=deg+1; l++) TabCoef2d(l) = TheCoef2d(l+i2);
|
||||
i2 += deg+1;
|
||||
BSplCLib::CoefsD2(UF, TabCoef2d, PLib::NoWeights(), Pt2d, V12d, V22d);
|
||||
MyV2d = gp_Vec2d(Pt2d, TabP2d(k));
|
||||
FU += MyV2d*V12d;
|
||||
DFU += V12d.SquareMagnitude() + MyV2d*V22d;
|
||||
}
|
||||
|
||||
if (DFU <= RealEpsilon()) {
|
||||
// Verification du parametrage:
|
||||
EC = Abs(Parameters(j) - UF);
|
||||
if (EC > ECmax) ECmax = EC;
|
||||
break;
|
||||
}
|
||||
|
||||
DU = -FU/DFU;
|
||||
DU = Sign(Min(5.e-02, Abs(DU)), DU);
|
||||
UF += DU;
|
||||
Parameters(j) = UF;
|
||||
}
|
||||
|
||||
// Test de progression:
|
||||
// ====================
|
||||
Errsov3d = MErr3d;
|
||||
Errsov2d = MErr2d;
|
||||
|
||||
MyF.Value(Parameters, Fval);
|
||||
SCU = MyF.CurveValue();
|
||||
MErr3d = MyF.MaxError3d();
|
||||
MErr2d = MyF.MaxError2d();
|
||||
|
||||
if (MErr3d< Tol3d && MErr2d < Tol2d) {
|
||||
Done = Standard_True;
|
||||
break;
|
||||
}
|
||||
if (MErr3d > 100.0*Tol3d || MErr2d > 100.0*Tol2d) {
|
||||
Done = Standard_False;
|
||||
grad = Standard_False;
|
||||
break;
|
||||
}
|
||||
if (i >= 2) {
|
||||
Gain3d = Abs(Errsov3d-MErr3d);
|
||||
Gain2d = Abs(Errsov2d-MErr2d);
|
||||
if ((MErr3d-Gain3d*(NbIterations-i)*0.5) > Tol3d ||
|
||||
(MErr2d-Gain2d*(NbIterations-i)*0.5) > Tol2d) {
|
||||
if (Gain3d < Tol3d/(2*NbIterations) &&
|
||||
Gain2d < Tol2d/(2*NbIterations)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
AvError = 0.;
|
||||
for (j = FirstPoint; j <= LastPoint; j++) {
|
||||
// Recherche des erreurs maxi et moyenne a un index donne:
|
||||
for (k = 1; k <= nbP; k++) {
|
||||
ParError(j) = Max(ParError(j), MyF.Error(j, k));
|
||||
}
|
||||
AvError += ParError(j);
|
||||
}
|
||||
AvError = AvError/(LastPoint-FirstPoint+1);
|
||||
|
||||
|
||||
MError3d = MyF.MaxError3d();
|
||||
MError2d = MyF.MaxError2d();
|
||||
if (MError3d < Tol3d && MError2d < Tol2d) {
|
||||
Done = Standard_True;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
AppParCurves_MultiCurve AppParCurves_Projection::Value() const {
|
||||
return SCU;
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean AppParCurves_Projection::IsDone() const {
|
||||
return Done;
|
||||
}
|
||||
|
||||
|
||||
Standard_Real AppParCurves_Projection::Error(const Standard_Integer Index) const {
|
||||
return ParError(Index);
|
||||
}
|
||||
|
||||
Standard_Real AppParCurves_Projection::AverageError() const {
|
||||
return AvError;
|
||||
}
|
||||
|
||||
Standard_Real AppParCurves_Projection::MaxError3d() const {
|
||||
return MError3d;
|
||||
}
|
||||
|
||||
Standard_Real AppParCurves_Projection::MaxError2d() const {
|
||||
return MError2d;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user