1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

21
src/AppBlend/AppBlend.cdl Executable file
View File

@@ -0,0 +1,21 @@
-- File: AppBlend.cdl
-- Created: Mon Dec 13 16:28:26 1993
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1993
package AppBlend
uses StdFail, MMgt, TCollection, TColStd, TColgp, GeomAbs
is
deferred generic class Line;
deferred generic class SectionGenerator;
deferred class Approx;
generic class AppSurf;
end AppBlend;

331
src/AppBlend/AppBlend_AppSurf.cdl Executable file
View File

@@ -0,0 +1,331 @@
-- File: AppBlend_AppSurf.cdl
-- Created: Mon Dec 13 16:29:23 1993
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
-- Modified: Fri Jul 10 11:23:35 1998
-- JCT : Add SpApprox in Perform
---Copyright: Matra Datavision 1993
generic class AppSurf from AppBlend
(TheSectionGenerator as any;
TheLine as Transient)
inherits Approx from AppBlend
---Purpose: Bspline approximation of a surface.
uses Array2OfPnt from TColgp,
HArray2OfPnt from TColgp,
Array2OfReal from TColStd,
HArray2OfReal from TColStd,
Array1OfReal from TColStd,
HArray1OfReal from TColStd,
Array1OfInteger from TColStd,
HArray1OfInteger from TColStd,
Array1OfPnt2d from TColgp,
SequenceOfArray1OfPnt2d from TColgp,
ParametrizationType from Approx,
Shape from GeomAbs
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
is
Create
returns AppSurf from AppBlend;
Create(Degmin,Degmax: Integer from Standard;
Tol3d,Tol2d : Real from Standard;
NbIt: Integer from Standard;
KnownParameters : Boolean from Standard = Standard_False)
returns AppSurf from AppBlend;
Init(me: in out; Degmin,Degmax: Integer from Standard;
Tol3d,Tol2d : Real from Standard;
NbIt: Integer from Standard;
KnownParameters : Boolean from Standard = Standard_False)
is static;
SetParType(me: in out; ParType : ParametrizationType from Approx)
---Purpose: Define the type of parametrization used in the approximation
is static;
SetContinuity(me: in out; C : Shape from GeomAbs)
---Purpose: Define the Continuity used in the approximation
is static;
SetCriteriumWeight(me : in out;
W1, W2, W3 : Real)
---Purpose: define the Weights associed to the criterium used in
-- the optimization.
--
raises DomainError -- if Wi <= 0
is static;
ParType(me)
---Purpose: returns the type of parametrization used in the approximation
returns ParametrizationType from Approx
is static;
Continuity(me)
---Purpose: returns the Continuity used in the approximation
returns Shape from GeomAbs
is static;
CriteriumWeight(me ;
W1, W2, W3 : out Real)
---Purpose: returns the Weights (as percent) associed to the criterium used in
-- the optimization.
is static;
Perform(me: in out; Lin: TheLine;
SecGen: in out TheSectionGenerator;
SpApprox : Boolean from Standard = Standard_False)
is static;
PerformSmoothing(me: in out; Lin: TheLine;
SecGen: in out TheSectionGenerator)
is static;
Perform(me: in out; Lin: TheLine;
SecGen: in out TheSectionGenerator;
NbMaxP: Integer from Standard)
is static;
InternalPerform(me: in out; Lin: TheLine;
SecGen: in out TheSectionGenerator;
SpApprox : Boolean from Standard;
UseVariational: Boolean from Standard)
is static private;
IsDone(me)
returns Boolean from Standard
---C++: inline
is static;
SurfShape(me; UDegree,VDegree : out Integer from Standard;
NbUPoles,NbVPoles: out Integer from Standard;
NbUKnots,NbVKnots: out Integer from Standard)
raises NotDone from StdFail
is static;
Surface(me; TPoles : out Array2OfPnt from TColgp;
TWeights : out Array2OfReal from TColStd;
TUKnots,TVKnots : out Array1OfReal from TColStd;
TUMults,TVMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail
is static;
UDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
VDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
SurfPoles(me)
returns Array2OfPnt from TColgp
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfWeights(me)
returns Array2OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfUKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfVKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfUMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
SurfVMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail
is static;
NbCurves2d(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail
is static;
Curves2dShape(me; Degree,NbPoles,NbKnots: out Integer from Standard)
raises NotDone from StdFail,
DomainError from Standard
is static;
Curve2d(me; Index: Integer from Standard;
TPoles : out Array1OfPnt2d from TColgp;
TKnots : out Array1OfReal from TColStd;
TMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is static;
Curves2dDegree(me)
returns Integer from Standard
---C++: inline
raises NotDone from StdFail,
DomainError from Standard
is static;
Curve2dPoles(me; Index: Integer from Standard)
returns Array1OfPnt2d from TColgp
---C++: inline
---C++: return const&
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is static;
Curves2dKnots(me)
returns Array1OfReal from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is static;
Curves2dMults(me)
returns Array1OfInteger from TColStd
---C++: inline
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is static;
TolReached(me; Tol3d, Tol2d : out Real from Standard)
---C++: inline
raises NotDone from StdFail
is static;
TolCurveOnSurf(me; Index : Integer from Standard)
returns Real from Standard
raises NotDone from StdFail
is static;
fields
done : Boolean from Standard;
dmin : Integer from Standard;
dmax : Integer from Standard;
tol3d : Real from Standard;
tol2d : Real from Standard;
nbit : Integer from Standard;
udeg : Integer from Standard;
vdeg : Integer from Standard;
knownp : Boolean from Standard;
tabPoles : HArray2OfPnt from TColgp;
tabWeights : HArray2OfReal from TColStd;
tabUKnots : HArray1OfReal from TColStd;
tabVKnots : HArray1OfReal from TColStd;
tabUMults : HArray1OfInteger from TColStd;
tabVMults : HArray1OfInteger from TColStd;
seqPoles2d : SequenceOfArray1OfPnt2d from TColgp;
tol3dreached : Real from Standard;
tol2dreached : Real from Standard;
paramtype : ParametrizationType from Approx;
continuity : Shape from GeomAbs;
critweights : Real[3];
end AppSurf;

970
src/AppBlend/AppBlend_AppSurf.gxx Executable file
View File

@@ -0,0 +1,970 @@
#include <AppDef_MultiLine.hxx>
#include <AppDef_MultiPointConstraint.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
#include <AppParCurves_MultiCurve.hxx>
#include <AppDef_BSplineCompute.hxx>
#include <AppDef_Compute.hxx>
#include <AppParCurves_Constraint.hxx>
#include <Approx_MCurvesToBSpCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_Array1OfVec2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <math_Vector.hxx>
#include <BSplCLib.hxx>
#include <StdFail_NotDone.hxx>
#include <AppParCurves_HArray1OfConstraintCouple.hxx>
#include <AppDef_TheVariational.hxx>
static Standard_Boolean scal = 1;
#ifdef DEB
extern Standard_Boolean AppBlend_GetContextSplineApprox();
extern Standard_Boolean AppBlend_GetContextApproxWithNoTgt();
#endif
// modified by EAP (Edward AGAPOV) Fri Jan 4 2002, bug OCC9
// --- keep pipe parametrized like path
//=======================================================================
//function : AppBlend_AppSurf
//purpose :
//=======================================================================
AppBlend_AppSurf::AppBlend_AppSurf ():done(Standard_False) {}
//=======================================================================
//function : AppBlend_AppSurf
//purpose :
//=======================================================================
AppBlend_AppSurf::AppBlend_AppSurf (const Standard_Integer Degmin,
const Standard_Integer Degmax,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Integer NbIt,
const Standard_Boolean KnownParameters):
done(Standard_False),dmin(Degmin),dmax(Degmax),
tol3d(Tol3d),tol2d(Tol2d),nbit(NbIt),knownp(KnownParameters)
{
continuity = GeomAbs_C2;
paramtype = Approx_ChordLength;
critweights[0]=0.4;
critweights[1]=0.2;
critweights[2]=0.4;
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void AppBlend_AppSurf::Init (const Standard_Integer Degmin,
const Standard_Integer Degmax,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Integer NbIt,
const Standard_Boolean KnownParameters)
{
done = Standard_False;
dmin = Degmin;
dmax = Degmax;
tol3d = Tol3d;
tol2d = Tol2d;
nbit = NbIt;
knownp = KnownParameters;
continuity = GeomAbs_C2;
paramtype = Approx_ChordLength;
critweights[0]=0.4;
critweights[1]=0.2;
critweights[2]=0.4;
}
//=======================================================================
//function : CriteriumWeight
//purpose : returns the Weights associed to the criterium used in
// the optimization.
//=======================================================================
//
void AppBlend_AppSurf::CriteriumWeight(Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const
{
W1 = critweights[0];
W2 = critweights[1];
W3 = critweights[2] ;
}
//=======================================================================
//function : SetCriteriumWeight
//purpose :
//=======================================================================
void AppBlend_AppSurf::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
if (W1 < 0 || W2 < 0 || W3 < 0 ) Standard_DomainError::Raise();
critweights[0] = W1;
critweights[1] = W2;
critweights[2] = W3;
}
//=======================================================================
//function : SetContinuity
//purpose :
//=======================================================================
void AppBlend_AppSurf::SetContinuity (const GeomAbs_Shape TheCont)
{
continuity = TheCont;
}
//=======================================================================
//function : Continuity
//purpose :
//=======================================================================
GeomAbs_Shape AppBlend_AppSurf::Continuity () const
{
return continuity;
}
//=======================================================================
//function : SetParType
//purpose :
//=======================================================================
void AppBlend_AppSurf::SetParType (const Approx_ParametrizationType ParType)
{
paramtype = ParType;
}
//=======================================================================
//function : ParType
//purpose :
//=======================================================================
Approx_ParametrizationType AppBlend_AppSurf::ParType () const
{
return paramtype;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
TheSectionGenerator& F,
const Standard_Boolean SpApprox)
{
InternalPerform(Lin, F, SpApprox, Standard_False);
}
//=======================================================================
//function : PerformSmoothing
//purpose :
//=======================================================================
void AppBlend_AppSurf::PerformSmoothing(const Handle(TheLine)& Lin,
TheSectionGenerator& F)
{
InternalPerform(Lin, F, Standard_True, Standard_True);
}
//=======================================================================
//function : InternalPerform
//purpose :
//=======================================================================
void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
TheSectionGenerator& F,
const Standard_Boolean SpApprox,
const Standard_Boolean UseSmoothing)
{
done = Standard_False;
if (Lin.IsNull()) {return;}
Standard_Integer i,j,k,NbPoint;
Standard_Integer NbUPoles,NbUKnots,NbPoles2d,NbVPoles;
Standard_Boolean withderiv;
AppParCurves_Constraint Cfirst,Clast;
Standard_Real mytol3d,mytol2d;
gp_XYZ newDv;
seqPoles2d.Clear();
NbPoint=Lin->NbPoints();
AppDef_MultiPointConstraint multP;
AppDef_MultiLine multL(NbPoint);
F.GetShape(NbUPoles,NbUKnots,udeg,NbPoles2d);
tabUKnots = new TColStd_HArray1OfReal (1,NbUKnots);
tabUMults = new TColStd_HArray1OfInteger (1,NbUKnots);
F.Knots(tabUKnots->ChangeArray1());
F.Mults(tabUMults->ChangeArray1());
TColgp_Array1OfPnt tabAppP(1,NbUPoles);
TColgp_Array1OfVec tabAppV(1,NbUPoles);
TColgp_Array1OfPnt2d tabP2d(1,Max(1,NbPoles2d));
TColgp_Array1OfVec2d tabV2d(1,Max(1,NbPoles2d));
TColStd_Array1OfReal tabW(1,NbUPoles),tabDW(1,NbUPoles);
TColgp_Array1OfPnt2d tabAppP2d(1,NbPoles2d+NbUPoles); // points2d + poids
TColgp_Array1OfVec2d tabAppV2d(1,NbPoles2d+NbUPoles);
AppParCurves_MultiBSpCurve multC;
// Standard_Boolean SpApprox = Standard_False;
withderiv = F.Section(Lin->Point(1),tabAppP,tabAppV,tabP2d,tabV2d,
tabW,tabDW);
#if DEB
// SpApprox = AppBlend_GetContextSplineApprox();
if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
#endif
for (j=1; j<=NbPoles2d; j++) {
tabAppP2d(j) = tabP2d(j);
if (withderiv) {
tabAppV2d(j) = tabV2d(j);
}
}
for (j=1; j<=NbUPoles; j++) {
// pour les courbes rationnelles il faut multiplier les poles par
// leurs poids respectifs
if (withderiv) {
tabAppV2d(NbPoles2d+j).SetCoord(tabDW(j),0.);
newDv.SetLinearForm(tabDW(j),tabAppP(j).XYZ(),tabW(j),tabAppV(j).XYZ());
tabAppV(j).SetXYZ(newDv);
}
tabAppP(j).SetXYZ(tabAppP(j).XYZ() * tabW(j));
tabAppP2d(NbPoles2d+j).SetCoord(tabW(j),0.);
}
if (withderiv) {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d,tabAppV,tabAppV2d);
Cfirst = AppParCurves_TangencyPoint;
}
else {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d);
Cfirst = AppParCurves_PassPoint;
}
multL.SetValue(1,multP);
for (i=2; i<=NbPoint-1; i++) {
if (SpApprox) {
F.Section(Lin->Point(i),tabAppP,tabP2d,tabW);
for (j=1; j<=NbPoles2d; j++) {
tabAppP2d(j) = tabP2d(j);
}
for (j=1; j<=NbUPoles; j++) {
// pour les courbes rationnelles il faut multiplier les poles par
// leurs poids respectifs
tabAppP(j).SetXYZ(tabAppP(j).XYZ() * tabW(j));
tabAppP2d(NbPoles2d+j).SetCoord(tabW(j),0.);
}
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d);
multL.SetValue(i,multP);
}
// ***********************
else {
withderiv = F.Section(Lin->Point(i),tabAppP,tabAppV,tabP2d,tabV2d,
tabW,tabDW);
#if DEB
if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
#endif
for (j=1; j<=NbPoles2d; j++) {
tabAppP2d(j) = tabP2d(j);
if (withderiv) {
tabAppV2d(j) = tabV2d(j);
}
}
for (j=1; j<=NbUPoles; j++) {
// pour les courbes rationnelles il faut multiplier les poles par
// leurs poids respectifs
if (withderiv) {
tabAppV2d(NbPoles2d+j).SetCoord(tabDW(j),0.);
newDv.SetLinearForm(tabDW(j),tabAppP(j).XYZ(),tabW(j),tabAppV(j).XYZ());
tabAppV(j).SetXYZ(newDv);
}
tabAppP(j).SetXYZ(tabAppP(j).XYZ() * tabW(j));
tabAppP2d(NbPoles2d+j).SetCoord(tabW(j),0.);
}
if (withderiv) {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d,tabAppV,tabAppV2d);
}
else {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d);
}
multL.SetValue(i,multP);
}
// ******************************
}
withderiv = F.Section(Lin->Point(NbPoint),tabAppP,tabAppV,tabP2d,tabV2d,
tabW,tabDW);
#if DEB
if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
#endif
for (j=1; j<=NbPoles2d; j++) {
tabAppP2d(j) = tabP2d(j);
if (withderiv) {
tabAppV2d(j) = tabV2d(j);
}
}
for (j=1; j<=NbUPoles; j++) {
// pour les courbes rationnelles il faut multiplier les poles par
// leurs poids respectifs
if (withderiv) {
tabAppV2d(NbPoles2d+j).SetCoord(tabDW(j),0.);
newDv.SetLinearForm(tabDW(j),tabAppP(j).XYZ(),tabW(j),tabAppV(j).XYZ());
tabAppV(j).SetXYZ(newDv);
}
tabAppP(j).SetXYZ(tabAppP(j).XYZ() * tabW(j));
tabAppP2d(NbPoles2d+j).SetCoord(tabW(j),0.);
}
if (withderiv) {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d,tabAppV,tabAppV2d);
Clast = AppParCurves_TangencyPoint;
}
else {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d);
Clast = AppParCurves_PassPoint;
}
multL.SetValue(NbPoint,multP);
//IFV 04.06.07 occ13904
if(NbPoint == 2) {
dmin = 1;
if(Cfirst == AppParCurves_PassPoint && Clast == AppParCurves_PassPoint) {
dmax = 1;
}
}
if (!SpApprox) {
AppDef_Compute theapprox (dmin,dmax,tol3d,tol2d,nbit, Standard_True, paramtype);
if (knownp) {
math_Vector theParams(1,NbPoint);
// On recale les parametres entre 0 et 1.
theParams(1) = 0.;
theParams(NbPoint) = 1.;
Standard_Real Uf = F.Parameter(Lin->Point(1));
Standard_Real Ul = F.Parameter(Lin->Point(NbPoint))-Uf;
for (i=2; i<NbPoint; i++) {
theParams(i) = (F.Parameter(Lin->Point(i))-Uf)/Ul;;
}
AppDef_Compute theAppDef(theParams,dmin,dmax,tol3d,tol2d,nbit,
Standard_True, Standard_True);
theapprox = theAppDef;
}
theapprox.SetConstraints(Cfirst,Clast);
theapprox.Perform(multL);
Standard_Real TheTol3d, TheTol2d;
mytol3d = mytol2d = 0.0;
for (Standard_Integer Index=1; Index<=theapprox.NbMultiCurves(); Index++) {
theapprox.Error(Index, TheTol3d, TheTol2d);
mytol3d = Max(TheTol3d, mytol3d);
mytol2d = Max(TheTol2d, mytol2d);
}
#ifdef DEB
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
#endif
multC = theapprox.SplineValue();
}
else {
if(!UseSmoothing) {
Standard_Boolean UseSquares = Standard_False;
if(nbit == 0) UseSquares = Standard_True;
AppDef_BSplineCompute theapprox (dmin,dmax,tol3d,tol2d,nbit,Standard_True, paramtype,
UseSquares);
if(continuity == GeomAbs_C0) {
theapprox.SetContinuity(0);
}
if(continuity == GeomAbs_C1) {
theapprox.SetContinuity(1);
}
else if(continuity == GeomAbs_C2) {
theapprox.SetContinuity(2);
}
else {
theapprox.SetContinuity(3);
}
theapprox.SetConstraints(Cfirst,Clast);
if (knownp) {
math_Vector theParams(1,NbPoint);
// On recale les parametres entre 0 et 1.
theParams(1) = 0.;
theParams(NbPoint) = 1.;
Standard_Real Uf = F.Parameter(Lin->Point(1));
Standard_Real Ul = F.Parameter(Lin->Point(NbPoint))-Uf;
for (i=2; i<NbPoint; i++) {
theParams(i) = (F.Parameter(Lin->Point(i))-Uf)/Ul;;
}
theapprox.Init(dmin,dmax,tol3d,tol2d,nbit,Standard_True,
Approx_IsoParametric,Standard_True);
theapprox.SetParameters(theParams);
}
theapprox.Perform(multL);
theapprox.Error(mytol3d,mytol2d);
#ifdef DEB
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
multC = theapprox.Value();
}
else {
//Variational algo
Handle(AppParCurves_HArray1OfConstraintCouple) TABofCC =
new AppParCurves_HArray1OfConstraintCouple(1, NbPoint);
AppParCurves_Constraint Constraint=AppParCurves_NoConstraint;
for(i = 1; i <= NbPoint; ++i) {
AppParCurves_ConstraintCouple ACC(i,Constraint);
TABofCC->SetValue(i,ACC);
}
TABofCC->ChangeValue(1).SetConstraint(Cfirst);
TABofCC->ChangeValue(NbPoint).SetConstraint(Clast);
AppDef_TheVariational Variation(multL, 1, NbPoint, TABofCC);
//===================================
Standard_Integer theMaxSegments = 1000;
Standard_Boolean theWithMinMax = Standard_False;
Standard_Boolean theWithCutting = Standard_True;
//===================================
Variation.SetMaxDegree(dmax);
Variation.SetContinuity(continuity);
Variation.SetMaxSegment(theMaxSegments);
Variation.SetTolerance(tol3d);
Variation.SetWithMinMax(theWithMinMax);
Variation.SetWithCutting(theWithCutting);
Variation.SetNbIterations(nbit);
Variation.SetCriteriumWeight(critweights[0], critweights[1], critweights[2]);
if(!Variation.IsCreated()) {
return;
}
if(Variation.IsOverConstrained()) {
return;
}
try {
Variation.Approximate();
}
catch (Standard_Failure) {
return;
}
if(!Variation.IsDone()) {
return;
}
mytol3d = Variation.MaxError();
mytol2d = 0.;
#ifdef DEB
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
multC = Variation.Value();
}
}
vdeg = multC.Degree();
NbVPoles = multC.NbPoles();
tabPoles = new TColgp_HArray2OfPnt (1,NbUPoles,1,NbVPoles);
tabWeights = new TColStd_HArray2OfReal (1,NbUPoles,1,NbVPoles);
tabVKnots = new TColStd_HArray1OfReal (multC.Knots().Lower(),
multC.Knots().Upper());
tabVKnots->ChangeArray1() = multC.Knots();
if (knownp && !UseSmoothing) {
BSplCLib::Reparametrize(F.Parameter(Lin->Point(1)),
F.Parameter(Lin->Point(NbPoint)),
tabVKnots->ChangeArray1());
}
tabVMults = new TColStd_HArray1OfInteger (multC.Multiplicities().Lower(),
multC.Multiplicities().Upper());
tabVMults->ChangeArray1() = multC.Multiplicities();
TColgp_Array1OfPnt newtabP(1,NbVPoles);
Handle(TColgp_HArray1OfPnt2d) newtabP2d =
new TColgp_HArray1OfPnt2d(1,NbVPoles);
for (j=1; j <=NbUPoles; j++) {
multC.Curve(j,newtabP);
multC.Curve(j+NbUPoles+NbPoles2d,newtabP2d->ChangeArray1());
for (k=1; k<=NbVPoles; k++) {
// pour les courbes rationnelles il faut maintenant diviser
// les poles par leurs poids respectifs
tabPoles->ChangeValue(j,k).
SetXYZ(newtabP(k).XYZ()/newtabP2d->Value(k).X());
tabWeights->SetValue(j,k,newtabP2d->Value(k).X());
}
}
for (j=1; j<=NbPoles2d; j++) {
newtabP2d = new TColgp_HArray1OfPnt2d(1,NbVPoles);
multC.Curve(NbUPoles+j,newtabP2d->ChangeArray1());
seqPoles2d.Append(newtabP2d);
}
done = Standard_True;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
TheSectionGenerator& F,
const Standard_Integer NbMaxP)
{
done = Standard_False;
if (Lin.IsNull()) {return;}
Standard_Integer i,j,k;
Standard_Integer NbUPoles,NbUKnots,NbPoles2d,NbVPoles;
Standard_Boolean withderiv;
AppParCurves_Constraint Cfirst=AppParCurves_NoConstraint,Clast=AppParCurves_NoConstraint;
Standard_Real mytol3d = 0.0, mytol2d = 0.0;
gp_XYZ newDv;
seqPoles2d.Clear();
Standard_Integer NbPointTot = Lin->NbPoints();
F.GetShape(NbUPoles,NbUKnots,udeg,NbPoles2d);
tabUKnots = new TColStd_HArray1OfReal (1,NbUKnots);
tabUMults = new TColStd_HArray1OfInteger (1,NbUKnots);
F.Knots(tabUKnots->ChangeArray1());
F.Mults(tabUMults->ChangeArray1());
TColgp_Array1OfPnt tabAppP(1,NbUPoles);
TColgp_Array1OfVec tabAppV(1,NbUPoles);
Standard_Real X,Y,Z,DX,DY,DZ;
X = Y = Z = RealLast();
DX = DY = DZ = RealFirst();
TColgp_Array1OfPnt2d tabP2d(1,Max(1,NbPoles2d));
TColgp_Array1OfVec2d tabV2d(1,Max(1,NbPoles2d));
TColStd_Array1OfReal X2d(1,Max(1,NbPoles2d));X2d.Init(RealLast());
TColStd_Array1OfReal Y2d(1,Max(1,NbPoles2d));Y2d.Init(RealLast());
TColStd_Array1OfReal DX2d(1,Max(1,NbPoles2d));DX2d.Init(RealFirst());
TColStd_Array1OfReal DY2d(1,Max(1,NbPoles2d));DY2d.Init(RealFirst());
TColStd_Array1OfReal tabW(1,NbUPoles),tabDW(1,NbUPoles);
TColgp_Array1OfPnt2d tabAppP2d(1,NbPoles2d+NbUPoles); // points2d + poids
TColgp_Array1OfVec2d tabAppV2d(1,NbPoles2d+NbUPoles);
// On calcule les boites de chaque ligne (box for all lines)
for(i = 1; i <= NbPointTot; i++){
F.Section(Lin->Point(i),tabAppP,tabAppV,tabP2d,tabV2d,tabW,tabDW);
Standard_Real x,y,z;
for(j = 1; j <= NbUPoles; j++){
tabAppP(j).Coord(x,y,z);
if(x < X) X = x; if(x > DX) DX = x;
if(y < Y) Y = y; if(y > DY) DY = y;
if(z < Z) Z = z; if(z > DZ) DZ = z;
}
for(j = 1; j <= NbPoles2d; j++){
tabP2d(j).Coord(x,y);
if(x < X2d(j)) X2d(j) = x; if(x > DX2d(j)) DX2d(j) = x;
if(y < Y2d(j)) Y2d(j) = y; if(y > DY2d(j)) DY2d(j) = y;
}
}
// On calcule pour chaque ligne la transformation vers 0 1.
Standard_Real seuil = 1000.*tol3d;
Standard_Real seuil2d = 1000.*tol2d;
if((DX - X) < seuil ){ DX = 1.; X = 0.; }
else{ DX = 1./(DX - X); X *= -DX; }
if((DY - Y) < seuil){ DY = 1.; Y = 0.; }
else{ DY = 1./(DY - Y); Y *= -DY; }
if((DZ - Z) < seuil){ DZ = 1.; Z = 0.; }
else{ DZ = 1./(DZ - Z); Z *= -DZ; }
for(j = 1; j <= NbPoles2d; j++){
if((DX2d(j) - X2d(j)) < seuil2d){ DX2d(j) = 1.; X2d(j) = 0.; }
else{ DX2d(j) = 1./(DX2d(j) - X2d(j)); X2d(j) *= -DX2d(j); }
if((DY2d(j) - Y2d(j)) < seuil2d){ DY2d(j) = 1.; Y2d(j) = 0.; }
else{ DY2d(j) = 1./(DY2d(j) - Y2d(j)); Y2d(j) *= -DY2d(j); }
}
if(!scal){
DX = 1.; X = 0.;
DY = 1.; Y = 0.;
DZ = 1.; Z = 0.;
for(j = 1; j <= NbPoles2d; j++){
DX2d(j) = 1.; X2d(j) = 0.;
DY2d(j) = 1.; Y2d(j) = 0.;
}
}
// modified by eap Thu Jan 3 14:45:22 2002 ___BEGIN___
// Keep "inter-troncons" parameters, not only first and last
// Standard_Real Ufirst=0,Ulast=0;
TColStd_SequenceOfReal aParamSeq;
if (knownp) {
// Ufirst = F.Parameter(Lin->Point(1));
// Ulast = F.Parameter(Lin->Point(NbPointTot));
aParamSeq.Append( F.Parameter (Lin->Point(1)) );
}
// modified by EAP Thu Jan 3 14:45:41 2002 ___END___
Approx_MCurvesToBSpCurve concat;
//On calcule le nombre de troncons.
Standard_Integer nbtronc = NbPointTot/NbMaxP;
Standard_Integer reste = NbPointTot - (nbtronc * NbMaxP);
// On regarde si il faut prendre un troncon de plus.
Standard_Integer nmax = NbMaxP;
if(nbtronc > 0 && reste > 0){
nmax = NbPointTot/(nbtronc + 1);
if(nmax > (2*NbMaxP)/3) {
nbtronc++;
reste = NbPointTot - (nbtronc * nmax);
}
else nmax = NbMaxP;
}
else if(nbtronc == 0){
nbtronc = 1;
nmax = reste;
reste = 0;
}
// Approximate each "troncon" with nb of Bezier's using AppDef_Compute
// and concat them into BSpline with Approx_MCurvesToBSpCurve
TColStd_Array1OfInteger troncsize(1,nbtronc);
TColStd_Array1OfInteger troncstart(1,nbtronc);
Standard_Integer rab = reste/nbtronc + 1;
Standard_Integer start = 1;
Standard_Integer itronc ;
for( itronc = 1; itronc <= nbtronc; itronc++){
troncstart(itronc) = start;
Standard_Integer rabrab = Min(rab,reste);
if(reste > 0){ reste -= rabrab; }
troncsize(itronc) = nmax + rabrab + 1;
start += (nmax + rabrab);
}
troncsize(nbtronc) = troncsize(nbtronc) - 1;
for(itronc = 1; itronc <= nbtronc; itronc++){
Standard_Integer NbPoint = troncsize(itronc);
Standard_Integer StPoint = troncstart(itronc);
AppDef_MultiPointConstraint multP;
AppDef_MultiLine multL(NbPoint);
for (i=1; i<=NbPoint; i++) {
Standard_Integer iLin = StPoint + i - 1;
Standard_Real x,y,z;
withderiv = F.Section(Lin->Point(iLin),tabAppP,tabAppV,tabP2d,tabV2d,
tabW,tabDW);
#if DEB
if(AppBlend_GetContextApproxWithNoTgt()) withderiv = Standard_False;
#endif
for (j=1; j<=NbPoles2d; j++) {
tabP2d(j).Coord(x,y);
tabAppP2d(j).SetCoord(DX2d(j)*x+X2d(j),DY2d(j)*y+Y2d(j));
if (withderiv) {
tabV2d(j).Coord(x,y);
tabAppV2d(j).SetCoord(DX2d(j)*x,DY2d(j)*y);
}
}
for (j=1; j<=NbUPoles; j++) {
// pour les courbes rationnelles il faut multiplier les poles par
// leurs poids respectifs
if (withderiv) {
tabAppV2d(NbPoles2d+j).SetCoord(tabDW(j),0.);
newDv.SetLinearForm(tabDW(j),tabAppP(j).XYZ(),tabW(j),tabAppV(j).XYZ());
tabAppV(j).SetCoord(DX*newDv.X(),DY*newDv.Y(),DZ*newDv.Z());
}
tabAppP(j).SetXYZ(tabAppP(j).XYZ() * tabW(j));
tabAppP2d(NbPoles2d+j).SetCoord(tabW(j),0.);
tabAppP(j).Coord(x,y,z);
tabAppP(j).SetCoord(DX*x+X,DY*y+Y,DZ*z+Z);
}
if (withderiv) {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d,tabAppV,tabAppV2d);
if(i == 1) Cfirst = AppParCurves_TangencyPoint;
else if(i == NbPoint) Clast = AppParCurves_TangencyPoint;
}
else {
multP = AppDef_MultiPointConstraint(tabAppP,tabAppP2d);
if(i == 1) Cfirst = AppParCurves_PassPoint;
else if(i == NbPoint) Clast = AppParCurves_PassPoint;
}
multL.SetValue(i,multP);
}
//IFV 04.06.07 occ13904
if(NbPoint == 2) {
dmin = 1;
if(Cfirst == AppParCurves_PassPoint && Clast == AppParCurves_PassPoint) {
dmax = 1;
}
}
// modified by EAP Thu Jan 3 15:44:13 2002 ___BEGIN___
Standard_Real Ufloc=0., Ulloc=0.;
AppDef_Compute theapprox (dmin,dmax,tol3d,tol2d,nbit);
if (knownp) {
math_Vector theParams(1,NbPoint);
// On recale les parametres entre 0 et 1.
/*Standard_Real*/ Ufloc = F.Parameter(Lin->Point(StPoint));
/*Standard_Real*/ Ulloc = F.Parameter(Lin->Point(StPoint+NbPoint-1));
// modified by EAP Thu Jan 3 15:45:17 2002 ___END___
for (i=1; i <= NbPoint; i++) {
Standard_Integer iLin = StPoint + i - 1;
theParams(i) = (F.Parameter(Lin->Point(iLin))-Ufloc)/(Ulloc - Ufloc);
}
AppDef_Compute theAppDef1(theParams,dmin,dmax,tol3d,tol2d,nbit, Standard_True,Standard_True);
theapprox = theAppDef1;
}
theapprox.SetConstraints(Cfirst,Clast);
theapprox.Perform(multL);
// modified by EAP Thu Jan 3 16:00:43 2002 ___BEGIN___
// To know internal parameters if multicurve is approximated by several Bezier's
TColStd_SequenceOfReal aPoleDistSeq;
Standard_Real aWholeDist=0;
// modified by EAP Thu Jan 3 16:45:48 2002 ___END___
Standard_Real TheTol3d, TheTol2d;
for (Standard_Integer Index=1; Index<=theapprox.NbMultiCurves(); Index++) {
AppParCurves_MultiCurve& mucu = theapprox.ChangeValue(Index);
theapprox.Error(Index, TheTol3d, TheTol2d);
mytol3d = Max(TheTol3d/DX, mytol3d);
mytol3d = Max(TheTol3d/DY, mytol3d);
mytol3d = Max(TheTol3d/DZ, mytol3d);
for(j = 1; j <= NbUPoles; j++){
mucu.Transform(j,
-X/DX,1./DX,
-Y/DY,1./DY,
-Z/DZ,1./DZ);
}
for(j = 1; j <= NbPoles2d; j++){
mucu.Transform2d(j + NbUPoles,
-X2d(j)/DX2d(j),1./DX2d(j),
-Y2d(j)/DY2d(j),1./DY2d(j));
mytol2d = Max(TheTol2d/DX2d(j), mytol2d);
mytol2d = Max(TheTol2d/DY2d(j), mytol2d);
}
concat.Append(mucu);
// modified by EAP Thu Jan 3 15:45:23 2002 ___BEGIN___
if (knownp && theapprox.NbMultiCurves() > 1)
{
gp_Pnt aFirstPole = mucu.Pole(Index, 1);
gp_Pnt aLastPole = mucu.Pole(Index, mucu.NbPoles());
aPoleDistSeq.Append (aFirstPole.Distance(aLastPole));
aWholeDist += aPoleDistSeq.Last();
}
}
if (knownp)
{
Standard_Integer iDist;
Standard_Real iU = Ufloc;
for (iDist=1; iDist<aPoleDistSeq.Length(); iDist++)
{
iU += aPoleDistSeq(iDist) / aWholeDist * (Ulloc - Ufloc);
//cout << "Internal: " << iU << endl;
aParamSeq.Append(iU);
}
aParamSeq.Append(Ulloc);
}
// modified by EAP Thu Jan 3 15:45:27 2002 ___END___
}
#ifdef DEB
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
concat.Perform();
const AppParCurves_MultiBSpCurve& multC = concat.Value();
vdeg = multC.Degree();
NbVPoles = multC.NbPoles();
tabPoles = new TColgp_HArray2OfPnt (1,NbUPoles,1,NbVPoles);
tabWeights = new TColStd_HArray2OfReal (1,NbUPoles,1,NbVPoles);
tabVKnots = new TColStd_HArray1OfReal (multC.Knots().Lower(),
multC.Knots().Upper());
tabVKnots->ChangeArray1() = multC.Knots();
if (knownp) {
// modified by EAP Fri Jan 4 12:07:30 2002 ___BEGIN___
if (aParamSeq.Length() != tabVKnots->Length())
{
BSplCLib::Reparametrize(F.Parameter(Lin->Point(1)),
F.Parameter(Lin->Point(Lin->NbPoints())),
tabVKnots->ChangeArray1()
);
#ifdef DEB
cout << "Warning: AppBlend_AppSurf::Perform(), bad length of aParamSeq: " <<
aParamSeq.Length() << " instead of " << tabVKnots->Length() << endl;
#endif
}
else
{
Standard_Integer iKnot, iTabKnot = tabVKnots->Lower();
for (iKnot=1; iKnot<=aParamSeq.Length(); iKnot++, iTabKnot++)
{
//cout << "Replace " << tabVKnots->Value(iTabKnot) << " with " << aParamSeq(iKnot) << endl;
tabVKnots->SetValue(iTabKnot, aParamSeq(iKnot));
}
}
// modified by EAP Fri Jan 4 12:07:35 2002 ___END___
}
tabVMults = new TColStd_HArray1OfInteger (multC.Multiplicities().Lower(),
multC.Multiplicities().Upper());
tabVMults->ChangeArray1() = multC.Multiplicities();
TColgp_Array1OfPnt newtabP(1,NbVPoles);
Handle(TColgp_HArray1OfPnt2d) newtabP2d =
new TColgp_HArray1OfPnt2d(1,NbVPoles);
for (j=1; j <=NbUPoles; j++) {
multC.Curve(j,newtabP);
multC.Curve(j+NbUPoles+NbPoles2d,newtabP2d->ChangeArray1());
for (k=1; k<=NbVPoles; k++) {
// pour les courbes rationnelles il faut maintenant diviser
// les poles par leurs poids respectifs
tabPoles->ChangeValue(j,k).
SetXYZ(newtabP(k).XYZ()/newtabP2d->Value(k).X());
tabWeights->SetValue(j,k,newtabP2d->Value(k).X());
}
}
for (j=1; j<=NbPoles2d; j++) {
newtabP2d = new TColgp_HArray1OfPnt2d(1,NbVPoles);
multC.Curve(NbUPoles+j,newtabP2d->ChangeArray1());
seqPoles2d.Append(newtabP2d);
}
done = Standard_True;
}
//=======================================================================
//function : SurfShape
//purpose :
//=======================================================================
void AppBlend_AppSurf::SurfShape (Standard_Integer& UDegree,
Standard_Integer& VDegree,
Standard_Integer& NbUPoles,
Standard_Integer& NbVPoles,
Standard_Integer& NbUKnots,
Standard_Integer& NbVKnots) const
{
if (!done) {StdFail_NotDone::Raise();}
UDegree = udeg;
VDegree = vdeg;
NbUPoles = tabPoles->ColLength();
NbVPoles = tabPoles->RowLength();
NbUKnots = tabUKnots->Length();
NbVKnots = tabVKnots->Length();
}
void AppBlend_AppSurf::Surface(TColgp_Array2OfPnt& TPoles,
TColStd_Array2OfReal& TWeights,
TColStd_Array1OfReal& TUKnots,
TColStd_Array1OfReal& TVKnots,
TColStd_Array1OfInteger& TUMults,
TColStd_Array1OfInteger& TVMults) const
{
if (!done) {StdFail_NotDone::Raise();}
TPoles = tabPoles->Array2();
TWeights = tabWeights->Array2();
TUKnots = tabUKnots->Array1();
TUMults = tabUMults->Array1();
TVKnots = tabVKnots->Array1();
TVMults = tabVMults->Array1();
}
//=======================================================================
//function : Curves2dShape
//purpose :
//=======================================================================
void AppBlend_AppSurf::Curves2dShape(Standard_Integer& Degree,
Standard_Integer& NbPoles,
Standard_Integer& NbKnots) const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
Degree = vdeg;
NbPoles = tabPoles->ColLength();
NbKnots = tabVKnots->Length();
}
//=======================================================================
//function : Curve2d
//purpose :
//=======================================================================
void AppBlend_AppSurf::Curve2d(const Standard_Integer Index,
TColgp_Array1OfPnt2d& TPoles,
TColStd_Array1OfReal& TKnots,
TColStd_Array1OfInteger& TMults) const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
TPoles = seqPoles2d(Index)->Array1();
TKnots = tabVKnots->Array1();
TMults = tabVMults->Array1();
}
//=======================================================================
//function : TolCurveOnSurf
//purpose :
//=======================================================================
Standard_Real AppBlend_AppSurf::TolCurveOnSurf(const Standard_Integer) const
{
return tol3dreached; //On ne s'embete pas !!
}

