1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0022550: Fixing data races

This commit is contained in:
KGV 2012-01-27 14:12:59 +00:00 committed by bugmaster
parent 46921bd5c8
commit 41194117bf
62 changed files with 1170 additions and 1274 deletions

View File

@ -49,25 +49,7 @@ class ApproxAFunc2Var from AdvApp2Var
-- and Num3DSS must be equal to 1. -- and Num3DSS must be equal to 1.
-- Warning: -- Warning:
-- the Function of type EvaluatorFunc2Var from Approx -- the Function of type EvaluatorFunc2Var from Approx
-- must be an extern "C" function -- must be a subclass of AdvApp2Var_EvaluatorFunc2Var
--
-- The evaluator Function has the following type :
-- typedef void (* AdvApp2Var_EvaluatorFunc2Var)
-- (Standard_Integer *, // Total Dimension
-- Standard_Real *, // StartEndInU[2]
-- Standard_Real *, // StartEndInV[2]
-- Standard_Integer *, // 1 for U = cte
-- // 2 for V = cte
-- Standard_Real *, // Value of cte
-- Standard_Integer *, // Number N of parameters
-- Standard_Real *, // Tab[N] of parameters at
-- // which evaluation
-- // should take place
-- Standard_Integer *, // U-Derivative Request
-- Standard_Integer *, // V-Derivative Request
-- Standard_Real *, // Result[Dimension,N]
-- Standard_Integer * // Error Code
-- ) ;
-- --
-- the result should be formatted in the following way : -- the result should be formatted in the following way :
-- <--Num1DSS--> <--2 * Num2DSS--> <--3 * Num3DSS--> -- <--Num1DSS--> <--2 * Num2DSS--> <--3 * Num3DSS-->
@ -379,8 +361,6 @@ fields
myMaxPatches : Integer ; myMaxPatches : Integer ;
-- maximum of patches allowed -- maximum of patches allowed
-- --
myEvaluator : EvaluatorFunc2Var from AdvApp2Var ;
-- external function
-- --
myConditions : Context from AdvApp2Var; myConditions : Context from AdvApp2Var;
myResult : Network from AdvApp2Var; myResult : Network from AdvApp2Var;

View File

@ -78,7 +78,6 @@ myPrecisionCode(PrecisCode),
myMaxDegInU(MaxDegInU), myMaxDegInU(MaxDegInU),
myMaxDegInV(MaxDegInV), myMaxDegInV(MaxDegInV),
myMaxPatches(MaxPatch), myMaxPatches(MaxPatch),
myEvaluator(Func),
myDone(Standard_False), myDone(Standard_False),
myHasResult(Standard_False) myHasResult(Standard_False)
{ {
@ -86,7 +85,7 @@ myHasResult(Standard_False)
myNumSubSpaces[1] = Num2DSS; myNumSubSpaces[1] = Num2DSS;
myNumSubSpaces[2] = Num3DSS; myNumSubSpaces[2] = Num3DSS;
Init(); Init();
Perform(UChoice,VChoice,Func); Perform(UChoice, VChoice, Func);
ConvertBS(); ConvertBS();
} }
@ -137,7 +136,6 @@ myPrecisionCode(PrecisCode),
myMaxDegInU(MaxDegInU), myMaxDegInU(MaxDegInU),
myMaxDegInV(MaxDegInV), myMaxDegInV(MaxDegInV),
myMaxPatches(MaxPatch), myMaxPatches(MaxPatch),
myEvaluator(Func),
myDone(Standard_False), myDone(Standard_False),
myHasResult(Standard_False) myHasResult(Standard_False)
{ {
@ -145,7 +143,7 @@ myHasResult(Standard_False)
myNumSubSpaces[1] = Num2DSS; myNumSubSpaces[1] = Num2DSS;
myNumSubSpaces[2] = Num3DSS; myNumSubSpaces[2] = Num3DSS;
Init(); Init();
Perform(UChoice,VChoice,Func,Crit); Perform(UChoice, VChoice, Func, Crit);
ConvertBS(); ConvertBS();
} }

View File

