mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +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:
parent
67e1d45b60
commit
89f18cb939
@ -19,10 +19,6 @@ package AppBlend
|
||||
uses StdFail, MMgt, TCollection, TColStd, TColgp, GeomAbs
|
||||
|
||||
is
|
||||
|
||||
deferred generic class Line;
|
||||
|
||||
deferred generic class SectionGenerator;
|
||||
|
||||
deferred class Approx;
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
-- Created on: 1993-12-16
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 Line from AppBlend
|
||||
(ThePoint as any)
|
||||
|
||||
---Purpose:
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
|
||||
is
|
||||
|
||||
NbPoints(me)
|
||||
|
||||
returns Integer from Standard;
|
||||
|
||||
|
||||
Point(me; Index: Integer from Standard)
|
||||
|
||||
returns ThePoint
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
end Line;
|
@ -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,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,76 +0,0 @@
|
||||
-- Created on: 1993-12-16
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 SectionGenerator from AppBlend
|
||||
(ThePoint as any)
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses Array1OfPnt from TColgp,
|
||||
Array1OfVec from TColgp,
|
||||
Array1OfPnt2d from TColgp,
|
||||
Array1OfVec2d from TColgp,
|
||||
Array1OfReal from TColStd,
|
||||
Array1OfInteger from TColStd
|
||||
|
||||
is
|
||||
|
||||
GetShape(me; NbPoles : out Integer from Standard;
|
||||
NbKnots : out Integer from Standard;
|
||||
Degree : out Integer from Standard;
|
||||
NbPoles2d : out Integer from Standard)
|
||||
|
||||
is static;
|
||||
|
||||
Knots(me; TKnots: out Array1OfReal from TColStd)
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Mults(me; TMults: out Array1OfInteger from TColStd)
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Section(me; P: ThePoint; Poles : out Array1OfPnt from TColgp;
|
||||
DPoles : out Array1OfVec from TColgp;
|
||||
Poles2d : out Array1OfPnt2d from TColgp;
|
||||
DPoles2d : out Array1OfVec2d from TColgp;
|
||||
Weigths : out Array1OfReal from TColStd;
|
||||
DWeigths : out Array1OfReal from TColStd)
|
||||
|
||||
---Purpose: Used for the first and last section
|
||||
-- The method returns Standard_True if the derivatives
|
||||
-- are computed, otherwise it returns Standard_False.
|
||||
|
||||
returns Boolean from Standard
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Section(me; P: ThePoint; Poles : out Array1OfPnt from TColgp;
|
||||
Poles2d : out Array1OfPnt2d from TColgp;
|
||||
Weigths : out Array1OfReal from TColStd)
|
||||
is static;
|
||||
|
||||
|
||||
Parameter(me; P: ThePoint)
|
||||
---Purpose: Returns the parameter of the point P. Used to
|
||||
-- impose the parameters in the approximation.
|
||||
returns Real from Standard
|
||||
is static;
|
||||
|
||||
end SectionGenerator;
|
@ -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.
|
@ -36,18 +36,7 @@ uses AppParCurves, Geom, math, StdFail, TCollection, TColStd, gp,
|
||||
TColgp, Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
deferred generic class TheLineTool; --- Template
|
||||
---Purpose: Tool describing a continous MultiLine.
|
||||
-- The MultiLine is described by a parameter.
|
||||
|
||||
deferred generic class TheSurfTool; --- Template
|
||||
---Purpose: Tool describing a continous Surface.
|
||||
-- The Surface is described by a couple of parameters.
|
||||
|
||||
|
||||
is
|
||||
|
||||
-------------------------------
|
||||
--- Algorithms:
|
||||
@ -62,12 +51,6 @@ is
|
||||
---Purpose: makes an approximation of a continous Line described by
|
||||
-- the tool TheLineTool.
|
||||
|
||||
generic class SurfLeastSquare;
|
||||
---Purpose: makes an approximation of a continous Surface
|
||||
-- described by the tool TheSurfaceTool.
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------
|
||||
--- Necessary class for approximation a function f(t):
|
||||
------------------------------------------------------
|
||||
|
@ -1,114 +0,0 @@
|
||||
-- Created on: 1993-05-19
|
||||
-- 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.
|
||||
|
||||
generic class SurfLeastSquare from AppCont(Surface as any;
|
||||
SurfTool as any)
|
||||
---as TheSurfTool(Surface)
|
||||
|
||||
---Purpose:
|
||||
|
||||
|
||||
uses Matrix from math,
|
||||
Vector from math,
|
||||
Constraint from AppParCurves,
|
||||
MultiCurve from AppParCurves,
|
||||
BezierSurface from Geom
|
||||
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard,
|
||||
DimensionError from Standard
|
||||
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create(Surf: Surface; U0, U1, V0, V1: Real;
|
||||
FirstCons, LastUCons, LastVCons, LastCons: Constraint;
|
||||
DegU, DegV: Integer; NbPoints: Integer = 12)
|
||||
---Purpose: given a MultiLine, this algorithm computes the
|
||||
-- approximation of a continous Surface into a bezier
|
||||
-- Surface.
|
||||
-- The algorithm minimizes the volume between the
|
||||
-- Surface Surf and the Bezier Surface doing the
|
||||
-- aproximation.
|
||||
-- NbPoints * NbPoints are taken on the Surface Surf.
|
||||
-- The Constraints are affected to the following points:
|
||||
--
|
||||
-- U0, V0 |--|---|---|---|---|---|-----| U1, V0
|
||||
-- FirstCons | | | | | | | LastUCons
|
||||
-- |--|---|---|---|---|---|-----|
|
||||
-- |--|---|---|---|---|---|-----|
|
||||
-- | | | | | | | |
|
||||
-- U0, V1 |--|---|---|---|---|---|-----| U1, V1
|
||||
-- LastVCons LastCons
|
||||
|
||||
|
||||
returns SurfLeastSquare from AppCont
|
||||
raises DimensionError from Standard;
|
||||
|
||||
|
||||
|
||||
IsDone(me)
|
||||
---Purpose: returns True if all has been correctly done.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Value(me: in out)
|
||||
---Purpose: returns the result of the approximation.
|
||||
-- An exception is raised if NotDone.
|
||||
---C++: return const &
|
||||
|
||||
returns BezierSurface from Geom
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
Error(me; F: in out Real; MaxE3d: in out Real)
|
||||
---Purpose: F is the sum of the square errors at each of the
|
||||
-- NbPoints*NbPoints and MaxE3d is the maximum value
|
||||
-- of these errors.
|
||||
-- An exception is raised if NotDone.
|
||||
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
Done: Boolean;
|
||||
SCU: BezierSurface from Geom;
|
||||
DegreU: Integer;
|
||||
DegreV: Integer;
|
||||
Nbdiscret: Integer;
|
||||
nbP: Integer;
|
||||
PointsX: Matrix;
|
||||
PointsY: Matrix;
|
||||
PointsZ: Matrix;
|
||||
PolesX: Vector;
|
||||
PolesY: Vector;
|
||||
PolesZ: Vector;
|
||||
myUParam: Vector;
|
||||
myVParam: Vector;
|
||||
VBU: Matrix;
|
||||
VBV: Matrix;
|
||||
|
||||
end SurfLeastSquare from AppCont;
|
||||
|
@ -1,493 +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 19/05/93
|
||||
|
||||
|
||||
#ifndef DEB
|
||||
#define No_Standard_OutOfRange
|
||||
#define No_Standard_RangeError
|
||||
#endif
|
||||
|
||||
#include <math_GaussPoints.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <AppParCurves_MultiPoint.hxx>
|
||||
#include <AppCont_ContMatrices.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <PLib.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
static void InvMSurfMatrix(const Standard_Integer classeU,
|
||||
const Standard_Integer classeV,
|
||||
math_Matrix& InvM)
|
||||
{
|
||||
math_Matrix Inv1(1, classeU);
|
||||
InvMMatrix(classeU, Inv1);
|
||||
math_Matrix Inv2(1, classeV);
|
||||
InvMMatrix(classeV, Inv2);
|
||||
|
||||
// math_Matrix InvM(1, classeU*classeV, 1, classeU*classeV);
|
||||
Standard_Integer i, j, k, l;
|
||||
|
||||
for (i = 1; i <= classeU; i++) {
|
||||
for (j= 1; j <= classeU; j++) {
|
||||
for (k =1; k<= classeV; k++) {
|
||||
for (l = 1; l<= classeV; l++) {
|
||||
InvM(k+(i-1)*classeV,l+(j-1)*classeV) = Inv1(i,j)*Inv2(k,l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MSurfMatrix(const Standard_Integer classeU,
|
||||
const Standard_Integer classeV,
|
||||
math_Matrix& M)
|
||||
{
|
||||
math_Matrix M1(1, classeU, 1, classeU);
|
||||
MMatrix(classeU, M1);
|
||||
math_Matrix M2(1, classeV, 1, classeV);
|
||||
MMatrix(classeV, M2);
|
||||
|
||||
// math_Matrix M(1, classeU*classeV, 1, classeU*classeV);
|
||||
Standard_Integer i, j, k, l;
|
||||
|
||||
for (i = 1; i <= classeU; i++) {
|
||||
for (j= 1; j <= classeU; j++) {
|
||||
for (k =1; k<= classeV; k++) {
|
||||
for (l = 1; l<= classeV; l++) {
|
||||
M(k+(i-1)*classeV,l+(j-1)*classeV) = M1(i,j)*M2(k,l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AppCont_SurfLeastSquare::
|
||||
AppCont_SurfLeastSquare(const Surface& Surf,
|
||||
const Standard_Real U0,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real V0,
|
||||
const Standard_Real V1,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastUCons,
|
||||
const AppParCurves_Constraint LastVCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const Standard_Integer DegU,
|
||||
const Standard_Integer DegV,
|
||||
const Standard_Integer NbPoints):
|
||||
PointsX(1, NbPoints, 1 , NbPoints),
|
||||
PointsY(1, NbPoints, 1 , NbPoints),
|
||||
PointsZ(1, NbPoints, 1 , NbPoints),
|
||||
PolesX(1, (DegU+1)*(DegV+1), 0.0),
|
||||
PolesY(1, (DegU+1)*(DegV+1), 0.0),
|
||||
PolesZ(1, (DegU+1)*(DegV+1), 0.0),
|
||||
myUParam(1, NbPoints),
|
||||
myVParam(1, NbPoints),
|
||||
VBU(1, DegU+1, 1, NbPoints),
|
||||
VBV(1, DegV+1, 1, NbPoints)
|
||||
{
|
||||
DegreU = DegU;
|
||||
DegreV = DegV;
|
||||
Nbdiscret = NbPoints;
|
||||
Standard_Integer c, c1, c2, classeU = DegU+1, classeV = DegV+1;
|
||||
Standard_Integer cla = classeU*classeV;
|
||||
Standard_Integer bdeb = 1, bfin = cla, clav = cla-classeV+1;
|
||||
Standard_Integer bint = 0, bint1 = 0, bint2 = 0, bintfin = 0;
|
||||
Standard_Integer bint3 = 0, bint4 = 0, bint5 = 0, bint6 = 0;
|
||||
Standard_Integer bint7 = 0, bint8 = 0;
|
||||
math_Vector GaussP(1, NbPoints), GaussW(1, NbPoints);
|
||||
Standard_Integer i, j, FirstP = 1, LastP = NbPoints;
|
||||
Standard_Real U, dU, V, dV, ISS, Coeff, Coeff2;
|
||||
Done = Standard_False;
|
||||
gp_Pnt Pt;
|
||||
gp_Vec VU, VV;
|
||||
math_Vector BX(1, cla, 0.0),
|
||||
BY(1, cla, 0.0),
|
||||
BZ(1, cla, 0.0);
|
||||
|
||||
GaussP = GPoints(NbPoints);
|
||||
GaussW = GWeights(NbPoints);
|
||||
math_Vector TheWeights(1, NbPoints), VBParam(1, NbPoints);
|
||||
|
||||
dU = 0.5*(U1-U0);
|
||||
dV = 0.5*(V1-V0);
|
||||
|
||||
// calcul et mise en ordre des parametres et des poids:
|
||||
for (i = FirstP; i <= LastP; i++) {
|
||||
U = 0.5*(U1+U0) + dU*GaussP(i);
|
||||
V = 0.5*(V1+V0) + dV*GaussP(i);
|
||||
if (i <= (NbPoints+1)/2) {
|
||||
myUParam(LastP-i+1) = U;
|
||||
myVParam(LastP-i+1) = V;
|
||||
VBParam(LastP-i+1) = 0.5*(1 + GaussP(i));
|
||||
TheWeights(LastP-i+1) = 0.5*GaussW(i);
|
||||
}
|
||||
else {
|
||||
myUParam(i-(NbPoints+1)/2) = U;
|
||||
myVParam(i-(NbPoints+1)/2) = V;
|
||||
VBParam(i-(NbPoints+1)/2) = 0.5*(1 + GaussP(i));
|
||||
TheWeights(i-(NbPoints+1)/2) = 0.5*GaussW(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Stockage des Points de Gauss:
|
||||
for (i = FirstP; i <= LastP; i++) {
|
||||
U = myUParam(i);
|
||||
for (j = FirstP; j <= LastP; j++) {
|
||||
V = myVParam(j);
|
||||
SurfTool::D0(Surf, U, V, Pt);
|
||||
Pt.Coord(PointsX(i, j), PointsY(i, j), PointsZ(i, j));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Calcul des VB ( fonctions de Bernstein):
|
||||
for (i = 1; i <= classeU; i++) {
|
||||
for (j = 1; j <= NbPoints; j++) {
|
||||
VBU(i,j) = PLib::Binomial(classeU-1,i-1)*
|
||||
Pow((1-VBParam(j)),classeU-i)*Pow(VBParam(j),i-1);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i <= classeV; i++) {
|
||||
for (j = 1; j <= NbPoints; j++) {
|
||||
VBV(i,j) = PLib::Binomial(classeV-1,i-1)*
|
||||
Pow((1-VBParam(j)),classeV-i)*Pow(VBParam(j),i-1);
|
||||
}
|
||||
}
|
||||
|
||||
// Traitement du second membre:
|
||||
c = 0;
|
||||
for (c1 = 1; c1 <= classeU; c1++) {
|
||||
for (c2 = 1; c2 <= classeV; c2++) {
|
||||
c++;
|
||||
for (i = 1; i <= NbPoints; i++) {
|
||||
for (j = 1; j <= NbPoints; j++) {
|
||||
Coeff = TheWeights(i)*TheWeights(j)*VBU(c1, i)*VBV(c2, j);
|
||||
BX(c) += PointsX(i, j)*Coeff;
|
||||
BY(c) += PointsY(i, j)*Coeff;
|
||||
BZ(c) += PointsZ(i, j)*Coeff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
math_Matrix InvM(1, classeU*classeV, 1, classeU*classeV);
|
||||
InvMSurfMatrix(classeU, classeV, InvM);
|
||||
TColgp_Array2OfPnt Poles(1, classeU, 1, classeV);
|
||||
|
||||
// Calcul des poles:
|
||||
// =================
|
||||
if (FirstCons == AppParCurves_NoConstraint &&
|
||||
LastCons == AppParCurves_NoConstraint &&
|
||||
LastUCons == AppParCurves_NoConstraint &&
|
||||
LastVCons == AppParCurves_NoConstraint) {
|
||||
|
||||
for (i = 1; i <= cla; i++) {
|
||||
for (j = 1; j <= cla; j++) {
|
||||
ISS = InvM(i, j);
|
||||
PolesX(i) += ISS * BX(j);
|
||||
PolesY(i) += ISS * BY(j);
|
||||
PolesZ(i) += ISS * BZ(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
// Traitement du second membre:
|
||||
math_Matrix M(1, classeU*classeV, 1, classeU*classeV);
|
||||
MSurfMatrix(classeU, classeV, M);
|
||||
|
||||
|
||||
if (FirstCons == AppParCurves_PassPoint ||
|
||||
FirstCons == AppParCurves_TangencyPoint) {
|
||||
bdeb = 2;
|
||||
SurfTool::D0(Surf, U0, V0, Pt);
|
||||
Pt.Coord(PolesX(1), PolesY(1), PolesZ(1));
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, 1);
|
||||
BX(c) = BX(c) - PolesX(1)*Coeff;
|
||||
BY(c) = BY(c) - PolesY(1)*Coeff;
|
||||
BZ(c) = BZ(c) - PolesZ(1)*Coeff;
|
||||
}
|
||||
}
|
||||
|
||||
if (LastCons == AppParCurves_PassPoint ||
|
||||
LastCons == AppParCurves_TangencyPoint) {
|
||||
bfin = cla-1;
|
||||
SurfTool::D0(Surf, U1, V1, Pt);
|
||||
Pt.Coord(PolesX(cla), PolesY(cla), PolesZ(cla));
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, cla);
|
||||
BX(c) = BX(c) - PolesX(cla)*Coeff;
|
||||
BY(c) = BY(c) - PolesY(cla)*Coeff;
|
||||
BZ(c) = BZ(c) - PolesZ(cla)*Coeff;
|
||||
}
|
||||
}
|
||||
|
||||
if (LastUCons == AppParCurves_PassPoint ||
|
||||
LastUCons == AppParCurves_TangencyPoint) {
|
||||
bint++; bint1 = clav;
|
||||
SurfTool::D0(Surf, U1, V0, Pt);
|
||||
Pt.Coord(PolesX(clav), PolesY(clav), PolesZ(clav));
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, clav);
|
||||
BX(c) = BX(c) - PolesX(clav)*Coeff;
|
||||
BY(c) = BY(c) - PolesY(clav)*Coeff;
|
||||
BZ(c) = BZ(c) - PolesZ(clav)*Coeff;
|
||||
}
|
||||
}
|
||||
|
||||
if (LastVCons == AppParCurves_PassPoint ||
|
||||
LastVCons == AppParCurves_TangencyPoint) {
|
||||
bint++; bint2 = classeV;
|
||||
SurfTool::D0(Surf, U0, V1, Pt);
|
||||
Pt.Coord(PolesX(classeV), PolesY(classeV), PolesZ(classeV));
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, classeV);
|
||||
BX(c) = BX(c) - PolesX(classeV)*Coeff;
|
||||
BY(c) = BY(c) - PolesY(classeV)*Coeff;
|
||||
BZ(c) = BZ(c) - PolesZ(classeV)*Coeff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (FirstCons == AppParCurves_TangencyPoint) {
|
||||
SurfTool::D1(Surf, U0, V0, Pt, VU, VV);
|
||||
bdeb = 3; bint++; bint3 = classeV+1;
|
||||
|
||||
PolesX(bint3) = PolesX(1) + VU.X()/DegU*(U1-U0);
|
||||
PolesY(bint3) = PolesY(1) + VU.Y()/DegU*(U1-U0);
|
||||
PolesZ(bint3) = PolesZ(1) + VU.Z()/DegU*(U1-U0);
|
||||
|
||||
PolesX(2) = PolesX(1) + VV.X()/DegV*(V1-V0);
|
||||
PolesY(2) = PolesY(1) + VV.Y()/DegV*(V1-V0);
|
||||
PolesZ(2) = PolesZ(1) + VV.Z()/DegV*(V1-V0);
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, 2); Coeff2 = M(c, bint3);
|
||||
BX(c) = BX(c) - PolesX(2)*Coeff - PolesX(bint3)*Coeff2;
|
||||
BY(c) = BY(c) - PolesY(2)*Coeff - PolesY(bint3)*Coeff2;
|
||||
BZ(c) = BZ(c) - PolesZ(2)*Coeff - PolesZ(bint3)*Coeff2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (LastCons == AppParCurves_TangencyPoint) {
|
||||
SurfTool::D1(Surf, U1, V1, Pt, VU, VV);
|
||||
bfin = cla-2; bint++; bint4 = cla-classeV;
|
||||
|
||||
PolesX(bint4) = PolesX(cla) - VU.X()/DegU*(U1-U0);
|
||||
PolesY(bint4) = PolesY(cla) - VU.Y()/DegU*(U1-U0);
|
||||
PolesZ(bint4) = PolesZ(cla) - VU.Z()/DegU*(U1-U0);
|
||||
|
||||
PolesX(cla-1) = PolesX(cla) - VV.X()/DegV*(V1-V0);
|
||||
PolesY(cla-1) = PolesY(cla) - VV.Y()/DegV*(V1-V0);
|
||||
PolesZ(cla-1) = PolesZ(cla) - VV.Z()/DegV*(V1-V0);
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, cla-1); Coeff2 = M(c, bint4);
|
||||
BX(c) = BX(c) - PolesX(cla-1)*Coeff - PolesX(bint4)*Coeff2;
|
||||
BY(c) = BY(c) - PolesY(cla-1)*Coeff - PolesY(bint4)*Coeff2;
|
||||
BZ(c) = BZ(c) - PolesZ(cla-1)*Coeff - PolesZ(bint4)*Coeff2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (LastVCons == AppParCurves_TangencyPoint) {
|
||||
SurfTool::D1(Surf, U0, V1, Pt, VU, VV);
|
||||
bint += 2; bint5 = classeV-1; bint6 = 2*classeV;
|
||||
|
||||
PolesX(bint5) = PolesX(classeV) - VV.X()/DegV*(V1-V0);
|
||||
PolesY(bint5) = PolesY(classeV) - VV.Y()/DegV*(V1-V0);
|
||||
PolesZ(bint5) = PolesZ(classeV) - VV.Z()/DegV*(V1-V0);
|
||||
|
||||
PolesX(bint6) = PolesX(classeV) + VU.X()/DegU*(U1-U0);
|
||||
PolesY(bint6) = PolesY(classeV) + VU.Y()/DegU*(U1-U0);
|
||||
PolesZ(bint6) = PolesZ(classeV) + VU.Z()/DegU*(U1-U0);
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, bint5); Coeff2 = M(c, bint6);
|
||||
BX(c) = BX(c) - PolesX(bint5)*Coeff - PolesX(bint6)*Coeff2;
|
||||
BY(c) = BY(c) - PolesY(bint5)*Coeff - PolesY(bint6)*Coeff2;
|
||||
BZ(c) = BZ(c) - PolesZ(bint5)*Coeff - PolesZ(bint6)*Coeff2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (LastUCons == AppParCurves_TangencyPoint) {
|
||||
SurfTool::D1(Surf, U1, V0, Pt, VU, VV);
|
||||
bint += 2; bint7 = clav-classeV; bint8 = clav+1;
|
||||
|
||||
PolesX(bint8) = PolesX(clav) + VV.X()/DegV*(V1-V0);
|
||||
PolesY(bint8) = PolesY(clav) + VV.Y()/DegV*(V1-V0);
|
||||
PolesZ(bint8) = PolesZ(clav) + VV.Z()/DegV*(V1-V0);
|
||||
|
||||
PolesX(bint7) = PolesX(clav) - VU.X()/DegU*(U1-U0);
|
||||
PolesY(bint7) = PolesY(clav) - VU.Y()/DegU*(U1-U0);
|
||||
PolesZ(bint7) = PolesZ(clav) - VU.Z()/DegU*(U1-U0);
|
||||
|
||||
for (c = 1; c <= cla; c++) {
|
||||
Coeff = M(c, bint8); Coeff2 = M(c, bint7);
|
||||
BX(c) = BX(c)- PolesX(bint8)*Coeff - PolesX(bint7)*Coeff2;
|
||||
BY(c) = BY(c)- PolesY(bint8)*Coeff - PolesY(bint7)*Coeff2;
|
||||
BZ(c) = BZ(c)- PolesZ(bint8)*Coeff - PolesZ(bint7)*Coeff2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
math_Vector B2X(bdeb, bfin-bint, 0.0);
|
||||
math_Vector B2Y(bdeb, bfin-bint, 0.0);
|
||||
math_Vector B2Z(bdeb, bfin-bint, 0.0);
|
||||
|
||||
Standard_Integer i2 = bdeb;
|
||||
for (i = bdeb; i <= bfin; i++) {
|
||||
if (i != bint1 && i != bint2 && i != bint3 && i != bint4 &&
|
||||
i != bint5 && i != bint6 && i != bint7 && i != bint8) {
|
||||
for (j = 1; j <= cla; j++) {
|
||||
Coeff = M(i, j);
|
||||
B2X(i2) = B2X(i2) + BX(j)*Coeff;
|
||||
B2Y(i2) = B2Y(i2) + BY(j)*Coeff;
|
||||
B2Z(i2) = B2Z(i2) + BZ(j)*Coeff;
|
||||
}
|
||||
i2 ++;
|
||||
}
|
||||
}
|
||||
|
||||
math_Matrix MP(1, cla, bdeb, bfin-bint);
|
||||
math_Matrix IBP(bdeb, bfin-bint, bdeb, bfin-bint);
|
||||
|
||||
Standard_Integer j2 = bdeb;
|
||||
for (i = 1; i <= cla; i++) {
|
||||
j2 = bdeb;
|
||||
for (j = bdeb; j <= bfin; j++) {
|
||||
if (j != bint1 && j != bint2 && j != bint3 && j != bint4 &&
|
||||
j != bint5 && j != bint6 && j != bint7 && j != bint8) {
|
||||
MP(i, j2) = M(i, j);
|
||||
j2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
math_Matrix IBP1 = MP.Transposed()*MP;
|
||||
IBP = IBP1.Inverse();
|
||||
|
||||
i2 = bdeb;
|
||||
for (i = bdeb; i <= bfin; i++) {
|
||||
if (i != bint1 && i != bint2 && i != bint3 && i != bint4 &&
|
||||
i != bint5 && i != bint6 && i != bint7 && i != bint8) {
|
||||
for (j = bdeb; j <= bfin-bint; j++) {
|
||||
ISS = IBP(i2, j);
|
||||
PolesX(i) += ISS * B2X(j);
|
||||
PolesY(i) += ISS * B2Y(j);
|
||||
PolesZ(i) += ISS * B2Z(j);
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 1; j <= classeV; j++) {
|
||||
for (i = 1; i <= classeU; i++) {
|
||||
Poles(i, j).SetCoord(PolesX(j+ (i-1)*classeV),
|
||||
PolesY(j+ (i-1)*classeV),
|
||||
PolesZ(j+ (i-1)*classeV));
|
||||
}
|
||||
}
|
||||
|
||||
SCU = new Geom_BezierSurface(Poles);
|
||||
Done = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_Boolean AppCont_SurfLeastSquare::IsDone() const
|
||||
{
|
||||
return Done;
|
||||
}
|
||||
|
||||
|
||||
const Handle(Geom_BezierSurface)& AppCont_SurfLeastSquare::Value()
|
||||
{
|
||||
return SCU;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AppCont_SurfLeastSquare::Error(Standard_Real& F,
|
||||
Standard_Real& MaxE3d) const
|
||||
{
|
||||
|
||||
Standard_Integer i, j, c, cu, cv, classeU = DegreU+1, classeV = DegreV+1;
|
||||
Standard_Real Coeff, err3d = 0.0;
|
||||
math_Matrix MyPointsX(1, Nbdiscret, 1, Nbdiscret);
|
||||
math_Matrix MyPointsY(1, Nbdiscret, 1, Nbdiscret);
|
||||
math_Matrix MyPointsZ(1, Nbdiscret, 1, Nbdiscret);
|
||||
MyPointsX = PointsX;
|
||||
MyPointsY = PointsY;
|
||||
MyPointsZ = PointsZ;
|
||||
MaxE3d = 0.0;
|
||||
F = 0.0;
|
||||
c = 0;
|
||||
|
||||
for (cu = 1; cu <= classeU; cu++) {
|
||||
for (cv = 1; cv <= classeV; cv++) {
|
||||
c++;
|
||||
for (i = 1; i <= Nbdiscret; i++) {
|
||||
for (j = 1; j <= Nbdiscret; j++) {
|
||||
Coeff = VBU(cu, i)*VBV(cv, j);
|
||||
MyPointsX(i, j) = MyPointsX(i, j) - PolesX(c)*Coeff;
|
||||
MyPointsY(i, j) = MyPointsY(i, j) - PolesY(c)*Coeff;
|
||||
MyPointsZ(i, j) = MyPointsZ(i, j) - PolesZ(c)*Coeff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 1; i <= Nbdiscret; i++) {
|
||||
for (j = 1; j <= Nbdiscret; j++) {
|
||||
err3d = MyPointsX(i, j) * MyPointsX(i, j) +
|
||||
MyPointsY(i, j) * MyPointsY(i, j) +
|
||||
MyPointsZ(i, j) * MyPointsZ(i, j);
|
||||
MaxE3d = Max(MaxE3d, err3d);
|
||||
F += err3d;
|
||||
}
|
||||
}
|
||||
|
||||
MaxE3d = Sqrt(MaxE3d);
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
-- Created on: 1993-04-22
|
||||
-- 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 TheLineTool from AppCont(MLine as any)
|
||||
|
||||
---Purpose: Template for desribing a continuous MultiLine.
|
||||
-- The Vectors returned by the methods Tangency are
|
||||
-- the derivative values.
|
||||
|
||||
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
|
||||
|
||||
FirstParameter(myclass; ML: MLine) returns Real;
|
||||
---Purpose: returns the first parameter of the Line.
|
||||
|
||||
LastParameter(myclass; ML: MLine) returns Real;
|
||||
---Purpose: returns the last parameter of the Line.
|
||||
|
||||
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; U: Real; tabPt: out Array1OfPnt);
|
||||
---Purpose: returns the 3d points of the multipoint <MPointIndex>
|
||||
-- when only 3d points exist.
|
||||
|
||||
|
||||
Value(myclass; ML: MLine; U: Real; tabPt2d: out Array1OfPnt2d);
|
||||
---Purpose: returns the 2d points of the multipoint <MPointIndex>
|
||||
-- when only 2d points exist.
|
||||
|
||||
|
||||
Value(myclass; ML: MLine; U: Real;
|
||||
tabPt: out Array1OfPnt; tabPt2d: out Array1OfPnt2d);
|
||||
---Purpose: returns the 3d and 2d points of the multipoint
|
||||
-- <MPointIndex>.
|
||||
|
||||
|
||||
D1(myclass; ML: MLine; U: Real; tabV: out Array1OfVec)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 3d derivative values of the multipoint
|
||||
-- <MPointIndex> when only 3d points exist.
|
||||
|
||||
|
||||
D1(myclass; ML: MLine; U: Real; tabV2d: out Array1OfVec2d)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 2d derivative values of the multipoint
|
||||
-- <MPointIndex> only when 2d points exist.
|
||||
|
||||
|
||||
D1(myclass; ML: MLine; U: Real;
|
||||
tabV: out Array1OfVec; tabV2d: out Array1OfVec2d)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 3d and 2d derivative values of the multipoint
|
||||
-- <MPointIndex>.
|
||||
|
||||
|
||||
end TheLineTool;
|
||||
|
@ -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,36 +0,0 @@
|
||||
-- Created on: 1993-04-28
|
||||
-- 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 TheSurfTool from AppCont(Surf as any)
|
||||
|
||||
---Purpose: Template for describing a continuous surface.
|
||||
|
||||
|
||||
uses Pnt from gp,
|
||||
Vec from gp
|
||||
|
||||
is
|
||||
|
||||
|
||||
D0(myclass; S: Surf; U, V: Real; Pt: out Pnt);
|
||||
---Purpose: returns the point of the surface at <U, V>.
|
||||
|
||||
|
||||
D1(myclass; S: Surf; U, V: Real; Pt: out Pnt; V1U, V1V: out Vec);
|
||||
---Purpose: returns the derivative and the point values of the surface
|
||||
-- at the parameters <U, V> .
|
||||
|
||||
end TheSurfTool;
|
@ -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.
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,7 @@ enumeration Status is
|
||||
PointsAdded,
|
||||
NoPointsAdded,
|
||||
NoApproximation
|
||||
end;
|
||||
|
||||
deferred generic class TheLineTool; ---Template
|
||||
---Purpose: This template is different from the one of AppParCurves.
|
||||
-- In this case, it is possible to insert new points
|
||||
-- during the approximation with ComputeLine.
|
||||
|
||||
end;
|
||||
|
||||
|
||||
---------------------------------------------
|
||||
@ -73,14 +67,6 @@ end;
|
||||
---Purpose: Approximate a continous MultiLine with a cutting.
|
||||
-- The Tool of the line is the tool from AppCont.
|
||||
|
||||
|
||||
generic class ComputeCSurface, MySLeastSquare;
|
||||
---Purpose: Approximate a continous Surface with or without cutting.
|
||||
-- The tool is the tool of AppCont.
|
||||
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
---Algorithms for BSpline curves construction:
|
||||
----------------------------------------------
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
generic class BSplComputeLine from Approx
|
||||
(MultiLine as any;
|
||||
LineTool as any) --as TheLineTool(MultiLine)
|
||||
LineTool as any)
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
generic class ComputeCLine from Approx
|
||||
(MultiLine as any;
|
||||
LineTool as any) --as TheLineTool from AppCont(MultiLine)
|
||||
LineTool as any)
|
||||
|
||||
|
||||
uses ParametrizationType from Approx,
|
||||
|
@ -1,162 +0,0 @@
|
||||
-- Created on: 1993-09-09
|
||||
-- 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 ComputeCSurface from Approx
|
||||
(Surface as any;
|
||||
SurfaceTool as any) --as TheLineTool from AppCont(MultiLine)
|
||||
|
||||
|
||||
uses SequenceOfReal from TColStd,
|
||||
HArray1OfReal from TColStd,
|
||||
SequenceOfSurface from TColGeom,
|
||||
BezierSurface from Geom,
|
||||
Constraint from AppParCurves
|
||||
|
||||
|
||||
|
||||
private class MySLeastSquare instantiates SurfLeastSquare from AppCont
|
||||
(Surface,
|
||||
SurfaceTool);
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create(Surf: Surface;
|
||||
degreemin: Integer = 4;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-3;
|
||||
FirstCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastUCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastVCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastCons: Constraint = AppParCurves_TangencyPoint;
|
||||
cutting: Boolean = Standard_False)
|
||||
|
||||
---Purpose: The Surface <Surface> 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.
|
||||
|
||||
returns ComputeCSurface;
|
||||
|
||||
|
||||
|
||||
|
||||
Create(degreemin: Integer = 3;
|
||||
degreemax: Integer = 8;
|
||||
Tolerance3d: Real = 1.0e-03;
|
||||
FirstCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastUCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastVCons: Constraint = AppParCurves_TangencyPoint;
|
||||
LastCons: Constraint = AppParCurves_TangencyPoint;
|
||||
cutting: Boolean = Standard_False)
|
||||
|
||||
---Purpose: Initializes the fields of the algorithm.
|
||||
|
||||
returns ComputeCSurface;
|
||||
|
||||
|
||||
Perform(me: in out; Surf: Surface)
|
||||
---Purpose: runs the algorithm after having initialized the fields.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
Compute(me: in out; Surf: Surface; Ufirst, Ulast, Vfirst, Vlast: Real;
|
||||
TheTol3d: in out Real)
|
||||
---Purpose: is internally used by the algorithms.
|
||||
|
||||
returns Boolean
|
||||
is static private;
|
||||
|
||||
|
||||
SetDegrees(me: in out; degreemin, degreemax: Integer)
|
||||
---Purpose: changes the degrees of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetTolerance(me: in out; Tolerance3d: Real)
|
||||
---Purpose: Changes the tolerances of the approximation.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
IsAllApproximated(me)
|
||||
---Purpose: returns False if at a moment of the approximation,
|
||||
-- NotDone was sent.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
IsToleranceReached(me)
|
||||
---Purpose: returns False if the status no cut has been done
|
||||
-- if necessary.
|
||||
|
||||
returns Boolean
|
||||
is static;
|
||||
|
||||
|
||||
Error(me; Index: Integer)
|
||||
---Purpose: returns the tolerance of the <Index> approximated Surface.
|
||||
returns Real
|
||||
is static;
|
||||
|
||||
|
||||
NbSurfaces(me)
|
||||
---Purpose: Returns the number of Bezier Surfaces doing the
|
||||
-- approximation of the Surface.
|
||||
returns Integer
|
||||
is static;
|
||||
|
||||
|
||||
Value(me; Index: Integer = 1)
|
||||
---Purpose: returns the approximation Surface of range <Index>.
|
||||
|
||||
returns BezierSurface from Geom;
|
||||
|
||||
|
||||
Parameters(me; Index: Integer; firstU, lastU, firstV, lastV: in out Real)
|
||||
---purpose: returns the first and last parameters of the
|
||||
-- <Index> Surface.
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
|
||||
mySurfaces: SequenceOfSurface from TColGeom;
|
||||
myfirstUparam: SequenceOfReal from TColStd;
|
||||
mylastUparam: SequenceOfReal from TColStd;
|
||||
myfirstVparam: SequenceOfReal from TColStd;
|
||||
mylastVparam: SequenceOfReal from TColStd;
|
||||
TheSurface: BezierSurface from Geom;
|
||||
alldone: Boolean;
|
||||
tolreached: Boolean;
|
||||
Tolers3d: SequenceOfReal from TColStd;
|
||||
mydegremin: Integer;
|
||||
mydegremax: Integer;
|
||||
mytol3d: Real;
|
||||
currenttol3d: Real;
|
||||
mycut: Boolean;
|
||||
myfirstUCons: Constraint;
|
||||
mylastUCons: Constraint;
|
||||
mylastVCons: Constraint;
|
||||
mylastCons: Constraint;
|
||||
|
||||
|
||||
|
||||
end ComputeCSurface;
|
@ -1,245 +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.
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
|
||||
Approx_ComputeCSurface::Approx_ComputeCSurface(
|
||||
const Surface& Surf,
|
||||
const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax,
|
||||
const Standard_Real Tolerance3d,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastUCons,
|
||||
const AppParCurves_Constraint LastVCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const Standard_Boolean cutting)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
mytol3d = Tolerance3d;
|
||||
myfirstUCons = FirstCons;
|
||||
mylastUCons = LastUCons;
|
||||
mylastVCons = LastVCons;
|
||||
mylastCons = LastCons;
|
||||
mycut = cutting;
|
||||
|
||||
Perform(Surf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Approx_ComputeCSurface::Approx_ComputeCSurface(
|
||||
const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax,
|
||||
const Standard_Real Tolerance3d,
|
||||
const AppParCurves_Constraint FirstCons,
|
||||
const AppParCurves_Constraint LastUCons,
|
||||
const AppParCurves_Constraint LastVCons,
|
||||
const AppParCurves_Constraint LastCons,
|
||||
const Standard_Boolean cutting)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
mytol3d = Tolerance3d;
|
||||
myfirstUCons = FirstCons;
|
||||
mylastUCons = LastUCons;
|
||||
mylastVCons = LastVCons;
|
||||
mylastCons = LastCons;
|
||||
mycut = cutting;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Approx_ComputeCSurface::Perform(const Surface& Surf)
|
||||
{
|
||||
Standard_Real UFirst, ULast, VFirst, VLast;
|
||||
UFirst = SurfaceTool::FirstUParameter(Surf);
|
||||
ULast = SurfaceTool::LastUParameter(Surf);
|
||||
VFirst = SurfaceTool::FirstVParameter(Surf);
|
||||
VLast = SurfaceTool::LastVParameter(Surf);
|
||||
Standard_Boolean Finish = Standard_False,
|
||||
begin = Standard_True, Ok = Standard_False;
|
||||
Standard_Real thetol3d;
|
||||
Standard_Real myfirstU = UFirst, mylastU = ULast;
|
||||
Standard_Real myfirstV = VFirst, mylastV = VLast;
|
||||
Standard_Integer i;
|
||||
|
||||
TColStd_Array2OfReal Error(1, 50, 1, 50); // pour l instant
|
||||
|
||||
if (!mycut) {
|
||||
alldone = Compute(Surf, UFirst, ULast, VFirst, VLast, thetol3d);
|
||||
if (!alldone) {
|
||||
tolreached = Standard_False;
|
||||
mySurfaces.Append(TheSurface);
|
||||
Tolers3d.Append(thetol3d);
|
||||
myfirstUparam.Append(UFirst);
|
||||
mylastUparam.Append(ULast);
|
||||
myfirstVparam.Append(VFirst);
|
||||
mylastVparam.Append(VLast);
|
||||
}
|
||||
}
|
||||
|
||||
else { // gestion du decoupage:
|
||||
TColStd_SequenceOfReal TheU, TheV;
|
||||
TheU.Append(UFirst);
|
||||
TheU.Append(ULast);
|
||||
TheV.Append(VFirst);
|
||||
TheV.Append(VLast);
|
||||
|
||||
while (!Finish) {
|
||||
|
||||
Ok = Compute(Surf, myfirstU, mylastU, myfirstV, mylastV, thetol3d);
|
||||
if (Ok) {
|
||||
if (Abs(ULast-mylastU) <= Precision::PConfusion() &&
|
||||
Abs(VLast-mylastV) <= Precision::PConfusion()) {
|
||||
Finish = Standard_True;
|
||||
alldone = Standard_True;
|
||||
return;
|
||||
}
|
||||
myfirstU = mylastU;
|
||||
mylastU = ULast;
|
||||
}
|
||||
else {
|
||||
// choix du decoupage en u ou en v:
|
||||
// si debut, en u:
|
||||
if (begin) {
|
||||
begin = Standard_False;
|
||||
mylastU = (myfirstU + mylastU)/2.;
|
||||
TheU.InsertAfter(1, mylastU);
|
||||
Error.SetValue(1, 1, currenttol3d);
|
||||
}
|
||||
else {
|
||||
Standard_Real tolu, tolv;
|
||||
for (i = 1; i <= TheU.Length(); i++) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_Boolean Approx_ComputeCSurface::Compute(const Surface& Surf,
|
||||
const Standard_Real Ufirst,
|
||||
const Standard_Real Ulast,
|
||||
const Standard_Real Vfirst,
|
||||
const Standard_Real Vlast,
|
||||
Standard_Real& TheTol3d)
|
||||
|
||||
{
|
||||
Standard_Integer NbPoints = 12; // 12 * 12 sur la surface.
|
||||
Standard_Integer degu, degv;
|
||||
Standard_Real Fv;
|
||||
|
||||
for (degu = mydegremin; degu <= mydegremax; degu++) {
|
||||
for (degv = mydegremin; degv <= mydegremax; degv++) {
|
||||
Approx_MySLeastSquare LSQ(Surf, Ufirst, Ulast, Vfirst, Vlast,
|
||||
myfirstUCons, mylastUCons,
|
||||
mylastVCons, mylastCons,
|
||||
degu, degv, NbPoints);
|
||||
LSQ.Error(Fv, TheTol3d);
|
||||
if (TheTol3d <= mytol3d) {
|
||||
TheSurface = LSQ.Value();
|
||||
mySurfaces.Append(TheSurface);
|
||||
tolreached = Standard_True;
|
||||
Tolers3d.Append(TheTol3d);
|
||||
currenttol3d = TheTol3d;
|
||||
myfirstUparam.Append(Ufirst);
|
||||
mylastUparam.Append(Ulast);
|
||||
myfirstVparam.Append(Vfirst);
|
||||
mylastVparam.Append(Vlast);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
if (degu == mydegremax && degv == mydegremax) {
|
||||
TheSurface = LSQ.Value();
|
||||
tolreached = Standard_False;
|
||||
currenttol3d = TheTol3d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_Real Approx_ComputeCSurface::Error(const Standard_Integer Index)const
|
||||
{
|
||||
return Tolers3d.Value(Index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Handle(Geom_BezierSurface) Approx_ComputeCSurface::Value(const Standard_Integer Index)const
|
||||
{
|
||||
return Handle(Geom_BezierSurface)::DownCast(mySurfaces.Value(Index));
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer Approx_ComputeCSurface::NbSurfaces() const
|
||||
{
|
||||
return mySurfaces.Length();
|
||||
}
|
||||
|
||||
|
||||
void Approx_ComputeCSurface::Parameters(const Standard_Integer Index,
|
||||
Standard_Real& firstU,
|
||||
Standard_Real& lastU,
|
||||
Standard_Real& firstV,
|
||||
Standard_Real& lastV)const
|
||||
{
|
||||
firstU = myfirstUparam.Value(Index);
|
||||
lastU = mylastUparam.Value(Index);
|
||||
firstV = myfirstVparam.Value(Index);
|
||||
lastV = mylastVparam.Value(Index);
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Approx_ComputeCSurface::IsToleranceReached() const
|
||||
{
|
||||
return tolreached;
|
||||
}
|
||||
|
||||
Standard_Boolean Approx_ComputeCSurface::IsAllApproximated() const
|
||||
{
|
||||
return alldone;
|
||||
}
|
||||
|
||||
|
||||
void Approx_ComputeCSurface::SetDegrees(const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Approx_ComputeCSurface::SetTolerance(const Standard_Real Tolerance3d)
|
||||
{
|
||||
mytol3d = Tolerance3d;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
generic class ComputeLine from Approx
|
||||
(MultiLine as any;
|
||||
LineTool as any) --as TheLineTool(MultiLine)
|
||||
LineTool as any)
|
||||
|
||||
|
||||
uses ParametrizationType from Approx,
|
||||
|
@ -1,106 +0,0 @@
|
||||
-- Created on: 1993-01-26
|
||||
-- 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 TheLineTool from Approx (MLine as any;
|
||||
MPoint as any)
|
||||
|
||||
---Purpose: Template which defines all the services relative to
|
||||
-- a MultiLine for approximation algorithms.
|
||||
|
||||
uses Status from Approx,
|
||||
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 derivative values of the multipoint
|
||||
-- <MPointIndex> when only 3d points exist.
|
||||
|
||||
|
||||
Tangency(myclass; ML: MLine; MPointIndex: Integer;
|
||||
tabV2d: out Array1OfVec2d)
|
||||
returns Boolean;
|
||||
---Purpose: returns the 2d derivative values 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 derivative values of the multipoint
|
||||
-- <MPointIndex>.
|
||||
|
||||
|
||||
|
||||
WhatStatus(myclass; ML: MLine; I1, I2: Integer)
|
||||
returns Status from Approx;
|
||||
---Purpose: . if Status = PointsAdded, a new MLine is created between
|
||||
-- the two MPoints <I1> and <I2> of ML by MakeMLBetween.
|
||||
-- . if Status = NoPointsAdded, no MLine will be created.
|
||||
-- The algorithm will return the best approximation done.
|
||||
-- . if Status = NoApproximation, nothing will be
|
||||
-- done between <I1> and <I2>.
|
||||
|
||||
MakeMLBetween(myclass; ML: MLine; I1, I2: Integer;
|
||||
NbPMin: Integer)
|
||||
returns MLine;
|
||||
---Purpose: Is called if WhatStatus returned "PointsAdded".
|
||||
|
||||
end TheLineTool;
|
||||
|
@ -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.
|
@ -23,8 +23,6 @@ uses
|
||||
|
||||
is
|
||||
|
||||
|
||||
generic class WLine; -- Only on curves with ->NbPoles, ->IsNull and ->Pole Methods
|
||||
deferred class SvSurfaces;
|
||||
generic class PrmPrmSvSurfaces,TheInt2S;
|
||||
generic class ImpPrmSvSurfaces,TheZerImpFunc;
|
||||
|
@ -1,59 +0,0 @@
|
||||
-- Created on: 1993-11-08
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- 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 WLine from ApproxInt (
|
||||
TheCurve as any;
|
||||
TheCurveTool as any;
|
||||
TheCurve2d as any;
|
||||
TheCurveTool2d as any)
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
|
||||
uses PntOn2S from IntSurf,
|
||||
LineOn2S from IntSurf
|
||||
|
||||
is
|
||||
|
||||
Create(CurveXYZ: TheCurve;
|
||||
CurveUV1: TheCurve2d;
|
||||
CurveUV2: TheCurve2d)
|
||||
|
||||
returns mutable WLine from ApproxInt;
|
||||
|
||||
Create(lin: LineOn2S from IntSurf; Tang: Boolean from Standard)
|
||||
|
||||
returns mutable WLine from ApproxInt;
|
||||
|
||||
NbPnts(me)
|
||||
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
Point(me: mutable; Index: Integer from Standard)
|
||||
|
||||
returns PntOn2S from IntSurf
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
curvxyz : TheCurve;
|
||||
curvuv1 : TheCurve2d;
|
||||
curvuv2 : TheCurve2d;
|
||||
pnton2s : PntOn2S from IntSurf;
|
||||
linon2s : LineOn2S from IntSurf;
|
||||
end WLine;
|
||||
|
@ -1,64 +0,0 @@
|
||||
// Created on: 1993-11-08
|
||||
// Created by: lbr
|
||||
// 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.
|
||||
|
||||
ApproxInt_WLine::ApproxInt_WLine(const TheCurve& CurveXYZ,
|
||||
const TheCurve2d& CurveUV1,
|
||||
const TheCurve2d& CurveUV2) {
|
||||
curvxyz = CurveXYZ;
|
||||
curvuv1 = CurveUV1;
|
||||
curvuv2 = CurveUV2;
|
||||
}
|
||||
|
||||
|
||||
ApproxInt_WLine::ApproxInt_WLine(const Handle(IntSurf_LineOn2S)& lin,
|
||||
const Standard_Boolean )
|
||||
:linon2s(lin)
|
||||
{
|
||||
}
|
||||
|
||||
Standard_Integer ApproxInt_WLine::NbPnts() const {
|
||||
if(!curvxyz.IsNull())
|
||||
return(curvxyz->NbPoles());
|
||||
if(!curvuv1.IsNull())
|
||||
return(curvuv1->NbPoles());
|
||||
if(!curvuv2.IsNull())
|
||||
return(curvuv2->NbPoles());
|
||||
return(linon2s->NbPoints());
|
||||
}
|
||||
|
||||
IntSurf_PntOn2S ApproxInt_WLine::Point(const Standard_Integer Index) {
|
||||
if(!linon2s.IsNull()) {
|
||||
if(linon2s->NbPoints()) {
|
||||
return(linon2s->Value(Index));
|
||||
}
|
||||
}
|
||||
gp_Pnt2d P1,P2;
|
||||
gp_Pnt P;
|
||||
if(!curvxyz.IsNull())
|
||||
P = curvxyz->Pole(Index);
|
||||
if(!curvuv1.IsNull())
|
||||
P1 = curvuv1->Pole(Index);
|
||||
if(!curvuv2.IsNull())
|
||||
P2 = curvuv2->Pole(Index);
|
||||
|
||||
pnton2s.SetValue(P,
|
||||
P1.X(),
|
||||
P1.Y(),
|
||||
P2.X(),
|
||||
P2.Y());
|
||||
return(pnton2s);
|
||||
}
|
||||
|
@ -31,8 +31,7 @@ uses IntSurf,
|
||||
is
|
||||
|
||||
-- deferred generic class SurfaceTool;
|
||||
|
||||
generic class Iterator; -- template class
|
||||
|
||||
|
||||
deferred class AppFunction; -- inherits FunctionSetWithDerivatives from math
|
||||
|
||||
|
@ -26,7 +26,7 @@ generic class CSWalking from Blend
|
||||
TheTopolTool as Transient;
|
||||
TheBlendTool as any;
|
||||
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc)
|
||||
TheSeqPointOnRst as any; -- as Iterator from Blend(ThePointOnRst)
|
||||
TheSeqPointOnRst as any;
|
||||
TheExtremity as any; -- as Extremity from Blend(TheVertex,TheArc,
|
||||
-- ThePointOnRst,TheSeqPointOnRst)
|
||||
TheLine as Transient) -- as Line from Blend(TheVertex,TheArc,
|
||||
|
@ -18,7 +18,7 @@ generic class Extremity from Blend
|
||||
(TheVertex as any;
|
||||
TheArc as any;
|
||||
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc)
|
||||
TheSequenceOfPointOnRst as any) -- as Iterator from Blend(ThePointOnRst)
|
||||
TheSequenceOfPointOnRst as any)
|
||||
|
||||
|
||||
|
||||
|
@ -1,58 +0,0 @@
|
||||
-- Created on: 1993-12-02
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 Iterator from Blend (Item as any)
|
||||
|
||||
---Purpose: Template class for an iterator.
|
||||
-- A Sequence from TCollection can implement this iterator.
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Creates an empty iterator.
|
||||
|
||||
returns Iterator;
|
||||
|
||||
|
||||
Clear(me: in out);
|
||||
|
||||
---Purpose: Clears the content of the iterator.
|
||||
|
||||
|
||||
|
||||
Append(me: in out; I: Item);
|
||||
|
||||
---Purpose: Adds an element in the iterator.
|
||||
|
||||
|
||||
Length(me: in out)
|
||||
|
||||
---Purpose: Returns the number of elements in the iterator.
|
||||
|
||||
returns Integer;
|
||||
|
||||
|
||||
Value(me: in out; Index: Integer from Standard)
|
||||
|
||||
---Purpose: Returns the element of range Index.
|
||||
|
||||
returns any Item;
|
||||
---C++: return const&
|
||||
---C++: alias operator()
|
||||
|
||||
|
||||
end Iterator;
|
@ -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.
|
@ -26,7 +26,7 @@ generic class Walking from Blend
|
||||
TheTopolTool as Transient;
|
||||
TheBlendTool as any;
|
||||
ThePointOnRst as any; -- as PointOnRst from Blend(TheArc)
|
||||
TheSeqPointOnRst as any; -- as Iterator from Blend(ThePointOnRst)
|
||||
TheSeqPointOnRst as any;
|
||||
TheExtremity as any; -- as Extremity from Blend(TheVertex,TheArc,
|
||||
-- ThePointOnRst,TheSeqPointOnRst)
|
||||
TheLine as Transient) -- as Line from Blend(TheVertex,TheArc,
|
||||
|
@ -23,12 +23,6 @@ uses Standard,StdFail,MMgt, GeomAbs, TopAbs, TCollection, gp, TColgp,
|
||||
Geom2d, TColStd, Geom, Adaptor3d, Adaptor2d
|
||||
|
||||
is
|
||||
|
||||
deferred generic class ArcTool; -- template class
|
||||
|
||||
deferred generic class SurfaceTool; -- template class
|
||||
|
||||
deferred generic class TopolTool; -- template class
|
||||
|
||||
generic class Point;
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
generic class ArcFunction from Contap
|
||||
(TheArc as any;
|
||||
TheSurface as any;
|
||||
TheArcTool as any; -- as ArcTool from Contap()
|
||||
TheSurfaceTool as any; -- as SurfaceTool from Contap()
|
||||
TheArcTool as any;
|
||||
TheSurfaceTool as any;
|
||||
TheSurfProps as any; -- as SurfProps from Contap(TheSurface,
|
||||
-- TheSurfaceTool)
|
||||
TheContTool as any) -- as ContTool from Contap()
|
||||
|
@ -1,58 +0,0 @@
|
||||
-- Created on: 1993-05-12
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 ArcTool from Contap
|
||||
(TheArc as any )
|
||||
|
||||
|
||||
---Purpose: Template class for a tool on the restriction of
|
||||
-- a surface.
|
||||
-- It is possible to implement this class with an instantiation
|
||||
-- of the class CurveTool from Adaptor3d.
|
||||
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Vec2d from gp
|
||||
|
||||
is
|
||||
|
||||
Value(myclass; A: TheArc; X: Real from Standard)
|
||||
|
||||
---Purpose: Returns the value in the parametric space
|
||||
-- of the surface S, of the point of parameter X
|
||||
-- on the arc A.
|
||||
|
||||
returns Pnt2d from gp;
|
||||
|
||||
|
||||
D1(myclass; A: TheArc; X: Real from Standard;
|
||||
P : out Pnt2d from gp;
|
||||
D2D : out Vec2d from gp);
|
||||
|
||||
---Purpose: Returns the value and the first derivatives in
|
||||
-- the parametric space of the surface S of the point
|
||||
-- at parameter X on the arc A.
|
||||
|
||||
|
||||
Resolution(myclass; A: TheArc; Tol3d: Real from Standard)
|
||||
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the space resolution Tol3d.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
end ArcTool;
|
@ -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.
|
@ -18,14 +18,11 @@ generic class ContourGen from Contap
|
||||
(TheVertex as any;
|
||||
TheArc as any;
|
||||
TheSurface as any;
|
||||
TheArcTool as any; -- as ArcTool from Contap(TheArc)
|
||||
TheSurfaceTool as any; -- as SurfaceTool from Contap(TheSurface)
|
||||
TheArcTool as any;
|
||||
TheSurfaceTool as any;
|
||||
TheContTool as any; -- as ContTool from Contap(TheVertex,TheArc,
|
||||
-- TheSurface)
|
||||
TheTopolTool as Transient)-- as TopolTool from IntStart(TheVertex,
|
||||
-- TheArc)
|
||||
|
||||
---Purpose:
|
||||
TheTopolTool as Transient)
|
||||
|
||||
|
||||
uses PathPoint from IntSurf,
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
generic class SurfProps from Contap
|
||||
(TheSurface as any;
|
||||
TheSurfaceTool as any) -- as SurfaceTool from Contap
|
||||
TheSurfaceTool as any)
|
||||
|
||||
---Purpose: Internal tool used to compute the normal and its
|
||||
-- derivatives.
|
||||
|
@ -1,142 +0,0 @@
|
||||
-- Created on: 1993-05-12
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 SurfaceTool from Contap
|
||||
(TheSurface as any)
|
||||
|
||||
|
||||
---Purpose: Template class for a tool on a surface.
|
||||
-- It is possible to implement this class with an
|
||||
-- instantiation of the Surface2Tool from Adaptor3d.
|
||||
|
||||
|
||||
uses SurfaceType from GeomAbs,
|
||||
Pln from gp,
|
||||
Sphere from gp,
|
||||
Cylinder from gp,
|
||||
Cone from gp,
|
||||
Pnt from gp,
|
||||
Vec from gp
|
||||
|
||||
is
|
||||
|
||||
|
||||
GetType(myclass; S: TheSurface)
|
||||
|
||||
returns SurfaceType from GeomAbs;
|
||||
|
||||
|
||||
Plane(myclass; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the plane from gp when GetType returns
|
||||
-- GeomAbs_Plane.
|
||||
|
||||
returns Pln from gp;
|
||||
|
||||
|
||||
Cylinder(myclass; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the cylinder from gp when GetType returns
|
||||
-- GeomAbs_Cylinder.
|
||||
|
||||
returns Cylinder from gp;
|
||||
|
||||
|
||||
Sphere(myclass; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the sphere from gp when GetType returns
|
||||
-- GeomAbs_Sphere.
|
||||
|
||||
returns Sphere from gp;
|
||||
|
||||
|
||||
Cone(myclass; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the cone from gp when GetType returns
|
||||
-- GeomAbs_Cone.
|
||||
|
||||
returns Cone from gp;
|
||||
|
||||
|
||||
|
||||
UIntervalFirst(myclass ; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the first U parameter of the surface.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
VIntervalFirst(myclass ; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the first V parameter of the surface.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
UIntervalLast(myclass ; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the last U parameter of the surface.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
VIntervalLast(myclass ; S: TheSurface)
|
||||
|
||||
---Purpose: Returns the last V parameter of the surface.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
Value (myclass ; S: TheSurface;
|
||||
U,V : Real from Standard)
|
||||
|
||||
---Purpose: Returns the point of parameter (U,V) on the surface.
|
||||
|
||||
returns Pnt from gp;
|
||||
|
||||
|
||||
D1(myclass; S: TheSurface; U,V: Real from Standard;
|
||||
P: out Pnt from gp; D1U,D1V: out Vec from gp);
|
||||
|
||||
---Purpose: Returns the point of parameter (U,V) on the surface,
|
||||
-- and the first derivatives in the directions u and v.
|
||||
|
||||
|
||||
D2(myclass; S: TheSurface; U,V: Real from Standard; P: out Pnt from gp;
|
||||
D1U,D1V,D2U,D2V,D2UV: out Vec from gp);
|
||||
|
||||
---Purpose: Returns the point of parameter (U,V) on the surface,
|
||||
-- and the first and the second derivatives in the
|
||||
-- directions u and v.
|
||||
|
||||
|
||||
UResolution(myclass; S : TheSurface; Tol3d: Real from Standard)
|
||||
|
||||
---Purpose: Returns the numerical resolution in the U direction,
|
||||
-- for a given resolution in 3d space.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
VResolution(myclass; S : TheSurface; Tol3d: Real from Standard)
|
||||
|
||||
---Purpose: Returns the numerical resolution in the V direction,
|
||||
-- for a given resolution in 3d space.
|
||||
|
||||
returns Real from Standard;
|
||||
|
||||
|
||||
end SurfaceTool;
|
@ -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,111 +0,0 @@
|
||||
-- Created on: 1993-05-12
|
||||
-- Created by: Jacques GOUSSARD
|
||||
-- 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 TopolTool from Contap
|
||||
( TheVertex as any;
|
||||
TheArc as any
|
||||
)
|
||||
|
||||
inherits TShared from MMgt
|
||||
|
||||
---Purpose: Template class for an iterator the restriction of
|
||||
-- a surface.
|
||||
|
||||
uses Orientation from TopAbs,
|
||||
State from TopAbs,
|
||||
Pnt2d from gp
|
||||
|
||||
|
||||
is
|
||||
|
||||
-- Arc iterator
|
||||
|
||||
Init(me: mutable)
|
||||
|
||||
;
|
||||
|
||||
|
||||
More(me: mutable)
|
||||
|
||||
returns Boolean from Standard
|
||||
;
|
||||
|
||||
|
||||
Value(me: mutable)
|
||||
|
||||
returns any TheArc
|
||||
;
|
||||
|
||||
|
||||
Next(me: mutable)
|
||||
|
||||
;
|
||||
|
||||
|
||||
-- Iterator on the vertex of an arc of restriction
|
||||
|
||||
|
||||
Initialize(me: mutable; A:TheArc);
|
||||
|
||||
|
||||
InitVertexIterator(me: mutable)
|
||||
|
||||
;
|
||||
|
||||
|
||||
MoreVertex(me: mutable)
|
||||
|
||||
returns Boolean from Standard
|
||||
;
|
||||
|
||||
|
||||
|
||||
Vertex(me: mutable)
|
||||
returns any TheVertex
|
||||
;
|
||||
|
||||
|
||||
NextVertex(me: mutable)
|
||||
|
||||
;
|
||||
|
||||
|
||||
Orientation(me: mutable; A: TheArc)
|
||||
|
||||
returns Orientation from TopAbs;
|
||||
|
||||
|
||||
Orientation(me: mutable; V: TheVertex)
|
||||
|
||||
returns Orientation from TopAbs;
|
||||
|
||||
|
||||
Identical(me: mutable; V1,V2: TheVertex)
|
||||
|
||||
---Purpose: Returns True if the vertices V1 and V2 are identical.
|
||||
-- This method does not take the orientation of the
|
||||
-- vertices in account.
|
||||
|
||||
returns Boolean from Standard;
|
||||
|
||||
|
||||
Classify(me: mutable; P: Pnt2d from gp; Tol: Real from Standard)
|
||||
|
||||
returns State from TopAbs;
|
||||
|
||||
|
||||
end TopolTool;
|
||||
|
@ -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.
|
@ -212,8 +212,6 @@ end ModeEnum;
|
||||
|
||||
class BooleanParameter;
|
||||
|
||||
generic class EnumerationParameter;
|
||||
|
||||
class IntegerParameter;
|
||||
|
||||
class RealParameter;
|
||||
@ -247,8 +245,6 @@ end ModeEnum;
|
||||
class InterpretedMethod;
|
||||
|
||||
class CompositMethod;
|
||||
|
||||
generic class MethodInstance;
|
||||
|
||||
deferred class MethodDefinitionsDictionary;
|
||||
|
||||
|
@ -1,102 +0,0 @@
|
||||
-- Created on: 1994-02-03
|
||||
-- Created by: Gilles DEBARBOUILLE
|
||||
-- Copyright (c) 1994-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 EnumerationParameter from Dynamic (Enum as any)
|
||||
|
||||
inherits
|
||||
|
||||
Parameter from Dynamic
|
||||
|
||||
---Purpose: This generic class defines a parameter with a given
|
||||
-- enumeration. For correct use an instanciation of this
|
||||
-- class, the Convert method must be defined. This
|
||||
-- method is automaticaly called by the constructor which
|
||||
-- takes a CString as value for the enumeration. The
|
||||
-- prototype of the Convert method must be described as
|
||||
-- follows :
|
||||
--
|
||||
-- void Convert(const Standard_CString,Enum);
|
||||
--
|
||||
-- The prototype and the body of this method, can be
|
||||
-- written in the file <mypackage.cxx> where the
|
||||
-- enumeration is described. No declaration of the
|
||||
-- Convert method in any .cdl file is necessary.
|
||||
|
||||
|
||||
uses
|
||||
CString from Standard,
|
||||
OStream from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(aparameter : CString from Standard)
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Creates an EnumerationParameter of <aparameter> as
|
||||
-- name.
|
||||
|
||||
returns mutable EnumerationParameter from Dynamic;
|
||||
|
||||
Create(aparameter : CString from Standard; avalue : Enum)
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Creates an EnumerationParameter of <aparameter> as
|
||||
-- name and <avalue> as value.
|
||||
|
||||
returns mutable EnumerationParameter from Dynamic;
|
||||
|
||||
Create(aparameter , avalue : CString from Standard)
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Creates an EnumerationParameter of <aparameter> as
|
||||
-- name and <avalue> as value. The user has to define a
|
||||
-- Convert method to translate the string <avalue> in an
|
||||
-- enumeration term.
|
||||
|
||||
returns mutable EnumerationParameter from Dynamic;
|
||||
|
||||
Value(me) returns Enum
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Returns the enumeration value <thevalue>.
|
||||
|
||||
is static;
|
||||
|
||||
Value (me : mutable ; avalue : Enum)
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Sets the field <thevalue> with the enumeration value <avalue>
|
||||
|
||||
is static;
|
||||
|
||||
Dump(me ; astream : in out OStream from Standard)
|
||||
|
||||
---Level: Internal
|
||||
|
||||
---Purpose: useful for debugging.
|
||||
|
||||
is redefined;
|
||||
|
||||
fields
|
||||
|
||||
thevalue : Enum;
|
||||
|
||||
end EnumerationParameter;
|
@ -1,84 +0,0 @@
|
||||
// Created on: 1994-02-03
|
||||
// Created by: Gilles DEBARBOUILLE
|
||||
// Copyright (c) 1994-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.
|
||||
|
||||
void String(const Standard_CString,Enum);
|
||||
|
||||
//=======================================================================
|
||||
//function : Dynamic_EnumerationParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Dynamic_EnumerationParameter::Dynamic_EnumerationParameter
|
||||
(const Standard_CString aparameter)
|
||||
: Dynamic_Parameter(aparameter)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dynamic_EnumerationParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Dynamic_EnumerationParameter::Dynamic_EnumerationParameter
|
||||
(const Standard_CString aparameter,
|
||||
const Enum& avalue)
|
||||
: Dynamic_Parameter(aparameter)
|
||||
{
|
||||
thevalue = avalue;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dynamic_EnumerationParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Dynamic_EnumerationParameter::Dynamic_EnumerationParameter
|
||||
(const Standard_CString aparameter,
|
||||
const Standard_CString avalue)
|
||||
: Dynamic_Parameter(aparameter)
|
||||
{
|
||||
String(avalue,thevalue);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Enum Dynamic_EnumerationParameter::Value() const
|
||||
{
|
||||
return thevalue;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Dynamic_EnumerationParameter::Value(const Enum& avalue)
|
||||
{
|
||||
thevalue = avalue;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Dynamic_EnumerationParameter::Dump(Standard_OStream& astream) const
|
||||
{
|
||||
Dynamic_Parameter::Dump(astream);
|
||||
astream<<" "<<thevalue;
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
-- Created on: 1993-12-23
|
||||
-- Created by: Gilles DEBARBOUILLE
|
||||
-- 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 MethodInstance from Dynamic (Dictionary as Transient)
|
||||
|
||||
inherits
|
||||
|
||||
Method from Dynamic
|
||||
|
||||
---Purpose: This class describes the facilities available to
|
||||
-- manipulate methods objects. It is a generic class
|
||||
-- because the creation of a MethodInstance requests
|
||||
-- a specific dictionary of definitions. In a method
|
||||
-- instance, it is only possible to set
|
||||
-- VariableInstance which are roughtly a copy of the
|
||||
-- variable set in the method definition and a
|
||||
-- pointer on the variable, describing the signature
|
||||
-- of the complex method in the process of build or
|
||||
-- addressing the user value.
|
||||
|
||||
uses
|
||||
|
||||
CString from Standard,
|
||||
OStream from Standard,
|
||||
Boolean from Standard,
|
||||
ModeEnum from Dynamic,
|
||||
Parameter from Dynamic,
|
||||
Variable from Dynamic,
|
||||
VariableNode from Dynamic,
|
||||
AsciiString from TCollection
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create(atype : CString from Standard) returns mutable MethodInstance from Dynamic;
|
||||
|
||||
---Level: Public
|
||||
|
||||
--- Purpose: Creates a MethodInstance object of the type <atype>.
|
||||
-- If <atype> is not defined in the dictionary, the object
|
||||
-- created will have no definition.
|
||||
|
||||
Create(amethodinstance : MethodInstance from Dynamic) returns mutable MethodInstance from Dynamic;
|
||||
|
||||
---Level: Public
|
||||
|
||||
--- Purpose: Creates a MethodInstance with as definition the method
|
||||
-- instance <amethodinstance>.
|
||||
|
||||
Type(me) returns AsciiString from TCollection
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Returns the type of object read in the definition.
|
||||
|
||||
is redefined;
|
||||
|
||||
Definition(me) returns Method from Dynamic
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Returns a reference to the definition of the
|
||||
-- MethodInstance.
|
||||
|
||||
is static;
|
||||
|
||||
Variable(me : mutable ; aparameter : Parameter from Dynamic
|
||||
; amode : ModeEnum from Dynamic
|
||||
; avariable : Variable from Dynamic)
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Creates and adds to the instance <me> the variable
|
||||
-- instance build with <aparameter> and <amode> and
|
||||
-- adresses the variable .
|
||||
|
||||
is static;
|
||||
|
||||
Value(me ; aname : CString from Standard
|
||||
; aparameter : out any Parameter from Dynamic
|
||||
; amode : out ModeEnum from Dynamic
|
||||
; avariable : out any Variable from Dynamic) returns Boolean
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Returns True, if there is a variable instance named
|
||||
-- <aname>, False otherwise. It returns in the argument
|
||||
-- <aparameter> the signature of the variable, in <amode>
|
||||
-- the variable is in, out, inout, internal or constant
|
||||
-- and in <avariable>, the reference to the effective
|
||||
-- value used by the instance or a reference to the
|
||||
-- variable defining the signature of the complex method
|
||||
-- using this instance of method.
|
||||
|
||||
is static;
|
||||
|
||||
Value(me ; aname : CString from Standard
|
||||
; aparameter : out any Parameter from Dynamic
|
||||
; amode : out ModeEnum from Dynamic
|
||||
; avariablenode : out any VariableNode from Dynamic) returns Boolean from Standard
|
||||
|
||||
---Level: Public
|
||||
|
||||
---Purpose: Returns True, if there is a variable instance named
|
||||
-- <aname>, False otherwise. It returns in the argument
|
||||
-- <aparameter> the signature of the variable, in <amode>
|
||||
-- the variable is in, out, inout, internal or constant
|
||||
-- and in <avariablenode>, the head of the effective
|
||||
-- referenced value used by the instance or the head of
|
||||
-- the variables reference defining the signature of the
|
||||
-- complex method using this instance of method.
|
||||
|
||||
is static;
|
||||
|
||||
Dump(me ; astream : in out OStream from Standard)
|
||||
|
||||
---Level: Internal
|
||||
|
||||
---Purpose: Useful for debugging.
|
||||
|
||||
is redefined;
|
||||
|
||||
fields
|
||||
|
||||
thedefinition : Method from Dynamic;
|
||||
|
||||
end MethodInstance;
|
@ -1,216 +0,0 @@
|
||||
// Created on: 1993-12-24
|
||||
// Created by: Gilles DEBARBOUILLE
|
||||
// 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.
|
||||
|
||||
// CRD : 15/04/97 : Passage WOK++ : Remplacement de TYPE par STANDARD_TYPE
|
||||
|
||||
|
||||
#include <Dynamic_MethodDefinition.hxx>
|
||||
#include <Dynamic_SequenceOfMethodDefinitions.hxx>
|
||||
#include <Dynamic_VariableNode.hxx>
|
||||
#include <Dynamic_Variable.hxx>
|
||||
#include <Dynamic_VariableInstance.hxx>
|
||||
#include <Dynamic_CompositVariableInstance.hxx>
|
||||
#include <Dynamic_AbstractVariableInstance.hxx>
|
||||
|
||||
void DictionaryOfDefinitions(Handle(Dictionary)&);
|
||||
|
||||
//=======================================================================
|
||||
//function : Dynamic_MethodInstance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Dynamic_MethodInstance::Dynamic_MethodInstance(const Standard_CString atype)
|
||||
{
|
||||
Handle(Dictionary) dictionary;
|
||||
DictionaryOfDefinitions(dictionary);
|
||||
|
||||
if(dictionary->Definition(atype,thedefinition)) return;
|
||||
else cout<<atype<<" n'existe pas dans le dictionnaire."<<endl;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dynamic_MethodInstance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Dynamic_MethodInstance::Dynamic_MethodInstance(const Handle(Dynamic_MethodInstance)& amethodinstance)
|
||||
{
|
||||
thedefinition = amethodinstance;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Type
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TCollection_AsciiString Dynamic_MethodInstance::Type() const
|
||||
{
|
||||
return Definition()->Type();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Definition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Dynamic_Method) Dynamic_MethodInstance::Definition() const
|
||||
{
|
||||
Handle(Dynamic_MethodInstance) definition;
|
||||
|
||||
if(thedefinition->IsKind(STANDARD_TYPE(Dynamic_MethodDefinition)))
|
||||
{
|
||||
return thedefinition;
|
||||
}
|
||||
else
|
||||
{
|
||||
definition = *(Handle_Dynamic_MethodInstance*)&thedefinition;
|
||||
return definition->Definition();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Variable
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Dynamic_MethodInstance::Variable(const Handle(Dynamic_Parameter)& aparameter,
|
||||
const Dynamic_ModeEnum amode,
|
||||
const Handle(Dynamic_Variable)& avariable)
|
||||
{
|
||||
Handle(Dynamic_AbstractVariableInstance) abstractvariableinstance;
|
||||
Handle(Dynamic_VariableNode) variablenode;
|
||||
Handle(Dynamic_Variable) variable;
|
||||
TCollection_AsciiString name = aparameter->Name();
|
||||
|
||||
if(Definition()->Variable(name.ToCString()))
|
||||
{
|
||||
variablenode = FirstVariableNode();
|
||||
while(!variablenode.IsNull())
|
||||
{
|
||||
variable = variablenode->Object();
|
||||
abstractvariableinstance = *(Handle_Dynamic_AbstractVariableInstance*)&variable;
|
||||
if(abstractvariableinstance->Parameter()->Name() == aparameter->Name())
|
||||
{
|
||||
abstractvariableinstance->Mode(amode);
|
||||
abstractvariableinstance->Parameter(aparameter);
|
||||
abstractvariableinstance->Variable(avariable);
|
||||
return;
|
||||
}
|
||||
variablenode = variablenode->Next();
|
||||
}
|
||||
abstractvariableinstance = new Dynamic_VariableInstance();
|
||||
abstractvariableinstance->Mode(amode);
|
||||
abstractvariableinstance->Parameter(aparameter);
|
||||
abstractvariableinstance->Variable(avariable);
|
||||
Dynamic_Method::Variable(abstractvariableinstance);
|
||||
}
|
||||
else
|
||||
cout<<"Pas de parametre du nom de : "<< aparameter->Name()<<endl;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Dynamic_MethodInstance::Value(const Standard_CString aname,
|
||||
Handle(Dynamic_Parameter)& aparameter,
|
||||
Dynamic_ModeEnum& amode,
|
||||
Handle(Dynamic_Variable)& avariable) const
|
||||
{
|
||||
Handle(Dynamic_Variable) variable;
|
||||
Handle(Dynamic_Variable) nullvariable;
|
||||
|
||||
if(Dynamic_Method::Value(aname,variable))
|
||||
{
|
||||
amode = variable->Mode();
|
||||
aparameter = variable->Parameter();
|
||||
if(variable->IsKind(STANDARD_TYPE(Dynamic_VariableInstance)))
|
||||
avariable = (*(Handle_Dynamic_VariableInstance*)&variable)->Variable();
|
||||
else
|
||||
avariable = nullvariable;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
else if(thedefinition->Value(aname,variable))
|
||||
{
|
||||
amode = variable->Mode();
|
||||
aparameter = variable->Parameter();
|
||||
if(variable->IsKind(STANDARD_TYPE(Dynamic_VariableInstance)))
|
||||
avariable = (*(Handle_Dynamic_VariableInstance*)&variable)->Variable();
|
||||
else
|
||||
avariable = nullvariable;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Dynamic_MethodInstance::Value(const Standard_CString aname,
|
||||
Handle(Dynamic_Parameter)& aparameter,
|
||||
Dynamic_ModeEnum& amode,
|
||||
Handle(Dynamic_VariableNode)& avariablenode) const
|
||||
{
|
||||
Handle(Dynamic_Variable) variable;
|
||||
Handle(Dynamic_VariableNode) nullvariablenode;
|
||||
|
||||
if(Dynamic_Method::Value(aname,variable))
|
||||
{
|
||||
amode = variable->Mode();
|
||||
aparameter = variable->Parameter();
|
||||
if(variable->IsKind(STANDARD_TYPE(Dynamic_CompositVariableInstance)))
|
||||
avariablenode = (*(Handle_Dynamic_CompositVariableInstance*)&variable)->FirstVariableNode();
|
||||
else
|
||||
avariablenode = nullvariablenode;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
else if(thedefinition->Value(aname,variable))
|
||||
{
|
||||
amode = variable->Mode();
|
||||
aparameter = variable->Parameter();
|
||||
if(variable->IsKind(STANDARD_TYPE(Dynamic_CompositVariableInstance)))
|
||||
avariablenode = (*(Handle_Dynamic_CompositVariableInstance*)&variable)->FirstVariableNode();
|
||||
else
|
||||
avariablenode = nullvariablenode;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
else return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Dynamic_MethodInstance::Dump(Standard_OStream& astream) const
|
||||
{
|
||||
Handle(Dynamic_VariableNode) variablenode = FirstVariableNode();
|
||||
astream<<"Method Instance : "<<Definition()->Type()<<endl;
|
||||
while(!variablenode.IsNull())
|
||||
{
|
||||
astream<<" ";
|
||||
variablenode->Object()->Dump(astream);
|
||||
astream<<endl;
|
||||
variablenode = variablenode->Next();
|
||||
}
|
||||
}
|
@ -57,8 +57,6 @@ is
|
||||
generic class Point;
|
||||
class POnSurf;
|
||||
class POnSurfParams;
|
||||
|
||||
generic class ExtPSOfRev;
|
||||
|
||||
-----------------------------------
|
||||
-- Treatement of elementary curves
|
||||
|
@ -1,76 +0,0 @@
|
||||
-- Created on: 1991-10-09
|
||||
-- Created by: Michel CHAUVAT
|
||||
-- Copyright (c) 1991-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 ExtPSOfRev from Extrema (SurfaceOfRevolution as any;
|
||||
Tool as any ; -- as ToolSurfaceOfRevolution(SurfaceOfRevolution)
|
||||
Curve as any;
|
||||
ToolCurve as any; -- as ToolCurve(Curve)
|
||||
TheExtPC as any
|
||||
)
|
||||
---Purpose: It calculates all the extremum distances
|
||||
-- between a point and a surface.
|
||||
-- These distances can be minimum or maximum.
|
||||
|
||||
uses POnSurf from Extrema,
|
||||
SequenceOfPOnSurf from Extrema,
|
||||
Pnt from gp,
|
||||
SequenceOfReal from TColStd
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create (P: Pnt; S: SurfaceOfRevolution; Tol: Real; NbV: Integer;
|
||||
TolV: Real) returns ExtPSOfRev;
|
||||
---Purpose: It calculates all the distances between a point
|
||||
-- and a surface of revolution.
|
||||
-- Tol is used to test if the point is on the axis.
|
||||
-- NbV and TolV are used to compute the extrema on a
|
||||
-- meridian (see ExtPC.cdl).
|
||||
|
||||
IsDone (me) returns Boolean
|
||||
---Purpose: Returns True if the distances are found.
|
||||
is static;
|
||||
|
||||
NbExt (me) returns Integer
|
||||
---Purpose: Returns the number of extremum distances.
|
||||
raises NotDone from StdFail
|
||||
-- if IsDone(me)=False.
|
||||
is static;
|
||||
|
||||
SquareDistance (me; N: Integer) returns Real
|
||||
---Purpose: Returns the value of the Nth resulting square distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
Point (me; N: Integer) returns POnSurf
|
||||
---C++: return const &
|
||||
---Purpose: Returns the point of the Nth resulting distance.
|
||||
raises NotDone from StdFail,
|
||||
-- if IsDone(me)=False.
|
||||
OutOfRange
|
||||
-- if N < 1 or N > NbPoints(me).
|
||||
is static;
|
||||
|
||||
fields
|
||||
myDone : Boolean;
|
||||
mySqDist: SequenceOfReal from TColStd;
|
||||
myPoint: SequenceOfPOnSurf from Extrema;
|
||||
|
||||
end ExtPSOfRev;
|
@ -1,106 +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.
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
//=============================================================================
|
||||
|
||||
Extrema_ExtPSOfRev::Extrema_ExtPSOfRev (const gp_Pnt& P,
|
||||
const SurfaceOfRevolution& S,
|
||||
const Standard_Real Tol,
|
||||
const Standard_Integer NbV, const Standard_Real TolV)
|
||||
/*-----------------------------------------------------------------------------
|
||||
Fonction:
|
||||
Recherche de toutes les distances extremales entre le point P et la surface
|
||||
de revolution S.
|
||||
|
||||
Methode:
|
||||
Soit Pp la projection du point P dans le plan XOY de la surface S;
|
||||
2 cas sont consideres:
|
||||
1- distance(Pp,O) < Tol:
|
||||
Il existe 0 ou une infinite de solutions; IsDone() = Standard_False;
|
||||
2- distance(Pp,O) > Tol:
|
||||
Soit U1 = angle(OX,OPp) avec 0. < U1 < 2.*M_PI,
|
||||
U2 = U1 + M_PI avec 0. < U2 < 2.*M_PI,
|
||||
M1 le meridien S(U1),
|
||||
M2 le meridien S(U2);
|
||||
On recherche les distances minimales entre P et M1 et les distances
|
||||
maximales entre P et M2. Soit {V1i,i=1,n} et {V2j, j=1,m} ces solutions;
|
||||
alors les (U1,V1i) correspondent a des distances minimales
|
||||
et les (U2,V2j) correspondent a des distances maximales.
|
||||
-----------------------------------------------------------------------------*/
|
||||
{
|
||||
myDone = Standard_False;
|
||||
|
||||
// Projection de P dans le plan XOY de la surface de revolution ...
|
||||
gp_Ax3 Pos = Tool::Position(S);
|
||||
gp_Pnt O = Pos.Location();
|
||||
gp_Vec OZ (Pos.Direction());
|
||||
gp_Pnt Pp = P.Translated(OZ.Multiplied(-(gp_Vec(O,P).Dot(OZ))));
|
||||
gp_Vec OPp (O,Pp);
|
||||
if (OPp.Magnitude() < Tol) { return; }
|
||||
|
||||
Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,OZ);
|
||||
Standard_Real U2 = U1 + M_PI;
|
||||
if (U1 < 0.) { U1 += 2. * M_PI; }
|
||||
Curve M1 = Tool::Meridian(S, U1);
|
||||
Curve M2 = Tool::Meridian(S, U2);
|
||||
TheExtPC ExtPM1 (P,M1,NbV,TolV,Tol);
|
||||
TheExtPC ExtPM2 (P,M2,NbV,TolV,Tol);
|
||||
if ((ExtPM1.IsDone()) && (ExtPM2.IsDone())) {
|
||||
Standard_Integer NbExt1 = ExtPM1.NbExt();
|
||||
Standard_Integer NbExt2 = ExtPM2.NbExt();
|
||||
Extrema_POnCurv ExtPM;
|
||||
for (Standard_Integer NoExt = 1; NoExt <= NbExt1; NoExt++) {
|
||||
if (ExtPM1.IsMin(NoExt)) {
|
||||
ExtPM = ExtPM1.Point(NoExt);
|
||||
mySqDist.Append(ExtPM1.SquareDistance(NoExt));
|
||||
myPoint.Append(Extrema_POnSurf(U1,ExtPM.Parameter(),ExtPM.SquareDistance()));
|
||||
}
|
||||
}
|
||||
for (NoExt = 1; NoExt <= NbExt2; NoExt++) {
|
||||
if (!ExtPM2.IsMin(NoExt)) {
|
||||
ExtPM = ExtPM2.Point(NoExt);
|
||||
mySqDist.Append(ExtPM2.SquareDistance(NoExt));
|
||||
myPoint.Append(Extrema_POnSurf(U2,ExtPM.Parameter(),ExtPM.SquareDistance()));
|
||||
}
|
||||
}
|
||||
myDone = Standard_True;
|
||||
}
|
||||
}
|
||||
//=============================================================================
|
||||
|
||||
Standard_Boolean Extrema_ExtPSOfRev::IsDone () const { return myDone; }
|
||||
//=============================================================================
|
||||
|
||||
Standard_Integer Extrema_ExtPSOfRev::NbExt () const
|
||||
{
|
||||
if (!IsDone()) { StdFail_NotDone::Raise(); }
|
||||
return mySqDist.Length();
|
||||
}
|
||||
//=============================================================================
|
||||
|
||||
Standard_Real Extrema_ExtPSOfRev::SquareDistance (const Standard_Integer N) const
|
||||
{
|
||||
if (!IsDone()) { StdFail_NotDone::Raise(); }
|
||||
return mySqDist.Value(N);
|
||||
}
|
||||
//=============================================================================
|
||||
|
||||
const Extrema_POnSurf& Extrema_ExtPSOfRev::Point (const Standard_Integer N) const
|
||||
{
|
||||
if (!IsDone()) { StdFail_NotDone::Raise(); }
|
||||
return myPoint.Value(N);
|
||||
}
|
||||
//=============================================================================
|
@ -136,13 +136,7 @@ enumeration ValueType
|
||||
-- with the minimum of methods required to implement
|
||||
-- the computation of the global properties for a curve
|
||||
-- or a surface.
|
||||
|
||||
|
||||
deferred generic class CurveTool;
|
||||
|
||||
deferred generic class FaceTool;
|
||||
|
||||
deferred generic class DomainTool;
|
||||
|
||||
--
|
||||
-- Class to compute the average plane or line of a set of points.
|
||||
|
@ -19,8 +19,7 @@
|
||||
|
||||
|
||||
generic class CGProps from GProp (Curve as any;
|
||||
Tool as any -- as CurveTool(Curve)
|
||||
)
|
||||
Tool as any)
|
||||
|
||||
inherits GProps from GProp
|
||||
|
||||
|
@ -1,68 +0,0 @@
|
||||
-- Created on: 1992-08-26
|
||||
-- Created by: Jean-Claude Vauthier
|
||||
-- Copyright (c) 1992-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 CurveTool from GProp (Curve as any)
|
||||
|
||||
--- Purpose :
|
||||
-- This template defines the minimum of methods required
|
||||
-- to compute the global properties of a C1 parametric
|
||||
-- curve in 3d space with the algorithmes of package GProp.
|
||||
-- To compute the global properties of your curves, you
|
||||
-- have to define your own "CurveTool" using this template.
|
||||
--
|
||||
-- Curve must be a bounded curve of continuity C1 defined in 3d
|
||||
-- space.
|
||||
|
||||
uses Pnt from gp,
|
||||
Vec from gp
|
||||
|
||||
is
|
||||
|
||||
|
||||
FirstParameter (myclass; C : Curve) returns Real;
|
||||
--- Purpose :
|
||||
-- Returns the parametric value of the start point of
|
||||
-- the curve. The curve is oriented from the start point
|
||||
-- to the end point.
|
||||
|
||||
|
||||
LastParameter (myclass; C : Curve) returns Real;
|
||||
--- Purpose :
|
||||
-- Returns the parametric value of the end point of
|
||||
-- the curve. The curve is oriented from the start point
|
||||
-- to the end point.
|
||||
|
||||
|
||||
IntegrationOrder (myclass; C : Curve) returns Integer;
|
||||
--- Purpose :
|
||||
-- Returns the number of Gauss points required to do
|
||||
-- the integration with a good accuracy using the
|
||||
-- Gauss method. For a polynomial curve of degree n
|
||||
-- the maxima of accuracy is obtained with an order
|
||||
-- of integration equal to 2*n-1.
|
||||
|
||||
|
||||
Value (myclass; C : Curve; U : Real) returns Pnt;
|
||||
--- Purpose : Returns the point of parameter U on the loaded curve.
|
||||
|
||||
|
||||
D1 (myclass; C : Curve; U: Real; P: out Pnt; V1: out Vec);
|
||||
--- Purpose :
|
||||
-- Returns the point of parameter U and the first derivative
|
||||
-- at this point.
|
||||
|
||||
|
||||
end CurveTool;
|
@ -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,38 +0,0 @@
|
||||
-- Created on: 1992-11-27
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1992-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 DomainTool from GProp (Arc as any)
|
||||
|
||||
---Purpose: Arc iterator
|
||||
|
||||
|
||||
is
|
||||
|
||||
Init(me : in out);
|
||||
---Purpose: Initializes the exploration with the parameters already set.
|
||||
|
||||
More(me : in out) returns Boolean from Standard;
|
||||
--- Purpose :
|
||||
-- Returns True if there is another arc of curve in the list.
|
||||
|
||||
Value(me : in out) returns Arc ;
|
||||
|
||||
Next(me : in out) ;
|
||||
--- Purpose :
|
||||
-- Sets the index of the arc iterator to the next arc of
|
||||
-- curve.
|
||||
|
||||
end DomainTool;
|
@ -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,106 +0,0 @@
|
||||
-- Created on: 1992-11-27
|
||||
-- Created by: Isabelle GRIGNON
|
||||
-- Copyright (c) 1992-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 FaceTool from GProp( Arc as any )
|
||||
|
||||
---Purpose: This template class defines the minimum of methods required
|
||||
-- to compute the global properties of Faces with the
|
||||
-- algorithms of the package GProp.
|
||||
-- To compute the global properties of a Face, in is necessary
|
||||
-- to define own "FaceTool" and to implement all the methods
|
||||
-- defined in this template. Note that it is not necessary to
|
||||
-- inherit this template class.
|
||||
|
||||
uses Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
Vec from gp,
|
||||
Vec2d from gp,
|
||||
IsoType from GeomAbs,
|
||||
HArray1OfReal from TColStd
|
||||
|
||||
is
|
||||
|
||||
UIntegrationOrder (me) returns Integer;
|
||||
---Purpose: Returns the number of points required to do the
|
||||
-- integration in the U parametric direction.
|
||||
|
||||
Bounds (me; U1, U2, V1, V2 : out Real);
|
||||
---Purpose: Returns the parametric bounds of the Face <S>.
|
||||
|
||||
Normal (me; U, V : Real; P : out Pnt; VNor: out Vec);
|
||||
---Purpose: Computes the point of parameter U, V on the Face <S> and
|
||||
-- the normal to the face at this point.
|
||||
|
||||
Load(me:in out; A : Arc);
|
||||
---Purpose: Loading the boundary arc.
|
||||
|
||||
Load(me : in out; IsFirstParam: Boolean from Standard;
|
||||
theIsoType : IsoType from GeomAbs);
|
||||
---Purpose: Loading the boundary arc. This arc is either a top, bottom,
|
||||
-- left or right bound of a UV rectangle in which the
|
||||
-- parameters of surface are defined.
|
||||
-- If IsFirstParam is equal to Standard_True, the face is
|
||||
-- initialized by either left of bottom bound. Otherwise it is
|
||||
-- initialized by the top or right one.
|
||||
-- If theIsoType is equal to GeomAbs_IsoU, the face is
|
||||
-- initialized with either left or right bound. Otherwise -
|
||||
-- with either top or bottom one.
|
||||
|
||||
FirstParameter (me) returns Real ;
|
||||
---Purpose: Returns the parametric value of the start point of
|
||||
-- the current arc of curve.
|
||||
|
||||
LastParameter (me) returns Real ;
|
||||
---Purpose: Returns the parametric value of the end point of
|
||||
-- the current arc of curve.
|
||||
|
||||
IntegrationOrder (me) returns Integer;
|
||||
---Purpose: Returns the number of points required to do the
|
||||
-- integration along the parameter of curve.
|
||||
|
||||
D12d (me; U: Real; P: out Pnt2d; V1: out Vec2d);
|
||||
---Purpose: Returns the point of parameter U and the first derivative
|
||||
-- at this point of a boundary curve.
|
||||
|
||||
GetUKnots(me; theUMin : Real from Standard;
|
||||
theUMax : Real from Standard;
|
||||
theUKnots: in out HArray1OfReal from TColStd);
|
||||
---Purpose: Returns an array of U knots of the face. The first and last
|
||||
-- elements of the array will be theUMin and theUMax. The
|
||||
-- middle elements will be the U Knots of the face greater
|
||||
-- then theUMin and lower then theUMax in increasing order.
|
||||
|
||||
GetTKnots(me; theTMin : Real from Standard;
|
||||
theTMax : Real from Standard;
|
||||
theTKnots: in out HArray1OfReal from TColStd);
|
||||
---Purpose: Returns an array of combination of T knots of the arc and
|
||||
-- V knots of the face. The first and last elements of the
|
||||
-- array will be theTMin and theTMax. The middle elements will
|
||||
-- be the Knots of the arc and the values of parameters of
|
||||
-- arc on which the value points have V coordinates close to V
|
||||
-- knots of face. All the parameter will be greater then
|
||||
-- theTMin and lower then theTMax in increasing order.
|
||||
|
||||
end FaceTool;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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.
|
@ -18,9 +18,8 @@
|
||||
|
||||
|
||||
generic class SGProps from GProp ( Arc as any;
|
||||
Face as any; --as FaceTool (Arc)
|
||||
Domain as any --as DomainTool(Arc)
|
||||
)
|
||||
Face as any;
|
||||
Domain as any)
|
||||
inherits GProps
|
||||
|
||||
--- Purpose :
|
||||
|
@ -18,9 +18,8 @@
|
||||
|
||||
|
||||
generic class VGProps from GProp (Arc as any;
|
||||
Face as any; -- as FaceTool(Arc)
|
||||
Domain as any -- as DomainTool(Arc)
|
||||
)
|
||||
Face as any;
|
||||
Domain as any)
|
||||
inherits GProps
|
||||
|
||||
--- Purpose :
|
||||
|
@ -14,9 +14,8 @@
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
generic class VGPropsGK from GProp (Arc as any;
|
||||
Face as any; -- as FaceTool(Arc)
|
||||
Domain as any -- as DomainTool(Arc)
|
||||
)
|
||||
Face as any;
|
||||
Domain as any)
|
||||
inherits GProps from GProp
|
||||
|
||||
---Purpose: Computes the global properties of a geometric solid
|
||||
|
Loading…
x
Reference in New Issue
Block a user