106
src/AppBlend/AppBlend_AppSurf.lxx Executable file
View File

@@ -0,0 +1,106 @@
#include <StdFail_NotDone.hxx>
#include <TColgp_HArray2OfPnt.hxx>
#include <TColgp_HArray1OfPnt2d.hxx>
#include <TColStd_HArray2OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
inline Standard_Boolean AppBlend_AppSurf::IsDone() const
{
return done;
}
inline Standard_Integer AppBlend_AppSurf::UDegree() const
{
if (!done) {StdFail_NotDone::Raise();}
return udeg;
}
inline Standard_Integer AppBlend_AppSurf::VDegree() const
{
if (!done) {StdFail_NotDone::Raise();}
return vdeg;
}
inline const TColgp_Array2OfPnt& AppBlend_AppSurf::SurfPoles() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabPoles->Array2();
}
inline const TColStd_Array2OfReal& AppBlend_AppSurf::SurfWeights() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabWeights->Array2();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::SurfUKnots() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabUKnots->Array1();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::SurfVKnots() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::SurfUMults() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabUMults->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::SurfVMults() const
{
if (!done) {StdFail_NotDone::Raise();}
return tabVMults->Array1();
}
inline Standard_Integer AppBlend_AppSurf::NbCurves2d () const
{
if (!done) {StdFail_NotDone::Raise();}
return seqPoles2d.Length();
}
inline Standard_Integer AppBlend_AppSurf::Curves2dDegree() const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
return vdeg;
}
inline const TColgp_Array1OfPnt2d& AppBlend_AppSurf::
Curve2dPoles(const Standard_Integer Index) const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
return seqPoles2d(Index)->Array1();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::Curves2dKnots () const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::Curves2dMults () const
{
if (!done) {StdFail_NotDone::Raise();}
if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
return tabVMults->Array1();
}
inline void AppBlend_AppSurf::TolReached (Standard_Real& Tol3d,
Standard_Real& Tol2d) const
{
if (!done) {StdFail_NotDone::Raise();}
Tol3d = tol3dreached;
Tol2d = tol2dreached;
}