@ -130,19 +130,7 @@ static
int mma2ds2_(integer *ndimen, int mma2ds2_(integer *ndimen,
doublereal *uintfn, doublereal *uintfn,
doublereal *vintfn, doublereal *vintfn,
void (*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *nbpntu, integer *nbpntu,
integer *nbpntv, integer *nbpntv,
doublereal *urootb, doublereal *urootb,
@ -162,19 +150,7 @@ int mma2ds2_(integer *ndimen,
static static
int mma1fdi_(integer *ndimen, int mma1fdi_(integer *ndimen,
doublereal *uvfonc, doublereal *uvfonc,
void (*foncnp) (// see AdvApp2Var_EvaluatorFunc2Var.hxx for details const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *isofav, integer *isofav,
doublereal *tconst, doublereal *tconst,
integer *nbroot, integer *nbroot,
@ -293,7 +269,7 @@ int mma1cdi_(integer *ndimen,
somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
fpntab_dim1, fpntab_offset, hermit_dim1, hermit_offset, i__1, fpntab_dim1, fpntab_offset, hermit_dim1, hermit_offset, i__1,
i__2, i__3; i__2, i__3;
/* Local variables */ /* Local variables */
static integer nroo2, ncfhe, nd, ii, kk; static integer nroo2, ncfhe, nd, ii, kk;
static integer ibb, kkm, kkp; static integer ibb, kkm, kkp;
@ -512,12 +488,12 @@ int mma1cnt_(integer *ndimen,
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset, integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
hermit_dim1, hermit_offset, crvjac_dim1, crvjac_offset, i__1, hermit_dim1, hermit_offset, crvjac_dim1, crvjac_offset, i__1,
i__2, i__3; i__2, i__3;
/* Local variables */ /* Local variables */
static integer nd, ii, jj, ibb; static integer nd, ii, jj, ibb;
static doublereal bid; static doublereal bid;
/* *********************************************************************** /* ***********************************************************************
*/ */
@ -631,19 +607,7 @@ int mma1cnt_(integer *ndimen,
//======================================================================= //=======================================================================
int mma1fdi_(integer *ndimen, int mma1fdi_(integer *ndimen,
doublereal *uvfonc, doublereal *uvfonc,
void (*foncnp) (// see AdvApp2Var_EvaluatorFunc2Var.hxx for details const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *isofav, integer *isofav,
doublereal *tconst, doublereal *tconst,
integer *nbroot, integer *nbroot,
@ -662,13 +626,13 @@ int mma1fdi_(integer *ndimen,
diftab_offset, contr1_dim1, contr1_offset, contr2_dim1, diftab_offset, contr1_dim1, contr1_offset, contr2_dim1,
contr2_offset, i__1, i__2; contr2_offset, i__1, i__2;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static integer ideb, ifin, nroo2, ideru, iderv; static integer ideb, ifin, nroo2, ideru, iderv;
static doublereal renor; static doublereal renor;
static integer ii, nd, ibb, iim, nbp, iip; static integer ii, nd, ibb, iim, nbp, iip;
static doublereal bid1, bid2; static doublereal bid1, bid2;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -819,7 +783,7 @@ int mma1fdi_(integer *ndimen,
/* ---------------------- Legendre polynom of degree NBROOT ------------------- /* ---------------------- Legendre polynom of degree NBROOT -------------------
*/ */
(*foncnp)(ndimen, foncnp.Evaluate (ndimen,
&uvfonc[3], &uvfonc[3],
&uvfonc[5], &uvfonc[5],
isofav, isofav,
@ -891,8 +855,8 @@ int mma1fdi_(integer *ndimen,
bid1 = (uvfonc[6] - uvfonc[5]) / 2.; bid1 = (uvfonc[6] - uvfonc[5]) / 2.;
i__1 = *iordre; i__1 = *iordre;
for (iderv = 1; iderv <= i__1; ++iderv) { for (iderv = 1; iderv <= i__1; ++iderv) {
(*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, & foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
nbp, ttable, &ideru, &iderv, &contr1[(iderv + 1) * &nbp, ttable, &ideru, &iderv, &contr1[(iderv + 1) *
contr1_dim1 + 1], iercod); contr1_dim1 + 1], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
@ -901,8 +865,8 @@ int mma1fdi_(integer *ndimen,
} }
i__1 = *iordre; i__1 = *iordre;
for (iderv = 1; iderv <= i__1; ++iderv) { for (iderv = 1; iderv <= i__1; ++iderv) {
(*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, & foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[( &nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
iderv + 1) * contr2_dim1 + 1], iercod); iderv + 1) * contr2_dim1 + 1], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
@ -915,8 +879,8 @@ int mma1fdi_(integer *ndimen,
bid1 = (uvfonc[4] - uvfonc[3]) / 2.; bid1 = (uvfonc[4] - uvfonc[3]) / 2.;
i__1 = *iordre; i__1 = *iordre;
for (ideru = 1; ideru <= i__1; ++ideru) { for (ideru = 1; ideru <= i__1; ++ideru) {
(*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, & foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
nbp, ttable, &ideru, &iderv, &contr1[(ideru + 1) * &nbp, ttable, &ideru, &iderv, &contr1[(ideru + 1) *
contr1_dim1 + 1], iercod); contr1_dim1 + 1], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
@ -925,8 +889,8 @@ int mma1fdi_(integer *ndimen,
} }
i__1 = *iordre; i__1 = *iordre;
for (ideru = 1; ideru <= i__1; ++ideru) { for (ideru = 1; ideru <= i__1; ++ideru) {
(*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, & foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[( &nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
ideru + 1) * contr2_dim1 + 1], iercod); ideru + 1) * contr2_dim1 + 1], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
@ -986,12 +950,12 @@ int mma1fer_(integer *,//ndimen,
{ {
/* System generated locals */ /* System generated locals */
integer crvjac_dim1, crvjac_offset, i__1, i__2; integer crvjac_dim1, crvjac_offset, i__1, i__2;
/* Local variables */ /* Local variables */
static integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier; static integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
static integer nbr0; static integer nbr0;
/* *********************************************************************** /* ***********************************************************************
*/ */
@ -1101,7 +1065,7 @@ int mma1fer_(integer *,//ndimen,
if (ncfnw <= *ncflim) { if (ncfnw <= *ncflim) {
mmaperm_(&ncfja, &ndses, &ncfja, iordre, &crvjac[idim * mmaperm_(&ncfja, &ndses, &ncfja, iordre, &crvjac[idim *
crvjac_dim1], &ncfnw, &errmoy[ii]); crvjac_dim1], &ncfnw, &errmoy[ii]);
*ncoeff = max(ncfnw,*ncoeff); *ncoeff = advapp_max(ncfnw,*ncoeff);
/* ------------- Set the declined coefficients to 0.D0 ----------- /* ------------- Set the declined coefficients to 0.D0 -----------
-------- */ -------- */
@ -1180,10 +1144,10 @@ int AdvApp2Var_ApproxF2var::mma1her_(const integer *iordre,
{ {
/* System generated locals */ /* System generated locals */
integer hermit_dim1, hermit_offset; integer hermit_dim1, hermit_offset;
/* Local variables */ /* Local variables */
static integer ibb; static integer ibb;
/* ********************************************************************** /* **********************************************************************
@ -1348,7 +1312,7 @@ int mma1jak_(integer *ndimen,
/* System generated locals */ /* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset, cgauss_dim1; crvjac_dim1, crvjac_offset, cgauss_dim1;
/* Local variables */ /* Local variables */
static integer ibb; static integer ibb;
@ -1463,8 +1427,7 @@ int mma1noc_(doublereal *dfuvin,
/* System generated locals */ /* System generated locals */
integer i__1; integer i__1;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static doublereal rider, riord; static doublereal rider, riord;
static integer nd, ibb; static integer nd, ibb;
@ -1597,12 +1560,10 @@ int mma1nop_(integer *nbroot,
{ {
/* System generated locals */ /* System generated locals */
integer i__1; integer i__1;
/* Local variables */ /* Local variables */
static doublereal alinu, blinu, alinv, blinv; static doublereal alinu, blinu, alinv, blinv;
static integer ii, ibb; static integer ii, ibb;
/* *********************************************************************** /* ***********************************************************************
*/ */
@ -1718,15 +1679,13 @@ int AdvApp2Var_ApproxF2var::mma2ac1_(integer const *ndimen,
contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1, contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1,
uhermt_offset, vhermt_dim1, vhermt_offset, patjac_dim1, uhermt_offset, vhermt_dim1, vhermt_offset, patjac_dim1,
patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5; patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer ndgu, ndgv; static integer ndgu, ndgv;
static doublereal bidu1, bidu2, bidv1, bidv2; static doublereal bidu1, bidu2, bidv1, bidv2;
static integer ioru1, iorv1, ii, nd, jj, ku, kv; static integer ioru1, iorv1, ii, nd, jj, ku, kv;
static doublereal cnt1, cnt2, cnt3, cnt4; static doublereal cnt1, cnt2, cnt3, cnt4;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -1885,7 +1844,7 @@ int AdvApp2Var_ApproxF2var::mma2ac2_(const integer *ndimen,
integer crbiv1_dim1, crbiv1_dim2, crbiv1_offset, crbiv2_dim1, crbiv2_dim2, integer crbiv1_dim1, crbiv1_dim2, crbiv1_offset, crbiv2_dim1, crbiv2_dim2,
crbiv2_offset, patjac_dim1, patjac_dim2, patjac_offset, crbiv2_offset, patjac_dim1, patjac_dim2, patjac_offset,
vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4; vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer ndgv1, ndgv2, ii, jj, nd, kk; static integer ndgv1, ndgv2, ii, jj, nd, kk;
@ -2031,14 +1990,11 @@ int AdvApp2Var_ApproxF2var::mma2ac3_(const integer *ndimen,
integer crbiu1_dim1, crbiu1_dim2, crbiu1_offset, crbiu2_dim1, crbiu2_dim2, integer crbiu1_dim1, crbiu1_dim2, crbiu1_offset, crbiu2_dim1, crbiu2_dim2,
crbiu2_offset, patjac_dim1, patjac_dim2, patjac_offset, crbiu2_offset, patjac_dim1, patjac_dim2, patjac_offset,
uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4; uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer ndgu1, ndgu2, ii, jj, nd, kk; static integer ndgu1, ndgu2, ii, jj, nd, kk;
static doublereal bid1, bid2; static doublereal bid1, bid2;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -2180,13 +2136,10 @@ int AdvApp2Var_ApproxF2var::mma2can_(const integer *ncfmxu,
/* System generated locals */ /* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, patcan_dim1, patcan_dim2, integer patjac_dim1, patjac_dim2, patjac_offset, patcan_dim1, patcan_dim2,
patcan_offset, i__1, i__2; patcan_offset, i__1, i__2;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer ilon1, ilon2, ii, nd; static integer ilon1, ilon2, ii, nd;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -2339,7 +2292,7 @@ int mma2cd1_(integer *ndimen,
{ {
static integer c__1 = 1; static integer c__1 = 1;
/* System generated locals */ /* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2, integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, contr3_dim1, contr3_dim2, contr3_offset, contr2_offset, contr3_dim1, contr3_dim2, contr3_offset,
@ -2357,9 +2310,6 @@ int mma2cd1_(integer *ndimen,
static doublereal bid1, bid2, bid3, bid4; static doublereal bid1, bid2, bid3, bid4;
static doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2; static doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -2710,7 +2660,7 @@ int mma2cd2_(integer *ndimen,
sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2, sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2,
diditb_offset, soditb_dim1, soditb_dim2, soditb_offset, diditb_offset, soditb_dim1, soditb_dim2, soditb_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4; disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
/* Local variables */ /* Local variables */
static integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp; static integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
static doublereal bid1, bid2, bid3, bid4; static doublereal bid1, bid2, bid3, bid4;
@ -3014,7 +2964,7 @@ int mma2cd3_(integer *ndimen,
{ {
static integer c__1 = 1; static integer c__1 = 1;
/* System generated locals */ /* System generated locals */
integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2, integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2,
sotbu2_offset, ditbu1_dim1, ditbu1_dim2, ditbu1_offset, sotbu2_offset, ditbu1_dim1, ditbu1_dim2, ditbu1_offset,
@ -4437,12 +4387,12 @@ L400:
L600: L600:
/* Computing MAX */ /* Computing MAX */
i__1 = 1, i__2 = (*iordru << 1) + 1, i__1 = max(i__1,i__2); i__1 = 1, i__2 = (*iordru << 1) + 1, i__1 = advapp_max(i__1,i__2);
minu = max(i__1,*ndminu); minu = advapp_max(i__1,*ndminu);
maxu = *ndguli; maxu = *ndguli;
/* Computing MAX */ /* Computing MAX */
i__1 = 1, i__2 = (*iordrv << 1) + 1, i__1 = max(i__1,i__2); i__1 = 1, i__2 = (*iordrv << 1) + 1, i__1 = advapp_max(i__1,i__2);
minv = max(i__1,*ndminv); minv = advapp_max(i__1,*ndminv);
maxv = *ndgvli; maxv = *ndgvli;
idim = 1; idim = 1;
i__1 = *nbsesp; i__1 = *nbsesp;
@ -4482,8 +4432,8 @@ L600:
} }
/* --> Return the nb of coeffs of approximation. */ /* --> Return the nb of coeffs of approximation. */
*ndegpu = max(*ndegpu,nu); *ndegpu = advapp_max(*ndegpu,nu);
*ndegpv = max(*ndegpv,nv); *ndegpv = advapp_max(*ndegpv,nv);
idim += ndses; idim += ndses;
/* L610: */ /* L610: */
} }
@ -4575,12 +4525,12 @@ L600:
} else { } else {
/* Computing MAX */ /* Computing MAX */
i__2 = 1, i__3 = (*iordru << 1) + 1, i__2 = max(i__2,i__3); i__2 = 1, i__3 = (*iordru << 1) + 1, i__2 = advapp_max(i__2,i__3);
minu = max(i__2,*ndminu); minu = advapp_max(i__2,*ndminu);
maxu = *ndguli; maxu = *ndguli;
/* Computing MAX */ /* Computing MAX */
i__2 = 1, i__3 = (*iordrv << 1) + 1, i__2 = max(i__2,i__3); i__2 = 1, i__3 = (*iordrv << 1) + 1, i__2 = advapp_max(i__2,i__3);
minv = max(i__2,*ndminv); minv = advapp_max(i__2,*ndminv);
maxv = *ndgvli; maxv = *ndgvli;
if (maxu >= (*iordru + 1) << 1 && maxv >= (*iordrv + 1) << 1) { if (maxu >= (*iordru + 1) << 1 && maxv >= (*iordrv + 1) << 1) {
mma2er2_(ndjacu, ndjacv, &ndses, &minu, &maxu, &minv, & mma2er2_(ndjacu, ndjacv, &ndses, &minu, &maxu, &minv, &
@ -4623,8 +4573,8 @@ L600:
/* --------------- Return the nb of coeff of approximation --- /* --------------- Return the nb of coeff of approximation ---
-------- */ -------- */
*ndegpu = max(*ndegpu,nu); *ndegpu = advapp_max(*ndegpu,nu);
*ndegpv = max(*ndegpv,nv); *ndegpv = advapp_max(*ndegpv,nv);
idim += ndses; idim += ndses;
/* L730: */ /* L730: */
} }
@ -4707,13 +4657,12 @@ int mma2cfu_(integer *ndujac,
/* System generated locals */ /* System generated locals */
integer sosotb_dim1, disotb_dim1, disotb_offset, soditb_dim1, integer sosotb_dim1, disotb_dim1, disotb_offset, soditb_dim1,
soditb_offset, diditb_dim1, i__1, i__2; soditb_offset, diditb_dim1, i__1, i__2;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer nptu2, nptv2, ii, jj; static integer nptu2, nptv2, ii, jj;
static doublereal bid0, bid1, bid2; static doublereal bid0, bid1, bid2;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -4924,12 +4873,11 @@ int mma2cfv_(integer *ndvjac,
/* System generated locals */ /* System generated locals */
integer chpair_dim1, chpair_offset, chimpr_dim1, chimpr_offset, integer chpair_dim1, chpair_offset, chimpr_dim1, chimpr_offset,
patjac_offset, i__1, i__2; patjac_offset, i__1, i__2;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer nptv2, ii, jj; static integer nptv2, ii, jj;
static doublereal bid1; static doublereal bid1;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -5063,19 +5011,7 @@ int mma2cfv_(integer *ndvjac,
int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen, int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen,
doublereal *uintfn, doublereal *uintfn,
doublereal *vintfn, doublereal *vintfn,
void (*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *nbpntu, integer *nbpntu,
integer *nbpntv, integer *nbpntv,
doublereal *urootb, doublereal *urootb,
@ -5101,8 +5037,6 @@ int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen,
static integer ibid1, ibid2, iuouv, nd; static integer ibid1, ibid2, iuouv, nd;
static integer isz1, isz2; static integer isz1, isz2;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -5397,19 +5331,7 @@ L9999:
int mma2ds2_(integer *ndimen, int mma2ds2_(integer *ndimen,
doublereal *uintfn, doublereal *uintfn,
doublereal *vintfn, doublereal *vintfn,
void (*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *nbpntu, integer *nbpntu,
integer *nbpntv, integer *nbpntv,
doublereal *urootb, doublereal *urootb,
@ -5664,8 +5586,8 @@ int mma2ds2_(integer *ndimen,
i__1 = nvroo; i__1 = nvroo;
for (iv = 1; iv <= i__1; ++iv) { for (iv = 1; iv <= i__1; ++iv) {
tcons = blinv + alinv * vrootb[iv]; tcons = blinv + alinv * vrootb[iv];
(*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, & foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod); &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
} }
@ -5705,8 +5627,8 @@ int mma2ds2_(integer *ndimen,
if (*nbpntv % 2 != 0) { if (*nbpntv % 2 != 0) {
tcons = blinv; tcons = blinv;
(*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, & foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod); &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
} }
@ -5735,8 +5657,8 @@ int mma2ds2_(integer *ndimen,
i__1 = nvroo; i__1 = nvroo;
for (iv = 1; iv <= i__1; ++iv) { for (iv = 1; iv <= i__1; ++iv) {
tcons = alinv * vrootb[(*nbpntv + 1) / 2 + iv] + blinv; tcons = alinv * vrootb[(*nbpntv + 1) / 2 + iv] + blinv;
(*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, & foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod); &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) { if (*iercod > 0) {
goto L9999; goto L9999;
} }
@ -5803,7 +5725,7 @@ int mma2er1_(integer *ndjacu,
/* System generated locals */ /* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3; integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static integer minu, minv; static integer minu, minv;
@ -5811,7 +5733,6 @@ int mma2er1_(integer *ndjacu,
static integer ii, nd, jj; static integer ii, nd, jj;
static doublereal bid0, bid1; static doublereal bid0, bid1;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -5916,7 +5837,7 @@ int mma2er1_(integer *ndjacu,
i__3 = *maxdgu; i__3 = *maxdgu;
for (ii = *mindgu; ii <= i__3; ++ii) { for (ii = *mindgu; ii <= i__3; ++ii) {
bid0 += (d__1 = patjac[ii + (jj + nd * patjac_dim2) * bid0 += (d__1 = patjac[ii + (jj + nd * patjac_dim2) *
patjac_dim1], abs(d__1)) * xmaxju[ii - minu]; patjac_dim1], advapp_abs(d__1)) * xmaxju[ii - minu];
/* L300: */ /* L300: */
} }
bid1 = bid0 * xmaxjv[jj - minv] + bid1; bid1 = bid0 * xmaxjv[jj - minv] + bid1;
@ -5970,7 +5891,7 @@ int mma2er2_(integer *ndjacu,
/* System generated locals */ /* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2; integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static logical ldbg; static logical ldbg;
static doublereal vaux[2]; static doublereal vaux[2];
@ -5979,7 +5900,6 @@ int mma2er2_(integer *ndjacu,
static integer ii, nd, jj, nu, nv; static integer ii, nd, jj, nu, nv;
static doublereal bid0, bid1; static doublereal bid0, bid1;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -6101,7 +6021,7 @@ L1001:
i__2 = nu; i__2 = nu;
for (ii = i2rdu; ii <= i__2; ++ii) { for (ii = i2rdu; ii <= i__2; ++ii) {
bid1 += (d__1 = patjac[ii + (nv + nd * patjac_dim2) * bid1 += (d__1 = patjac[ii + (nv + nd * patjac_dim2) *
patjac_dim1], abs(d__1)) * xmaxju[ii - i2rdu] * bid0; patjac_dim1], advapp_abs(d__1)) * xmaxju[ii - i2rdu] * bid0;
/* L200: */ /* L200: */
} }
vecerr[nd] = bid1; vecerr[nd] = bid1;
@ -6126,7 +6046,7 @@ L1001:
i__2 = nv; i__2 = nv;
for (jj = i2rdv; jj <= i__2; ++jj) { for (jj = i2rdv; jj <= i__2; ++jj) {
bid1 += (d__1 = patjac[nu + (jj + nd * patjac_dim2) * bid1 += (d__1 = patjac[nu + (jj + nd * patjac_dim2) *
patjac_dim1], abs(d__1)) * xmaxjv[jj - i2rdv] * bid0; patjac_dim1], advapp_abs(d__1)) * xmaxjv[jj - i2rdv] * bid0;
/* L400: */ /* L400: */
} }
vecerr[nd] = bid1; vecerr[nd] = bid1;
@ -6169,8 +6089,8 @@ L1001:
*/ */
L2001: L2001:
*newdgu = max(nu,1); *newdgu = advapp_max(nu,1);
*newdgv = max(nv,1); *newdgv = advapp_max(nv,1);
/* ----------------------------------- The end -------------------------- /* ----------------------------------- The end --------------------------
*/ */
@ -6189,19 +6109,7 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
integer *nbsesp, integer *nbsesp,
integer *ndimse, integer *ndimse,
doublereal *uvfonc, doublereal *uvfonc,
void (*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
doublereal *tconst, doublereal *tconst,
integer *isofav, integer *isofav,
integer *nbroot, integer *nbroot,
@ -6463,10 +6371,10 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
*/ */
AdvApp2Var_MathBase::mmveps3_(&eps3); AdvApp2Var_MathBase::mmveps3_(&eps3);
if ((d__1 = uvfonc[4] - uvfonc[3], abs(d__1)) < eps3) { if ((d__1 = uvfonc[4] - uvfonc[3], advapp_abs(d__1)) < eps3) {
goto L9100; goto L9100;
} }
if ((d__1 = uvfonc[6] - uvfonc[5], abs(d__1)) < eps3) { if ((d__1 = uvfonc[6] - uvfonc[5], advapp_abs(d__1)) < eps3) {
goto L9100; goto L9100;
} }
@ -6488,9 +6396,9 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
/* the auxiliary curve for MMAPCMP */ /* the auxiliary curve for MMAPCMP */
ibid1 = *ndimen * (*nbroot + 2); ibid1 = *ndimen * (*nbroot + 2);
ibid2 = ((*iordre + 1) << 1) * *nbroot; ibid2 = ((*iordre + 1) << 1) * *nbroot;
isz2 = max(ibid1,ibid2); isz2 = advapp_max(ibid1,ibid2);
ibid1 = (((*ncflim - 1) / 2 + 1) << 1) * *ndimen; ibid1 = (((*ncflim - 1) / 2 + 1) << 1) * *ndimen;
isz2 = max(ibid1,isz2); isz2 = advapp_max(ibid1,isz2);
/* --> To return the polynoms of hermit. */ /* --> To return the polynoms of hermit. */
isz3 = ((*iordre + 1) << 2) * (*iordre + 1); isz3 = ((*iordre + 1) << 2) * (*iordre + 1);
/* --> For the Gauss coeff. of integration. */ /* --> For the Gauss coeff. of integration. */
@ -6783,12 +6691,12 @@ int AdvApp2Var_ApproxF2var::mma2fx6_(integer *ncfmxu,
errmax_offset, ncoefu_dim1, ncoefu_offset, ncoefv_dim1, errmax_offset, ncoefu_dim1, ncoefu_offset, ncoefv_dim1,
ncoefv_offset, i__1, i__2, i__3, i__4, i__5; ncoefv_offset, i__1, i__2, i__3, i__4, i__5;
doublereal d__1, d__2; doublereal d__1, d__2;
/* Local variables */ /* Local variables */
static integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb; static integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
static doublereal bid; static doublereal bid;
static doublereal tol; static doublereal tol;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -6899,30 +6807,30 @@ L200:
tol = epsapr[ns]; tol = epsapr[ns];
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 9]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 9];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 10]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 10];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 11]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 11];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 12]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 12];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
if (ii == 1 || ii == *nbupat || jj == 1 || jj == *nbvpat) if (ii == 1 || ii == *nbupat || jj == 1 || jj == *nbvpat)
{ {
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 5]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 5];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 6]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 6];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 7]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 7];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + (epsfro_dim1 << 3)]; d__1 = tol, d__2 = epsfro[ns + (epsfro_dim1 << 3)];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
} }
bid = 0.; bid = 0.;
@ -6933,7 +6841,7 @@ L200:
for (kv = 1; kv <= i__5; ++kv) { for (kv = 1; kv <= i__5; ++kv) {
bid += (d__1 = patcan[ncfu + (kv + (id + (ii + jj bid += (d__1 = patcan[ncfu + (kv + (id + (ii + jj
* patcan_dim4) * patcan_dim3) * * patcan_dim4) * patcan_dim3) *
patcan_dim2) * patcan_dim1], abs(d__1)); patcan_dim2) * patcan_dim1], advapp_abs(d__1));
/* L230: */ /* L230: */
} }
/* L220: */ /* L220: */
@ -6964,30 +6872,30 @@ L300:
tol = epsapr[ns]; tol = epsapr[ns];
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 9]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 9];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 10]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 10];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 11]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 11];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 12]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 12];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
if (ii == 1 || ii == *nbupat || jj == 1 || jj == *nbvpat) if (ii == 1 || ii == *nbupat || jj == 1 || jj == *nbvpat)
{ {
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 5]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 5];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 6]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 6];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 7]; d__1 = tol, d__2 = epsfro[ns + epsfro_dim1 * 7];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
/* Computing MIN */ /* Computing MIN */
d__1 = tol, d__2 = epsfro[ns + (epsfro_dim1 << 3)]; d__1 = tol, d__2 = epsfro[ns + (epsfro_dim1 << 3)];
tol = min(d__1,d__2); tol = advapp_min(d__1,d__2);
} }
bid = 0.; bid = 0.;
@ -6998,7 +6906,7 @@ L300:
for (ku = 1; ku <= i__5; ++ku) { for (ku = 1; ku <= i__5; ++ku) {
bid += (d__1 = patcan[ku + (ncfv + (id + (ii + jj bid += (d__1 = patcan[ku + (ncfv + (id + (ii + jj
* patcan_dim4) * patcan_dim3) * * patcan_dim4) * patcan_dim3) *
patcan_dim2) * patcan_dim1], abs(d__1)); patcan_dim2) * patcan_dim1], advapp_abs(d__1));
/* L330: */ /* L330: */
} }
/* L320: */ /* L320: */
@ -7019,8 +6927,8 @@ L300:
/* --- Return the nbs of coeff. and pass to the next square --- */ /* --- Return the nbs of coeff. and pass to the next square --- */
L400: L400:
ncoefu[ii + jj * ncoefu_dim1] = max(ncfu,2); ncoefu[ii + jj * ncoefu_dim1] = advapp_max(ncfu,2);
ncoefv[ii + jj * ncoefv_dim1] = max(ncfv,2); ncoefv[ii + jj * ncoefv_dim1] = advapp_max(ncfv,2);
/* L110: */ /* L110: */
} }
/* L100: */ /* L100: */
@ -7400,8 +7308,8 @@ int mma2moy_(integer *ndgumx,
idebu = (*iordru + 1) << 1; idebu = (*iordru + 1) << 1;
idebv = (*iordrv + 1) << 1; idebv = (*iordrv + 1) << 1;
minu = max(idebu,*mindgu); minu = advapp_max(idebu,*mindgu);
minv = max(idebv,*mindgv); minv = advapp_max(idebv,*mindgv);
bid0 = 0.; bid0 = 0.;
*errmoy = 0.; *errmoy = 0.;
@ -7465,7 +7373,7 @@ int AdvApp2Var_ApproxF2var::mma2roo_(integer *nbpntu,
{ {
/* System generated locals */ /* System generated locals */
integer i__1; integer i__1;
/* Local variables */ /* Local variables */
static integer ii, ibb; static integer ii, ibb;
@ -7571,13 +7479,11 @@ int mmmapcoe_(integer *ndim,
/* System generated locals */ /* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset, integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3; crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3;
/* Local variables */ /* Local variables */
static integer igss, ikdeb; static integer igss, ikdeb;
static doublereal bidon; static doublereal bidon;
static integer nd, ik, ir, nbroot, ibb; static integer nd, ik, ir, nbroot, ibb;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -7739,8 +7645,6 @@ int mmaperm_(integer *ncofmx,
static doublereal bidj; static doublereal bidj;
static integer i__, ia, nd, ncfcut, ibb; static integer i__, ia, nd, ncfcut, ibb;
static doublereal bid; static doublereal bid;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -7845,11 +7749,9 @@ int AdvApp2Var_ApproxF2var::mmapptt_(const integer *ndgjac,
{ {
/* System generated locals */ /* System generated locals */
integer cgauss_dim1, i__1; integer cgauss_dim1, i__1;
/* Local variables */ /* Local variables */
static integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb; static integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
/* ********************************************************************** /* **********************************************************************
*/ */

View File

@ -11,6 +11,7 @@
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <AdvApp2Var_Data_f2c.hxx> #include <AdvApp2Var_Data_f2c.hxx>
#include <AdvApp2Var_EvaluatorFunc2Var.hxx>
// //
class AdvApp2Var_ApproxF2var { class AdvApp2Var_ApproxF2var {
public: public:
@ -19,19 +20,7 @@ Standard_EXPORT static int mma2fnc_(integer *ndimen,
integer *nbsesp, integer *nbsesp,
integer *ndimse, integer *ndimse,
doublereal *uvfonc, doublereal *uvfonc,
void(*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
doublereal *tconst, doublereal *tconst,
integer *isofav, integer *isofav,
integer *nbroot, integer *nbroot,
@ -100,19 +89,7 @@ Standard_EXPORT static int mma2cdi_(integer *ndimen,
Standard_EXPORT static int mma2ds1_(integer *ndimen, Standard_EXPORT static int mma2ds1_(integer *ndimen,
doublereal *uintfn, doublereal *uintfn,
doublereal *vintfn, doublereal *vintfn,
void (*foncnp) ( const AdvApp2Var_EvaluatorFunc2Var& foncnp,
int *,
double *,
double *,
int *,
double *,
int *,
double *,
int *,
int *,
double *,
int *
),
integer *nbpntu, integer *nbpntu,
integer *nbpntv, integer *nbpntv,
doublereal *urootb, doublereal *urootb,

View File

@ -155,12 +155,12 @@ struct Namelist {
}; };
typedef struct Namelist Namelist; typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x)) #define advapp_abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x) #define dabs(x) (doublereal)advapp_abs(x)
#define min(a,b) ((a) <= (b) ? (a) : (b)) #define advapp_min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b)) #define advapp_max(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (doublereal)min(a,b) #define dmin(a,b) (doublereal)advapp_min(a,b)
#define dmax(a,b) (doublereal)max(a,b) #define dmax(a,b) (doublereal)advapp_max(a,b)
#define bit_test(a,b) ((a) >> (b) & 1) #define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b))) #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))

View File

@ -3,7 +3,6 @@
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi38> // <jct@sgi38>
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
@ -14,36 +13,59 @@
#include <Standard_PrimitiveTypes.hxx> #include <Standard_PrimitiveTypes.hxx>
#endif #endif
#ifndef AdvApp2Var_EvaluatorFunc2Var_HeaderFile #ifndef AdvApp2Var_EvaluatorFunc2Var_HeaderFile
#define AdvApp2Var_EvaluatorFunc2Var_HeaderFile #define AdvApp2Var_EvaluatorFunc2Var_HeaderFile
extern "C" { // History - the C function pointer converted to a virtual class
typedef void (* AdvApp2Var_EvaluatorFunc2Var) (Standard_Integer *, // in order to get rid of usage of static functions and static data
// Dimension class AdvApp2Var_EvaluatorFunc2Var
Standard_Real *, {
// StartEnd[2] in U public:
Standard_Real *,
// StartEnd[2] in V
Standard_Integer *,
// Choice of constante, 1 for U, 2 for V
Standard_Real *,
// Value of constant parameter
Standard_Integer *,
// Number of parameters
Standard_Real *,
// Values of parameters,
Standard_Integer *,
// Derivative Request in U
Standard_Integer *,
// Derivative Request in V
Standard_Real *,
// Result[Dimension]
Standard_Integer *) ;
// Error Code
//! Empty constructor
AdvApp2Var_EvaluatorFunc2Var() {}
} //! Destructor should be declared as virtual
virtual ~AdvApp2Var_EvaluatorFunc2Var () {}
//! Function evaluation method to be defined by descendant
virtual void Evaluate (Standard_Integer* theDimension,
Standard_Real* theUStartEnd,
Standard_Real* theVStartEnd,
Standard_Integer* theFavorIso, //!< Choice of constante, 1 for U, 2 for V
Standard_Real* theConstParam, //!< Value of constant parameter
Standard_Integer* theNbParams, //!< Number of parameters N
Standard_Real* theParameters, //!< Values of parameters,
Standard_Integer* theUOrder, //!< Derivative Request in U
Standard_Integer* theVOrder, //!< Derivative Request in V
Standard_Real* theResult, //!< Result[Dimension,N]
Standard_Integer* theErrorCode) const = 0;
//! Shortcut for function-call style usage
void operator() (Standard_Integer* theDimension,
Standard_Real* theUStartEnd,
Standard_Real* theVStartEnd,
Standard_Integer* theFavorIso,
Standard_Real* theConstParam,
Standard_Integer* theNbParams,
Standard_Real* theParameters,
Standard_Integer* theUOrder,
Standard_Integer* theVOrder,
Standard_Real* theResult,
Standard_Integer* theErrorCode) const
{
Evaluate (theDimension, theUStartEnd, theVStartEnd, theFavorIso,
theConstParam, theNbParams,
theParameters, theUOrder, theVOrder, theResult, theErrorCode);
}
private:
//! Copy constructor is declared private to forbid copying
AdvApp2Var_EvaluatorFunc2Var (const AdvApp2Var_EvaluatorFunc2Var& ) {}
//! Assignment operator is declared private to forbid copying
void operator= (const AdvApp2Var_EvaluatorFunc2Var& ) {}
};
#endif #endif

View File

@ -255,7 +255,7 @@ int AdvApp2Var_MathBase::mdsptpt_(integer *ndimen,
/* System generated locals */ /* System generated locals */
integer i__1; integer i__1;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static integer i__; static integer i__;
static doublereal differ[100]; static doublereal differ[100];
@ -405,12 +405,10 @@ int AdvApp2Var_MathBase::mmapcmp_(integer *ndim,
/* System generated locals */ /* System generated locals */
integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1, integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1,
i__2; i__2;
/* Local variables */ /* Local variables */
static integer ipair, nd, ndegre, impair, ibb, idg; static integer ipair, nd, ndegre, impair, ibb, idg;
//extern int mgsomsg_();//mgenmsg_(), //extern int mgsomsg_();//mgenmsg_(),
/* ********************************************************************** /* **********************************************************************
*/ */
@ -523,12 +521,11 @@ int mmaper0_(integer *ncofmx,
/* System generated locals */ /* System generated locals */
integer crvlgd_dim1, crvlgd_offset, i__1, i__2; integer crvlgd_dim1, crvlgd_offset, i__1, i__2;
doublereal d__1; doublereal d__1;
/* Local variables */ /* Local variables */
static integer ncut; static integer ncut;
static doublereal bidon; static doublereal bidon;
static integer ii, nd; static integer ii, nd;
/* *********************************************************************** /* ***********************************************************************
*/ */
@ -608,7 +605,7 @@ int mmaper0_(integer *ncofmx,
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvlgd[ii + nd * crvlgd_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvlgd[ii + nd * crvlgd_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -776,7 +773,7 @@ int mmaper2_(integer *ncofmx,
idec = 3; idec = 3;
/* Computing MAX */ /* Computing MAX */
i__1 = idec, i__2 = *ncfnew + 1; i__1 = idec, i__2 = *ncfnew + 1;
ncut = max(i__1,i__2); ncut = advapp_max(i__1,i__2);
/* -------------- Removal of coefficients of high degree ----------- /* -------------- Removal of coefficients of high degree -----------
*/ */
@ -789,7 +786,7 @@ int mmaper2_(integer *ncofmx,
bidon = xmaxj[ii - idec]; bidon = xmaxj[ii - idec];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -962,7 +959,7 @@ int mmaper4_(integer *ncofmx,
idec = 5; idec = 5;
/* Computing MAX */ /* Computing MAX */
i__1 = idec, i__2 = *ncfnew + 1; i__1 = idec, i__2 = *ncfnew + 1;
ncut = max(i__1,i__2); ncut = advapp_max(i__1,i__2);
/* -------------- Removal of high degree coefficients ----------- /* -------------- Removal of high degree coefficients -----------
*/ */
@ -975,7 +972,7 @@ int mmaper4_(integer *ncofmx,
bidon = xmaxj[ii - idec]; bidon = xmaxj[ii - idec];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -1139,7 +1136,7 @@ int mmaper6_(integer *ncofmx,
idec = 7; idec = 7;
/* Computing MAX */ /* Computing MAX */
i__1 = idec, i__2 = *ncfnew + 1; i__1 = idec, i__2 = *ncfnew + 1;
ncut = max(i__1,i__2); ncut = advapp_max(i__1,i__2);
/* -------------- Removal of high degree coefficients ----------- /* -------------- Removal of high degree coefficients -----------
*/ */
@ -1152,7 +1149,7 @@ int mmaper6_(integer *ncofmx,
bidon = xmaxj[ii - idec]; bidon = xmaxj[ii - idec];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvjac[ii + nd * crvjac_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -1187,10 +1184,9 @@ int AdvApp2Var_MathBase::mmaperx_(integer *ncofmx,
{ {
/* System generated locals */ /* System generated locals */
integer crvjac_dim1, crvjac_offset; integer crvjac_dim1, crvjac_offset;
/* Local variables */ /* Local variables */
static integer jord; static integer jord;
/* ********************************************************************** /* **********************************************************************
*/ */
@ -1604,7 +1600,7 @@ int AdvApp2Var_MathBase::mmarcin_(integer *ndimax,
/* At zero machine it is tested if the output interval is not null */ /* At zero machine it is tested if the output interval is not null */
AdvApp2Var_MathBase::mmveps3_(&eps3); AdvApp2Var_MathBase::mmveps3_(&eps3);
if ((d__1 = *u1 - *u0, abs(d__1)) < eps3) { if ((d__1 = *u1 - *u0, advapp_abs(d__1)) < eps3) {
*iercod = 13; *iercod = 13;
goto L9999; goto L9999;
} }
@ -2393,7 +2389,7 @@ L5000:
/* ------ Take into account DIF - Test of convergence */ /* ------ Take into account DIF - Test of convergence */
++iter; ++iter;
dif = (d__1 = sottc - oldso, abs(d__1)); dif = (d__1 = sottc - oldso, advapp_abs(d__1));
/* ------ If DIF is OK, leave..., otherwise: */ /* ------ If DIF is OK, leave..., otherwise: */
@ -2578,7 +2574,7 @@ int mmchole_(integer *,//mxcoef,
/* Computing MAX */ /* Computing MAX */
i__2 = i__ - aposit[(i__ << 1) + 1], i__3 = j - aposit[(j << 1) + i__2 = i__ - aposit[(i__ << 1) + 1], i__3 = j - aposit[(j << 1) +
1]; 1];
kmin = max(i__2,i__3); kmin = advapp_max(i__2,i__3);
i__2 = j - 1; i__2 = j - 1;
for (k = kmin; k <= i__2; ++k) { for (k = kmin; k <= i__2; ++k) {
somme += chomat[aposit[(i__ << 1) + 2] - (i__ - k)] * chomat[ somme += chomat[aposit[(i__ << 1) + 2] - (i__ - k)] * chomat[
@ -5192,12 +5188,12 @@ int mmherm0_(doublereal *debfin,
--debfin; --debfin;
/* Function Body */ /* Function Body */
d1 = abs(debfin[1]); d1 = advapp_abs(debfin[1]);
if (d1 > (float)100.) { if (d1 > (float)100.) {
goto L9101; goto L9101;
} }
d2 = abs(debfin[2]); d2 = advapp_abs(debfin[2]);
if (d2 > (float)100.) { if (d2 > (float)100.) {
goto L9101; goto L9101;
} }
@ -5207,7 +5203,7 @@ int mmherm0_(doublereal *debfin,
goto L9101; goto L9101;
} }
d1 = (d__1 = debfin[2] - debfin[1], abs(d__1)); d1 = (d__1 = debfin[2] - debfin[1], advapp_abs(d__1));
if (d1 / d2 < (float).01) { if (d1 / d2 < (float).01) {
goto L9101; goto L9101;
} }
@ -5229,7 +5225,7 @@ int mmherm0_(doublereal *debfin,
/* IS IT ALREADY INITIALIZED ? */ /* IS IT ALREADY INITIALIZED ? */
d1 = abs(debfin[1]) + abs(debfin[2]); d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
d1 *= 16111959; d1 *= 16111959;
if (debfin[1] != mmcmher_.tdebut) { if (debfin[1] != mmcmher_.tdebut) {
@ -5370,7 +5366,7 @@ L100:
mmcmher_.tdebut = debfin[1]; mmcmher_.tdebut = debfin[1];
mmcmher_.tfinal = debfin[2]; mmcmher_.tfinal = debfin[2];
d1 = abs(debfin[1]) + abs(debfin[2]); d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
mmcmher_.verifi = d1 * 16111959; mmcmher_.verifi = d1 * 16111959;
@ -5563,7 +5559,7 @@ int mmherm1_(doublereal *debfin,
/* IS-IT CORRECTLY INITIALIZED ? */ /* IS-IT CORRECTLY INITIALIZED ? */
d1 = abs(debfin[1]) + abs(debfin[2]); d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
d1 *= 16111959; d1 *= 16111959;
/* OTHERWISE IT IS INITIALIZED */ /* OTHERWISE IT IS INITIALIZED */
@ -6465,7 +6461,7 @@ int mmloncv_(integer *ndimax,
/* ****** Calculate the optimal degree ** */ /* ****** Calculate the optimal degree ** */
kk = *ncoeff / 4 + 1; kk = *ncoeff / 4 + 1;
kk = min(kk,10); kk = advapp_min(kk,10);
/* ****** Return the coefficients for the integral (DEGRE=4*KK) */ /* ****** Return the coefficients for the integral (DEGRE=4*KK) */
/* if KK <> KGAR. */ /* if KK <> KGAR. */
@ -6739,7 +6735,7 @@ L9900:
/* Computing MAX */ /* Computing MAX */
i__1 = iorjac + 1; i__1 = iorjac + 1;
nwcof = max(i__1,1); nwcof = advapp_max(i__1,1);
AdvApp2Var_SysBase::mvriraz_((integer *)&nwcof, AdvApp2Var_SysBase::mvriraz_((integer *)&nwcof,
(char *)wpoly); (char *)wpoly);
wpoly[0] = 1.; wpoly[0] = 1.;
@ -8117,7 +8113,7 @@ int mmrslw_(integer *normax,
kpiv = 0; kpiv = 0;
i__2 = *nordre; i__2 = *nordre;
for (jj = kk; jj <= i__2; ++jj) { for (jj = kk; jj <= i__2; ++jj) {
akj = (d__1 = abmatr[kk + jj * abmatr_dim1], abs(d__1)); akj = (d__1 = abmatr[kk + jj * abmatr_dim1], advapp_abs(d__1));
if (akj > pivot) { if (akj > pivot) {
pivot = akj; pivot = akj;
kpiv = jj; kpiv = jj;
@ -8610,11 +8606,11 @@ L1000:
*/ */
L2000: L2000:
if ((d__1 = *tparam - tablev[ideb], abs(d__1)) < *epsil) { if ((d__1 = *tparam - tablev[ideb], advapp_abs(d__1)) < *epsil) {
*itypen = 1; *itypen = 1;
goto L9999; goto L9999;
} }
if ((d__1 = *tparam - tablev[ifin], abs(d__1)) < *epsil) { if ((d__1 = *tparam - tablev[ifin], advapp_abs(d__1)) < *epsil) {
*itypen = 2; *itypen = 2;
goto L9999; goto L9999;
} }
@ -8877,7 +8873,7 @@ int mmtrpj0_(integer *ncofmx,
bidon = sqrt(bidon); bidon = sqrt(bidon);
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -9061,7 +9057,7 @@ int mmtrpj2_(integer *ncofmx,
bidon = xmaxj[i__ - ncut]; bidon = xmaxj[i__ - ncut];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -9089,7 +9085,7 @@ L400:
bid = 0.; bid = 0.;
i__1 = *ndimen; i__1 = *ndimen;
for (nd = 1; nd <= i__1; ++nd) { for (nd = 1; nd <= i__1; ++nd) {
bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)); bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1));
/* L600: */ /* L600: */
} }
if (bid > eps1) { if (bid > eps1) {
@ -9266,7 +9262,7 @@ int mmtrpj4_(integer *ncofmx,
bidon = xmaxj[i__ - ncut]; bidon = xmaxj[i__ - ncut];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -9294,7 +9290,7 @@ L400:
bid = 0.; bid = 0.;
i__1 = *ndimen; i__1 = *ndimen;
for (nd = 1; nd <= i__1; ++nd) { for (nd = 1; nd <= i__1; ++nd) {
bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)); bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1));
/* L600: */ /* L600: */
} }
if (bid > eps1) { if (bid > eps1) {
@ -9469,7 +9465,7 @@ int mmtrpj6_(integer *ncofmx,
bidon = xmaxj[i__ - ncut]; bidon = xmaxj[i__ - ncut];
i__2 = *ndimen; i__2 = *ndimen;
for (nd = 1; nd <= i__2; ++nd) { for (nd = 1; nd <= i__2; ++nd) {
ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)) * ycvmax[nd] += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1)) *
bidon; bidon;
/* L310: */ /* L310: */
} }
@ -9497,7 +9493,7 @@ L400:
bid = 0.; bid = 0.;
i__1 = *ndimen; i__1 = *ndimen;
for (nd = 1; nd <= i__1; ++nd) { for (nd = 1; nd <= i__1; ++nd) {
bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], abs(d__1)); bid += (d__1 = crvlgd[i__ + nd * crvlgd_dim1], advapp_abs(d__1));
/* L600: */ /* L600: */
} }
if (bid > eps1) { if (bid > eps1) {
@ -9716,7 +9712,7 @@ L9999:
i__1 = *ndimen; i__1 = *ndimen;
for (ii = 1; ii <= i__1; ++ii) { for (ii = 1; ii <= i__1; ++ii) {
vecnrm[ii] = vector[ii] / vnorm; vecnrm[ii] = vector[ii] / vnorm;
if ((d__1 = vecnrm[ii], abs(d__1)) <= eps0) { if ((d__1 = vecnrm[ii], advapp_abs(d__1)) <= eps0) {
++izero; ++izero;
} else { } else {
iunit = ii; iunit = ii;
@ -11251,7 +11247,7 @@ L9900:
irmax = 1; irmax = 1;
i__1 = *ndimen; i__1 = *ndimen;
for (i__ = 2; i__ <= i__1; ++i__) { for (i__ = 2; i__ <= i__1; ++i__) {
if ((d__1 = vecteu[irmax], abs(d__1)) < (d__2 = vecteu[i__], abs(d__2) if ((d__1 = vecteu[irmax], advapp_abs(d__1)) < (d__2 = vecteu[i__], advapp_abs(d__2)
)) { )) {
irmax = i__; irmax = i__;
} }
@ -11260,7 +11256,7 @@ L9900:
/* ___ Calculate the norme */ /* ___ Calculate the norme */
if ((d__1 = vecteu[irmax], abs(d__1)) < 1.) { if ((d__1 = vecteu[irmax], advapp_abs(d__1)) < 1.) {
xsom = 0.; xsom = 0.;
i__1 = *ndimen; i__1 = *ndimen;
for (i__ = 1; i__ <= i__1; ++i__) { for (i__ = 1; i__ <= i__1; ++i__) {
@ -11283,7 +11279,7 @@ L9900:
} }
/* L300: */ /* L300: */
} }
ret_val = (d__1 = vecteu[irmax], abs(d__1)) * sqrt(xsom); ret_val = (d__1 = vecteu[irmax], advapp_abs(d__1)) * sqrt(xsom);
} }
/* *********************************************************************** /* ***********************************************************************

View File

@ -3016,7 +3016,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
mcrgene_.icore[mcrgene_.ncore * 12 - 10]; mcrgene_.icore[mcrgene_.ncore * 12 - 10];
/* Computing MAX */ /* Computing MAX */
i__1 = mcrstac_.mbyte[ksys - 1], i__2 = mcrstac_.nbyte[ksys - 1]; i__1 = mcrstac_.mbyte[ksys - 1], i__2 = mcrstac_.nbyte[ksys - 1];
mcrstac_.mbyte[ksys - 1] = max(i__1,i__2); mcrstac_.mbyte[ksys - 1] = advapp_max(i__1,i__2);
goto L9900; goto L9900;

View File

@ -270,5 +270,7 @@ mysquares: Boolean from Standard;
myitermax: Integer from Standard; myitermax: Integer from Standard;
myfirstC: Constraint from AppParCurves; myfirstC: Constraint from AppParCurves;
mylastC: Constraint from AppParCurves; mylastC: Constraint from AppParCurves;
myMultiLineNb: Integer from Standard;
myIsClear : Boolean from Standard;
end ComputeLine; end ComputeLine;

View File

@ -23,9 +23,6 @@
#include <stdio.h> #include <stdio.h>
static Standard_Boolean IsClear = Standard_False;
static Standard_Integer nbML = 0;
#ifdef DEB #ifdef DEB
static Standard_Boolean mydebug = Standard_False; static Standard_Boolean mydebug = Standard_False;
@ -391,6 +388,8 @@ Approx_ComputeLine::Approx_ComputeLine
const Standard_Integer NbIterations, const Standard_Integer NbIterations,
const Standard_Boolean cutting, const Standard_Boolean cutting,
const Standard_Boolean Squares) const Standard_Boolean Squares)
: myMultiLineNb (0),
myIsClear (Standard_False)
{ {
myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(), myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(),
Parameters.Upper()); Parameters.Upper());
@ -422,6 +421,8 @@ Approx_ComputeLine::Approx_ComputeLine
const Standard_Integer NbIterations, const Standard_Integer NbIterations,
const Standard_Boolean cutting, const Standard_Boolean cutting,
const Standard_Boolean Squares) const Standard_Boolean Squares)
: myMultiLineNb (0),
myIsClear (Standard_False)
{ {
myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(), myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(),
Parameters.Upper()); Parameters.Upper());
@ -451,6 +452,8 @@ Approx_ComputeLine::Approx_ComputeLine
const Standard_Boolean cutting, const Standard_Boolean cutting,
const Approx_ParametrizationType parametrization, const Approx_ParametrizationType parametrization,
const Standard_Boolean Squares) const Standard_Boolean Squares)
: myMultiLineNb (0),
myIsClear (Standard_False)
{ {
myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2); myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2);
Par = parametrization; Par = parametrization;
@ -477,6 +480,8 @@ Approx_ComputeLine::Approx_ComputeLine
const Standard_Boolean cutting, const Standard_Boolean cutting,
const Approx_ParametrizationType parametrization, const Approx_ParametrizationType parametrization,
const Standard_Boolean Squares) const Standard_Boolean Squares)
: myMultiLineNb (0),
myIsClear (Standard_False)
{ {
myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2); myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2);
alldone = Standard_False; alldone = Standard_False;
@ -501,14 +506,15 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
#ifdef DEB #ifdef DEB
if (mydebug) DUMP(Line); if (mydebug) DUMP(Line);
#endif #endif
if (!IsClear) { if (!myIsClear)
{
myMultiCurves.Clear(); myMultiCurves.Clear();
myPar.Clear(); myPar.Clear();
Tolers3d.Clear(); Tolers3d.Clear();
Tolers2d.Clear(); Tolers2d.Clear();
nbML = 0; myMultiLineNb = 0;
} }
else IsClear = Standard_False; else myIsClear = Standard_False;
Standard_Integer i, nbp, Thefirstpt, Thelastpt, oldlastpt; Standard_Integer i, nbp, Thefirstpt, Thelastpt, oldlastpt;
Standard_Boolean Finish = Standard_False, Standard_Boolean Finish = Standard_False,
@ -613,8 +619,8 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
-LineTool::LastPoint(OtherLine); -LineTool::LastPoint(OtherLine);
//-- Si MakeML a echoue on retourne une ligne vide //-- Si MakeML a echoue on retourne une ligne vide
if ((nbpdsotherligne == 0) || myMultiLineNb >= 3)
if( (nbpdsotherligne == 0) || nbML >= 3) { {
FailOnPointsAdded = Standard_True; FailOnPointsAdded = Standard_True;
//-- cout<<" ** ApproxComputeLine MakeML Echec ** LBR lbr "<<endl; //-- cout<<" ** ApproxComputeLine MakeML Echec ** LBR lbr "<<endl;
if (myfirstpt == mylastpt) break; // Pour etre sur de ne pas if (myfirstpt == mylastpt) break; // Pour etre sur de ne pas
@ -676,12 +682,13 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
mylastpt = Thelastpt; mylastpt = Thelastpt;
} }
else { else
IsClear = Standard_True; {
nbML++; myIsClear = Standard_True;
++myMultiLineNb;
Perform(OtherLine); Perform(OtherLine);
myfirstpt = mylastpt; myfirstpt = mylastpt;
mylastpt = Thelastpt; mylastpt = Thelastpt;
} }
} }

View File

@ -29,7 +29,7 @@
#include <CPnts_AbscissaPoint.hxx> #include <CPnts_AbscissaPoint.hxx>
#include <Approx_CurvlinFunc.hxx> #include <Approx_CurvlinFunc.hxx>
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx> #include <OSD_Timer.hxx>
static OSD_Chronometer chr_total, chr_init, chr_approx; static OSD_Chronometer chr_total, chr_init, chr_approx;
@ -118,7 +118,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
const Standard_Integer MaxDegree, const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments) const Standard_Integer MaxSegments)
{ {
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0; t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0; uparam_count = 0;
InitChron(chr_total); InitChron(chr_total);
@ -131,11 +131,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS); Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol); ThreeDTol->Init(Tol);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init); InitChron(chr_init);
#endif #endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C3D, Tol/10); Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C3D, Tol/10);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init); ResultChron(chr_init, t_init);
#endif #endif
@ -150,7 +150,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
fonct->Intervals(CutPnts_C3,GeomAbs_C3); fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3); AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx); InitChron(chr_approx);
#endif #endif
@ -161,7 +161,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
MaxDegree, MaxSegments, MaxDegree, MaxSegments,
evC, CutTool); evC, CutTool);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx); ResultChron(chr_approx, t_approx);
#endif #endif
@ -178,7 +178,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
} }
myMaxError3d = aApprox.MaxError(3,1); myMaxError3d = aApprox.MaxError(3,1);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total); ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl; cout<<" total reparametrization time = "<<t_total<<endl;
@ -256,7 +256,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
const Standard_Integer MaxDegree, const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments) const Standard_Integer MaxSegments)
{ {
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0; t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0; uparam_count = 0;
InitChron(chr_total); InitChron(chr_total);
@ -281,11 +281,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS); Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol/2.); ThreeDTol->Init(Tol/2.);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init); InitChron(chr_init);
#endif #endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D, Surf, Tol/20); Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D, Surf, Tol/20);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init); ResultChron(chr_init, t_init);
#endif #endif
@ -300,7 +300,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
fonct->Intervals(CutPnts_C3,GeomAbs_C3); fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3); AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx); InitChron(chr_approx);
#endif #endif
@ -311,7 +311,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
MaxDegree, MaxSegments, MaxDegree, MaxSegments,
evCOnS, CutTool); evCOnS, CutTool);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx); ResultChron(chr_approx, t_approx);
#endif #endif
@ -339,7 +339,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
myMaxError2d1 = Max (aApprox.MaxError(1,1),aApprox.MaxError(1,2)); myMaxError2d1 = Max (aApprox.MaxError(1,1),aApprox.MaxError(1,2));
myMaxError3d = aApprox.MaxError(3,1); myMaxError3d = aApprox.MaxError(3,1);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total); ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl; cout<<" total reparametrization time = "<<t_total<<endl;
@ -421,7 +421,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
{ {
Standard_Integer i; Standard_Integer i;
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0; t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0; uparam_count = 0;
InitChron(chr_total); InitChron(chr_total);
@ -446,11 +446,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS); Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol/2); ThreeDTol->Init(Tol/2);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init); InitChron(chr_init);
#endif #endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D1, C2D2, Surf1, Surf2, Tol/20); Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D1, C2D2, Surf1, Surf2, Tol/20);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init); ResultChron(chr_init, t_init);
#endif #endif
@ -465,7 +465,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
fonct->Intervals(CutPnts_C3,GeomAbs_C3); fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3); AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx); InitChron(chr_approx);
#endif #endif
@ -476,7 +476,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
MaxDegree, MaxSegments, MaxDegree, MaxSegments,
evCOn2S, CutTool); evCOn2S, CutTool);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx); ResultChron(chr_approx, t_approx);
#endif #endif
@ -512,7 +512,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
myMaxError2d2 = Max (aApprox.MaxError(1,3),aApprox.MaxError(1,4)); myMaxError2d2 = Max (aApprox.MaxError(1,3),aApprox.MaxError(1,4));
myMaxError3d = aApprox.MaxError(3,1); myMaxError3d = aApprox.MaxError(3,1);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total); ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl; cout<<" total reparametrization time = "<<t_total<<endl;

View File

@ -141,7 +141,9 @@ fields
myLength1: Real from Standard; myLength1: Real from Standard;
myLength2: Real from Standard; myLength2: Real from Standard;
myTolLen : Real from Standard; myTolLen : Real from Standard;
myPrevS : Real from Standard; -- should be mutable
myPrevU : Real from Standard; -- should be mutable
myUi_1 : HArray1OfReal from TColStd; myUi_1 : HArray1OfReal from TColStd;
mySi_1 : HArray1OfReal from TColStd; mySi_1 : HArray1OfReal from TColStd;
myUi_2 : HArray1OfReal from TColStd; myUi_2 : HArray1OfReal from TColStd;

View File

@ -12,8 +12,7 @@
#include <GCPnts_AbscissaPoint.hxx> #include <GCPnts_AbscissaPoint.hxx>
#include <Precision.hxx> #include <Precision.hxx>
static Standard_Real myPrevS, myPrevU; #ifdef __OCC_DEBUG_CHRONO
#ifdef DEB
#include <OSD_Timer.hxx> #include <OSD_Timer.hxx>
static OSD_Chronometer chr_uparam; static OSD_Chronometer chr_uparam;
Standard_EXPORT Standard_Integer uparam_count; Standard_EXPORT Standard_Integer uparam_count;
@ -98,7 +97,9 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor3d_HCurve)& C, const
myCase(1), myCase(1),
myFirstS(0), myFirstS(0),
myLastS(1), myLastS(1),
myTolLen(Tol) myTolLen(Tol),
myPrevS (0.0),
myPrevU (0.0)
{ {
Init(); Init();
} }
@ -109,7 +110,9 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor2d_HCurve2d)& C2D, co
myCase(2), myCase(2),
myFirstS(0), myFirstS(0),
myLastS(1), myLastS(1),
myTolLen(Tol) myTolLen(Tol),
myPrevS (0.0),
myPrevU (0.0)
{ {
Init(); Init();
} }
@ -122,7 +125,9 @@ Approx_CurvlinFunc::Approx_CurvlinFunc(const Handle(Adaptor2d_HCurve2d)& C2D1, c
myCase(3), myCase(3),
myFirstS(0), myFirstS(0),
myLastS(1), myLastS(1),
myTolLen(Tol) myTolLen(Tol),
myPrevS (0.0),
myPrevU (0.0)
{ {
Init(); Init();
} }
@ -206,8 +211,9 @@ void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)&
for(i = Si->Lower(); i<= Si->Upper(); i++) for(i = Si->Lower(); i<= Si->Upper(); i++)
Si->ChangeValue(i) /= Len; Si->ChangeValue(i) /= Len;
myPrevS = myFirstS; // TODO - fields should be mutable
myPrevU = FirstU; const_cast<Approx_CurvlinFunc*>(this)->myPrevS = myFirstS;
const_cast<Approx_CurvlinFunc*>(this)->myPrevU = FirstU;
} }
void Approx_CurvlinFunc::SetTol(const Standard_Real Tol) void Approx_CurvlinFunc::SetTol(const Standard_Real Tol)
@ -431,7 +437,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
Standard_Real deltaS, base, U, Length; Standard_Real deltaS, base, U, Length;
Standard_Integer NbInt, NInterval, i; Standard_Integer NbInt, NInterval, i;
Handle(TColStd_HArray1OfReal) InitUArray, InitSArray; Handle(TColStd_HArray1OfReal) InitUArray, InitSArray;
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_uparam); InitChron(chr_uparam);
#endif #endif
if(S < 0 || S > 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter"); if(S < 0 || S > 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter");
@ -477,10 +483,11 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
U = GCPnts_AbscissaPoint(C, deltaS, base, UGuess, myTolLen).Parameter(); U = GCPnts_AbscissaPoint(C, deltaS, base, UGuess, myTolLen).Parameter();
myPrevS = S; // TODO - fields should be mutable
myPrevU = U; const_cast<Approx_CurvlinFunc*>(this)->myPrevS = S;
const_cast<Approx_CurvlinFunc*>(this)->myPrevU = U;
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_uparam, t_uparam); ResultChron(chr_uparam, t_uparam);
uparam_count++; uparam_count++;
#endif #endif

View File

@ -39,7 +39,7 @@
#include <Geom2d_BSplineCurve.hxx> #include <Geom2d_BSplineCurve.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx> #include <OSD_Timer.hxx>
OSD_Chronometer chr_total, chr_init, chr_approx, chr_booltool; OSD_Chronometer chr_total, chr_init, chr_approx, chr_booltool;
@ -184,7 +184,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
void BRepAlgo_NormalProjection::Build() void BRepAlgo_NormalProjection::Build()
{ {
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
Standard_Integer init_count = 0, approx_count = 0, booltool_count = 0; Standard_Integer init_count = 0, approx_count = 0, booltool_count = 0;
t_total = 0; t_total = 0;
t_init = 0; t_init = 0;
@ -255,12 +255,12 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
TolU = hsur->UResolution(myTol3d)/20; TolU = hsur->UResolution(myTol3d)/20;
TolV = hsur->VResolution(myTol3d)/20; TolV = hsur->VResolution(myTol3d)/20;
// Projection // Projection
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init); InitChron(chr_init);
#endif #endif
Projector = Projector =
ProjLib_CompProjectedCurve(hsur, hcur, TolU, TolV, myMaxDist); ProjLib_CompProjectedCurve(hsur, hcur, TolU, TolV, myMaxDist);
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init,t_init); ResultChron(chr_init,t_init);
init_count++; init_count++;
#endif #endif
@ -348,13 +348,13 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
BB.UpdateVertex(TopExp::LastVertex(TopoDS::Edge(prj)),myTol3d); BB.UpdateVertex(TopExp::LastVertex(TopoDS::Edge(prj)),myTol3d);
} }
else { else {
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx); InitChron(chr_approx);
#endif #endif
Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d, Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d,
myContinuity, myMaxDegree, myMaxSeg, myContinuity, myMaxDegree, myMaxSeg,
Only3d, Only2d); Only3d, Only2d);
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx,t_approx); ResultChron(chr_approx,t_approx);
approx_count++; approx_count++;
@ -460,7 +460,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if(myFaceBounds) { if(myFaceBounds) {
// Trimming edges by face bounds // Trimming edges by face bounds
// if the solution is degenerated, use of BoolTool is avoided // if the solution is degenerated, use of BoolTool is avoided
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_booltool); InitChron(chr_booltool);
#endif #endif
if(!Degenerated){ if(!Degenerated){
@ -525,7 +525,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
myAncestorMap.Bind(prj, Edges->Value(i)); myAncestorMap.Bind(prj, Edges->Value(i));
myCorresp.Bind(prj, Faces->Value(j)); myCorresp.Bind(prj, Faces->Value(j));
} }
#ifdef DEBUG #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_booltool,t_booltool); ResultChron(chr_booltool,t_booltool);
booltool_count++; booltool_count++;
#endif #endif
@ -550,7 +550,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
myIsDone = Standard_True; myIsDone = Standard_True;
#if DEBUG #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total,t_total); ResultChron(chr_total,t_total);
cout<<"Build - Total time : "<<t_total<<" includes:" <<endl; cout<<"Build - Total time : "<<t_total<<" includes:" <<endl;

View File

@ -37,9 +37,9 @@ void BRepClass3d_Intersector3d::Perform(const gp_Lin& L,
const Standard_Real Tol, const Standard_Real Tol,
const TopoDS_Face& Face) { const TopoDS_Face& Face) {
static IntCurveSurface_HInter HICS; IntCurveSurface_HInter HICS;
static BRepAdaptor_Surface surface; BRepAdaptor_Surface surface;
static BRepClass_FaceClassifier classifier2d; BRepClass_FaceClassifier classifier2d;
Handle(Geom_Line) geomline = new Geom_Line(L); Handle(Geom_Line) geomline = new Geom_Line(L);
GeomAdaptor_Curve LL(geomline); GeomAdaptor_Curve LL(geomline);

View File

@ -18,6 +18,7 @@ uses
Pnt from gp, Pnt from gp,
Pnt2d from gp, Pnt2d from gp,
Lin from gp, Lin from gp,
Vec from gp,
Face from TopoDS, Face from TopoDS,
Shell from TopoDS, Shell from TopoDS,
Shape from TopoDS, Shape from TopoDS,
@ -60,6 +61,13 @@ is
Param: out Real from Standard) Param: out Real from Standard)
returns Boolean from Standard; returns Boolean from Standard;
FindAPointInTheFace(myclass; F: Face from TopoDS;
P: out Pnt from gp;
u,v: out Real from Standard;
Param: out Real from Standard;
theVecD1U, theVecD1V: out Vec from gp)
returns Boolean from Standard;
FindAPointInTheFace(myclass; F: Face from TopoDS; FindAPointInTheFace(myclass; F: Face from TopoDS;
P: out Pnt from gp; P: out Pnt from gp;
u,v: out Real from Standard) u,v: out Real from Standard)
@ -82,14 +90,23 @@ is
Index: out Integer from Standard) Index: out Integer from Standard)
returns Boolean from Standard is static ; returns Boolean from Standard is static ;
PointInTheFace(me; F: Face from TopoDS;
P: out Pnt from gp;
u,v: out Real from Standard;
Param: out Real from Standard;
Index: out Integer from Standard;
surf: HSurface from BRepAdaptor;
u1,v1,u2,v2: Real from Standard)
returns Boolean from Standard is static;
PointInTheFace(me; F: Face from TopoDS; PointInTheFace(me; F: Face from TopoDS;
P: out Pnt from gp; P: out Pnt from gp;
u,v: out Real from Standard; u,v: out Real from Standard;
Param: out Real from Standard; Param: out Real from Standard;
Index: out Integer from Standard; Index: out Integer from Standard;
surf: HSurface from BRepAdaptor; surf: HSurface from BRepAdaptor;
u1,v1,u2,v2: Real from Standard) u1,v1,u2,v2: Real from Standard;
theVecD1U, theVecD1V: out Vec from gp)
returns Boolean from Standard is static ; returns Boolean from Standard is static ;
---Purpose: <Index> gives point index to search from and returns ---Purpose: <Index> gives point index to search from and returns
-- point index of succeseful search -- point index of succeseful search

View File

@ -42,9 +42,6 @@
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepClass_FaceClassifier.hxx> #include <BRepClass_FaceClassifier.hxx>
//<-OCC454(apo) //<-OCC454(apo)
static Standard_Integer numedg=0;
static gp_Vec staticd1u_gp_vec;
static gp_Vec staticd1v_gp_vec;
//======================================================================= //=======================================================================
//function : FindAPointInTheFace //function : FindAPointInTheFace
@ -56,8 +53,8 @@ static gp_Vec staticd1v_gp_vec;
Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
(const TopoDS_Face& _face, (const TopoDS_Face& _face,
gp_Pnt& APoint_, gp_Pnt& APoint_,
Standard_Real& param_) Standard_Real& param_)
{ {
Standard_Real u,v; Standard_Real u,v;
Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v,param_); Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v,param_);
return r; return r;
@ -72,97 +69,113 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
(const TopoDS_Face& _face, (const TopoDS_Face& _face,
gp_Pnt& APoint_, gp_Pnt& APoint_,
Standard_Real& u_, Standard_Real& v_, Standard_Real& u_, Standard_Real& v_,
Standard_Real& param_) Standard_Real& param_)
{ {
TopoDS_Face face=_face; gp_Vec aVecD1U, aVecD1V;
face.Orientation(TopAbs_FORWARD); return FindAPointInTheFace (_face, APoint_, u_, v_, param_, aVecD1U, aVecD1V);
}
TopExp_Explorer faceexplorer;
//=======================================================================
//function : FindAPointInTheFace
//purpose :
//=======================================================================
Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
(const TopoDS_Face& _face,
gp_Pnt& APoint_,
Standard_Real& u_, Standard_Real& v_,
Standard_Real& param_,
gp_Vec& theVecD1U,
gp_Vec& theVecD1V)
{
TopoDS_Face face = _face;
face.Orientation (TopAbs_FORWARD);
TopExp_Explorer faceexplorer;
BRepAdaptor_Curve2d c; BRepAdaptor_Curve2d c;
gp_Vec2d T; gp_Vec2d T;
gp_Pnt2d P; gp_Pnt2d P;
//Standard_Boolean Ok = Standard_False;
Standard_Integer nedg=1;
for (faceexplorer.Init(face,TopAbs_EDGE); for (faceexplorer.Init(face,TopAbs_EDGE);
faceexplorer.More(); faceexplorer.More();
faceexplorer.Next()) { faceexplorer.Next())
if(numedg==0 || nedg++==numedg) { {
TopoDS_Edge Edge = TopoDS::Edge(faceexplorer.Current()); TopoDS_Edge Edge = TopoDS::Edge (faceexplorer.Current());
c.Initialize(Edge,face); c.Initialize (Edge, face);
#ifdef DEB #ifdef DEB
Standard_Integer nbinterval = Standard_Integer nbinterval =
#endif #endif
c.NbIntervals(GeomAbs_C1); c.NbIntervals(GeomAbs_C1);
c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(),P,T); c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(),P,T);
Standard_Real x=T.X(); Standard_Real x = T.X();
Standard_Real y=T.Y(); Standard_Real y = T.Y();
if(Edge.Orientation() == TopAbs_FORWARD) { if (Edge.Orientation() == TopAbs_FORWARD)
T.SetCoord(-y,x); {
} T.SetCoord (-y, x);
else { }
T.SetCoord(y,-x); else
} {
Standard_Real ParamInit = RealLast(); T.SetCoord ( y, -x);
Standard_Real TolInit = 0.00001; }
Standard_Boolean APointExist = Standard_False; Standard_Real ParamInit = RealLast();
Standard_Real TolInit = 0.00001;
BRepClass_FacePassiveClassifier FClassifier; Standard_Boolean APointExist = Standard_False;
T.Normalize(); BRepClass_FacePassiveClassifier FClassifier;
P.SetCoord(P.X()+TolInit*T.X(),P.Y()+TolInit*T.Y());
FClassifier.Reset(gp_Lin2d(P,T),ParamInit,RealEpsilon()); //-- Length and Tolerance ####### T.Normalize();
P.SetCoord (P.X() + TolInit * T.X(), P.Y() + TolInit * T.Y());
TopExp_Explorer otherfaceexplorer; FClassifier.Reset (gp_Lin2d (P, T), ParamInit, RealEpsilon()); //-- Length and Tolerance #######
// Modified by Sergey KHROMOV - Tue Apr 1 11:32:51 2003 Begin
Standard_Integer aNbEdges = 0; TopExp_Explorer otherfaceexplorer;
for (otherfaceexplorer.Init(face,TopAbs_EDGE); Standard_Integer aNbEdges = 0;
otherfaceexplorer.More(); for (otherfaceexplorer.Init (face, TopAbs_EDGE);
otherfaceexplorer.Next(), aNbEdges++) { otherfaceexplorer.More();
// for (otherfaceexplorer.Init(face,TopAbs_EDGE); otherfaceexplorer.Next(), ++aNbEdges)
// otherfaceexplorer.More(); {
// otherfaceexplorer.Next()) { TopoDS_Edge OtherEdge = TopoDS::Edge (otherfaceexplorer.Current());
// Modified by Sergey KHROMOV - Tue Apr 1 11:32:52 2003 End if (OtherEdge.Orientation() != TopAbs_EXTERNAL && OtherEdge != Edge)
TopoDS_Edge OtherEdge = TopoDS::Edge(otherfaceexplorer.Current()); {
if((OtherEdge.Orientation() == TopAbs_EXTERNAL || BRepClass_Edge AEdge (OtherEdge, face);
OtherEdge == Edge)) { FClassifier.Compare (AEdge, OtherEdge.Orientation());
} if (FClassifier.ClosestIntersection())
else { {
BRepClass_Edge AEdge(OtherEdge,face); if(ParamInit > FClassifier.Parameter())
FClassifier.Compare(AEdge,OtherEdge.Orientation()); {
if(FClassifier.ClosestIntersection()) { ParamInit = FClassifier.Parameter();
//-- cout<<" ---> Edge : "<<FClassifier.Parameter()<<endl; APointExist = Standard_True;
if(ParamInit > FClassifier.Parameter()) { }
ParamInit = FClassifier.Parameter(); }
APointExist = Standard_True;
}
}
}
}
// Modified by Sergey KHROMOV - Tue Apr 1 11:34:36 2003 Begin
if (aNbEdges == 1) {
BRepClass_Edge AEdge(Edge,face);
FClassifier.Compare(AEdge,Edge.Orientation());
if(FClassifier.ClosestIntersection()) {
if(ParamInit > FClassifier.Parameter()) {
ParamInit = FClassifier.Parameter();
APointExist = Standard_True;
}
}
}
// Modified by Sergey KHROMOV - Tue Apr 1 11:34:36 2003 End
if(APointExist) {
ParamInit*=0.41234;
u_ = P.X() + ParamInit* T.X();
v_ = P.Y() + ParamInit* T.Y();
BRepAdaptor_Surface s;
s.Initialize(face,Standard_False);
s.D1(u_,v_,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
return(Standard_True);
} }
} }
if (aNbEdges == 1)
{
BRepClass_Edge AEdge (Edge, face);
FClassifier.Compare (AEdge, Edge.Orientation());
if (FClassifier.ClosestIntersection())
{
if (ParamInit > FClassifier.Parameter())
{
ParamInit = FClassifier.Parameter();
APointExist = Standard_True;
}
}
}
if (APointExist)
{
ParamInit *= 0.41234;
u_ = P.X() + ParamInit* T.X();
v_ = P.Y() + ParamInit* T.Y();
BRepAdaptor_Surface s;
s.Initialize (face, Standard_False);
s.D1 (u_, v_, APoint_, theVecD1U, theVecD1V);
return Standard_True;
}
} }
return(Standard_False); return Standard_False;
} }
//======================================================================= //=======================================================================
@ -180,8 +193,32 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
const Standard_Real U1, const Standard_Real U1,
const Standard_Real V1, const Standard_Real V1,
const Standard_Real U2, const Standard_Real U2,
const Standard_Real V2 ) const const Standard_Real V2) const
{ {
gp_Vec aVecD1U, aVecD1V;
return PointInTheFace (Face, APoint_, u_, v_, param_, IndexPoint, surf,
U1, V1, U2, V2, aVecD1U, aVecD1V);
}
//=======================================================================
//function : PointInTheFace
//purpose :
//=======================================================================
Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
(const TopoDS_Face& Face,
gp_Pnt& APoint_,
Standard_Real& u_, Standard_Real& v_,
Standard_Real& param_,
Standard_Integer& IndexPoint,
const Handle(BRepAdaptor_HSurface)& surf,
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2,
gp_Vec& theVecD1U,
gp_Vec& theVecD1V) const
{
Standard_Real u,du = (U2-U1)/6.0; Standard_Real u,du = (U2-U1)/6.0;
Standard_Real v,dv = (V2-V1)/6.0; Standard_Real v,dv = (V2-V1)/6.0;
if(du<1e-12) du=1e-12; if(du<1e-12) du=1e-12;
@ -202,8 +239,8 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
} }
@ -215,7 +252,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
@ -227,7 +264,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
@ -239,7 +276,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
@ -257,7 +294,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
@ -269,7 +306,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec); surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
return(Standard_True); return(Standard_True);
} }
@ -280,8 +317,9 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
else { else {
//printf("BRepClass3d_SolidExplorer Face not found ds the map \n"); //printf("BRepClass3d_SolidExplorer Face not found ds the map \n");
} }
return(BRepClass3d_SolidExplorer::FindAPointInTheFace(Face,APoint_,u_,v_,param_));
return BRepClass3d_SolidExplorer
::FindAPointInTheFace (Face,APoint_, u_, v_, param_, theVecD1U, theVecD1V);
} }
//======================================================================= //=======================================================================
@ -350,10 +388,14 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
Standard_Real& _Par) Standard_Real& _Par)
//modified by NIZNHY-PKV Thu Nov 14 14:34:10 2002 t //modified by NIZNHY-PKV Thu Nov 14 14:34:10 2002 t
{ {
const Standard_Real TolU = Precision::PConfusion();
const Standard_Real TolV = TolU;
TopoDS_Face face; TopoDS_Face face;
TopExp_Explorer faceexplorer; TopExp_Explorer faceexplorer;
//TopExp_Explorer edgeexplorer; //TopExp_Explorer edgeexplorer;
gp_Pnt APoint; gp_Pnt APoint;
gp_Vec aVecD1U, aVecD1V;
Standard_Real maxscal=0; Standard_Real maxscal=0;
Standard_Boolean ptfound=Standard_False; Standard_Boolean ptfound=Standard_False;
Standard_Real Par; Standard_Real Par;
@ -404,7 +446,6 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
// if(IsInfiniteUV(U1,V1,U2,V2)){//OCC454(apo)-> // if(IsInfiniteUV(U1,V1,U2,V2)){//OCC454(apo)->
GeomAdaptor_Surface GA(BRep_Tool::Surface(face)); GeomAdaptor_Surface GA(BRep_Tool::Surface(face));
static Standard_Real TolU = Precision::PConfusion(), TolV = TolU;
Extrema_ExtPS Ext(P,GA,TolU,TolV); Extrema_ExtPS Ext(P,GA,TolU,TolV);
if (Ext.IsDone() && Ext.NbExt() > 0) { if (Ext.IsDone() && Ext.NbExt() > 0) {
// evaluate the lower distance and its index; // evaluate the lower distance and its index;
@ -448,7 +489,6 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
_Par = V.Magnitude(); _Par = V.Magnitude();
L = gp_Lin(P,V); L = gp_Lin(P,V);
ptfound=Standard_True; ptfound=Standard_True;
numedg=0;
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f //modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
//return ; //return ;
return 0; return 0;
@ -461,36 +501,37 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
// find point in a face not too far from a projection of P on face // find point in a face not too far from a projection of P on face
// Modified by skv - Tue Sep 16 15:25:00 2003 OCC578 End // Modified by skv - Tue Sep 16 15:25:00 2003 OCC578 End
do { do {
if(PointInTheFace(face,APoint,_u,_v,myParamOnEdge,++IndexPoint,surf,U1,V1,U2,V2)) { if (PointInTheFace (face, APoint, _u, _v, myParamOnEdge, ++IndexPoint, surf,
NbPointsOK++; U1, V1, U2, V2,
gp_Vec V(P,APoint); aVecD1U, aVecD1V))
Par = V.Magnitude(); {
if(Par > gp::Resolution()) { ++NbPointsOK;
gp_Vec Norm=staticd1u_gp_vec.Crossed(staticd1v_gp_vec); gp_Vec V (P, APoint);
Standard_Real tt = Norm.Magnitude(); Par = V.Magnitude();
tt=Abs(Norm.Dot(V))/(tt*Par); if (Par > gp::Resolution())
if(tt>maxscal) { {
maxscal=tt; gp_Vec Norm = aVecD1U.Crossed (aVecD1V);
L = gp_Lin(P,V); Standard_Real tt = Norm.Magnitude();
_Par=Par; tt = Abs (Norm.Dot (V)) / (tt * Par);
ptfound=Standard_True; if (tt > maxscal)
if(maxscal>0.2) { {
myParamOnEdge=svmyparam; maxscal = tt;
numedg=0; L = gp_Lin (P, V);
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f _Par = Par;
//return ; ptfound = Standard_True;
return 0; if (maxscal>0.2)
//modified by NIZNHY-PKV Thu Nov 14 12:25:33 2002 t {
} myParamOnEdge=svmyparam;
} return 0;
} }
} }
}
}
} }
while(IndexPoint<200 && NbPointsOK<16); while(IndexPoint<200 && NbPointsOK<16);
myParamOnEdge=svmyparam; myParamOnEdge=svmyparam;
numedg=0;
if(maxscal>0.2) { if(maxscal>0.2) {
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f //modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
//return ; //return ;

View File

@ -45,11 +45,11 @@
#include <BRep_CurveRepresentation.hxx> #include <BRep_CurveRepresentation.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx> #include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TVertex.hxx> #include <BRep_TVertex.hxx>
#include <AdvApprox_ApproxAFunction.hxx>
#include <Approx_SameParameter.hxx> #include <Approx_SameParameter.hxx>
#include <TColgp_Array1OfPnt.hxx> #include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx> #include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_MapOfTransient.hxx> #include <TColStd_MapOfTransient.hxx>
#include <GeomAdaptor_Curve.hxx> #include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HCurve.hxx> #include <GeomAdaptor_HCurve.hxx>
@ -72,6 +72,7 @@
#include <Geom_BSplineSurface.hxx> #include <Geom_BSplineSurface.hxx>
// TODO - not thread-safe static variables
static Standard_Real thePrecision = Precision::Confusion(); static Standard_Real thePrecision = Precision::Confusion();
static Handle(Geom_Plane) thePlane; static Handle(Geom_Plane) thePlane;
@ -753,12 +754,8 @@ static void SetEdgeTol(const TopoDS_Edge& E,
else else
GP = Handle(Geom_Plane)::DownCast(S); GP = Handle(Geom_Plane)::DownCast(S);
static Handle(GeomAdaptor_HCurve) HC; Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve();
static Handle(GeomAdaptor_HSurface) HS; Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
if (HC.IsNull()) {
HC = new GeomAdaptor_HCurve();
HS = new GeomAdaptor_HSurface();
}
TopLoc_Location LC; TopLoc_Location LC;
Standard_Real First, Last; Standard_Real First, Last;
@ -942,14 +939,9 @@ void BRepLib::SameParameter(const TopoDS_Edge& AnEdge,
const Standard_Integer NCONTROL = 22; const Standard_Integer NCONTROL = 22;
static Handle(GeomAdaptor_HCurve) HC; Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve();
static Handle(Geom2dAdaptor_HCurve) HC2d; Handle(Geom2dAdaptor_HCurve) HC2d = new Geom2dAdaptor_HCurve();
static Handle(GeomAdaptor_HSurface) HS; Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
if(HC.IsNull()){
HC = new GeomAdaptor_HCurve();
HC2d = new Geom2dAdaptor_HCurve();
HS = new GeomAdaptor_HSurface();
}
GeomAdaptor_Curve& GAC = HC->ChangeCurve(); GeomAdaptor_Curve& GAC = HC->ChangeCurve();
Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d(); Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d();
GeomAdaptor_Surface& GAS = HS->ChangeSurface(); GeomAdaptor_Surface& GAS = HS->ChangeSurface();

View File

@ -100,11 +100,9 @@ static Standard_Boolean Project(const Handle(Geom2d_Curve)& C,
Standard_Real Eps2 = BRep_Tool::Tolerance(V); Standard_Real Eps2 = BRep_Tool::Tolerance(V);
Eps2 *= Eps2; Eps2 *= Eps2;
static Handle(Geom2dAdaptor_HCurve) HG2AHC; Handle(Geom2dAdaptor_HCurve) HG2AHC = new Geom2dAdaptor_HCurve();
if ( HG2AHC.IsNull() ) HG2AHC = new Geom2dAdaptor_HCurve();
HG2AHC->Set(C); HG2AHC->Set(C);
static Handle(GeomAdaptor_HSurface) HGAHS; Handle(GeomAdaptor_HSurface) HGAHS = new GeomAdaptor_HSurface();
if ( HGAHS.IsNull() ) HGAHS = new GeomAdaptor_HSurface();
HGAHS->Set(S); HGAHS->Set(S);
Adaptor3d_CurveOnSurface ACOS(HG2AHC,HGAHS); Adaptor3d_CurveOnSurface ACOS(HG2AHC,HGAHS);

View File

@ -18,11 +18,9 @@
// in TangExtendToConstraint; Continuity can be equal to 0 // in TangExtendToConstraint; Continuity can be equal to 0
// //
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#include <BSplCLib.ixx> #include <BSplCLib.ixx>
#include <PLib.hxx> #include <PLib.hxx>
#include <PLib_LocalArray.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
@ -40,51 +38,22 @@ typedef TColStd_Array1OfInteger Array1OfInteger;
class BSplCLib_LocalMatrix : public math_Matrix class BSplCLib_LocalMatrix : public math_Matrix
{ {
public: public:
BSplCLib_LocalMatrix (Standard_Integer DerivativeRequest, Standard_Integer Order) BSplCLib_LocalMatrix (Standard_Integer DerivativeRequest, Standard_Integer Order)
: math_Matrix (myBuffer, 1, DerivativeRequest + 1, 1, Order) : math_Matrix (myBuffer, 1, DerivativeRequest + 1, 1, Order)
{ {
if ( DerivativeRequest > BSplCLib::MaxDegree() || Standard_OutOfRange_Raise_if (DerivativeRequest > BSplCLib::MaxDegree() ||
Order > BSplCLib::MaxDegree()+1 || Order > BSplCLib::MaxDegree()+1 || BSplCLib::MaxDegree() > 25,
BSplCLib::MaxDegree() > 25 ) "BSplCLib: bspline degree is greater than maximum supported");
Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
} }
private: private:
// local buffer, to be sufficient for addressing by index [Degree+1][Degree+1] // local buffer, to be sufficient for addressing by index [Degree+1][Degree+1]
// (see math_Matrix implementation) // (see math_Matrix implementation)
Standard_Real myBuffer[27*27]; Standard_Real myBuffer[27*27];
}; };
//======================================================================= typedef PLib_LocalArray BSplCLib_LocalArray;
//class : BSplCLib_LocalArray
//purpose: Auxiliary class optimizing creation of array buffer for
// evaluation of bspline (using stack allocation for small arrays)
//=======================================================================
#define LOCARRAY_BUFFER 1024
class BSplCLib_LocalArray
{
public:
BSplCLib_LocalArray (Standard_Integer Size)
: myPtr(myBuffer)
{
if ( Size > LOCARRAY_BUFFER )
myPtr = (Standard_Real*)Standard::Allocate (Size * sizeof(Standard_Real));
}
~BSplCLib_LocalArray ()
{
if ( myPtr != myBuffer )
Standard::Free (*(Standard_Address*)&myPtr);
}
Standard_Real& operator [] (int i) { return myPtr[i]; }
private:
Standard_Real myBuffer[LOCARRAY_BUFFER];
Standard_Real* myPtr;
};
//======================================================================= //=======================================================================
//function : Hunt //function : Hunt
@ -4172,13 +4141,13 @@ void BSplCLib::Resolution( Standard_Real& Poles,
// purpose : // purpose :
//======================================================================= //=======================================================================
// array of flat knots for bezier curve of maximum 25 degree
static const Standard_Real knots[52] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
const Standard_Real& BSplCLib::FlatBezierKnots (const Standard_Integer Degree) const Standard_Real& BSplCLib::FlatBezierKnots (const Standard_Integer Degree)
{ {
if ( Degree < 1 || Degree > MaxDegree() || MaxDegree() != 25 ) Standard_OutOfRange_Raise_if (Degree < 1 || Degree > MaxDegree() || MaxDegree() != 25,
Standard_OutOfRange::Raise ("Bezier curve degree greater than maximal supported"); "Bezier curve degree greater than maximal supported");
// array of flat knots for bezier curve of maximum 25 degree
static Standard_Real knots[52] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
return knots[25-Degree]; return knots[25-Degree];
} }

View File

@ -4,9 +4,6 @@
// BSpline Curve in 2d space // BSpline Curve in 2d space
// ************************** // **************************
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#define Dimension_gen 2 #define Dimension_gen 2
#define Array1OfPoints TColgp_Array1OfPnt2d #define Array1OfPoints TColgp_Array1OfPnt2d
@ -38,4 +35,3 @@
#define BSplCLib_DataContainer BSplCLib_DataContainer_2d #define BSplCLib_DataContainer BSplCLib_DataContainer_2d
#include <BSplCLib_CurveComputation.gxx> #include <BSplCLib_CurveComputation.gxx>

View File

@ -6,9 +6,6 @@
// EvalBsplineBasis, // EvalBsplineBasis,
// EvalPolynomial : Horners method // EvalPolynomial : Horners method
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <BSplCLib.hxx> #include <BSplCLib.hxx>
@ -30,10 +27,11 @@
struct BSplCLib_DataContainer struct BSplCLib_DataContainer
{ {
BSplCLib_DataContainer(Standard_Integer Degree) BSplCLib_DataContainer(Standard_Integer Degree)
{ {
if ( Degree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25 ) Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree() ||
Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported"); BSplCLib::MaxDegree() > 25,
"BSplCLib: bspline degree is greater than maximum supported");
} }
Standard_Real poles[2*(25+1)]; Standard_Real poles[2*(25+1)];
@ -918,11 +916,11 @@ void BSplCLib::FunctionMultiply
for (ii = 1 ; ii <= num_new_poles ; ii++) { for (ii = 1 ; ii <= num_new_poles ; ii++) {
contact_order_array(ii) = 0 ; contact_order_array(ii) = 0 ;
(*FunctionPtr)(contact_order_array(ii), FunctionPtr.Evaluate (contact_order_array(ii),
start_end, start_end,
parameters(ii), parameters(ii),
result, result,
error_code) ; error_code);
if (error_code) { if (error_code) {
Status = 1 ; Status = 1 ;
goto FINISH ; goto FINISH ;
@ -1008,11 +1006,11 @@ void BSplCLib::FunctionReparameterise
for (ii = 1 ; ii <= num_new_poles ; ii++) { for (ii = 1 ; ii <= num_new_poles ; ii++) {
contact_order_array(ii) = 0 ; contact_order_array(ii) = 0 ;
(*FunctionPtr)(contact_order_array(ii), FunctionPtr.Evaluate (contact_order_array(ii),
start_end, start_end,
parameters(ii), parameters(ii),
result, result,
error_code) ; error_code);
if (error_code) { if (error_code) {
Status = 1 ; Status = 1 ;
goto FINISH ; goto FINISH ;

View File

@ -9,9 +9,6 @@
// BSpline Curve in 3d space // BSpline Curve in 3d space
// *************************** // ***************************
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#define Dimension_gen 3 #define Dimension_gen 3
#define Array1OfPoints TColgp_Array1OfPnt #define Array1OfPoints TColgp_Array1OfPnt
@ -47,4 +44,3 @@
#define BSplCLib_DataContainer BSplCLib_DataContainer_3d #define BSplCLib_DataContainer BSplCLib_DataContainer_3d
#include <BSplCLib_CurveComputation.gxx> #include <BSplCLib_CurveComputation.gxx>

View File

@ -11,9 +11,6 @@
#include <PLib.hxx> #include <PLib.hxx>
#include <math_Matrix.hxx> #include <math_Matrix.hxx>
#define No_Standard_RangeError
#define No_Standard_OutOfRange
//======================================================================= //=======================================================================
//struct : BSplCLib_DataContainer //struct : BSplCLib_DataContainer
//purpose: Auxiliary structure providing buffers for poles and knots used in //purpose: Auxiliary structure providing buffers for poles and knots used in
@ -24,8 +21,9 @@ struct BSplCLib_DataContainer
{ {
BSplCLib_DataContainer(Standard_Integer Degree) BSplCLib_DataContainer(Standard_Integer Degree)
{ {
if ( Degree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25 ) Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree() ||
Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported"); BSplCLib::MaxDegree() > 25,
"BSplCLib: bspline degree is greater than maximum supported");
} }
Standard_Real poles[(25+1)*(Dimension_gen+1)]; Standard_Real poles[(25+1)*(Dimension_gen+1)];
@ -1412,4 +1410,3 @@ void BSplCLib::FunctionReparameterise
array_of_new_poles[0], array_of_new_poles[0],
Status) ; Status) ;
} }

View File

@ -3,16 +3,9 @@
// Author: Xavier BENVENISTE // Author: Xavier BENVENISTE
// <xab@zozox.paris1.matra-dtv.fr> // <xab@zozox.paris1.matra-dtv.fr>
#ifndef _BSplCLib_EvaluatorFunction_HeaderFile #ifndef _BSplCLib_EvaluatorFunction_HeaderFile
#define _BSplCLib_EvaluatorFunction_HeaderFile #define _BSplCLib_EvaluatorFunction_HeaderFile
// File: AdvApprox_EvaluatorFunction.hxx
// Created: Mon May 29 17:04:50 1995
// Author: Xavier BENVENISTE
// <xab@nonox>
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
@ -22,18 +15,43 @@
#ifndef _Standard_PrimitiveTypes_HeaderFile #ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx> #include <Standard_PrimitiveTypes.hxx>
#endif #endif
typedef void (* BSplCLib_EvaluatorFunction) (const Standard_Integer ,
// Derivative Request
const Standard_Real *,
// StartEnd[2]
const Standard_Real ,
// Parameter
Standard_Real &,
// Result
Standard_Integer & ) ;
// Error Code
// History - C function pointer converted to a virtual class
// in order to get rid of usage of static functions and static data
class BSplCLib_EvaluatorFunction
{
public:
//! Empty constructor
BSplCLib_EvaluatorFunction () {}
//! Destructor should be declared as virtual
virtual ~BSplCLib_EvaluatorFunction () {}
//! Function evaluation method to be defined by descendant
virtual void Evaluate (const Standard_Integer theDerivativeRequest,
const Standard_Real* theStartEnd,
const Standard_Real theParameter,
Standard_Real& theResult,
Standard_Integer& theErrorCode) const = 0;
//! Shortcut for function-call style usage
void operator () (const Standard_Integer theDerivativeRequest,
const Standard_Real* theStartEnd,
const Standard_Real theParameter,
Standard_Real& theResult,
Standard_Integer& theErrorCode) const
{
Evaluate (theDerivativeRequest, theStartEnd, theParameter, theResult, theErrorCode);
}
private:
//! Copy constructor is declared private to forbid copying
BSplCLib_EvaluatorFunction (const BSplCLib_EvaluatorFunction&) {}
//! Assignment operator is declared private to forbid copying
void operator = (const BSplCLib_EvaluatorFunction&) {}
};
#endif #endif

View File

@ -9,11 +9,9 @@
// pmn 07-10-96 : Correction de DN dans le cas rationnal. // pmn 07-10-96 : Correction de DN dans le cas rationnal.
// pmn 06-02-97 : Correction des poids dans RationalDerivative. (PRO700) // pmn 06-02-97 : Correction des poids dans RationalDerivative. (PRO700)
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#include <BSplSLib.ixx> #include <BSplSLib.ixx>
#include <PLib.hxx> #include <PLib.hxx>
#include <PLib_LocalArray.hxx>
#include <BSplCLib.hxx> #include <BSplCLib.hxx>
#include <TColgp_Array2OfXYZ.hxx> #include <TColgp_Array2OfXYZ.hxx>
#include <TColgp_Array1OfXYZ.hxx> #include <TColgp_Array1OfXYZ.hxx>
@ -23,7 +21,7 @@
#include <math_Matrix.hxx> #include <math_Matrix.hxx>
// for null derivatives // for null derivatives
static Standard_Real BSplSLib_zero[3] = {0.,0.,0.}; static Standard_Real BSplSLib_zero[3] = {0.0, 0.0, 0.0};
#ifdef WNT #ifdef WNT
#define M_SQRT2 1.4142135623730950488016887 #define M_SQRT2 1.4142135623730950488016887
#endif #endif
@ -34,14 +32,13 @@ static Standard_Real BSplSLib_zero[3] = {0.,0.,0.};
// evaluation of bspline (allocated in the stack) // evaluation of bspline (allocated in the stack)
//======================================================================= //=======================================================================
struct BSplSLib_DataContainer struct BSplSLib_DataContainer
{ {
BSplSLib_DataContainer (Standard_Integer UDegree, Standard_Integer VDegree) BSplSLib_DataContainer (Standard_Integer UDegree, Standard_Integer VDegree)
{ {
if ( UDegree > BSplCLib::MaxDegree() || Standard_OutOfRange_Raise_if (UDegree > BSplCLib::MaxDegree() ||
VDegree > BSplCLib::MaxDegree() || VDegree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25,
BSplCLib::MaxDegree() != 25 ) "BSplSLib: bspline degree is greater than maximum supported");
Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
} }
Standard_Real poles[4*(25+1)*(25+1)]; Standard_Real poles[4*(25+1)*(25+1)];
@ -50,35 +47,7 @@ struct BSplSLib_DataContainer
Standard_Real ders[48]; Standard_Real ders[48];
}; };
//======================================================================= typedef PLib_LocalArray BSplSLib_LocalArray;
//class : BSplSLib_LocalArray
//purpose: Auxiliary class optimizing creation of array buffer for
// evaluation of bspline (using stack allocation for small arrays)
//=======================================================================
#define LOCARRAY_BUFFER 1024
class BSplSLib_LocalArray
{
public:
BSplSLib_LocalArray (Standard_Integer Size)
: myPtr(myBuffer)
{
if ( Size > LOCARRAY_BUFFER )
myPtr = (Standard_Real*)Standard::Allocate (Size * sizeof(Standard_Real));
}
~BSplSLib_LocalArray ()
{
if ( myPtr != myBuffer )
Standard::Free (*(Standard_Address*)&myPtr);
}
operator Standard_Real* () { return myPtr; }
private:
Standard_Real myBuffer[LOCARRAY_BUFFER];
Standard_Real* myPtr;
};
//************************************************************************** //**************************************************************************
// Evaluation methods // Evaluation methods
@ -211,8 +180,6 @@ void BSplSLib::RationalDerivative(const Standard_Integer UDeg,
iiM1 = - M1; iiM1 = - M1;
iiM3 = - M3; iiM3 = - M3;
PLib::Binomial(N);
PLib::Binomial(M);
for (ii = 0 ; ii <= N ; ii++) { for (ii = 0 ; ii <= N ; ii++) {
iiM1 += M1; iiM1 += M1;
@ -3316,7 +3283,7 @@ void BSplSLib::FunctionMultiply
NewDenominator(ii,jj), NewDenominator(ii,jj),
NewNumerator(ii,jj)) ; NewNumerator(ii,jj)) ;
Function(0, Function.Evaluate (0,
UParameters(ii), UParameters(ii),
VParameters(jj), VParameters(jj),
result, result,
@ -3345,4 +3312,3 @@ void BSplSLib::FunctionMultiply
Standard_ConstructionError::Raise(); Standard_ConstructionError::Raise();
} }
} }

View File

@ -3,11 +3,9 @@
// Author: Xavier BENVENISTE // Author: Xavier BENVENISTE
// <xab@zozox.paris1.matra-dtv.fr> // <xab@zozox.paris1.matra-dtv.fr>
#ifndef _BSplSLib_EvaluatorFunction_HeaderFile #ifndef _BSplSLib_EvaluatorFunction_HeaderFile
#define _BSplSLib_EvaluatorFunction_HeaderFile #define _BSplSLib_EvaluatorFunction_HeaderFile
#ifndef _Standard_Integer_HeaderFile #ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#endif #endif
@ -17,21 +15,43 @@
#ifndef _Standard_PrimitiveTypes_HeaderFile #ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx> #include <Standard_PrimitiveTypes.hxx>
#endif #endif
typedef void (* BSplSLib_EvaluatorFunction) (const Standard_Integer ,
// Derivative Request
const Standard_Real ,
// UParameter
const Standard_Real ,
// VParameter
Standard_Real &,
// Result
Standard_Integer & ) ;
// Error Code
// Histroy - C function pointer converted to a virtual class
// in order to get rid of usage of static functions and static data
class BSplSLib_EvaluatorFunction
{
public:
//! Empty constructor
BSplSLib_EvaluatorFunction () {}
//! Destructor should be declared as virtual
virtual ~BSplSLib_EvaluatorFunction () {}
//! Function evaluation method to be defined by descendant
virtual void Evaluate (const Standard_Integer theDerivativeRequest,
const Standard_Real theUParameter,
const Standard_Real theVParameter,
Standard_Real& theResult,
Standard_Integer& theErrorCode) const = 0;
//! Shortcut for function-call style usage
void operator () (const Standard_Integer theDerivativeRequest,
const Standard_Real theUParameter,
const Standard_Real theVParameter,
Standard_Real& theResult,
Standard_Integer& theErrorCode) const
{
Evaluate (theDerivativeRequest, theUParameter, theVParameter, theResult, theErrorCode);
}
private:
//! Copy constructor is declared private to forbid copying
BSplSLib_EvaluatorFunction (const BSplSLib_EvaluatorFunction&) {}
//! Assignment operator is declared private to forbid copying
void operator = (const BSplSLib_EvaluatorFunction&) {}
};
#endif #endif

View File

@ -382,8 +382,6 @@ gp_Vec CSLib::DNNUV(const Standard_Integer Nu,
{ {
Standard_Integer i,j; Standard_Integer i,j;
gp_Vec D(0,0,0),VG,VD,PV; gp_Vec D(0,0,0),VG,VD,PV;
PLib::Binomial(Nu);
PLib::Binomial(Nv);
for(i=0;i<=Nu;i++) for(i=0;i<=Nu;i++)
for(j=0;j<=Nv;j++){ for(j=0;j<=Nv;j++){
VG=DerSurf.Value(i+1,j); VG=DerSurf.Value(i+1,j);
@ -406,8 +404,6 @@ gp_Vec CSLib::DNNUV(const Standard_Integer Nu,
{ {
Standard_Integer i,j; Standard_Integer i,j;
gp_Vec D(0,0,0),VG,VD,PV; gp_Vec D(0,0,0),VG,VD,PV;
PLib::Binomial(Nu);
PLib::Binomial(Nv);
for(i=0;i<=Nu;i++) for(i=0;i<=Nu;i++)
for(j=0;j<=Nv;j++){ for(j=0;j<=Nv;j++){
VG=DerSurf1.Value(i+1,j); VG=DerSurf1.Value(i+1,j);
@ -441,8 +437,6 @@ DerVecNor.SetValue(0,0,DerNor);
Dnorm=DerNUV.Value(Iduref,Idvref)*DerVecNor.Value(0,0); Dnorm=DerNUV.Value(Iduref,Idvref)*DerVecNor.Value(0,0);
TabNorm.SetValue(0,0,Dnorm); TabNorm.SetValue(0,0,Dnorm);
TabScal.SetValue(0,0,0.); TabScal.SetValue(0,0,0.);
PLib::Binomial(Kderiv + Iduref);
PLib::Binomial(Kderiv + Idvref);
for ( Mderiv = 1;Mderiv <= Kderiv; Mderiv++) for ( Mderiv = 1;Mderiv <= Kderiv; Mderiv++)
for ( Pderiv = 0 ; Pderiv <= Mderiv ; Pderiv++) for ( Pderiv = 0 ; Pderiv <= Mderiv ; Pderiv++)
{ {

View File

@ -27,7 +27,6 @@ Standard_Boolean CSLib_NormalPolyDef::Value(const Standard_Real X,
Standard_Real co,si; Standard_Real co,si;
co=cos(X); co=cos(X);
si=sin(X); si=sin(X);
PLib::Binomial(myK0);
for(Standard_Integer i=0;i<=myK0;i++){ for(Standard_Integer i=0;i<=myK0;i++){
F=F+PLib::Bin(myK0,i)*pow(co,i)*pow(si,(myK0-i))*myTABli(i); F=F+PLib::Bin(myK0,i)*pow(co,i)*pow(si,(myK0-i))*myTABli(i);

View File

@ -473,33 +473,45 @@ const Convert_ParameterisationType Parameterisation)
return TheCurve; return TheCurve;
} }
//======================================================================= //=======================================================================
//function : law_evaluator //class : law_evaluator
//purpose : //purpose :
//======================================================================= //=======================================================================
static Handle(Geom2d_BSplineCurve) Ancore = NULL ; class Geom2dConvert_law_evaluator : public BSplCLib_EvaluatorFunction
{
public:
Geom2dConvert_law_evaluator (const Handle(Geom2d_BSplineCurve)& theAncore)
: myAncore (theAncore) {}
virtual void Evaluate (const Standard_Integer theDerivativeRequest,
const Standard_Real* theStartEnd,
const Standard_Real theParameter,
Standard_Real& theResult,
Standard_Integer& theErrorCode) const
{
theErrorCode = 0;
if (!myAncore.IsNull() &&
theParameter >= theStartEnd[0] &&
theParameter <= theStartEnd[1] &&
theDerivativeRequest == 0)
{
gp_Pnt2d aPoint;
myAncore->D0 (theParameter, aPoint);
theResult = aPoint.Coord (2);
}
else
theErrorCode = 1;
}
private:
Handle(Geom2d_BSplineCurve) myAncore;
};
static void law_evaluator(const Standard_Integer DerivativeRequest,
const Standard_Real *StartEnd,
const Standard_Real Parameter,
Standard_Real & Result,
Standard_Integer & ErrorCode)
{ErrorCode = 0 ;
if (!Ancore.IsNull() &&
Parameter >= StartEnd[0] &&
Parameter <= StartEnd[1] &&
DerivativeRequest == 0){
gp_Pnt2d a_point ;
Ancore->D0(Parameter,
a_point) ;
Result = a_point.Coord(2) ;
}
else
ErrorCode = 1 ;
}
//======================================================================= //=======================================================================
//function : MultNumandDenom //function : MultNumandDenom
@ -539,7 +551,7 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
a->Poles(aPoles); a->Poles(aPoles);
a->Multiplicities(aMults); a->Multiplicities(aMults);
BSplCLib::Reparametrize(BS->FirstParameter(),BS->LastParameter(),aKnots); BSplCLib::Reparametrize(BS->FirstParameter(),BS->LastParameter(),aKnots);
Ancore= new Geom2d_BSplineCurve(aPoles,aKnots,aMults,a->Degree()); Handle(Geom2d_BSplineCurve) anAncore = new Geom2d_BSplineCurve (aPoles, aKnots, aMults, a->Degree());
BSplCLib::MergeBSplineKnots(tolerance,start_value,end_value, BSplCLib::MergeBSplineKnots(tolerance,start_value,end_value,
a->Degree(),aKnots,aMults, a->Degree(),aKnots,aMults,
@ -555,7 +567,7 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
for (jj=1;jj<=2;jj++) for (jj=1;jj<=2;jj++)
BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii)); BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii));
//POP pour NT //POP pour NT
BSplCLib_EvaluatorFunction ev = law_evaluator; Geom2dConvert_law_evaluator ev (anAncore);
BSplCLib::FunctionMultiply(ev, BSplCLib::FunctionMultiply(ev,
BS->Degree(), BS->Degree(),
BSFlatKnots, BSFlatKnots,
@ -899,27 +911,40 @@ static GeomAbs_Shape Continuity(const Handle(Geom2d_Curve)& C1,
} }
//======================================================================= //=======================================================================
//function :reparameterise_evaluator //class :reparameterise_evaluator
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Real polynomial_coefficient[3] ; class Geom2dConvert_reparameterise_evaluator : public BSplCLib_EvaluatorFunction
{
static void reparameterise_evaluator( public:
const Standard_Integer DerivativeRequest,
// const Standard_Real *StartEnd, Geom2dConvert_reparameterise_evaluator (const Standard_Real thePolynomialCoefficient[3])
const Standard_Real *, {
const Standard_Real Parameter, memcpy(myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient));
Standard_Real & Result, }
Standard_Integer & ErrorCode) {
ErrorCode = 0 ; virtual void Evaluate (const Standard_Integer theDerivativeRequest,
PLib::EvalPolynomial(Parameter, const Standard_Real* /*theStartEnd*/,
DerivativeRequest, const Standard_Real theParameter,
2, Standard_Real& theResult,
1, Standard_Integer& theErrorCode) const
polynomial_coefficient[0], {
Result) ; theErrorCode = 0;
} PLib::EvalPolynomial (theParameter,
theDerivativeRequest,
2,
1,
*((Standard_Real* )myPolynomialCoefficient), // function really only read values from this array
theResult);
}
private:
Standard_Real myPolynomialCoefficient[3];
};
//======================================================================= //=======================================================================
//function : ConcatG1 //function : ConcatG1
@ -1001,6 +1026,8 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
index=0; index=0;
Pretreatment(ArrayOfCurves); Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
indexmin=Indexmin(ArrayOfCurves); indexmin=Indexmin(ArrayOfCurves);
if (indexmin!=(ArrayOfCurves.Length()-1)) if (indexmin!=(ArrayOfCurves.Length()-1))
@ -1025,11 +1052,11 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax); a=(lambda*lambda2-1)/(2*lambda*tmax);
polynomial_coefficient[2]=a; aPolynomialCoefficient[2] = a;
b=(1/lambda); b=(1/lambda);
polynomial_coefficient[1]=b; aPolynomialCoefficient[1] = b;
c=umin; c=umin;
polynomial_coefficient[0]=c; aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1); TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots()); TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults); Curve1->Multiplicities(KnotC1Mults);
@ -1056,7 +1083,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
for (jj=1;jj<=2;jj++) for (jj=1;jj<=2;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii)); Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour NT //POP pour NT
BSplCLib_EvaluatorFunction ev = reparameterise_evaluator; Geom2dConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
BSplCLib::FunctionReparameterise(ev, BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(), Curve1->Degree(),
Curve1FlatKnots, Curve1FlatKnots,
@ -1246,6 +1273,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
Standard_Integer k=0; Standard_Integer k=0;
index=0; index=0;
Pretreatment(ArrayOfCurves); Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
ArrayOfIndices->SetValue(0,0); ArrayOfIndices->SetValue(0,0);
@ -1280,11 +1308,11 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax); a=(lambda*lambda2-1)/(2*lambda*tmax);
polynomial_coefficient[2]=a; aPolynomialCoefficient[2] = a;
b=(1/lambda); b=(1/lambda);
polynomial_coefficient[1]=b; aPolynomialCoefficient[1] = b;
c=umin; c=umin;
polynomial_coefficient[0]=c; aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1); TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots()); TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults); Curve1->Multiplicities(KnotC1Mults);
@ -1311,7 +1339,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
for (jj=1;jj<=2;jj++) for (jj=1;jj<=2;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii)); Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour NT //POP pour NT
BSplCLib_EvaluatorFunction ev = reparameterise_evaluator; Geom2dConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
// BSplCLib::FunctionReparameterise(reparameterise_evaluator, // BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev, BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(), Curve1->Degree(),

View File

@ -475,30 +475,43 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve
//======================================================================= //=======================================================================
//function : law_evaluator //class : law_evaluator
//purpose : usefull to estimate the value of a function //purpose : usefull to estimate the value of a function
//======================================================================= //=======================================================================
static Handle(Geom2d_BSplineCurve) Ancore = NULL ; class GeomConvert_law_evaluator : public BSplCLib_EvaluatorFunction
{
static void law_evaluator(const Standard_Integer DerivativeRequest, public:
const Standard_Real *StartEnd,
const Standard_Real Parameter, GeomConvert_law_evaluator (const Handle(Geom2d_BSplineCurve)& theAncore)
Standard_Real & Result, : myAncore (theAncore) {}
Standard_Integer & ErrorCode)
{ErrorCode = 0 ; virtual void Evaluate (const Standard_Integer theDerivativeRequest,
if (!Ancore.IsNull() && const Standard_Real* theStartEnd,
Parameter >= StartEnd[0] && const Standard_Real theParameter,
Parameter <= StartEnd[1] && Standard_Real& theResult,
DerivativeRequest == 0){ Standard_Integer& theErrorCode) const
gp_Pnt2d a_point ; {
Ancore->D0(Parameter, theErrorCode = 0;
a_point) ; if (!myAncore.IsNull() &&
Result = a_point.Coord(2) ; theParameter >= theStartEnd[0] &&
} theParameter <= theStartEnd[1] &&
else theDerivativeRequest == 0)
ErrorCode = 1 ; {
} gp_Pnt2d aPoint;
myAncore->D0 (theParameter, aPoint);
theResult = aPoint.Coord(2);
}
else
theErrorCode = 1;
}
private:
Handle(Geom2d_BSplineCurve) myAncore;
};
//======================================================================= //=======================================================================
//function : MultNumandDenom //function : MultNumandDenom
@ -540,7 +553,7 @@ static Handle(Geom_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCurv
a->Poles(aPoles); a->Poles(aPoles);
a->Multiplicities(aMults); a->Multiplicities(aMults);
BSplCLib::Reparametrize(BS->FirstParameter(),BS->LastParameter(),aKnots); BSplCLib::Reparametrize(BS->FirstParameter(),BS->LastParameter(),aKnots);
Ancore= new Geom2d_BSplineCurve(aPoles,aKnots,aMults,a->Degree()); //call of the law-evaluator Handle(Geom2d_BSplineCurve) anAncore = new Geom2d_BSplineCurve (aPoles, aKnots, aMults, a->Degree());
BSplCLib::MergeBSplineKnots(tolerance,start_value,end_value, //merge of the knots BSplCLib::MergeBSplineKnots(tolerance,start_value,end_value, //merge of the knots
a->Degree(),aKnots,aMults, a->Degree(),aKnots,aMults,
@ -556,8 +569,8 @@ static Handle(Geom_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCurv
for (jj=1;jj<=3;jj++) for (jj=1;jj<=3;jj++)
BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii)); BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii));
//POP pour WNT //POP pour WNT
BSplCLib_EvaluatorFunction ev = law_evaluator; GeomConvert_law_evaluator ev (anAncore);
BSplCLib::FunctionMultiply(ev, BSplCLib::FunctionMultiply(ev,
BS->Degree(), BS->Degree(),
BSFlatKnots, BSFlatKnots,
@ -727,27 +740,40 @@ static void ReorderArrayOfG1Curves(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
} }
//======================================================================= //=======================================================================
//function :reparameterise_evaluator //class : reparameterise_evaluator
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Real polynomial_coefficient[3] ; class GeomConvert_reparameterise_evaluator : public BSplCLib_EvaluatorFunction
{
static void reparameterise_evaluator( public:
const Standard_Integer DerivativeRequest,
// const Standard_Real *StartEnd, GeomConvert_reparameterise_evaluator (const Standard_Real thePolynomialCoefficient[3])
const Standard_Real *, {
const Standard_Real Parameter, memcpy (myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient));
Standard_Real & Result, }
Standard_Integer & ErrorCode) {
ErrorCode = 0 ; virtual void Evaluate (const Standard_Integer theDerivativeRequest,
PLib::EvalPolynomial(Parameter, const Standard_Real* /*theStartEnd*/,
DerivativeRequest, const Standard_Real theParameter,
2, Standard_Real& theResult,
1, Standard_Integer& theErrorCode) const
polynomial_coefficient[0], {
Result) ; theErrorCode = 0;
} PLib::EvalPolynomial (theParameter,
theDerivativeRequest,
2,
1,
*((Standard_Real* )myPolynomialCoefficient), // function really only read values from this array
theResult);
}
private:
Standard_Real myPolynomialCoefficient[3];
};
//======================================================================= //=======================================================================
//function : ConcatG1 //function : ConcatG1
@ -825,6 +851,7 @@ static void reparameterise_evaluator(
index=0; index=0;
Pretreatment(ArrayOfCurves); Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
indexmin=Indexmin(ArrayOfCurves); indexmin=Indexmin(ArrayOfCurves);
@ -850,11 +877,11 @@ static void reparameterise_evaluator(
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax); a=(lambda*lambda2-1)/(2*lambda*tmax);
polynomial_coefficient[2]=a; aPolynomialCoefficient[2] = a;
b=(1/lambda); b=(1/lambda);
polynomial_coefficient[1]=b; aPolynomialCoefficient[1] = b;
c=umin; c=umin;
polynomial_coefficient[0]=c; aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1); TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots()); TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults); Curve1->Multiplicities(KnotC1Mults);
@ -881,7 +908,7 @@ static void reparameterise_evaluator(
for (jj=1;jj<=3;jj++) for (jj=1;jj<=3;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii)); Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour WNT //POP pour WNT
BSplCLib_EvaluatorFunction ev = reparameterise_evaluator; GeomConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
// BSplCLib::FunctionReparameterise(reparameterise_evaluator, // BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev, BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(), Curve1->Degree(),
@ -1052,6 +1079,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
Standard_Integer k=0; Standard_Integer k=0;
index=0; index=0;
Pretreatment(ArrayOfCurves); Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
ArrayOfIndices->SetValue(0,0); ArrayOfIndices->SetValue(0,0);
@ -1085,11 +1113,11 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter(); umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2); tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax); a=(lambda*lambda2-1)/(2*lambda*tmax);
polynomial_coefficient[2]=a; aPolynomialCoefficient[2] = a;
b=(1/lambda); b=(1/lambda);
polynomial_coefficient[1]=b; aPolynomialCoefficient[1] = b;
c=umin; c=umin;
polynomial_coefficient[0]=c; aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1); TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots()); TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults); Curve1->Multiplicities(KnotC1Mults);
@ -1116,7 +1144,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
for (jj=1;jj<=3;jj++) for (jj=1;jj<=3;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii)); Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour WNT //POP pour WNT
BSplCLib_EvaluatorFunction ev = reparameterise_evaluator; GeomConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
BSplCLib::FunctionReparameterise(ev, BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(), Curve1->Degree(),

View File

@ -8,9 +8,34 @@
#include <TColStd_HArray1OfReal.hxx> #include <TColStd_HArray1OfReal.hxx>
#include <AdvApprox_PrefAndRec.hxx> #include <AdvApprox_PrefAndRec.hxx>
static Handle(Adaptor3d_HSurface) fonct; class GeomConvert_ApproxSurface_Eval : public AdvApp2Var_EvaluatorFunc2Var
{
extern "C" void mySurfEval1(Standard_Integer * Dimension, public:
GeomConvert_ApproxSurface_Eval (const Handle(Adaptor3d_HSurface)& theAdaptor)
: myAdaptor (theAdaptor) {}
virtual void Evaluate (Standard_Integer* theDimension,
Standard_Real* theUStartEnd,
Standard_Real* theVStartEnd,
Standard_Integer* theFavorIso,
Standard_Real* theConstParam,
Standard_Integer* theNbParams,
Standard_Real* theParameters,
Standard_Integer* theUOrder,
Standard_Integer* theVOrder,
Standard_Real* theResult,
Standard_Integer* theErrorCode) const;
private:
mutable Handle(Adaptor3d_HSurface) myAdaptor;
};
void GeomConvert_ApproxSurface_Eval::Evaluate (Standard_Integer * Dimension,
// Dimension // Dimension
Standard_Real * UStartEnd, Standard_Real * UStartEnd,
// StartEnd[2] in U // StartEnd[2] in U
@ -30,7 +55,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
// Derivative Request in V // Derivative Request in V
Standard_Real * Result, Standard_Real * Result,
// Result[Dimension,N] // Result[Dimension,N]
Standard_Integer * ErrorCode) Standard_Integer * ErrorCode) const
// Error Code // Error Code
{ {
*ErrorCode = 0; *ErrorCode = 0;
@ -71,8 +96,8 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
// Initialisation // Initialisation
fonct = fonct->UTrim(UStartEnd[0], UStartEnd[1], Precision::PConfusion()); myAdaptor = myAdaptor->UTrim (UStartEnd[0], UStartEnd[1], Precision::PConfusion());
fonct = fonct->VTrim(VStartEnd[0], VStartEnd[1], Precision::PConfusion()); myAdaptor = myAdaptor->VTrim (VStartEnd[0], VStartEnd[1], Precision::PConfusion());
/* /*
for (idim=1;idim<=*Dimension;idim++) { for (idim=1;idim<=*Dimension;idim++) {
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
@ -91,7 +116,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 0 : case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar); pnt = myAdaptor->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X(); Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y(); Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z(); Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
@ -100,7 +125,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 1 : case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2); myAdaptor->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) { if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X(); Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y(); Result[1+(jpar-1)*(*Dimension)] = v1.Y();
@ -116,7 +141,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 2 : case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5); myAdaptor->D2 (Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X(); Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y(); Result[1+(jpar-1)*(*Dimension)] = v3.Y();
@ -137,7 +162,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 3 : case 3 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
fonct->D3(Upar, Vpar, pnt, v1, v2, v3, v4, v5, v6, v7, v8, v9); myAdaptor->D3 (Upar, Vpar, pnt, v1, v2, v3, v4, v5, v6, v7, v8, v9);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v8.X(); Result[(jpar-1)*(*Dimension)] = v8.X();
Result[1+(jpar-1)*(*Dimension)] = v8.Y(); Result[1+(jpar-1)*(*Dimension)] = v8.Y();
@ -153,7 +178,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 4 : case 4 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
vect = fonct->DN(Upar, Vpar, *UOrder, *VOrder); vect = myAdaptor->DN (Upar, Vpar, *UOrder, *VOrder);
Result[(jpar-1)*(*Dimension)] = vect.X(); Result[(jpar-1)*(*Dimension)] = vect.X();
Result[1+(jpar-1)*(*Dimension)] = vect.Y(); Result[1+(jpar-1)*(*Dimension)] = vect.Y();
Result[2+(jpar-1)*(*Dimension)] = vect.Z(); Result[2+(jpar-1)*(*Dimension)] = vect.Z();
@ -167,7 +192,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 0 : case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar); pnt = myAdaptor->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X(); Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y(); Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z(); Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
@ -176,7 +201,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 1 : case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2); myAdaptor->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) { if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X(); Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y(); Result[1+(jpar-1)*(*Dimension)] = v1.Y();
@ -192,7 +217,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 2 : case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5); myAdaptor->D2 (Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X(); Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y(); Result[1+(jpar-1)*(*Dimension)] = v3.Y();
@ -213,7 +238,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 3 : case 3 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
fonct->D3(Upar, Vpar, pnt, v1, v2, v3, v4, v5, v6, v7, v8, v9); myAdaptor->D3 (Upar, Vpar, pnt, v1, v2, v3, v4, v5, v6, v7, v8, v9);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v8.X(); Result[(jpar-1)*(*Dimension)] = v8.X();
Result[1+(jpar-1)*(*Dimension)] = v8.Y(); Result[1+(jpar-1)*(*Dimension)] = v8.Y();
@ -229,7 +254,7 @@ extern "C" void mySurfEval1(Standard_Integer * Dimension,
case 4 : case 4 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
vect = fonct->DN(Upar, Vpar, *UOrder, *VOrder); vect = myAdaptor->DN (Upar, Vpar, *UOrder, *VOrder);
Result[(jpar-1)*(*Dimension)] = vect.X(); Result[(jpar-1)*(*Dimension)] = vect.X();
Result[1+(jpar-1)*(*Dimension)] = vect.Y(); Result[1+(jpar-1)*(*Dimension)] = vect.Y();
Result[2+(jpar-1)*(*Dimension)] = vect.Z(); Result[2+(jpar-1)*(*Dimension)] = vect.Z();
@ -255,9 +280,9 @@ GeomConvert_ApproxSurface::GeomConvert_ApproxSurface(const Handle(Geom_Surface)&
const Standard_Integer MaxSegments, const Standard_Integer MaxSegments,
const Standard_Integer PrecisCode) const Standard_Integer PrecisCode)
{ {
Standard_Real U0, U1, V0, V1; Standard_Real U0, U1, V0, V1;
fonct = new (GeomAdaptor_HSurface)(Surf); // Initialisation de la surface algorithmique Handle(Adaptor3d_HSurface) aSurfAdaptor = new GeomAdaptor_HSurface (Surf);
Surf->Bounds(U0, U1, V0, V1); Surf->Bounds(U0, U1, V0, V1);
// " Init des nombres de sous-espaces et des tolerances" // " Init des nombres de sous-espaces et des tolerances"
@ -285,27 +310,27 @@ GeomConvert_ApproxSurface::GeomConvert_ApproxSurface(const Handle(Geom_Surface)&
GeomAbs_IsoType IsoType = GeomAbs_IsoV; GeomAbs_IsoType IsoType = GeomAbs_IsoV;
Standard_Integer NbDec; Standard_Integer NbDec;
NbDec = fonct->NbUIntervals(GeomAbs_C2); NbDec = aSurfAdaptor->NbUIntervals(GeomAbs_C2);
TColStd_Array1OfReal UDec_C2(1, NbDec+1); TColStd_Array1OfReal UDec_C2(1, NbDec+1);
fonct->UIntervals(UDec_C2, GeomAbs_C2); aSurfAdaptor->UIntervals(UDec_C2, GeomAbs_C2);
NbDec = fonct->NbVIntervals(GeomAbs_C2); NbDec = aSurfAdaptor->NbVIntervals(GeomAbs_C2);
TColStd_Array1OfReal VDec_C2(1, NbDec+1); TColStd_Array1OfReal VDec_C2(1, NbDec+1);
fonct->VIntervals(VDec_C2, GeomAbs_C2); aSurfAdaptor->VIntervals(VDec_C2, GeomAbs_C2);
NbDec = fonct->NbUIntervals(GeomAbs_C3); NbDec = aSurfAdaptor->NbUIntervals(GeomAbs_C3);
TColStd_Array1OfReal UDec_C3(1, NbDec+1); TColStd_Array1OfReal UDec_C3(1, NbDec+1);
fonct->UIntervals(UDec_C3, GeomAbs_C3); aSurfAdaptor->UIntervals(UDec_C3, GeomAbs_C3);
NbDec = fonct->NbVIntervals(GeomAbs_C3); NbDec = aSurfAdaptor->NbVIntervals(GeomAbs_C3);
TColStd_Array1OfReal VDec_C3(1, NbDec+1); TColStd_Array1OfReal VDec_C3(1, NbDec+1);
fonct->VIntervals(VDec_C3, GeomAbs_C3); aSurfAdaptor->VIntervals(VDec_C3, GeomAbs_C3);
// Approximation avec decoupe preferentiel // Approximation avec decoupe preferentiel
// aux lieux de discontinuitees C2 // aux lieux de discontinuitees C2
AdvApprox_PrefAndRec pUDec(UDec_C2,UDec_C3); AdvApprox_PrefAndRec pUDec(UDec_C2,UDec_C3);
AdvApprox_PrefAndRec pVDec(VDec_C2,VDec_C3); AdvApprox_PrefAndRec pVDec(VDec_C2,VDec_C3);
//POP pour WNT //POP pour WNT
AdvApp2Var_EvaluatorFunc2Var ev = mySurfEval1; GeomConvert_ApproxSurface_Eval ev (aSurfAdaptor);
AdvApp2Var_ApproxAFunc2Var approx(nb1, nb2, nb3, AdvApp2Var_ApproxAFunc2Var approx(nb1, nb2, nb3,
nul1,nul1,eps3D, nul1,nul1,eps3D,
nul2,nul2,epsfr, nul2,nul2,epsfr,

View File

@ -1963,29 +1963,41 @@ static Standard_Boolean CanBeTreated(Handle(Geom_BSplineSurface)& BSurf)
} }
//======================================================================= //=======================================================================
//function : law_evaluator //class : law_evaluator
//purpose : usefull to estimate the value of a function of 2 variables //purpose : usefull to estimate the value of a function of 2 variables
//======================================================================= //=======================================================================
static GeomLib_DenominatorMultiplierPtr MyPtr = NULL ; class law_evaluator : public BSplSLib_EvaluatorFunction
{
public:
static void law_evaluator(const Standard_Integer DerivativeRequest, law_evaluator (const GeomLib_DenominatorMultiplierPtr theDenominatorPtr)
const Standard_Real UParameter, : myDenominator (theDenominatorPtr) {}
const Standard_Real VParameter,
Standard_Real & Result, virtual void Evaluate (const Standard_Integer theDerivativeRequest,
Standard_Integer & ErrorCode) { const Standard_Real theUParameter,
const Standard_Real theVParameter,
ErrorCode = 0 ; Standard_Real& theResult,
Standard_Integer& theErrorCode) const
if ((!(MyPtr == NULL)) && {
(DerivativeRequest == 0)) { if ((myDenominator != NULL) && (theDerivativeRequest == 0))
Result=MyPtr->Value(UParameter,VParameter); {
theResult = myDenominator->Value (theUParameter, theVParameter);
theErrorCode = 0;
}
else
{
theErrorCode = 1;
}
} }
else {
ErrorCode = 1 ; private:
}
} GeomLib_DenominatorMultiplierPtr myDenominator;
};
//======================================================================= //=======================================================================
//function : CheckIfKnotExists //function : CheckIfKnotExists
//purpose : true if the knot already exists in the knot sequence //purpose : true if the knot already exists in the knot sequence
@ -2128,8 +2140,7 @@ static void FunctionMultiply(Handle(Geom_BSplineSurface)& BSurf,
TColStd_Array1OfReal FlatKnots(1,length); TColStd_Array1OfReal FlatKnots(1,length);
BSplCLib::KnotSequence(NewKnots->ChangeArray1(),NewMults->ChangeArray1(),FlatKnots); BSplCLib::KnotSequence(NewKnots->ChangeArray1(),NewMults->ChangeArray1(),FlatKnots);
GeomLib_DenominatorMultiplier local_denominator(BSurf,FlatKnots) ; GeomLib_DenominatorMultiplier aDenominator (BSurf, FlatKnots);
MyPtr = &local_denominator ; //definition of a(u,v)
BuildFlatKnot(surface_u_knots, BuildFlatKnot(surface_u_knots,
surface_u_mults, surface_u_mults,
@ -2164,7 +2175,7 @@ static void FunctionMultiply(Handle(Geom_BSplineSurface)& BSurf,
BSplCLib::KnotSequence(newuknots->ChangeArray1(),newumults->ChangeArray1(),newuflatknots); BSplCLib::KnotSequence(newuknots->ChangeArray1(),newumults->ChangeArray1(),newuflatknots);
BSplCLib::KnotSequence(newvknots->ChangeArray1(),newvmults->ChangeArray1(),newvflatknots); BSplCLib::KnotSequence(newvknots->ChangeArray1(),newvmults->ChangeArray1(),newvflatknots);
//POP pour WNT //POP pour WNT
BSplSLib_EvaluatorFunction ev = law_evaluator; law_evaluator ev (&aDenominator);
// BSplSLib::FunctionMultiply(law_evaluator, //multiplication // BSplSLib::FunctionMultiply(law_evaluator, //multiplication
BSplSLib::FunctionMultiply(ev, //multiplication BSplSLib::FunctionMultiply(ev, //multiplication
BSurf->UDegree(), BSurf->UDegree(),

View File

@ -34,10 +34,33 @@
#include <Plate_Plate.hxx> #include <Plate_Plate.hxx>
static Handle(Geom_Surface) fonct = NULL; class GeomPlate_MakeApprox_Eval : public AdvApp2Var_EvaluatorFunc2Var
{
public:
extern "C" void myPlateSurfEval(Standard_Integer * Dimension, GeomPlate_MakeApprox_Eval (const Handle(Geom_Surface)& theSurf)
: mySurf (theSurf) {}
virtual void Evaluate (Standard_Integer* theDimension,
Standard_Real* theUStartEnd,
Standard_Real* theVStartEnd,
Standard_Integer* theFavorIso,
Standard_Real* theConstParam,
Standard_Integer* theNbParams,
Standard_Real* theParameters,
Standard_Integer* theUOrder,
Standard_Integer* theVOrder,
Standard_Real* theResult,
Standard_Integer* theErrorCode) const;
private:
Handle(Geom_Surface) mySurf;
};
void GeomPlate_MakeApprox_Eval::Evaluate (Standard_Integer * Dimension,
// Dimension // Dimension
Standard_Real * UStartEnd, Standard_Real * UStartEnd,
// StartEnd[2] in U // StartEnd[2] in U
@ -57,9 +80,9 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
// Derivative Request in V // Derivative Request in V
Standard_Real * Result, Standard_Real * Result,
// Result[Dimension,N] // Result[Dimension,N]
Standard_Integer * ErrorCode) Standard_Integer * ErrorCode) const
// Error Code // Error Code
{ {
*ErrorCode = 0; *ErrorCode = 0;
Standard_Integer idim,jpar; Standard_Integer idim,jpar;
Standard_Real Upar,Vpar; Standard_Real Upar,Vpar;
@ -114,7 +137,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 0 : case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar); pnt = mySurf->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X(); Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y(); Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z(); Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
@ -123,7 +146,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 1 : case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2); mySurf->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) { if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X(); Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y(); Result[1+(jpar-1)*(*Dimension)] = v1.Y();
@ -139,7 +162,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 2 : case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1]; Vpar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5); mySurf->D2 (Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X(); Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y(); Result[1+(jpar-1)*(*Dimension)] = v3.Y();
@ -165,7 +188,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 0 : case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
pnt = fonct->Value(Upar,Vpar); pnt = mySurf->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X(); Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y(); Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z(); Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
@ -174,7 +197,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 1 : case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
fonct->D1(Upar, Vpar, pnt, v1, v2); mySurf->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) { if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X(); Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y(); Result[1+(jpar-1)*(*Dimension)] = v1.Y();
@ -190,7 +213,7 @@ extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
case 2 : case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) { for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1]; Upar = Parameters[jpar-1];
fonct->D2(Upar, Vpar, pnt, v1, v2, v3, v4, v5); mySurf->D2 (Upar, Vpar, pnt, v1, v2, v3, v4, v5);
if (*UOrder==2) { if (*UOrder==2) {
Result[(jpar-1)*(*Dimension)] = v3.X(); Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y(); Result[1+(jpar-1)*(*Dimension)] = v3.Y();
@ -228,7 +251,6 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
const Standard_Real EnlargeCoeff) const Standard_Real EnlargeCoeff)
{ {
myPlate = SurfPlate; myPlate = SurfPlate;
fonct = myPlate;
Standard_Real U0=0., U1=0., V0=0., V1=0.; Standard_Real U0=0., U1=0., V0=0., V1=0.;
myPlate->RealBounds(U0, U1, V0, V1); myPlate->RealBounds(U0, U1, V0, V1);
@ -256,7 +278,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
AdvApprox_DichoCutting myDec; AdvApprox_DichoCutting myDec;
//POP pour WNT //POP pour WNT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval; GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3, AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D, nul1,nul1,eps3D,
nul2,nul2,epsfr, nul2,nul2,epsfr,
@ -293,7 +315,6 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
const Standard_Real EnlargeCoeff) const Standard_Real EnlargeCoeff)
{ {
myPlate = SurfPlate; myPlate = SurfPlate;
fonct = myPlate;
TColgp_SequenceOfXY Seq2d; TColgp_SequenceOfXY Seq2d;
TColgp_SequenceOfXYZ Seq3d; TColgp_SequenceOfXYZ Seq3d;
@ -311,13 +332,13 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
gp_Vec v1h,v2h,v3h; gp_Vec v1h,v2h,v3h;
if (CritOrder==0) { if (CritOrder==0) {
// a l'ordre 0 // a l'ordre 0
fonct->D0(P2d.X(),P2d.Y(),PP); myPlate->D0 (P2d.X(), P2d.Y(), PP);
gp_XYZ P3d(PP.X(),PP.Y(),PP.Z()); gp_XYZ P3d(PP.X(),PP.Y(),PP.Z());
Seq3d.Append(P3d); Seq3d.Append(P3d);
} }
else { else {
// a l'ordre 1 // a l'ordre 1
fonct->D1(P2d.X(),P2d.Y(),PP,v1h,v2h); myPlate->D1 (P2d.X(), P2d.Y(), PP, v1h, v2h);
v3h=v1h^v2h; v3h=v1h^v2h;
gp_XYZ P3d(v3h.X(),v3h.Y(),v3h.Z()); gp_XYZ P3d(v3h.X(),v3h.Y(),v3h.Z());
Seq3d.Append(P3d); Seq3d.Append(P3d);
@ -367,7 +388,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
if (CritOrder==-1) { if (CritOrder==-1) {
myPrec = 1; myPrec = 1;
// POP pour NT // POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval; GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3, AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D, nul1,nul1,eps3D,
nul2,nul2,epsfr, nul2,nul2,epsfr,
@ -388,7 +409,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
else if (CritOrder==0) { else if (CritOrder==0) {
GeomPlate_PlateG0Criterion Crit0(Seq2d,Seq3d,seuil); GeomPlate_PlateG0Criterion Crit0(Seq2d,Seq3d,seuil);
// POP pour NT // POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval; GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3, AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D, nul1,nul1,eps3D,
nul2,nul2,epsfr, nul2,nul2,epsfr,
@ -411,7 +432,7 @@ GeomPlate_MakeApprox::GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& Surf
else if (CritOrder==1) { else if (CritOrder==1) {
GeomPlate_PlateG1Criterion Crit1(Seq2d,Seq3d,seuil); GeomPlate_PlateG1Criterion Crit1(Seq2d,Seq3d,seuil);
// POP pour NT // POP pour NT
AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval; GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3, AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D, nul1,nul1,eps3D,
nul2,nul2,epsfr, nul2,nul2,epsfr,

View File

@ -44,7 +44,6 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
static Standard_Boolean AnErrorOccurred=Standard_False;
@ -77,7 +76,7 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
,const Standard_Real TheTol) ,const Standard_Real TheTol)
{ {
AnErrorOccurred = Standard_False; Standard_Boolean AnErrorOccurred = Standard_False;
this->ResetFields(); this->ResetFields();
DomainOnCurve1=D1; DomainOnCurve1=D1;
@ -248,7 +247,7 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
,const Standard_Real TheTol) ,const Standard_Real TheTol)
{ {
AnErrorOccurred = Standard_False; Standard_Boolean AnErrorOccurred = Standard_False;
this->ResetFields(); this->ResetFields();
DomainOnCurve1=D1; DomainOnCurve1=D1;
@ -354,6 +353,7 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
gp_Pnt2d P1,P2; gp_Pnt2d P1,P2;
Standard_Integer nbsamples; Standard_Integer nbsamples;
done = Standard_False; done = Standard_False;
Standard_Boolean AnErrorOccurred = Standard_False;
nbsamples = TheCurveTool::NbSamples(C1,D1.FirstParameter(),D1.LastParameter()); nbsamples = TheCurveTool::NbSamples(C1,D1.FirstParameter(),D1.LastParameter());
@ -770,6 +770,7 @@ void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
gp_Pnt2d P1,P2; gp_Pnt2d P1,P2;
Standard_Integer nbsamplesOnC1,nbsamplesOnC2; Standard_Integer nbsamplesOnC1,nbsamplesOnC2;
done = Standard_False; done = Standard_False;
Standard_Boolean AnErrorOccurred = Standard_False;
if(NbIter>NBITER_MAX_POLYGON) return; if(NbIter>NBITER_MAX_POLYGON) return;

View File

@ -17,7 +17,7 @@ Standard_Integer IntCurveSurface_CurveTool::NbSamples (const CurveGen& C,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real U1) { const Standard_Real U1) {
GeomAbs_CurveType typC = C.GetType(); GeomAbs_CurveType typC = C.GetType();
static Standard_Real nbsOther = 10.0; const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther; Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line) if(typC == GeomAbs_Line)

View File

@ -21,7 +21,7 @@ Standard_Integer IntCurveSurface_HCurveTool::NbSamples (const CurveGen& C,
const Standard_Real U0, const Standard_Real U0,
const Standard_Real U1) { const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType(); GeomAbs_CurveType typC = C->GetType();
static Standard_Real nbsOther = 10.0; const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther; Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line) if(typC == GeomAbs_Line)
@ -47,7 +47,7 @@ void IntCurveSurface_HCurveTool::SamplePars (const CurveGen& C,
const Standard_Integer NbMin, const Standard_Integer NbMin,
Handle(TColStd_HArray1OfReal)& Pars) { Handle(TColStd_HArray1OfReal)& Pars) {
GeomAbs_CurveType typC = C->GetType(); GeomAbs_CurveType typC = C->GetType();
static Standard_Real nbsOther = 10.0; const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther; Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line) if(typC == GeomAbs_Line)

View File

@ -1195,7 +1195,7 @@ void IntCurveSurface_Inter::PerformConicSurf(const gp_Lin& Line,
case GeomAbs_Cone: case GeomAbs_Cone:
{ {
//OCC516(apo)-> //OCC516(apo)->
static Standard_Real correction = 1.E+5*Precision::Angular(); const Standard_Real correction = 1.E+5*Precision::Angular();
gp_Cone cn = TheSurfaceTool::Cone(surface); gp_Cone cn = TheSurfaceTool::Cone(surface);
if(Abs(cn.SemiAngle()) < M_PI/2.0 - correction){ if(Abs(cn.SemiAngle()) < M_PI/2.0 - correction){
IntAna_IntConicQuad LinCone(Line,cn); IntAna_IntConicQuad LinCone(Line,cn);

View File

@ -104,7 +104,7 @@ void IntCurveSurface_Polyhedron::Init(const ThePSurface& Surface,
const Standard_Real V0, const Standard_Real V0,
const Standard_Real U1, const Standard_Real U1,
const Standard_Real V1) { const Standard_Real V1) {
static Standard_Integer DebugDump = 0; const Standard_Integer DebugDump = 0;
Standard_Integer i1,i2; Standard_Integer i1,i2;
Standard_Real U,V; Standard_Real U,V;
Standard_Real U1mU0sNbdeltaU = (U1-U0)/(Standard_Real)nbdeltaU; Standard_Real U1mU0sNbdeltaU = (U1-U0)/(Standard_Real)nbdeltaU;
@ -190,7 +190,7 @@ void IntCurveSurface_Polyhedron::Init(const ThePSurface& Surface,
void IntCurveSurface_Polyhedron::Init(const ThePSurface& Surface, void IntCurveSurface_Polyhedron::Init(const ThePSurface& Surface,
const TColStd_Array1OfReal& Upars, const TColStd_Array1OfReal& Upars,
const TColStd_Array1OfReal& Vpars) { const TColStd_Array1OfReal& Vpars) {
static Standard_Integer DebugDump = 0; const Standard_Integer DebugDump = 0;
Standard_Integer i1,i2; Standard_Integer i1,i2;
Standard_Real U,V; Standard_Real U,V;
gp_Pnt TP; gp_Pnt TP;

View File

@ -82,8 +82,11 @@ IntImp_ConstIsoparametric IntImp_Int2S::
math_FunctionSetRoot& Rsnld, math_FunctionSetRoot& Rsnld,
const IntImp_ConstIsoparametric ChoixIso ) const IntImp_ConstIsoparametric ChoixIso )
{ {
static math_Vector BornInf(1,3),BornSup(1,3),Tolerance(1,3),UVap(1,3); Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
static TColStd_Array1OfReal Uvres(1,4); Standard_Real UvresBuf[4];
math_Vector BornInf (BornInfBuf, 1, 3), BornSup (BornSupBuf, 1, 3), Tolerance (ToleranceBuf, 1, 3), UVap (UVapBuf, 1, 3);
TColStd_Array1OfReal Uvres (UvresBuf[0], 1, 4);
IntImp_ConstIsoparametric BestChoix; IntImp_ConstIsoparametric BestChoix;
myZerParFunc.ComputeParameters(ChoixIso,Param,UVap, myZerParFunc.ComputeParameters(ChoixIso,Param,UVap,
BornInf,BornSup,Tolerance); BornInf,BornSup,Tolerance);
@ -120,7 +123,8 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
gp_Vec DPUV[4]; gp_Vec DPUV[4];
gp_Pnt P1,P2; gp_Pnt P1,P2;
Standard_Real Epsuv[4]; Standard_Real Epsuv[4];
static TColStd_Array1OfReal Duv(1,4); Standard_Real DuvBuf[4];
TColStd_Array1OfReal Duv (DuvBuf[0], 1, 4);
Standard_Real UVd[4],UVf[4]; Standard_Real UVd[4],UVf[4];
IntImp_ConstIsoparametric ChoixIso[4]; IntImp_ConstIsoparametric ChoixIso[4];
IntImp_ConstIsoparametric BestChoix=ChoixRef[0]; IntImp_ConstIsoparametric BestChoix=ChoixRef[0];
@ -230,6 +234,3 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
} }
return BestChoix; return BestChoix;
} }

View File

@ -74,10 +74,8 @@ void IntImp_IntCS::Perform(const Standard_Real U,
const Standard_Real w0, const Standard_Real w0,
const Standard_Real w1) { const Standard_Real w1) {
done = Standard_True; done = Standard_True;
static math_Vector UVap(1,3); Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
static math_Vector BornInf(1,3); math_Vector BornInf (BornInfBuf, 1, 3), BornSup (BornSupBuf, 1, 3), Tolerance (ToleranceBuf, 1, 3), UVap (UVapBuf, 1, 3);
static math_Vector BornSup(1,3);
static math_Vector Tolerance(1,3);
UVap(1) = U; UVap(1) = U;
UVap(2) = V; UVap(2) = V;
UVap(3) = W; UVap(3) = W;

View File

@ -12,8 +12,6 @@
//purpose : Initialize for a deferred interference. //purpose : Initialize for a deferred interference.
//======================================================================= //=======================================================================
static Standard_Integer debug=0;
Intf_Interference::Intf_Interference (const Standard_Boolean Self) Intf_Interference::Intf_Interference (const Standard_Boolean Self)
: SelfIntf(Self) : SelfIntf(Self)
{} {}
@ -114,21 +112,9 @@ Standard_Boolean Intf_Interference::Insert(const Intf_TangentZone& LaZone)
Standard_Integer npcz=-1; // Number of points in the current zone Standard_Integer npcz=-1; // Number of points in the current zone
Standard_Integer nplz=LaZone.NumberOfPoints(); // in the new zone Standard_Integer nplz=LaZone.NumberOfPoints(); // in the new zone
if (debug>0) {
cout << "Zone of insertion : \n";
LaZone.Dump(2);
cout << endl;
}
// Loop on TangentZone : // Loop on TangentZone :
for (Standard_Integer Iz=1; Iz<=myTZones.Length(); Iz++) { for (Standard_Integer Iz=1; Iz<=myTZones.Length(); Iz++) {
if (debug>0) {
cout << "Zone : "<< Iz << "\n";
myTZones(Iz).Dump(2);
cout << endl;
}
// Loop on edges of the TangentZone : // Loop on edges of the TangentZone :
npcz=myTZones(Iz).NumberOfPoints(); npcz=myTZones(Iz).NumberOfPoints();
Standard_Integer Ipz0, Ipz1, Ipz2; Standard_Integer Ipz0, Ipz1, Ipz2;
@ -201,13 +187,6 @@ Standard_Boolean Intf_Interference::Insert(const Intf_TangentZone& LaZone)
Inserted =Standard_False; Inserted =Standard_False;
} }
if (debug>0) {
if (Inserted) {
cout << "Zone agrandie : "<< lzin <<" \n";
myTZones(lzin).Dump(2);
cout << endl;
}
}
if (Inserted) { if (Inserted) {
Intf_TangentZone theNew=myTZones(lzin); Intf_TangentZone theNew=myTZones(lzin);
myTZones.Remove(lzin); myTZones.Remove(lzin);

View File

@ -86,4 +86,10 @@ is
---Purpose: Computes the intersection between two segments ---Purpose: Computes the intersection between two segments
-- <BegO><EndO> et <BegT><EndT>. -- <BegO><EndO> et <BegT><EndT>.
fields
oClos, tClos : Boolean from Standard;
iObje1, iObje2, nbso : Integer from Standard;
BeginOfNotClosedObje1: Boolean from Standard;
BeginOfNotClosedObje2: Boolean from Standard;
end InterferencePolygon2d; end InterferencePolygon2d;

View File

@ -12,11 +12,12 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <TColStd_ListOfInteger.hxx> #include <TColStd_ListOfInteger.hxx>
static Standard_Integer debug=0;
// Angular precision (sinus) below that value two right segments // Angular precision (sinus) below that value two right segments
// are considered as having a potential zone of tangency. // are considered as having a potential zone of tangency.
static Standard_Real PRCANG=Precision::Angular(); namespace
{
static const Standard_Real PRCANG = Precision::Angular();
};
//======================================================================= //=======================================================================
//function : Intf_InterferencePolygon2d //function : Intf_InterferencePolygon2d
@ -24,7 +25,14 @@ static Standard_Real PRCANG=Precision::Angular();
//======================================================================= //=======================================================================
Intf_InterferencePolygon2d::Intf_InterferencePolygon2d() Intf_InterferencePolygon2d::Intf_InterferencePolygon2d()
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
oClos (Standard_False),
tClos (Standard_False),
iObje1 (0),
iObje2 (0),
nbso (0),
BeginOfNotClosedObje1 (Standard_False),
BeginOfNotClosedObje2 (Standard_False)
{} {}
//======================================================================= //=======================================================================
@ -32,12 +40,16 @@ Intf_InterferencePolygon2d::Intf_InterferencePolygon2d()
//purpose : Constructor of the interference beetween two Polygon. //purpose : Constructor of the interference beetween two Polygon.
//======================================================================= //=======================================================================
static Standard_Boolean oClos, tClos;
static Standard_Integer iObje1, iObje2, nbso;
Intf_InterferencePolygon2d::Intf_InterferencePolygon2d Intf_InterferencePolygon2d::Intf_InterferencePolygon2d
(const Polygon2d1& Obje1, const Polygon2d2& Obje2) (const Polygon2d1& Obje1, const Polygon2d2& Obje2)
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
oClos (Standard_False),
tClos (Standard_False),
iObje1 (0),
iObje2 (0),
nbso (0),
BeginOfNotClosedObje1 (Standard_False),
BeginOfNotClosedObje2 (Standard_False)
{ {
if (!ToolPolygon2d1::Bounding(Obje1).IsOut if (!ToolPolygon2d1::Bounding(Obje1).IsOut
(ToolPolygon2d2::Bounding(Obje2))) { (ToolPolygon2d2::Bounding(Obje2))) {
@ -61,7 +73,14 @@ Intf_InterferencePolygon2d::Intf_InterferencePolygon2d
Intf_InterferencePolygon2d::Intf_InterferencePolygon2d Intf_InterferencePolygon2d::Intf_InterferencePolygon2d
(const Polygon2d1& Obje) (const Polygon2d1& Obje)
: Intf_Interference(Standard_True) : Intf_Interference (Standard_True),
oClos (Standard_False),
tClos (Standard_False),
iObje1 (0),
iObje2 (0),
nbso (0),
BeginOfNotClosedObje1 (Standard_False),
BeginOfNotClosedObje2 (Standard_False)
{ {
Tolerance=ToolPolygon2d1::DeflectionOverEstimation(Obje)*2; Tolerance=ToolPolygon2d1::DeflectionOverEstimation(Obje)*2;
if (Tolerance==0.) if (Tolerance==0.)
@ -129,8 +148,6 @@ gp_Pnt2d Intf_InterferencePolygon2d::Pnt2dValue
//function : Interference //function : Interference
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Boolean BeginOfNotClosedObje1;
static Standard_Boolean BeginOfNotClosedObje2;
void Intf_InterferencePolygon2d::Interference void Intf_InterferencePolygon2d::Interference
(const Polygon2d1& Obje1, (const Polygon2d1& Obje1,
@ -234,12 +251,6 @@ void Intf_InterferencePolygon2d::Clean()
if (delta1<1. && delta2<1.) Only1Seg=Standard_True; if (delta1<1. && delta2<1.) Only1Seg=Standard_True;
if (delta1==0. || delta2==0.) Only1Seg=Standard_True; if (delta1==0. || delta2==0.) Only1Seg=Standard_True;
if (debug==1) {
cout<<"\n tz("<<ltz<<") Avant retrait First("<<pr1mi<<","<<pr1ma<<") "
<<"Second("<<pr2mi<<","<<pr2ma<<")\n";
myTZones(ltz-decal).Dump(2);
}
for (lpi=1; lpi<=myTZones(ltz-decal).NumberOfPoints(); lpi++) { for (lpi=1; lpi<=myTZones(ltz-decal).NumberOfPoints(); lpi++) {
if (PI1.Incidence()<=PRCANG) {tsp=tsps=0;break;} if (PI1.Incidence()<=PRCANG) {tsp=tsps=0;break;}
PI1.InfoFirst(dim1,addr1,par); PI1.InfoFirst(dim1,addr1,par);

View File

@ -129,7 +129,11 @@ is
-- <BegT><EndT> and points <BegO>,<EndO>. -- <BegT><EndT> and points <BegO>,<EndO>.
fields IndexMin : Integer from Standard; fields IndexMin : Integer from Standard;
MinimalDist : Real from Standard; MinimalDist : Real from Standard;
iObje1, iObje2 : Integer from Standard;
beginOfNotClosedFirst: Boolean from Standard;
beginOfNotClosedSecon: Boolean from Standard;
end InterferencePolygon3d; end InterferencePolygon3d;

View File

@ -18,7 +18,12 @@
//======================================================================= //=======================================================================
Intf_InterferencePolygon3d::Intf_InterferencePolygon3d() Intf_InterferencePolygon3d::Intf_InterferencePolygon3d()
: Intf_Interference(Standard_False), IndexMin(0) : Intf_Interference (Standard_False),
IndexMin (0),
iObje1 (0),
iObje2 (0),
beginOfNotClosedFirst (Standard_True),
beginOfNotClosedSecon (Standard_True)
{} {}
//======================================================================= //=======================================================================
@ -26,11 +31,14 @@ Intf_InterferencePolygon3d::Intf_InterferencePolygon3d()
//purpose : Constructor of the interference beetween two Polygon. //purpose : Constructor of the interference beetween two Polygon.
//======================================================================= //=======================================================================
static Standard_Integer iObje1, iObje2;
Intf_InterferencePolygon3d::Intf_InterferencePolygon3d Intf_InterferencePolygon3d::Intf_InterferencePolygon3d
(const Polygon3d1& Obje1, const Polygon3d2& Obje2) (const Polygon3d1& Obje1, const Polygon3d2& Obje2)
: Intf_Interference(Standard_False), IndexMin(0) : Intf_Interference (Standard_False),
IndexMin (0),
iObje1 (0),
iObje2 (0),
beginOfNotClosedFirst (Standard_True),
beginOfNotClosedSecon (Standard_True)
{ {
Tolerance=ToolPolygon3d1::DeflectionOverEstimation(Obje1)+ Tolerance=ToolPolygon3d1::DeflectionOverEstimation(Obje1)+
ToolPolygon3d2::DeflectionOverEstimation(Obje2); ToolPolygon3d2::DeflectionOverEstimation(Obje2);
@ -46,7 +54,12 @@ Intf_InterferencePolygon3d::Intf_InterferencePolygon3d
Intf_InterferencePolygon3d::Intf_InterferencePolygon3d Intf_InterferencePolygon3d::Intf_InterferencePolygon3d
(const Polygon3d1& Obje) (const Polygon3d1& Obje)
: Intf_Interference(Standard_True), IndexMin(0) : Intf_Interference (Standard_True),
IndexMin(0),
iObje1 (0),
iObje2 (0),
beginOfNotClosedFirst (Standard_True),
beginOfNotClosedSecon (Standard_True)
{ {
Tolerance=ToolPolygon3d1::DeflectionOverEstimation(Obje)*2; Tolerance=ToolPolygon3d1::DeflectionOverEstimation(Obje)*2;
Interference(Obje); Interference(Obje);
@ -139,9 +152,6 @@ Standard_Integer Intf_InterferencePolygon3d::MinimalResult () const
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Boolean beginOfNotClosedFirst=Standard_True;
static Standard_Boolean beginOfNotClosedSecon=Standard_True;
void Intf_InterferencePolygon3d::Interference void Intf_InterferencePolygon3d::Interference
(const Polygon3d1& Obje1, (const Polygon3d1& Obje1,
const Polygon3d2& Obje2) const Polygon3d2& Obje2)

View File

@ -170,4 +170,8 @@ is
---Purpose: Computes the intersection between the segment <BegO><EndO> ---Purpose: Computes the intersection between the segment <BegO><EndO>
-- and the triangle <TTri> of <thePolyh>. -- and the triangle <TTri> of <thePolyh>.
fields
BeginOfClosedPolygon: Boolean from Standard;
iLin : Integer from Standard;
end InterferencePolygonPolyhedron; end InterferencePolygonPolyhedron;

View File

@ -17,22 +17,11 @@
#include <Intf_SeqOfTangentZone.hxx> #include <Intf_SeqOfTangentZone.hxx>
#include <Intf.hxx> #include <Intf.hxx>
#ifdef DEB
static Standard_Integer debug=0;
#endif
#if 0
static Standard_Real PRCANG=0.1;
#endif
//#ifndef DEB
static int Pourcent3[4]={0,1,2,0};
//#else
//static Pourcent3[4]={0,1,2,0};
//#endif
#include <Extrema_ExtElC.hxx> #include <Extrema_ExtElC.hxx>
#include <Extrema_POnCurv.hxx> #include <Extrema_POnCurv.hxx>
static const int Pourcent3[4] = {0, 1, 2, 0};
static Standard_Boolean IsInSegment(const gp_Vec& P1P2, static Standard_Boolean IsInSegment(const gp_Vec& P1P2,
const gp_Vec& P1P, const gp_Vec& P1P,
const Standard_Real NP1P2, const Standard_Real NP1P2,
@ -57,7 +46,9 @@ static Standard_Boolean IsInSegment(const gp_Vec& P1P2,
//======================================================================= //=======================================================================
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron() Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron()
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
BeginOfClosedPolygon (Standard_False),
iLin (0)
{} {}
//======================================================================= //=======================================================================
@ -66,12 +57,11 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron()
// and a Polyhedron. // and a Polyhedron.
//======================================================================= //=======================================================================
static Standard_Boolean BeginOfClosedPolygon;
static Standard_Integer iLin;
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Polygon3d& thePolyg, const Polyhedron& thePolyh) (const Polygon3d& thePolyg, const Polyhedron& thePolyh)
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
BeginOfClosedPolygon (Standard_False),
iLin (0)
{ {
Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+ Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
ToolPolyh::DeflectionOverEstimation(thePolyh); ToolPolyh::DeflectionOverEstimation(thePolyh);
@ -84,12 +74,12 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
} }
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Polygon3d& thePolyg, const Polyhedron& thePolyh, (const Polygon3d& thePolyg, const Polyhedron& thePolyh,
Bnd_BoundSortBox &PolyhGrid) Bnd_BoundSortBox &PolyhGrid)
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
BeginOfClosedPolygon (Standard_False),
iLin (0)
{ {
Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+ Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
ToolPolyh::DeflectionOverEstimation(thePolyh); ToolPolyh::DeflectionOverEstimation(thePolyh);
@ -109,7 +99,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const gp_Lin& theLin, const Polyhedron& thePolyh) (const gp_Lin& theLin, const Polyhedron& thePolyh)
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
BeginOfClosedPolygon (Standard_False),
iLin (0)
{ {
Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh); Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
if (Tolerance==0.) if (Tolerance==0.)
@ -148,7 +140,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh) (const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh)
: Intf_Interference(Standard_False) : Intf_Interference (Standard_False),
BeginOfClosedPolygon (Standard_False),
iLin (0)
{ {
Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh); Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
if (Tolerance==0.) if (Tolerance==0.)
@ -636,19 +630,6 @@ void Intf_InterferencePolygonPolyhedron::Interference
} }
//======================================================================= //=======================================================================
//function : Intersect //function : Intersect
//purpose : Compute the intersection beetween the segment or the line //purpose : Compute the intersection beetween the segment or the line
@ -787,23 +768,9 @@ void Intf_InterferencePolygonPolyhedron::Intersect
Standard_Real dEndTri=(triNor*EndO.XYZ())-triDp; // Distance <EndO> plan Standard_Real dEndTri=(triNor*EndO.XYZ())-triDp; // Distance <EndO> plan
gp_XYZ segO=EndO.XYZ()-BegO.XYZ(); gp_XYZ segO=EndO.XYZ()-BegO.XYZ();
segO.Normalize(); segO.Normalize();
#if 0
Standard_Real angl=triNor*segO;
#endif
Standard_Boolean NoIntersectionWithTriangle = Standard_False; Standard_Boolean NoIntersectionWithTriangle = Standard_False;
Standard_Boolean PolygonCutsPlane = Standard_True; Standard_Boolean PolygonCutsPlane = Standard_True;
#if 0
if (((!Infinite && Abs(dBegTri)<=Tolerance && Abs(dEndTri)<=Tolerance) ||
(Infinite && angl<=PRCANG)) || (dBegTri-dEndTri)==0.) {
// On est dans la Zone d influence calculer sur quel partie :
// !!cout<<" AAAA ";
// !!cout<<" Beg End :"<<dBegTri<<" "<<dEndTri<<endl;
}
#endif
Standard_Real param; Standard_Real param;
t = dBegTri-dEndTri; t = dBegTri-dEndTri;
if (t >= 1.e-16 || t<=-1.e-16) if (t >= 1.e-16 || t<=-1.e-16)
@ -829,39 +796,9 @@ void Intf_InterferencePolygonPolyhedron::Intersect
if(NoIntersectionWithTriangle == Standard_False) { if(NoIntersectionWithTriangle == Standard_False) {
gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param); gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
Standard_Real dPiE[3], dPtPi[3], sigd; Standard_Real dPiE[3], dPtPi[3], sigd;
#ifndef DEB Standard_Integer is = 0;
Standard_Integer is =0;
#else
Standard_Integer is;
#endif
Standard_Integer sEdge=-1; Standard_Integer sEdge=-1;
Standard_Integer sVertex=-1; Standard_Integer sVertex=-1;
/* for (is=0; is<3; is++) {
gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[(is+1)%3]).XYZ()-
ToolPolyh::Point(thePolyh, pTri[is]).XYZ());
gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[is]).XYZ());
dPtPi[is]=vecP.Modulus();
if (dPtPi[is]<=floatgap) {
sVertex=is;
break;
}
gp_XYZ segT_x_vecP(segT^vecP);
Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
sigd = segT_x_vecP*triNor;
if(sigd>floatgap)
sigd = 1.0;
else if(sigd<-floatgap)
sigd = -1.0;
else {
sigd = 0.0;
}
dPiE[is]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
if (Abs(dPiE[is])<=floatgap) {
sEdge=is;
break;
}
}
*/
Standard_Integer tbreak=0; Standard_Integer tbreak=0;
{ //-- is = 0 { //-- is = 0
gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[1]).XYZ()- gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[1]).XYZ()-
@ -892,7 +829,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect
} }
} }
} }
if(tbreak==0) { //-- is = 1 if(tbreak==0) { //-- is = 1
gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[2]).XYZ()- gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[2]).XYZ()-
ToolPolyh::Point(thePolyh, pTri[1]).XYZ()); ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
@ -1136,11 +1073,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect
if(NoIntersectionWithTriangle == Standard_False) { if(NoIntersectionWithTriangle == Standard_False) {
gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param); gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
Standard_Real dPiE[3], dPtPi[3], sigd; Standard_Real dPiE[3], dPtPi[3], sigd;
#ifndef DEB Standard_Integer is = 0;
Standard_Integer is =0;
#else
Standard_Integer is;
#endif
Standard_Integer sEdge=-1; Standard_Integer sEdge=-1;
Standard_Integer sVertex=-1; Standard_Integer sVertex=-1;
Standard_Integer tbreak=0; Standard_Integer tbreak=0;
@ -1370,4 +1303,3 @@ void Intf_InterferencePolygonPolyhedron::Intersect
} }
} }
} }
// end of File: Intf_InterferencePolygonPolyhedron.gxx

View File

@ -16,6 +16,7 @@ generic class InterferencePolyhedron from Intf
-- self interference of a polyhedron. -- self interference of a polyhedron.
uses Pnt from gp, uses Pnt from gp,
XYZ from gp,
Box from Bnd, Box from Bnd,
SectionPoint from Intf, SectionPoint from Intf,
SeqOfSectionPoint from Intf, SeqOfSectionPoint from Intf,
@ -85,5 +86,17 @@ is
---Purpose: Computes the zone of tangence between the facet <Tri1> of ---Purpose: Computes the zone of tangence between the facet <Tri1> of
-- <FirstPol> and the facet <Tri2> of <SecondPol>. -- <FirstPol> and the facet <Tri2> of <SecondPol>.
CoupleCharacteristics (me: in out;
FirstPol: Polyhedron1;
SeconPol: Polyhedron2) is private;
fields
OI : Integer from Standard[3]; -- index des sommets de l objet
TI : Integer from Standard[3]; -- index des sommets du tool
dpOpT : Real from Standard[3, 3]; -- distance point Objet - point Tool
dpOeT : Real from Standard[3, 3]; -- distance point Objet - edge Tool
deOpT : Real from Standard[3, 3]; -- distance edge Objet - point Tool
voo : XYZ from gp[3]; -- vecteur point point Obje
vtt : XYZ from gp[3]; -- vecteur point point Tool
Incidence: Real from Standard; -- angle entre les deux plans
end InterferencePolyhedron; end InterferencePolyhedron;

View File

@ -18,9 +18,7 @@
#include <TColStd_ListIteratorOfListOfInteger.hxx> #include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <Bnd_BoundSortBox.hxx> #include <Bnd_BoundSortBox.hxx>
//static Pourcent3[9]={0,1,2,0,1,2,0,1,2}; static const int Pourcent3[9] = {0, 1, 2, 0, 1, 2, 0, 1, 2};
static int Pourcent3[9]={0,1,2,0,1,2,0,1,2};
//======================================================================= //=======================================================================
//function : Intf_InterferencePolyhedron //function : Intf_InterferencePolyhedron
@ -36,8 +34,6 @@ Intf_InterferencePolyhedron::Intf_InterferencePolyhedron ()
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer debug=0;
Intf_InterferencePolyhedron::Intf_InterferencePolyhedron Intf_InterferencePolyhedron::Intf_InterferencePolyhedron
(const Polyhedron1& FirstPol, const Polyhedron2& SeconPol) (const Polyhedron1& FirstPol, const Polyhedron2& SeconPol)
: Intf_Interference(Standard_False) : Intf_Interference(Standard_False)
@ -108,8 +104,6 @@ void Intf_InterferencePolyhedron::Perform
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer iFirst, iSecon;
void Intf_InterferencePolyhedron::Interference void Intf_InterferencePolyhedron::Interference
(const Polyhedron1&) (const Polyhedron1&)
{} {}
@ -120,6 +114,7 @@ void Intf_InterferencePolyhedron::Interference
Standard_Boolean gridOnFirst=Standard_True; Standard_Boolean gridOnFirst=Standard_True;
Standard_Integer NbTrianglesFirstPol = ToolPolyhe1::NbTriangles(FirstPol); Standard_Integer NbTrianglesFirstPol = ToolPolyhe1::NbTriangles(FirstPol);
Standard_Integer NbTrianglesSecondPol = ToolPolyhe2::NbTriangles(SeconPol); Standard_Integer NbTrianglesSecondPol = ToolPolyhe2::NbTriangles(SeconPol);
Standard_Integer iFirst, iSecon;
//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------
//-- the same number of triangles it is necessary to test better on //-- the same number of triangles it is necessary to test better on
@ -196,18 +191,6 @@ void Intf_InterferencePolyhedron::Interference
//purpose : Intersection of two triangles issue from two Polyhedron. //purpose : Intersection of two triangles issue from two Polyhedron.
//======================================================================= //=======================================================================
void CoupleCharacteristics(const Polyhedron1& FirstPol,
const Polyhedron2& SeconPol);
static Standard_Integer OI[3]; // index des sommets de l objet
static Standard_Integer TI[3]; // index des sommets du tool
static Standard_Real dpOpT[3][3]; // distance point Objet - point Tool
static Standard_Real dpOeT[3][3]; // distance point Objet - edge Tool
static Standard_Real deOpT[3][3]; // distance edge Objet - point Tool
static gp_XYZ voo[3]; // vecteur point point Obje
static gp_XYZ vtt[3]; // vecteur point point Tool
static Standard_Real Incidence; // angle entre les deux plans
void Intf_InterferencePolyhedron::Intersect void Intf_InterferencePolyhedron::Intersect
(const Standard_Integer Tri1, const Polyhedron1& FirstPol, (const Standard_Integer Tri1, const Polyhedron1& FirstPol,
const Standard_Integer Tri2, const Polyhedron2& SeconPol) const Standard_Integer Tri2, const Polyhedron2& SeconPol)
@ -290,12 +273,8 @@ void Intf_InterferencePolyhedron::Intersect
(Abs(dpOfT[0]+dpOfT[1]+dpOfT[2])!= (Abs(dpOfT[0]+dpOfT[1]+dpOfT[2])!=
Abs(dpOfT[0])+Abs(dpOfT[1])+Abs(dpOfT[2]))){ Abs(dpOfT[0])+Abs(dpOfT[1])+Abs(dpOfT[2]))){
if (TangentZoneValue(TheTZ, FirstPol, Tri1, SeconPol, Tri2)) { if (TangentZoneValue(TheTZ, FirstPol, Tri1, SeconPol, Tri2))
if (debug==2) { {
cout<< "Zone de tangence Couple Tri1, Tri2 : "
<< Tri1 << ", " << Tri2 << " : " << endl;
TheTZ.Dump(2);
}
if (!Insert(TheTZ)) myTZones.Append(TheTZ); if (!Insert(TheTZ)) myTZones.Append(TheTZ);
} }
} }
@ -662,10 +641,6 @@ void Intf_InterferencePolyhedron::Intersect
ifin=id[2]; // ifin=id[2]; //
} }
else { else {
if(debug==2) {
cout << "Impossible calculation problem in pointersec!"
<< endl;
}
ideb=-999; // No line of section possible ideb=-999; // No line of section possible
ifin=-999; ifin=-999;
} }
@ -684,10 +659,6 @@ void Intf_InterferencePolyhedron::Intersect
ifin=id[2]; // ifin=id[2]; //
} }
else { else {
if(debug==2) {
cout << "Impossible calculation problem in pointersec !"
<< endl;
}
ideb=-999; // No line of section possible ideb=-999; // No line of section possible
ifin=-999; ifin=-999;
} }
@ -882,9 +853,6 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
deOpT[nob][nou]*deOpT[nob][nou2]<0.) { deOpT[nob][nou]*deOpT[nob][nou2]<0.) {
if (nbpInt>=6) { if (nbpInt>=6) {
if(debug==2) {
cout << "Nombre de P.I. > 6 dans une TZ ! " << endl;
}
break; break;
} }
else { else {
@ -926,12 +894,6 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
} }
} }
if (nbNoInserted>0) { if (nbNoInserted>0) {
if(debug==2) {
cout << "Insertion impossible ! \n";
cout << " La Zone : \n";
TheTZ.Dump(4);
cout << " Le(s) Point(s) : \n";
}
nob=nbNoInserted-1; nob=nbNoInserted-1;
while (nob>=0) { while (nob>=0) {
Tpi(piToInsert[nob--]).Dump(4); Tpi(piToInsert[nob--]).Dump(4);
@ -948,8 +910,8 @@ Standard_Boolean Intf_InterferencePolyhedron::TangentZoneValue
//purpose : //purpose :
//======================================================================= //=======================================================================
void CoupleCharacteristics(const Polyhedron1& FirstPol, void Intf_InterferencePolyhedron::CoupleCharacteristics (const Polyhedron1& FirstPol,
const Polyhedron2& SeconPol) const Polyhedron2& SeconPol)
{ {
Standard_Integer n1, n2; Standard_Integer n1, n2;
Standard_Real lg; Standard_Real lg;
@ -994,22 +956,4 @@ void CoupleCharacteristics(const Polyhedron1& FirstPol,
deOpT[n1][n2]=dpOpT[n1][n2]; deOpT[n1][n2]=dpOpT[n1][n2];
} }
} }
#if 0
if (debug==1) {
cout<<"dpOpT: "<<dpOpT[0][0]<<" , "<<dpOpT[0][1]<<" , "<<dpOpT[0][2]<<"\n";
cout<<" : "<<dpOpT[1][0]<<" , "<<dpOpT[1][1]<<" , "<<dpOpT[1][2]<<"\n";
cout<<" : "<<dpOpT[2][0]<<" , "<<dpOpT[2][1]<<" , "<<dpOpT[2][2]<<"\n";
cout << endl;
cout<<"dpOeT: "<<dpOeT[0][0]<<" , "<<dpOeT[0][1]<<" , "<<dpOeT[0][2]<<"\n";
cout<<" : "<<dpOeT[1][0]<<" , "<<dpOeT[1][1]<<" , "<<dpOeT[1][2]<<"\n";
cout<<" : "<<dpOeT[2][0]<<" , "<<dpOeT[2][1]<<" , "<<dpOeT[2][2]<<"\n";
cout << endl;
cout<<"deOpT: "<<deOpT[0][0]<<" , "<<deOpT[0][1]<<" , "<<deOpT[0][2]<<"\n";
cout<<" : "<<deOpT[1][0]<<" , "<<deOpT[1][1]<<" , "<<deOpT[1][2]<<"\n";
cout<<" : "<<deOpT[2][0]<<" , "<<deOpT[2][1]<<" , "<<deOpT[2][2]<<"\n";
cout << endl;
}
#endif
} }
// EOF File: Intf_InterferencePolyhedron.gxx

View File

@ -106,5 +106,10 @@ is Create returns Tool from Intf;
fields nbSeg : Integer from Standard; fields nbSeg : Integer from Standard;
beginOnCurve : Real from Standard [6]; beginOnCurve : Real from Standard [6];
endOnCurve : Real from Standard [6]; endOnCurve : Real from Standard [6];
bord : Integer from Standard [12];
xint : Real from Standard [12];
yint : Real from Standard [12];
zint : Real from Standard [12];
parint : Real from Standard [12];
end Tool; end Tool;

View File

@ -126,11 +126,6 @@ void Intf_Tool::Lin2dBox(const gp_Lin2d& L2d,
//function : Hypr2dBox //function : Hypr2dBox
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer bord[12];
static Standard_Real xint[12];
static Standard_Real yint[12];
static Standard_Real zint[12];
static Standard_Real parint[12];
void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d,
const Bnd_Box2d& domain, const Bnd_Box2d& domain,

View File

@ -1,3 +1,4 @@
PLib_ChangeDim.gxx PLib_ChangeDim.gxx
PLib_JacobiPolynomial_0.hxx PLib_JacobiPolynomial_0.hxx
PLib_LocalArray.hxx
PLib_CMPLRS.edl PLib_CMPLRS.edl

View File

@ -74,18 +74,7 @@ is
---Purpose: Get from FP the coordinates of the poles. ---Purpose: Get from FP the coordinates of the poles.
Bin(N,P : Integer) returns Real; Bin(N,P : Integer) returns Real;
---Purpose: Returns the Binomial Cnp , without testing anything. ---Purpose: Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
---C++: inline
Binomial(N : Integer);
---Purpose: test on N > maxbinom and build the PASCAL triangle
-- on size N if necessary.
---C++: inline
InternalBinomial(N : Integer;
maxbinom : out Integer;
binom : out Address);
---Purpose: only called by Binomial(N,P)
RationalDerivative(Degree : Integer; RationalDerivative(Degree : Integer;
N : Integer; N : Integer;

View File

@ -6,10 +6,8 @@
// Modified: 18/06/1996 by PMN : NULL reference. // Modified: 18/06/1996 by PMN : NULL reference.
// Modified: 19/02/1997 by JCT : EvalPoly2Var added // Modified: 19/02/1997 by JCT : EvalPoly2Var added
#define No_Standard_RangeError
#define No_Standard_OutOfRange
#include <PLib.ixx> #include <PLib.ixx>
#include <PLib_LocalArray.hxx>
#include <math_Matrix.hxx> #include <math_Matrix.hxx>
#include <math_Gauss.hxx> #include <math_Gauss.hxx>
#include <Standard_ConstructionError.hxx> #include <Standard_ConstructionError.hxx>
@ -41,70 +39,87 @@
#include <math_Gauss.hxx> #include <math_Gauss.hxx>
#include <math.hxx> #include <math.hxx>
void PLib::InternalBinomial(const Standard_Integer N, class BinomAllocator
Standard_Integer& maxbinom,
Standard_Address& binom)
{ {
if (N > maxbinom) { public:
Standard_Integer i,im1,ip1,id2,md2,md3,j,k;
Standard_Integer np1 = N + 1;
Standard_Integer** nwbin = new Standard_Integer* [np1];
if (maxbinom >= 0) {
for (i = 0; i <= maxbinom; i++) nwbin[i] = //! Main constructor
((Standard_Integer**)binom)[i]; BinomAllocator (const Standard_Integer theMaxBinom)
delete [] ((Standard_Integer**)binom); : myBinom (NULL),
} myMaxBinom (theMaxBinom)
else { {
maxbinom = 0; Standard_Integer i, im1, ip1, id2, md2, md3, j, k;
nwbin[0] = new Standard_Integer [1]; Standard_Integer np1 = myMaxBinom + 1;
nwbin[0][0] = 1; myBinom = new Standard_Integer*[np1];
} myBinom[0] = new Standard_Integer[1];
binom = nwbin; myBinom[0][0] = 1;
for (i = 1; i < np1; ++i)
for (i = maxbinom + 1; i < np1; i++) { {
im1 = i - 1; im1 = i - 1;
ip1 = i + 1; ip1 = i + 1;
id2 = i >> 1; id2 = i >> 1;
md2 = im1 >> 1; md2 = im1 >> 1;
md3 = ip1 >> 1; md3 = ip1 >> 1;
k = 0; k = 0;
((Standard_Integer**)binom)[i] = new Standard_Integer [ip1]; myBinom[i] = new Standard_Integer[ip1];
for (j = 0; j < id2; j++) { for (j = 0; j < id2; ++j)
((Standard_Integer**)binom)[i][j] = {
k + ((Standard_Integer**)binom)[im1][j]; myBinom[i][j] = k + myBinom[im1][j];
k = ((Standard_Integer**)binom)[im1][j]; k = myBinom[im1][j];
} }
j = id2; j = id2;
if (j > md2) j = im1 - j; if (j > md2) j = im1 - j;
((Standard_Integer**)binom)[i][id2] = myBinom[i][id2] = k + myBinom[im1][j];
k + ((Standard_Integer**)binom)[im1][j];
for (j = ip1 - md3; j < ip1; j++) { for (j = ip1 - md3; j < ip1; j++)
((Standard_Integer**)binom)[i][j] = {
((Standard_Integer**)binom)[i][i - j]; myBinom[i][j] = myBinom[i][i - j];
} }
} }
maxbinom = N;
} }
}
static Standard_Integer storage_size = 0 ; //! Destructor
static Standard_Real *derivative_storage= NULL; ~BinomAllocator()
static Standard_Integer binomial_size = 0; {
static Standard_Real *binomial_array = NULL; // free memory
for (Standard_Integer i = 0; i <= myMaxBinom; ++i)
{
delete[] myBinom[i];
}
delete[] myBinom;
}
static void LocalArray(const Standard_Integer newsize, Standard_Real Value (const Standard_Integer N,
Standard_Integer& size, const Standard_Integer P) const
Standard_Real** arr) {
Standard_OutOfRange_Raise_if (N > myMaxBinom,
"PLib, BinomAllocator: requested degree is greater than maximum supported");
return Standard_Real (myBinom[N][P]);
}
private:
Standard_Integer** myBinom;
Standard_Integer myMaxBinom;
};
namespace
{ {
// update a local array // we do not call BSplCLib here to avoid Cyclic dependency detection by WOK
if (newsize > size) { //static BinomAllocator THE_BINOM (BSplCLib::MaxDegree() + 1);
if (*arr) delete [] *arr; static BinomAllocator THE_BINOM (25 + 1);
size = newsize; };
*arr = new Standard_Real [size];
} //=======================================================================
//function : Bin
//purpose :
//=======================================================================
Standard_Real PLib::Bin(const Standard_Integer N,
const Standard_Integer P)
{
return THE_BINOM.Value (N, P);
} }
//======================================================================= //=======================================================================
@ -161,29 +176,20 @@ void PLib::RationalDerivative(const Standard_Integer Degree,
Standard_Real *RationalArray = &RDers; Standard_Real *RationalArray = &RDers;
Standard_Real Factor ; Standard_Real Factor ;
Standard_Integer ii, Index, OtherIndex, Index1, Index2, jj; Standard_Integer ii, Index, OtherIndex, Index1, Index2, jj;
PLib_LocalArray binomial_array;
PLib_LocalArray derivative_storage;
if (Dimension == 3) { if (Dimension == 3) {
Standard_Integer DeRequest1 = DerivativeRequest + 1; Standard_Integer DeRequest1 = DerivativeRequest + 1;
Standard_Integer MinDegRequ = DerivativeRequest; Standard_Integer MinDegRequ = DerivativeRequest;
if (MinDegRequ > Degree) MinDegRequ = Degree; if (MinDegRequ > Degree) MinDegRequ = Degree;
if (DeRequest1 > binomial_size) { binomial_array.Allocate (DeRequest1);
if (binomial_size > 0) {
delete [] binomial_array;
}
binomial_array = new Standard_Real [DeRequest1];
binomial_size = DeRequest1;
}
for (ii = 0 ; ii < DeRequest1 ; ii++) { for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ; binomial_array[ii] = 1.0e0 ;
} }
if (!All) { if (!All) {
Standard_Integer DimDeRequ1 = (DeRequest1 << 1) + DeRequest1; Standard_Integer DimDeRequ1 = (DeRequest1 << 1) + DeRequest1;
if (storage_size < DimDeRequ1) { derivative_storage.Allocate (DimDeRequ1);
if (storage_size > 0)
delete [] derivative_storage ;
derivative_storage = new Standard_Real [DimDeRequ1];
storage_size = DimDeRequ1;
}
RationalArray = derivative_storage ; RationalArray = derivative_storage ;
} }
@ -258,25 +264,14 @@ void PLib::RationalDerivative(const Standard_Integer Degree,
Standard_Integer DeRequest1 = DerivativeRequest + 1; Standard_Integer DeRequest1 = DerivativeRequest + 1;
Standard_Integer MinDegRequ = DerivativeRequest; Standard_Integer MinDegRequ = DerivativeRequest;
if (MinDegRequ > Degree) MinDegRequ = Degree; if (MinDegRequ > Degree) MinDegRequ = Degree;
if (DeRequest1 > binomial_size) { binomial_array.Allocate (DeRequest1);
if (binomial_size > 0) {
delete [] binomial_array;
}
binomial_array = new Standard_Real [DeRequest1];
binomial_size = DeRequest1;
}
for (ii = 0 ; ii < DeRequest1 ; ii++) { for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ; binomial_array[ii] = 1.0e0 ;
} }
if (!All) { if (!All) {
Standard_Integer DimDeRequ1 = Dimension * DeRequest1; Standard_Integer DimDeRequ1 = Dimension * DeRequest1;
if (storage_size < DimDeRequ1) { derivative_storage.Allocate (DimDeRequ1);
if (storage_size > 0)
delete [] derivative_storage ;
derivative_storage = new Standard_Real [DimDeRequ1];
storage_size = DimDeRequ1;
}
RationalArray = derivative_storage ; RationalArray = derivative_storage ;
} }
@ -401,13 +396,8 @@ void PLib::RationalDerivatives(const Standard_Integer DerivativeRequest,
Standard_Integer ii, Index, Index1, Index2, jj; Standard_Integer ii, Index, Index1, Index2, jj;
Standard_Integer DeRequest1 = DerivativeRequest + 1; Standard_Integer DeRequest1 = DerivativeRequest + 1;
if (DeRequest1 > binomial_size) { PLib_LocalArray binomial_array (DeRequest1);
if (binomial_size > 0) { PLib_LocalArray derivative_storage;
delete [] binomial_array;
}
binomial_array = new Standard_Real [DeRequest1];
binomial_size = DeRequest1;
}
for (ii = 0 ; ii < DeRequest1 ; ii++) { for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ; binomial_array[ii] = 1.0e0 ;
@ -1938,9 +1928,8 @@ PLib::EvalLagrange(const Standard_Real Parameter,
ResultArray = &Results ; ResultArray = &Results ;
if (local_request >= Degree) { if (local_request >= Degree) {
local_request = Degree ; local_request = Degree ;
} }
LocalArray((Degree + 1) * Dimension, PLib_LocalArray divided_differences_array ((Degree + 1) * Dimension);
storage_divided, &divided_differences_array) ;
// //
// Build the divided differences array // Build the divided differences array
// //
@ -2070,8 +2059,7 @@ Standard_Integer PLib::EvalCubicHermite
if (local_request >= Degree) { if (local_request >= Degree) {
local_request = Degree ; local_request = Degree ;
} }
LocalArray((Degree + 1) * Dimension, PLib_LocalArray divided_differences_array ((Degree + 1) * Dimension);
storage_size, &divided_differences_array) ;
for (ii = 0, jj = 0 ; ii < 2 ; ii++, jj+= 2) { for (ii = 0, jj = 0 ; ii < 2 ; ii++, jj+= 2) {
ParametersArray[jj] = ParametersArray[jj] =
@ -2305,8 +2293,6 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
} }
Standard_Real Cnp; Standard_Real Cnp;
PLib::Binomial(reflen - 1);
for (i = 2; i < reflen; i++ ) { for (i = 2; i < reflen; i++ ) {
Cnp = PLib::Bin(reflen - 1, i - 1); Cnp = PLib::Bin(reflen - 1, i - 1);
if (rat) Weights (lowp + i - 1) = WCoefs (lowc + i - 1) / Cnp; if (rat) Weights (lowp + i - 1) = WCoefs (lowc + i - 1) / Cnp;
@ -2478,7 +2464,6 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
Standard_Integer I1, I2; Standard_Integer I1, I2;
Standard_Integer NPoleu , NPolev; Standard_Integer NPoleu , NPolev;
gp_XYZ Temp; gp_XYZ Temp;
PLib::Binomial(RowLength - 1);
for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){ for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){
Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol); Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol);
@ -2510,7 +2495,6 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
} }
} }
} }
PLib::Binomial(ColLength - 1);
for (NPolev = LowerCol; NPolev <= UpperCol; NPolev++){ for (NPolev = LowerCol; NPolev <= UpperCol; NPolev++){

View File

@ -3,26 +3,12 @@
// Author: Laurent BOURESCHE // Author: Laurent BOURESCHE
// <lbo@phylox> // <lbo@phylox>
static Standard_Integer maxbinom = -1; inline TColStd_Array1OfReal& PLib::NoWeights()
static Standard_Address binom;
inline TColStd_Array1OfReal& PLib::NoWeights()
{ {
return (*((TColStd_Array1OfReal*) NULL )); return (*((TColStd_Array1OfReal*) NULL ));
} }
inline TColStd_Array2OfReal& PLib::NoWeights2() inline TColStd_Array2OfReal& PLib::NoWeights2()
{ {
return (*((TColStd_Array2OfReal*) NULL )); return (*((TColStd_Array2OfReal*) NULL ));
} }
inline Standard_Real PLib::Bin(const Standard_Integer N,
const Standard_Integer P)
{
return (Standard_Real)((Standard_Integer**)binom)[N][P];
}
inline void PLib::Binomial(const Standard_Integer N)
{
if (N > maxbinom) PLib::InternalBinomial(N,maxbinom,binom);
}

View File

@ -3,9 +3,9 @@
// Author: Sergey SOKOLOV // Author: Sergey SOKOLOV
// <ssv@velox.nnov.matra-dtv.fr> // <ssv@velox.nnov.matra-dtv.fr>
#include <PLib_HermitJacobi.ixx> #include <PLib_HermitJacobi.ixx>
#include <PLib.hxx> #include <PLib.hxx>
#include <PLib_LocalArray.hxx>
#include <TColStd_HArray1OfReal.hxx> #include <TColStd_HArray1OfReal.hxx>
//======================================================================= //=======================================================================
@ -133,13 +133,11 @@ void PLib_HermitJacobi::D0123(const Standard_Integer NDeriv,
TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD2,
TColStd_Array1OfReal& BasisD3) TColStd_Array1OfReal& BasisD3)
{ {
// Tableaux en static PLib_LocalArray jac0 (4 * 20);
static Standard_Real jac0[4*20]; PLib_LocalArray jac1 (4 * 20);
static Standard_Real jac1[4*20]; PLib_LocalArray jac2 (4 * 20);
static Standard_Real jac2[4*20]; PLib_LocalArray jac3 (4 * 20);
static Standard_Real jac3[4*20]; PLib_LocalArray wvalues (4);
static Standard_Real wvalues[4];
Standard_Integer i, j; Standard_Integer i, j;
Standard_Integer NivConstr = this->NivConstr(), Standard_Integer NivConstr = this->NivConstr(),
@ -293,4 +291,3 @@ void PLib_HermitJacobi::D3(const Standard_Real U,
{ {
D0123(3,U,BasisValue,BasisD1,BasisD2,BasisD3); D0123(3,U,BasisValue,BasisD1,BasisD2,BasisD3);
} }

View File

@ -0,0 +1,68 @@
// File: PLib_LocalArray.hxx
// Created: Wed Sep 23 2009
// Copyright: Open CASCADE 2009
#ifndef _PLib_LocalArray_HeaderFile
#define _PLib_LocalArray_HeaderFile
#include <Standard.hxx>
#include <Standard_TypeDef.hxx>
//! Auxiliary class optimizing creation of array buffer for
//! evaluation of bspline (using stack allocation for small arrays)
class PLib_LocalArray
{
public:
// 1K * sizeof (double) = 8K
static const size_t MAX_ARRAY_SIZE = 1024;
PLib_LocalArray (const size_t theSize)
: myPtr (myBuffer)
{
Allocate(theSize);
}
PLib_LocalArray()
: myPtr (myBuffer) {}
virtual ~PLib_LocalArray()
{
Deallocate();
}
void Allocate (const size_t theSize)
{
Deallocate();
if (theSize > MAX_ARRAY_SIZE)
myPtr = (Standard_Real*)Standard::Allocate (theSize * sizeof(Standard_Real));
else
myPtr = myBuffer;
}
operator Standard_Real*() const
{
return myPtr;
}
private:
PLib_LocalArray (const PLib_LocalArray& );
PLib_LocalArray& operator= (const PLib_LocalArray& );
protected:
void Deallocate()
{
if (myPtr != myBuffer)
Standard::Free (*(Standard_Address*)&myPtr);
}
protected:
Standard_Real myBuffer[MAX_ARRAY_SIZE];
Standard_Real* myPtr;
};
#endif

View File

@ -139,5 +139,6 @@ fields
ddu : Real[10]; ddu : Real[10];
ddv : Real[10]; ddv : Real[10];
maxConstraintOrder : Integer; maxConstraintOrder : Integer;
PolynomialPartOnly : Boolean; PolynomialPartOnly : Boolean;
Uold, Vold, U2, R, L : Real; -- these fields should be mutable
end; end;

View File

@ -25,11 +25,15 @@
//purpose : //purpose :
//======================================================================= //=======================================================================
Plate_Plate::Plate_Plate() : Plate_Plate::Plate_Plate()
order(0), n_el(0), n_dim(0), : order(0), n_el(0), n_dim(0),
solution(0),points(0),deru(0),derv(0), solution(0),points(0),deru(0),derv(0),
OK(Standard_False),maxConstraintOrder(0) OK(Standard_False),maxConstraintOrder(0),
Uold (1.e20),
Vold (1.e20),
U2 (0.0),
R (0.0),
L (0.0)
{ {
PolynomialPartOnly = Standard_False; PolynomialPartOnly = Standard_False;
} }
@ -39,10 +43,15 @@ Plate_Plate::Plate_Plate() :
//purpose : //purpose :
//======================================================================= //=======================================================================
Plate_Plate::Plate_Plate(const Plate_Plate& Ref) : Plate_Plate::Plate_Plate(const Plate_Plate& Ref)
order(Ref.order),n_el(Ref.n_el),n_dim(Ref.n_dim), : order(Ref.order),n_el(Ref.n_el),n_dim(Ref.n_dim),
solution(0),points(0),deru(0),derv(0), solution(0),points(0),deru(0),derv(0),
OK(Ref.OK) OK (Ref.OK),
Uold (1.e20),
Vold (1.e20),
U2 (0.0),
R (0.0),
L (0.0)
{ {
Standard_Integer i; Standard_Integer i;
if (Ref.OK) { if (Ref.OK) {
@ -1042,19 +1051,10 @@ gp_XYZ Plate_Plate::EvaluateDerivative(const gp_XY& point2d, const Standard_Inte
// of Laplcian at the power order // of Laplcian at the power order
//======================================================================= //=======================================================================
static Standard_Real Uold = 1.e20;
static Standard_Real Vold = 1.e20;
static Standard_Real U2=0;
static Standard_Real R=0;
static Standard_Real L=0;
Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu, const Standard_Integer iv) const Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu, const Standard_Integer iv) const
{ {
// Standard_Real U2; Plate_Plate* aThis = const_cast<Plate_Plate*>(this);
// Standard_Real R;
// Standard_Real L;
//
Standard_Real U,V; Standard_Real U,V;
Standard_Integer IU,IV; Standard_Integer IU,IV;
@ -1081,18 +1081,18 @@ Standard_Real Plate_Plate::SolEm(const gp_XY& point2d, const Standard_Integer iu
} }
else else
{ {
Uold = U; aThis->Uold = U;
Vold = V; aThis->Vold = V;
U2 = U*U; aThis->U2 = U*U;
R = U2+V*V; aThis->R = U2+V*V;
if (R<1.e-20) return 0; if (R<1.e-20) return 0;
L = log(R); aThis->L = log(R);
} }
Standard_Real DUV = 0; Standard_Real DUV = 0;
Standard_Integer m = order; Standard_Integer m = order;
Standard_Integer mm1 = m-1; Standard_Integer mm1 = m-1;
Standard_Real &r = R; Standard_Real &r = aThis->R;
//Standard_Real pr = pow(R, mm1 - IU - IV); //Standard_Real pr = pow(R, mm1 - IU - IV);

View File

@ -188,30 +188,31 @@ is
-- curve to project and surface -- curve to project and surface
returns Real returns Real
raises NoSuchObject; raises NoSuchObject;
-- Methods for debugging -- Methods for debugging
GetSequence(me) returns HSequenceOfHSequenceOfPnt from ProjLib GetSequence(me) returns HSequenceOfHSequenceOfPnt from ProjLib
---C++: return const & ---C++: return const &
is static; is static;
GetType(me) returns CurveType from GeomAbs GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current ---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola, -- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve. -- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static; is redefined static;
fields fields
mySurface : HSurface from Adaptor3d; mySurface : HSurface from Adaptor3d;
myCurve : HCurve from Adaptor3d; myCurve : HCurve from Adaptor3d;
myNbCurves : Integer from Standard; myNbCurves : Integer from Standard;
mySequence : HSequenceOfHSequenceOfPnt from ProjLib; mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
myTolU : Real from Standard; myTolU : Real from Standard;
myTolV : Real from Standard; myTolV : Real from Standard;
myMaxDist : Real from Standard; myMaxDist : Real from Standard;
myUIso : HArray1OfBoolean from TColStd; myUIso : HArray1OfBoolean from TColStd;
myVIso : HArray1OfBoolean from TColStd; myVIso : HArray1OfBoolean from TColStd;
mySnglPnts : HArray1OfBoolean from TColStd; mySnglPnts : HArray1OfBoolean from TColStd;
myMaxDistance : HArray1OfReal from TColStd; myMaxDistance : HArray1OfReal from TColStd;
myTabInt : HArray1OfReal from TColStd; -- this field should be mutable
end CompProjectedCurve; end CompProjectedCurve;

View File

@ -19,10 +19,9 @@
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <GeomLib.hxx> #include <GeomLib.hxx>
#define FuncTol 1.e-10 #define FuncTol 1.e-10
#if DEB #ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx> #include <OSD_Timer.hxx>
static OSD_Chronometer chr_init_point, chr_dicho_bound; static OSD_Chronometer chr_init_point, chr_dicho_bound;
@ -45,7 +44,6 @@ static void ResultChron( OSD_Chronometer & ch, Standard_Real & time)
} }
#endif #endif
static Handle(TColStd_HArray1OfReal) TabInt;
//======================================================================= //=======================================================================
//function : d1 //function : d1
@ -159,7 +157,7 @@ static void d1(const Standard_Real t,
//purpose : computes first derivative of the 3d projected curve //purpose : computes first derivative of the 3d projected curve
//======================================================================= //=======================================================================
#ifdef DEB #if 0
static void d1CurvOnSurf(const Standard_Real t, static void d1CurvOnSurf(const Standard_Real t,
const Standard_Real u, const Standard_Real u,
const Standard_Real v, const Standard_Real v,
@ -398,7 +396,7 @@ static void DichExactBound(gp_Pnt& Sol,
const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HCurve)& Curve,
const Handle(Adaptor3d_HSurface)& Surface) const Handle(Adaptor3d_HSurface)& Surface)
{ {
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_dicho_bound); InitChron(chr_dicho_bound);
#endif #endif
@ -426,7 +424,7 @@ static void DichExactBound(gp_Pnt& Sol,
} }
else aNotSol = t; else aNotSol = t;
} }
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_dicho_bound,t_dicho_bound); ResultChron(chr_dicho_bound,t_dicho_bound);
dicho_bound_count++; dicho_bound_count++;
#endif #endif
@ -533,7 +531,7 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point,
void ProjLib_CompProjectedCurve::Init() void ProjLib_CompProjectedCurve::Init()
{ {
TabInt.Nullify(); myTabInt.Nullify();
Standard_Real Tol;// Tolerance for ExactBound Standard_Real Tol;// Tolerance for ExactBound
Standard_Integer i, Nend = 0; Standard_Integer i, Nend = 0;
@ -632,11 +630,11 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point,
if (!initpoint) if (!initpoint)
{ {
myCurve->D0(t,CPoint); myCurve->D0(t,CPoint);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init_point); InitChron(chr_init_point);
#endif #endif
initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V); initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V);
#ifdef DEB #ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init_point,t_init_point); ResultChron(chr_init_point,t_init_point);
init_point_count++; init_point_count++;
#endif #endif
@ -1278,15 +1276,9 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
Standard_Integer ProjLib_CompProjectedCurve::NbIntervals(const GeomAbs_Shape S) const Standard_Integer ProjLib_CompProjectedCurve::NbIntervals(const GeomAbs_Shape S) const
{ {
TabInt.Nullify(); const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt.Nullify();
BuildIntervals(S); BuildIntervals(S);
Standard_Integer NbInt; return myTabInt->Length() - 1;
NbInt=TabInt->Length() - 1;
#ifdef DEB
// cout<<"NbIntervals = "<<NbInt<<endl;
#endif
return NbInt;
} }
//======================================================================= //=======================================================================
@ -1296,16 +1288,8 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
void ProjLib_CompProjectedCurve::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const void ProjLib_CompProjectedCurve::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const
{ {
if(TabInt.IsNull()) BuildIntervals(S); if (myTabInt.IsNull()) BuildIntervals (S);
T = TabInt->Array1(); T = myTabInt->Array1();
#if DEB
/* cout<<"Intervals = ";
for(Standard_Integer i = 1; i <= T.Length(); i++)
cout<<T(i)<<" ";
cout<<endl;
*/
#endif
} }
//======================================================================= //=======================================================================
@ -1315,11 +1299,7 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
{ {
#ifndef DEB
GeomAbs_Shape SforS = GeomAbs_CN; GeomAbs_Shape SforS = GeomAbs_CN;
#else
GeomAbs_Shape SforS;
#endif
switch(S) { switch(S) {
case GeomAbs_C0: case GeomAbs_C0:
SforS = GeomAbs_C1; SforS = GeomAbs_C1;
@ -1512,9 +1492,9 @@ gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
BArr->ChangeValue(i) = Fusion(i); BArr->ChangeValue(i) = Fusion(i);
} }
TabInt = new TColStd_HArray1OfReal(1, BArr->Length()); const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt = new TColStd_HArray1OfReal(1, BArr->Length());
for(i = 1; i <= BArr->Length(); i++) for(i = 1; i <= BArr->Length(); i++)
TabInt->ChangeValue(i) = BArr->Value(i); myTabInt->ChangeValue(i) = BArr->Value(i);
} }
@ -1544,24 +1524,3 @@ GeomAbs_CurveType ProjLib_CompProjectedCurve::GetType() const
{ {
return GeomAbs_OtherCurve; return GeomAbs_OtherCurve;
} }