200
src/AppBlend/AppBlend_Approx.cdl Executable file
View File

@@ -0,0 +1,200 @@
-- File: AppBlend_Approx.cdl
-- Created: Tue Aug 27 16:29:23 1996
-- Author: Philippe MANGIN
-- <pmn@sgi29>
---Copyright: Matra Datavision 1996
deferred class Approx from AppBlend
---Purpose: Bspline approximation of a surface.
uses Array2OfPnt from TColgp,
HArray2OfPnt from TColgp,
Array2OfReal from TColStd,
HArray2OfReal from TColStd,
Array1OfReal from TColStd,
HArray1OfReal from TColStd,
Array1OfInteger from TColStd,
HArray1OfInteger from TColStd,
Array1OfPnt2d from TColgp
raises NotDone from StdFail,
DomainError from Standard,
OutOfRange from Standard
is
Delete(me:out) is virtual;
---C++: alias "Standard_EXPORT virtual ~AppBlend_Approx(){Delete() ; }"
IsDone(me)
returns Boolean from Standard
is deferred;
SurfShape(me; UDegree,VDegree : out Integer from Standard;
NbUPoles,NbVPoles: out Integer from Standard;
NbUKnots,NbVKnots: out Integer from Standard)
raises NotDone from StdFail
is deferred;
Surface(me; TPoles : out Array2OfPnt from TColgp;
TWeights : out Array2OfReal from TColStd;
TUKnots,TVKnots : out Array1OfReal from TColStd;
TUMults,TVMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail
is deferred;
UDegree(me)
returns Integer from Standard
raises NotDone from StdFail
is deferred;
VDegree(me)
returns Integer from Standard
raises NotDone from StdFail
is deferred;
SurfPoles(me)
returns Array2OfPnt from TColgp
---C++: return const&
raises NotDone from StdFail
is deferred;
SurfWeights(me)
returns Array2OfReal from TColStd
---C++: return const&
raises NotDone from StdFail
is deferred;
SurfUKnots(me)
returns Array1OfReal from TColStd
---C++: return const&
raises NotDone from StdFail
is deferred;
SurfVKnots(me)
returns Array1OfReal from TColStd
---C++: return const&
raises NotDone from StdFail
is deferred;
SurfUMults(me)
returns Array1OfInteger from TColStd
---C++: return const&
raises NotDone from StdFail
is deferred;
SurfVMults(me)
returns Array1OfInteger from TColStd
---C++: return const&
raises NotDone from StdFail
is deferred;
NbCurves2d(me)
returns Integer from Standard
raises NotDone from StdFail
is deferred;
Curves2dShape(me; Degree,NbPoles,NbKnots: out Integer from Standard)
raises NotDone from StdFail,
DomainError from Standard
is deferred;
Curve2d(me; Index: Integer from Standard;
TPoles : out Array1OfPnt2d from TColgp;
TKnots : out Array1OfReal from TColStd;
TMults : out Array1OfInteger from TColStd)
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is deferred;
Curves2dDegree(me)
returns Integer from Standard
raises NotDone from StdFail,
DomainError from Standard
is deferred;
Curve2dPoles(me; Index: Integer from Standard)
returns Array1OfPnt2d from TColgp
---C++: return const&
raises NotDone from StdFail,
OutOfRange from Standard,
DomainError from Standard
is deferred;
Curves2dKnots(me)
returns Array1OfReal from TColStd
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is deferred;
Curves2dMults(me)
returns Array1OfInteger from TColStd
---C++: return const&
raises NotDone from StdFail,
DomainError from Standard
is deferred;
TolReached(me; Tol3d, Tol2d : out Real from Standard)
raises NotDone from StdFail
is deferred;
TolCurveOnSurf(me; Index : Integer from Standard)
returns Real from Standard
raises NotDone from StdFail
is deferred;
end Approx;

View File

@@ -0,0 +1,10 @@
// File: AppBlend_Approx.cxx
// Created: Wed Aug 28 09:08:43 1996
// Author: Philippe MANGIN
// <pmn@sgi29>
#include <AppBlend_Approx.ixx>
void AppBlend_Approx::Delete()
{}

35
src/AppBlend/AppBlend_Debug.cxx Executable file
View File

@@ -0,0 +1,35 @@
// File: AppBlend_Debug.cxx
// Created: Tue Oct 18 16:11:21 1994
// Author: Laurent BOURESCHE
// <lbo@phylox>
#include <Standard_Boolean.hxx>
#ifndef __AppBlend_API
# if defined(WNT) && !defined(HAVE_NO_DLL)
# ifdef __AppBlend_DLL
# define __AppBlend_API __declspec( dllexport )
# else
# define __AppBlend_API __declspec( dllimport )
# endif /*__AppBlend_DLL*/
# else
# define __AppBlend_API
# endif /*WNT*/
#endif /*__AppBlend_API*/
//****************************************************
// Fonctions permettant de changer le type des approx.
//****************************************************
static Standard_Boolean AppBlend_ContextSplineApprox = Standard_False;
__AppBlend_API extern void AppBlend_SetContextSplineApprox(const Standard_Boolean b)
{ AppBlend_ContextSplineApprox = b; }
__AppBlend_API extern Standard_Boolean AppBlend_GetContextSplineApprox()
{ return AppBlend_ContextSplineApprox; }
static Standard_Boolean AppBlend_ContextApproxWithNoTgt = Standard_False;
__AppBlend_API extern void AppBlend_SetContextApproxWithNoTgt(const Standard_Boolean b)
{ AppBlend_ContextApproxWithNoTgt = b; }
__AppBlend_API extern Standard_Boolean AppBlend_GetContextApproxWithNoTgt()
{ return AppBlend_ContextApproxWithNoTgt; }

33
src/AppBlend/AppBlend_Line.cdl Executable file
View File

@@ -0,0 +1,33 @@
-- File: AppBlend_Line.cdl
-- Created: Thu Dec 16 10:20:42 1993
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1993
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;

0
src/AppBlend/AppBlend_Line.gxx Executable file
View File

0
src/AppBlend/AppBlend_Line.lxx Executable file
View File

View File

@@ -0,0 +1,67 @@
-- File: AppBlend_SectionGenerator.cdl
-- Created: Thu Dec 16 10:35:55 1993
-- Author: Jacques GOUSSARD
-- <jag@topsn2>
---Copyright: Matra Datavision 1993
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;

View File

1
src/AppBlend/FILES Executable file
View File

@@ -0,0 +1 @@
AppBlend_Debug.cxx