-- and Num3DSS must be equal to 1.
-- Warning:
-- the Function of type EvaluatorFunc2Var from Approx
- -- must be an extern "C" function
- --
- -- 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
- -- ) ;
+ -- must be a subclass of AdvApp2Var_EvaluatorFunc2Var
--
-- the result should be formatted in the following way :
-- <--Num1DSS--> <--2 * Num2DSS--> <--3 * Num3DSS-->
myMaxPatches : Integer ;
-- maximum of patches allowed
--
- myEvaluator : EvaluatorFunc2Var from AdvApp2Var ;
- -- external function
--
myConditions : Context from AdvApp2Var;
myResult : Network from AdvApp2Var;
myMaxDegInU(MaxDegInU),
myMaxDegInV(MaxDegInV),
myMaxPatches(MaxPatch),
-myEvaluator(Func),
myDone(Standard_False),
myHasResult(Standard_False)
{
myNumSubSpaces[1] = Num2DSS;
myNumSubSpaces[2] = Num3DSS;
Init();
- Perform(UChoice,VChoice,Func);
+ Perform(UChoice, VChoice, Func);
ConvertBS();
}
myMaxDegInU(MaxDegInU),
myMaxDegInV(MaxDegInV),
myMaxPatches(MaxPatch),
-myEvaluator(Func),
myDone(Standard_False),
myHasResult(Standard_False)
{
myNumSubSpaces[1] = Num2DSS;
myNumSubSpaces[2] = Num3DSS;
Init();
- Perform(UChoice,VChoice,Func,Crit);
+ Perform(UChoice, VChoice, Func, Crit);
ConvertBS();
}
int mma2ds2_(integer *ndimen,
doublereal *uintfn,
doublereal *vintfn,
- void (*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *nbpntu,
integer *nbpntv,
doublereal *urootb,
static
int mma1fdi_(integer *ndimen,
doublereal *uvfonc,
- void (*foncnp) (// see AdvApp2Var_EvaluatorFunc2Var.hxx for details
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *isofav,
doublereal *tconst,
integer *nbroot,
somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
fpntab_dim1, fpntab_offset, hermit_dim1, hermit_offset, i__1,
i__2, i__3;
-
+
/* Local variables */
static integer nroo2, ncfhe, nd, ii, kk;
static integer ibb, kkm, kkp;
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
hermit_dim1, hermit_offset, crvjac_dim1, crvjac_offset, i__1,
i__2, i__3;
-
+
/* Local variables */
static integer nd, ii, jj, ibb;
static doublereal bid;
-
-
+
+
/* ***********************************************************************
*/
//=======================================================================
int mma1fdi_(integer *ndimen,
doublereal *uvfonc,
- void (*foncnp) (// see AdvApp2Var_EvaluatorFunc2Var.hxx for details
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *isofav,
doublereal *tconst,
integer *nbroot,
diftab_offset, contr1_dim1, contr1_offset, contr2_dim1,
contr2_offset, i__1, i__2;
doublereal d__1;
-
+
/* Local variables */
static integer ideb, ifin, nroo2, ideru, iderv;
static doublereal renor;
static integer ii, nd, ibb, iim, nbp, iip;
static doublereal bid1, bid2;
-
+
/* **********************************************************************
*/
/* ---------------------- Legendre polynom of degree NBROOT -------------------
*/
- (*foncnp)(ndimen,
+ foncnp.Evaluate (ndimen,
&uvfonc[3],
&uvfonc[5],
isofav,
bid1 = (uvfonc[6] - uvfonc[5]) / 2.;
i__1 = *iordre;
for (iderv = 1; iderv <= i__1; ++iderv) {
- (*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, &
- nbp, ttable, &ideru, &iderv, &contr1[(iderv + 1) *
+ foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
+ &nbp, ttable, &ideru, &iderv, &contr1[(iderv + 1) *
contr1_dim1 + 1], iercod);
if (*iercod > 0) {
goto L9999;
}
i__1 = *iordre;
for (iderv = 1; iderv <= i__1; ++iderv) {
- (*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, &
- nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
+ foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
+ &nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
iderv + 1) * contr2_dim1 + 1], iercod);
if (*iercod > 0) {
goto L9999;
bid1 = (uvfonc[4] - uvfonc[3]) / 2.;
i__1 = *iordre;
for (ideru = 1; ideru <= i__1; ++ideru) {
- (*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, &
- nbp, ttable, &ideru, &iderv, &contr1[(ideru + 1) *
+ foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
+ &nbp, ttable, &ideru, &iderv, &contr1[(ideru + 1) *
contr1_dim1 + 1], iercod);
if (*iercod > 0) {
goto L9999;
}
i__1 = *iordre;
for (ideru = 1; ideru <= i__1; ++ideru) {
- (*foncnp)(ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst, &
- nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
+ foncnp.Evaluate (ndimen, &uvfonc[3], &uvfonc[5], isofav, tconst,
+ &nbp, &ttable[*nbroot + 1], &ideru, &iderv, &contr2[(
ideru + 1) * contr2_dim1 + 1], iercod);
if (*iercod > 0) {
goto L9999;
{
/* System generated locals */
integer crvjac_dim1, crvjac_offset, i__1, i__2;
-
+
/* Local variables */
static integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
static integer nbr0;
-
-
+
+
/* ***********************************************************************
*/
if (ncfnw <= *ncflim) {
mmaperm_(&ncfja, &ndses, &ncfja, iordre, &crvjac[idim *
crvjac_dim1], &ncfnw, &errmoy[ii]);
- *ncoeff = max(ncfnw,*ncoeff);
+ *ncoeff = advapp_max(ncfnw,*ncoeff);
/* ------------- Set the declined coefficients to 0.D0 -----------
-------- */
{
/* System generated locals */
integer hermit_dim1, hermit_offset;
-
+
/* Local variables */
static integer ibb;
-
+
/* **********************************************************************
/* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset, cgauss_dim1;
-
+
/* Local variables */
static integer ibb;
/* System generated locals */
integer i__1;
doublereal d__1;
-
-
+
/* Local variables */
static doublereal rider, riord;
static integer nd, ibb;
{
/* System generated locals */
integer i__1;
-
+
/* Local variables */
static doublereal alinu, blinu, alinv, blinv;
static integer ii, ibb;
-
-
/* ***********************************************************************
*/
contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1,
uhermt_offset, vhermt_dim1, vhermt_offset, patjac_dim1,
patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5;
-
+
/* Local variables */
static logical ldbg;
static integer ndgu, ndgv;
static doublereal bidu1, bidu2, bidv1, bidv2;
static integer ioru1, iorv1, ii, nd, jj, ku, kv;
static doublereal cnt1, cnt2, cnt3, cnt4;
-
-
/* **********************************************************************
*/
integer crbiv1_dim1, crbiv1_dim2, crbiv1_offset, crbiv2_dim1, crbiv2_dim2,
crbiv2_offset, patjac_dim1, patjac_dim2, patjac_offset,
vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4;
-
+
/* Local variables */
static logical ldbg;
static integer ndgv1, ndgv2, ii, jj, nd, kk;
integer crbiu1_dim1, crbiu1_dim2, crbiu1_offset, crbiu2_dim1, crbiu2_dim2,
crbiu2_offset, patjac_dim1, patjac_dim2, patjac_offset,
uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4;
-
+
/* Local variables */
static logical ldbg;
static integer ndgu1, ndgu2, ii, jj, nd, kk;
static doublereal bid1, bid2;
-
-
-
/* **********************************************************************
*/
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, patcan_dim1, patcan_dim2,
patcan_offset, i__1, i__2;
-
+
/* Local variables */
static logical ldbg;
static integer ilon1, ilon2, ii, nd;
-
-
-
/* **********************************************************************
*/
{
static integer c__1 = 1;
-
+
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, contr3_dim1, contr3_dim2, contr3_offset,
static doublereal bid1, bid2, bid3, bid4;
static doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
-
-
-
/* **********************************************************************
*/
sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2,
diditb_offset, soditb_dim1, soditb_dim2, soditb_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
-
+
/* Local variables */
static integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
static doublereal bid1, bid2, bid3, bid4;
{
static integer c__1 = 1;
-
+
/* System generated locals */
integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2,
sotbu2_offset, ditbu1_dim1, ditbu1_dim2, ditbu1_offset,
L600:
/* Computing MAX */
- i__1 = 1, i__2 = (*iordru << 1) + 1, i__1 = max(i__1,i__2);
- minu = max(i__1,*ndminu);
+ i__1 = 1, i__2 = (*iordru << 1) + 1, i__1 = advapp_max(i__1,i__2);
+ minu = advapp_max(i__1,*ndminu);
maxu = *ndguli;
/* Computing MAX */
- i__1 = 1, i__2 = (*iordrv << 1) + 1, i__1 = max(i__1,i__2);
- minv = max(i__1,*ndminv);
+ i__1 = 1, i__2 = (*iordrv << 1) + 1, i__1 = advapp_max(i__1,i__2);
+ minv = advapp_max(i__1,*ndminv);
maxv = *ndgvli;
idim = 1;
i__1 = *nbsesp;
}
/* --> Return the nb of coeffs of approximation. */
- *ndegpu = max(*ndegpu,nu);
- *ndegpv = max(*ndegpv,nv);
+ *ndegpu = advapp_max(*ndegpu,nu);
+ *ndegpv = advapp_max(*ndegpv,nv);
idim += ndses;
/* L610: */
}
} else {
/* Computing MAX */
- i__2 = 1, i__3 = (*iordru << 1) + 1, i__2 = max(i__2,i__3);
- minu = max(i__2,*ndminu);
+ i__2 = 1, i__3 = (*iordru << 1) + 1, i__2 = advapp_max(i__2,i__3);
+ minu = advapp_max(i__2,*ndminu);
maxu = *ndguli;
/* Computing MAX */
- i__2 = 1, i__3 = (*iordrv << 1) + 1, i__2 = max(i__2,i__3);
- minv = max(i__2,*ndminv);
+ i__2 = 1, i__3 = (*iordrv << 1) + 1, i__2 = advapp_max(i__2,i__3);
+ minv = advapp_max(i__2,*ndminv);
maxv = *ndgvli;
if (maxu >= (*iordru + 1) << 1 && maxv >= (*iordrv + 1) << 1) {
mma2er2_(ndjacu, ndjacv, &ndses, &minu, &maxu, &minv, &
/* --------------- Return the nb of coeff of approximation ---
-------- */
- *ndegpu = max(*ndegpu,nu);
- *ndegpv = max(*ndegpv,nv);
+ *ndegpu = advapp_max(*ndegpu,nu);
+ *ndegpv = advapp_max(*ndegpv,nv);
idim += ndses;
/* L730: */
}
/* System generated locals */
integer sosotb_dim1, disotb_dim1, disotb_offset, soditb_dim1,
soditb_offset, diditb_dim1, i__1, i__2;
-
+
/* Local variables */
static logical ldbg;
static integer nptu2, nptv2, ii, jj;
static doublereal bid0, bid1, bid2;
-
/* **********************************************************************
*/
/* System generated locals */
integer chpair_dim1, chpair_offset, chimpr_dim1, chimpr_offset,
patjac_offset, i__1, i__2;
-
+
/* Local variables */
static logical ldbg;
static integer nptv2, ii, jj;
static doublereal bid1;
-
/* **********************************************************************
*/
int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen,
doublereal *uintfn,
doublereal *vintfn,
- void (*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *nbpntu,
integer *nbpntv,
doublereal *urootb,
static integer ibid1, ibid2, iuouv, nd;
static integer isz1, isz2;
-
-
/* **********************************************************************
*/
int mma2ds2_(integer *ndimen,
doublereal *uintfn,
doublereal *vintfn,
- void (*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *nbpntu,
integer *nbpntv,
doublereal *urootb,
i__1 = nvroo;
for (iv = 1; iv <= i__1; ++iv) {
tcons = blinv + alinv * vrootb[iv];
- (*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, &
- ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
+ foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
+ &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) {
goto L9999;
}
if (*nbpntv % 2 != 0) {
tcons = blinv;
- (*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, &
- ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
+ foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
+ &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) {
goto L9999;
}
i__1 = nvroo;
for (iv = 1; iv <= i__1; ++iv) {
tcons = alinv * vrootb[(*nbpntv + 1) / 2 + iv] + blinv;
- (*foncnp)(ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu, &
- ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
+ foncnp.Evaluate (ndimen, dbfn1, dbfn2, iiuouv, &tcons, nbpntu,
+ &ttable[1], &c__0, &c__0, &fpntab[fpntab_offset], iercod);
if (*iercod > 0) {
goto L9999;
}
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
doublereal d__1;
-
+
/* Local variables */
static logical ldbg;
static integer minu, minv;
static integer ii, nd, jj;
static doublereal bid0, bid1;
-
/* **********************************************************************
*/
i__3 = *maxdgu;
for (ii = *mindgu; ii <= i__3; ++ii) {
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: */
}
bid1 = bid0 * xmaxjv[jj - minv] + bid1;
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2;
doublereal d__1;
-
+
/* Local variables */
static logical ldbg;
static doublereal vaux[2];
static integer ii, nd, jj, nu, nv;
static doublereal bid0, bid1;
-
/* **********************************************************************
*/
i__2 = nu;
for (ii = i2rdu; ii <= i__2; ++ii) {
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: */
}
vecerr[nd] = bid1;
i__2 = nv;
for (jj = i2rdv; jj <= i__2; ++jj) {
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: */
}
vecerr[nd] = bid1;
*/
L2001:
- *newdgu = max(nu,1);
- *newdgv = max(nv,1);
+ *newdgu = advapp_max(nu,1);
+ *newdgv = advapp_max(nv,1);
/* ----------------------------------- The end --------------------------
*/
integer *nbsesp,
integer *ndimse,
doublereal *uvfonc,
- void (*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
doublereal *tconst,
integer *isofav,
integer *nbroot,
*/
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;
}
- 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;
}
/* the auxiliary curve for MMAPCMP */
ibid1 = *ndimen * (*nbroot + 2);
ibid2 = ((*iordre + 1) << 1) * *nbroot;
- isz2 = max(ibid1,ibid2);
+ isz2 = advapp_max(ibid1,ibid2);
ibid1 = (((*ncflim - 1) / 2 + 1) << 1) * *ndimen;
- isz2 = max(ibid1,isz2);
+ isz2 = advapp_max(ibid1,isz2);
/* --> To return the polynoms of hermit. */
isz3 = ((*iordre + 1) << 2) * (*iordre + 1);
/* --> For the Gauss coeff. of integration. */
errmax_offset, ncoefu_dim1, ncoefu_offset, ncoefv_dim1,
ncoefv_offset, i__1, i__2, i__3, i__4, i__5;
doublereal d__1, d__2;
-
+
/* Local variables */
static integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
static doublereal bid;
static doublereal tol;
-
+
/* **********************************************************************
*/
tol = epsapr[ns];
/* Computing MIN */
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 */
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 */
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 */
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)
{
/* Computing MIN */
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 */
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 */
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 */
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.;
for (kv = 1; kv <= i__5; ++kv) {
bid += (d__1 = patcan[ncfu + (kv + (id + (ii + jj
* patcan_dim4) * patcan_dim3) *
- patcan_dim2) * patcan_dim1], abs(d__1));
+ patcan_dim2) * patcan_dim1], advapp_abs(d__1));
/* L230: */
}
/* L220: */
tol = epsapr[ns];
/* Computing MIN */
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 */
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 */
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 */
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)
{
/* Computing MIN */
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 */
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 */
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 */
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.;
for (ku = 1; ku <= i__5; ++ku) {
bid += (d__1 = patcan[ku + (ncfv + (id + (ii + jj
* patcan_dim4) * patcan_dim3) *
- patcan_dim2) * patcan_dim1], abs(d__1));
+ patcan_dim2) * patcan_dim1], advapp_abs(d__1));
/* L330: */
}
/* L320: */
/* --- Return the nbs of coeff. and pass to the next square --- */
L400:
- ncoefu[ii + jj * ncoefu_dim1] = max(ncfu,2);
- ncoefv[ii + jj * ncoefv_dim1] = max(ncfv,2);
+ ncoefu[ii + jj * ncoefu_dim1] = advapp_max(ncfu,2);
+ ncoefv[ii + jj * ncoefv_dim1] = advapp_max(ncfv,2);
/* L110: */
}
/* L100: */
idebu = (*iordru + 1) << 1;
idebv = (*iordrv + 1) << 1;
- minu = max(idebu,*mindgu);
- minv = max(idebv,*mindgv);
+ minu = advapp_max(idebu,*mindgu);
+ minv = advapp_max(idebv,*mindgv);
bid0 = 0.;
*errmoy = 0.;
{
/* System generated locals */
integer i__1;
-
+
/* Local variables */
static integer ii, ibb;
/* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3;
-
+
/* Local variables */
static integer igss, ikdeb;
static doublereal bidon;
static integer nd, ik, ir, nbroot, ibb;
-
-
/* **********************************************************************
*/
static doublereal bidj;
static integer i__, ia, nd, ncfcut, ibb;
static doublereal bid;
-
-
/* **********************************************************************
*/
{
/* System generated locals */
integer cgauss_dim1, i__1;
-
+
/* Local variables */
static integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
-
-
/* **********************************************************************
*/
#include <Standard_Macro.hxx>
#include <AdvApp2Var_Data_f2c.hxx>
+#include <AdvApp2Var_EvaluatorFunc2Var.hxx>
//
class AdvApp2Var_ApproxF2var {
public:
integer *nbsesp,
integer *ndimse,
doublereal *uvfonc,
- void(*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
doublereal *tconst,
integer *isofav,
integer *nbroot,
Standard_EXPORT static int mma2ds1_(integer *ndimen,
doublereal *uintfn,
doublereal *vintfn,
- void (*foncnp) (
- int *,
- double *,
- double *,
- int *,
- double *,
- int *,
- double *,
- int *,
- int *,
- double *,
- int *
- ),
+ const AdvApp2Var_EvaluatorFunc2Var& foncnp,
integer *nbpntu,
integer *nbpntv,
doublereal *urootb,
};
typedef struct Namelist Namelist;
-#define abs(x) ((x) >= 0 ? (x) : -(x))
-#define dabs(x) (doublereal)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define dmin(a,b) (doublereal)min(a,b)
-#define dmax(a,b) (doublereal)max(a,b)
+#define advapp_abs(x) ((x) >= 0 ? (x) : -(x))
+#define dabs(x) (doublereal)advapp_abs(x)
+#define advapp_min(a,b) ((a) <= (b) ? (a) : (b))
+#define advapp_max(a,b) ((a) >= (b) ? (a) : (b))
+#define dmin(a,b) (doublereal)advapp_min(a,b)
+#define dmax(a,b) (doublereal)advapp_max(a,b)
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
// Author: Joelle CHAUVET
// <jct@sgi38>
-
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#include <Standard_PrimitiveTypes.hxx>
#endif
-
#ifndef AdvApp2Var_EvaluatorFunc2Var_HeaderFile
#define AdvApp2Var_EvaluatorFunc2Var_HeaderFile
-extern "C" {
-typedef void (* AdvApp2Var_EvaluatorFunc2Var) (Standard_Integer *,
- // Dimension
- Standard_Real *,
- // StartEnd[2] in U
- 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
-
-
-}
+// History - the C function pointer converted to a virtual class
+// in order to get rid of usage of static functions and static data
+class AdvApp2Var_EvaluatorFunc2Var
+{
+public:
+
+ //! 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
/* System generated locals */
integer i__1;
doublereal d__1;
-
+
/* Local variables */
static integer i__;
static doublereal differ[100];
/* System generated locals */
integer crvold_dim1, crvold_offset, crvnew_dim1, crvnew_offset, i__1,
i__2;
-
+
/* Local variables */
static integer ipair, nd, ndegre, impair, ibb, idg;
//extern int mgsomsg_();//mgenmsg_(),
-
-
/* **********************************************************************
*/
/* System generated locals */
integer crvlgd_dim1, crvlgd_offset, i__1, i__2;
doublereal d__1;
-
+
/* Local variables */
static integer ncut;
- static doublereal bidon;
+ static doublereal bidon;
static integer ii, nd;
-
/* ***********************************************************************
*/
i__2 = *ndimen;
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;
/* L310: */
}
idec = 3;
/* Computing MAX */
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 -----------
*/
bidon = xmaxj[ii - idec];
i__2 = *ndimen;
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;
/* L310: */
}
idec = 5;
/* Computing MAX */
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 -----------
*/
bidon = xmaxj[ii - idec];
i__2 = *ndimen;
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;
/* L310: */
}
idec = 7;
/* Computing MAX */
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 -----------
*/
bidon = xmaxj[ii - idec];
i__2 = *ndimen;
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;
/* L310: */
}
{
/* System generated locals */
integer crvjac_dim1, crvjac_offset;
-
+
/* Local variables */
static integer jord;
-
/* **********************************************************************
*/
/* At zero machine it is tested if the output interval is not null */
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;
goto L9999;
}
/* ------ Take into account DIF - Test of convergence */
++iter;
- dif = (d__1 = sottc - oldso, abs(d__1));
+ dif = (d__1 = sottc - oldso, advapp_abs(d__1));
/* ------ If DIF is OK, leave..., otherwise: */
/* Computing MAX */
i__2 = i__ - aposit[(i__ << 1) + 1], i__3 = j - aposit[(j << 1) +
1];
- kmin = max(i__2,i__3);
+ kmin = advapp_max(i__2,i__3);
i__2 = j - 1;
for (k = kmin; k <= i__2; ++k) {
somme += chomat[aposit[(i__ << 1) + 2] - (i__ - k)] * chomat[
--debfin;
/* Function Body */
- d1 = abs(debfin[1]);
+ d1 = advapp_abs(debfin[1]);
if (d1 > (float)100.) {
goto L9101;
}
- d2 = abs(debfin[2]);
+ d2 = advapp_abs(debfin[2]);
if (d2 > (float)100.) {
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) {
goto L9101;
}
/* IS IT ALREADY INITIALIZED ? */
- d1 = abs(debfin[1]) + abs(debfin[2]);
+ d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
d1 *= 16111959;
if (debfin[1] != mmcmher_.tdebut) {
mmcmher_.tdebut = debfin[1];
mmcmher_.tfinal = debfin[2];
- d1 = abs(debfin[1]) + abs(debfin[2]);
+ d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
mmcmher_.verifi = d1 * 16111959;
/* IS-IT CORRECTLY INITIALIZED ? */
- d1 = abs(debfin[1]) + abs(debfin[2]);
+ d1 = advapp_abs(debfin[1]) + advapp_abs(debfin[2]);
d1 *= 16111959;
/* OTHERWISE IT IS INITIALIZED */
/* ****** Calculate the optimal degree ** */
kk = *ncoeff / 4 + 1;
- kk = min(kk,10);
+ kk = advapp_min(kk,10);
/* ****** Return the coefficients for the integral (DEGRE=4*KK) */
/* if KK <> KGAR. */
/* Computing MAX */
i__1 = iorjac + 1;
- nwcof = max(i__1,1);
+ nwcof = advapp_max(i__1,1);
AdvApp2Var_SysBase::mvriraz_((integer *)&nwcof,
(char *)wpoly);
wpoly[0] = 1.;
kpiv = 0;
i__2 = *nordre;
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) {
pivot = akj;
kpiv = jj;
*/
L2000:
- if ((d__1 = *tparam - tablev[ideb], abs(d__1)) < *epsil) {
+ if ((d__1 = *tparam - tablev[ideb], advapp_abs(d__1)) < *epsil) {
*itypen = 1;
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;
goto L9999;
}
bidon = sqrt(bidon);
i__2 = *ndimen;
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;
/* L310: */
}
bidon = xmaxj[i__ - ncut];
i__2 = *ndimen;
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;
/* L310: */
}
bid = 0.;
i__1 = *ndimen;
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: */
}
if (bid > eps1) {
bidon = xmaxj[i__ - ncut];
i__2 = *ndimen;
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;
/* L310: */
}
bid = 0.;
i__1 = *ndimen;
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: */
}
if (bid > eps1) {
bidon = xmaxj[i__ - ncut];
i__2 = *ndimen;
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;
/* L310: */
}
bid = 0.;
i__1 = *ndimen;
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: */
}
if (bid > eps1) {
i__1 = *ndimen;
for (ii = 1; ii <= i__1; ++ii) {
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;
} else {
iunit = ii;
irmax = 1;
i__1 = *ndimen;
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__;
}
/* ___ Calculate the norme */
- if ((d__1 = vecteu[irmax], abs(d__1)) < 1.) {
+ if ((d__1 = vecteu[irmax], advapp_abs(d__1)) < 1.) {
xsom = 0.;
i__1 = *ndimen;
for (i__ = 1; i__ <= i__1; ++i__) {
}
/* L300: */
}
- ret_val = (d__1 = vecteu[irmax], abs(d__1)) * sqrt(xsom);
+ ret_val = (d__1 = vecteu[irmax], advapp_abs(d__1)) * sqrt(xsom);
}
/* ***********************************************************************
mcrgene_.icore[mcrgene_.ncore * 12 - 10];
/* Computing MAX */
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;
myitermax: Integer from Standard;
myfirstC: Constraint from AppParCurves;
mylastC: Constraint from AppParCurves;
+myMultiLineNb: Integer from Standard;
+myIsClear : Boolean from Standard;
end ComputeLine;
#include <stdio.h>
-static Standard_Boolean IsClear = Standard_False;
-static Standard_Integer nbML = 0;
-
#ifdef DEB
static Standard_Boolean mydebug = Standard_False;
const Standard_Integer NbIterations,
const Standard_Boolean cutting,
const Standard_Boolean Squares)
+: myMultiLineNb (0),
+ myIsClear (Standard_False)
{
myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(),
Parameters.Upper());
const Standard_Integer NbIterations,
const Standard_Boolean cutting,
const Standard_Boolean Squares)
+: myMultiLineNb (0),
+ myIsClear (Standard_False)
{
myfirstParam = new TColStd_HArray1OfReal(Parameters.Lower(),
Parameters.Upper());
const Standard_Boolean cutting,
const Approx_ParametrizationType parametrization,
const Standard_Boolean Squares)
+: myMultiLineNb (0),
+ myIsClear (Standard_False)
{
myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2);
Par = parametrization;
const Standard_Boolean cutting,
const Approx_ParametrizationType parametrization,
const Standard_Boolean Squares)
+: myMultiLineNb (0),
+ myIsClear (Standard_False)
{
myConstraints = new AppParCurves_HArray1OfConstraintCouple(1, 2);
alldone = Standard_False;
#ifdef DEB
if (mydebug) DUMP(Line);
#endif
- if (!IsClear) {
+ if (!myIsClear)
+ {
myMultiCurves.Clear();
myPar.Clear();
Tolers3d.Clear();
Tolers2d.Clear();
- nbML = 0;
+ myMultiLineNb = 0;
}
- else IsClear = Standard_False;
+ else myIsClear = Standard_False;
Standard_Integer i, nbp, Thefirstpt, Thelastpt, oldlastpt;
Standard_Boolean Finish = Standard_False,
-LineTool::LastPoint(OtherLine);
//-- Si MakeML a echoue on retourne une ligne vide
-
- if( (nbpdsotherligne == 0) || nbML >= 3) {
+ if ((nbpdsotherligne == 0) || myMultiLineNb >= 3)
+ {
FailOnPointsAdded = Standard_True;
//-- cout<<" ** ApproxComputeLine MakeML Echec ** LBR lbr "<<endl;
if (myfirstpt == mylastpt) break; // Pour etre sur de ne pas
mylastpt = Thelastpt;
}
- else {
- IsClear = Standard_True;
- nbML++;
+ else
+ {
+ myIsClear = Standard_True;
+ ++myMultiLineNb;
Perform(OtherLine);
myfirstpt = mylastpt;
- mylastpt = Thelastpt;
+ mylastpt = Thelastpt;
}
}
#include <CPnts_AbscissaPoint.hxx>
#include <Approx_CurvlinFunc.hxx>
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx>
static OSD_Chronometer chr_total, chr_init, chr_approx;
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
{
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0;
InitChron(chr_total);
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init);
#endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C3D, Tol/10);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init);
#endif
fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx);
#endif
MaxDegree, MaxSegments,
evC, CutTool);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx);
#endif
}
myMaxError3d = aApprox.MaxError(3,1);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
{
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0;
InitChron(chr_total);
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol/2.);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init);
#endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D, Surf, Tol/20);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init);
#endif
fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx);
#endif
MaxDegree, MaxSegments,
evCOnS, CutTool);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx);
#endif
myMaxError2d1 = Max (aApprox.MaxError(1,1),aApprox.MaxError(1,2));
myMaxError3d = aApprox.MaxError(3,1);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
{
Standard_Integer i;
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0;
InitChron(chr_total);
Handle(TColStd_HArray1OfReal) ThreeDTol = new TColStd_HArray1OfReal(1,Num3DSS);
ThreeDTol->Init(Tol/2);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init);
#endif
Handle(Approx_CurvlinFunc) fonct = new Approx_CurvlinFunc(C2D1, C2D2, Surf1, Surf2, Tol/20);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init, t_init);
#endif
fonct->Intervals(CutPnts_C3,GeomAbs_C3);
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx);
#endif
MaxDegree, MaxSegments,
evCOn2S, CutTool);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx, t_approx);
#endif
myMaxError2d2 = Max (aApprox.MaxError(1,3),aApprox.MaxError(1,4));
myMaxError3d = aApprox.MaxError(3,1);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
myLength1: Real from Standard;
myLength2: 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;
mySi_1 : HArray1OfReal from TColStd;
myUi_2 : HArray1OfReal from TColStd;
#include <GCPnts_AbscissaPoint.hxx>
#include <Precision.hxx>
-static Standard_Real myPrevS, myPrevU;
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx>
static OSD_Chronometer chr_uparam;
Standard_EXPORT Standard_Integer uparam_count;
myCase(1),
myFirstS(0),
myLastS(1),
- myTolLen(Tol)
+ myTolLen(Tol),
+ myPrevS (0.0),
+ myPrevU (0.0)
{
Init();
}
myCase(2),
myFirstS(0),
myLastS(1),
- myTolLen(Tol)
+ myTolLen(Tol),
+ myPrevS (0.0),
+ myPrevU (0.0)
{
Init();
}
myCase(3),
myFirstS(0),
myLastS(1),
- myTolLen(Tol)
+ myTolLen(Tol),
+ myPrevS (0.0),
+ myPrevU (0.0)
{
Init();
}
for(i = Si->Lower(); i<= Si->Upper(); i++)
Si->ChangeValue(i) /= Len;
- myPrevS = myFirstS;
- myPrevU = FirstU;
+ // TODO - fields should be mutable
+ const_cast<Approx_CurvlinFunc*>(this)->myPrevS = myFirstS;
+ const_cast<Approx_CurvlinFunc*>(this)->myPrevU = FirstU;
}
void Approx_CurvlinFunc::SetTol(const Standard_Real Tol)
Standard_Real deltaS, base, U, Length;
Standard_Integer NbInt, NInterval, i;
Handle(TColStd_HArray1OfReal) InitUArray, InitSArray;
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_uparam);
#endif
if(S < 0 || S > 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter");
U = GCPnts_AbscissaPoint(C, deltaS, base, UGuess, myTolLen).Parameter();
- myPrevS = S;
- myPrevU = U;
+ // TODO - fields should be mutable
+ 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);
uparam_count++;
#endif
#include <Geom2d_BSplineCurve.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx>
OSD_Chronometer chr_total, chr_init, chr_approx, chr_booltool;
void BRepAlgo_NormalProjection::Build()
{
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
Standard_Integer init_count = 0, approx_count = 0, booltool_count = 0;
t_total = 0;
t_init = 0;
TolU = hsur->UResolution(myTol3d)/20;
TolV = hsur->VResolution(myTol3d)/20;
// Projection
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init);
#endif
Projector =
ProjLib_CompProjectedCurve(hsur, hcur, TolU, TolV, myMaxDist);
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init,t_init);
init_count++;
#endif
BB.UpdateVertex(TopExp::LastVertex(TopoDS::Edge(prj)),myTol3d);
}
else {
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_approx);
#endif
Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d,
myContinuity, myMaxDegree, myMaxSeg,
Only3d, Only2d);
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_approx,t_approx);
approx_count++;
if(myFaceBounds) {
// Trimming edges by face bounds
// if the solution is degenerated, use of BoolTool is avoided
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_booltool);
#endif
if(!Degenerated){
myAncestorMap.Bind(prj, Edges->Value(i));
myCorresp.Bind(prj, Faces->Value(j));
}
-#ifdef DEBUG
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_booltool,t_booltool);
booltool_count++;
#endif
myIsDone = Standard_True;
-#if DEBUG
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_total,t_total);
cout<<"Build - Total time : "<<t_total<<" includes:" <<endl;
const Standard_Real Tol,
const TopoDS_Face& Face) {
- static IntCurveSurface_HInter HICS;
- static BRepAdaptor_Surface surface;
- static BRepClass_FaceClassifier classifier2d;
+ IntCurveSurface_HInter HICS;
+ BRepAdaptor_Surface surface;
+ BRepClass_FaceClassifier classifier2d;
Handle(Geom_Line) geomline = new Geom_Line(L);
GeomAdaptor_Curve LL(geomline);
Pnt from gp,
Pnt2d from gp,
Lin from gp,
+ Vec from gp,
Face from TopoDS,
Shell from TopoDS,
Shape from TopoDS,
Param: out Real 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;
P: out Pnt from gp;
u,v: out Real from Standard)
Index: out Integer from Standard)
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;
- 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)
+ 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;
+ theVecD1U, theVecD1V: out Vec from gp)
returns Boolean from Standard is static ;
---Purpose: <Index> gives point index to search from and returns
-- point index of succeseful search
#include <BRep_Tool.hxx>
#include <BRepClass_FaceClassifier.hxx>
//<-OCC454(apo)
-static Standard_Integer numedg=0;
-static gp_Vec staticd1u_gp_vec;
-static gp_Vec staticd1v_gp_vec;
//=======================================================================
//function : FindAPointInTheFace
Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
(const TopoDS_Face& _face,
gp_Pnt& APoint_,
- Standard_Real& param_)
-{
+ Standard_Real& param_)
+{
Standard_Real u,v;
Standard_Boolean r = FindAPointInTheFace(_face,APoint_,u,v,param_);
return r;
(const TopoDS_Face& _face,
gp_Pnt& APoint_,
Standard_Real& u_, Standard_Real& v_,
- Standard_Real& param_)
-{
- TopoDS_Face face=_face;
- face.Orientation(TopAbs_FORWARD);
-
- TopExp_Explorer faceexplorer;
+ Standard_Real& param_)
+{
+ gp_Vec aVecD1U, aVecD1V;
+ return FindAPointInTheFace (_face, APoint_, u_, v_, param_, aVecD1U, aVecD1V);
+}
+
+//=======================================================================
+//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;
gp_Vec2d T;
gp_Pnt2d P;
- //Standard_Boolean Ok = Standard_False;
- Standard_Integer nedg=1;
+
for (faceexplorer.Init(face,TopAbs_EDGE);
faceexplorer.More();
- faceexplorer.Next()) {
- if(numedg==0 || nedg++==numedg) {
- TopoDS_Edge Edge = TopoDS::Edge(faceexplorer.Current());
- c.Initialize(Edge,face);
+ faceexplorer.Next())
+ {
+ TopoDS_Edge Edge = TopoDS::Edge (faceexplorer.Current());
+ c.Initialize (Edge, face);
#ifdef DEB
- Standard_Integer nbinterval =
+ Standard_Integer nbinterval =
#endif
- c.NbIntervals(GeomAbs_C1);
- c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(),P,T);
-
- Standard_Real x=T.X();
- Standard_Real y=T.Y();
- if(Edge.Orientation() == TopAbs_FORWARD) {
- T.SetCoord(-y,x);
- }
- else {
- T.SetCoord(y,-x);
- }
- Standard_Real ParamInit = RealLast();
- Standard_Real TolInit = 0.00001;
- Standard_Boolean APointExist = Standard_False;
-
- BRepClass_FacePassiveClassifier FClassifier;
-
- T.Normalize();
- P.SetCoord(P.X()+TolInit*T.X(),P.Y()+TolInit*T.Y());
- FClassifier.Reset(gp_Lin2d(P,T),ParamInit,RealEpsilon()); //-- Length and Tolerance #######
-
- TopExp_Explorer otherfaceexplorer;
-// Modified by Sergey KHROMOV - Tue Apr 1 11:32:51 2003 Begin
- Standard_Integer aNbEdges = 0;
- for (otherfaceexplorer.Init(face,TopAbs_EDGE);
- otherfaceexplorer.More();
- otherfaceexplorer.Next(), aNbEdges++) {
-// for (otherfaceexplorer.Init(face,TopAbs_EDGE);
-// otherfaceexplorer.More();
-// otherfaceexplorer.Next()) {
-// Modified by Sergey KHROMOV - Tue Apr 1 11:32:52 2003 End
- TopoDS_Edge OtherEdge = TopoDS::Edge(otherfaceexplorer.Current());
- if((OtherEdge.Orientation() == TopAbs_EXTERNAL ||
- OtherEdge == Edge)) {
- }
- else {
- BRepClass_Edge AEdge(OtherEdge,face);
- FClassifier.Compare(AEdge,OtherEdge.Orientation());
- if(FClassifier.ClosestIntersection()) {
- //-- cout<<" ---> Edge : "<<FClassifier.Parameter()<<endl;
- 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;
- }
- }
+ c.NbIntervals(GeomAbs_C1);
+ c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(),P,T);
+
+ Standard_Real x = T.X();
+ Standard_Real y = T.Y();
+ if (Edge.Orientation() == TopAbs_FORWARD)
+ {
+ T.SetCoord (-y, x);
+ }
+ else
+ {
+ T.SetCoord ( y, -x);
+ }
+ Standard_Real ParamInit = RealLast();
+ Standard_Real TolInit = 0.00001;
+ Standard_Boolean APointExist = Standard_False;
+
+ BRepClass_FacePassiveClassifier FClassifier;
+
+ T.Normalize();
+ P.SetCoord (P.X() + TolInit * T.X(), P.Y() + TolInit * T.Y());
+ FClassifier.Reset (gp_Lin2d (P, T), ParamInit, RealEpsilon()); //-- Length and Tolerance #######
+
+ TopExp_Explorer otherfaceexplorer;
+ Standard_Integer aNbEdges = 0;
+ for (otherfaceexplorer.Init (face, TopAbs_EDGE);
+ otherfaceexplorer.More();
+ otherfaceexplorer.Next(), ++aNbEdges)
+ {
+ TopoDS_Edge OtherEdge = TopoDS::Edge (otherfaceexplorer.Current());
+ if (OtherEdge.Orientation() != TopAbs_EXTERNAL && OtherEdge != Edge)
+ {
+ BRepClass_Edge AEdge (OtherEdge, face);
+ FClassifier.Compare (AEdge, OtherEdge.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;
+}
+
+//=======================================================================
+//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) const
+{
+ gp_Vec aVecD1U, aVecD1V;
+ return PointInTheFace (Face, APoint_, u_, v_, param_, IndexPoint, surf,
+ U1, V1, U2, V2, aVecD1U, aVecD1V);
}
//=======================================================================
const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
- const Standard_Real V2 ) const
-{
+ const Standard_Real V2,
+ gp_Vec& theVecD1U,
+ gp_Vec& theVecD1V) const
+{
Standard_Real u,du = (U2-U1)/6.0;
Standard_Real v,dv = (V2-V1)/6.0;
if(du<1e-12) du=1e-12;
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
- IndexPoint = NbPntCalc;
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
+ IndexPoint = NbPntCalc;
return(Standard_True);
}
}
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc;
return(Standard_True);
}
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc;
return(Standard_True);
}
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc;
return(Standard_True);
}
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc;
return(Standard_True);
}
if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v;
- surf->D1(u,v,APoint_,staticd1u_gp_vec,staticd1v_gp_vec);
+ surf->D1 (u, v, APoint_, theVecD1U, theVecD1V);
IndexPoint = NbPntCalc;
return(Standard_True);
}
else {
//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);
}
//=======================================================================
Standard_Real& _Par)
//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;
TopExp_Explorer faceexplorer;
//TopExp_Explorer edgeexplorer;
gp_Pnt APoint;
+ gp_Vec aVecD1U, aVecD1V;
Standard_Real maxscal=0;
Standard_Boolean ptfound=Standard_False;
Standard_Real Par;
// if(IsInfiniteUV(U1,V1,U2,V2)){//OCC454(apo)->
GeomAdaptor_Surface GA(BRep_Tool::Surface(face));
- static Standard_Real TolU = Precision::PConfusion(), TolV = TolU;
Extrema_ExtPS Ext(P,GA,TolU,TolV);
if (Ext.IsDone() && Ext.NbExt() > 0) {
// evaluate the lower distance and its index;
_Par = V.Magnitude();
L = gp_Lin(P,V);
ptfound=Standard_True;
- numedg=0;
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
//return ;
return 0;
// 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
- do {
- if(PointInTheFace(face,APoint,_u,_v,myParamOnEdge,++IndexPoint,surf,U1,V1,U2,V2)) {
- NbPointsOK++;
- gp_Vec V(P,APoint);
- Par = V.Magnitude();
- if(Par > gp::Resolution()) {
- gp_Vec Norm=staticd1u_gp_vec.Crossed(staticd1v_gp_vec);
- Standard_Real tt = Norm.Magnitude();
- tt=Abs(Norm.Dot(V))/(tt*Par);
- if(tt>maxscal) {
- maxscal=tt;
- L = gp_Lin(P,V);
- _Par=Par;
- ptfound=Standard_True;
- if(maxscal>0.2) {
- myParamOnEdge=svmyparam;
- numedg=0;
- //modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
- //return ;
- return 0;
- //modified by NIZNHY-PKV Thu Nov 14 12:25:33 2002 t
- }
- }
- }
- }
+ do {
+ if (PointInTheFace (face, APoint, _u, _v, myParamOnEdge, ++IndexPoint, surf,
+ U1, V1, U2, V2,
+ aVecD1U, aVecD1V))
+ {
+ ++NbPointsOK;
+ gp_Vec V (P, APoint);
+ Par = V.Magnitude();
+ if (Par > gp::Resolution())
+ {
+ gp_Vec Norm = aVecD1U.Crossed (aVecD1V);
+ Standard_Real tt = Norm.Magnitude();
+ tt = Abs (Norm.Dot (V)) / (tt * Par);
+ if (tt > maxscal)
+ {
+ maxscal = tt;
+ L = gp_Lin (P, V);
+ _Par = Par;
+ ptfound = Standard_True;
+ if (maxscal>0.2)
+ {
+ myParamOnEdge=svmyparam;
+ return 0;
+ }
+ }
+ }
+ }
}
while(IndexPoint<200 && NbPointsOK<16);
myParamOnEdge=svmyparam;
- numedg=0;
if(maxscal>0.2) {
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
//return ;
#include <BRep_CurveRepresentation.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TVertex.hxx>
+#include <AdvApprox_ApproxAFunction.hxx>
#include <Approx_SameParameter.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <Geom_BSplineSurface.hxx>
+// TODO - not thread-safe static variables
static Standard_Real thePrecision = Precision::Confusion();
static Handle(Geom_Plane) thePlane;
else
GP = Handle(Geom_Plane)::DownCast(S);
- static Handle(GeomAdaptor_HCurve) HC;
- static Handle(GeomAdaptor_HSurface) HS;
- if (HC.IsNull()) {
- HC = new GeomAdaptor_HCurve();
- HS = new GeomAdaptor_HSurface();
- }
+ Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve();
+ Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
TopLoc_Location LC;
Standard_Real First, Last;
const Standard_Integer NCONTROL = 22;
- static Handle(GeomAdaptor_HCurve) HC;
- static Handle(Geom2dAdaptor_HCurve) HC2d;
- static Handle(GeomAdaptor_HSurface) HS;
- if(HC.IsNull()){
- HC = new GeomAdaptor_HCurve();
- HC2d = new Geom2dAdaptor_HCurve();
- HS = new GeomAdaptor_HSurface();
- }
+ Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve();
+ Handle(Geom2dAdaptor_HCurve) HC2d = new Geom2dAdaptor_HCurve();
+ Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface();
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d();
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
Standard_Real Eps2 = BRep_Tool::Tolerance(V);
Eps2 *= Eps2;
- static Handle(Geom2dAdaptor_HCurve) HG2AHC;
- if ( HG2AHC.IsNull() ) HG2AHC = new Geom2dAdaptor_HCurve();
+ Handle(Geom2dAdaptor_HCurve) HG2AHC = new Geom2dAdaptor_HCurve();
HG2AHC->Set(C);
- static Handle(GeomAdaptor_HSurface) HGAHS;
- if ( HGAHS.IsNull() ) HGAHS = new GeomAdaptor_HSurface();
+ Handle(GeomAdaptor_HSurface) HGAHS = new GeomAdaptor_HSurface();
HGAHS->Set(S);
Adaptor3d_CurveOnSurface ACOS(HG2AHC,HGAHS);
// in TangExtendToConstraint; Continuity can be equal to 0
//
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#include <BSplCLib.ixx>
#include <PLib.hxx>
+#include <PLib_LocalArray.hxx>
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
class BSplCLib_LocalMatrix : public math_Matrix
{
- public:
+public:
BSplCLib_LocalMatrix (Standard_Integer DerivativeRequest, Standard_Integer Order)
: math_Matrix (myBuffer, 1, DerivativeRequest + 1, 1, Order)
{
- if ( DerivativeRequest > BSplCLib::MaxDegree() ||
- Order > BSplCLib::MaxDegree()+1 ||
- BSplCLib::MaxDegree() > 25 )
- Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
+ Standard_OutOfRange_Raise_if (DerivativeRequest > BSplCLib::MaxDegree() ||
+ Order > BSplCLib::MaxDegree()+1 || BSplCLib::MaxDegree() > 25,
+ "BSplCLib: bspline degree is greater than maximum supported");
}
-
+
private:
// local buffer, to be sufficient for addressing by index [Degree+1][Degree+1]
// (see math_Matrix implementation)
Standard_Real myBuffer[27*27];
};
-//=======================================================================
-//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;
-};
+typedef PLib_LocalArray BSplCLib_LocalArray;
//=======================================================================
//function : Hunt
// 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)
{
- if ( Degree < 1 || Degree > MaxDegree() || MaxDegree() != 25 )
- Standard_OutOfRange::Raise ("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 };
+ Standard_OutOfRange_Raise_if (Degree < 1 || Degree > MaxDegree() || MaxDegree() != 25,
+ "Bezier curve degree greater than maximal supported");
+
return knots[25-Degree];
}
// BSpline Curve in 2d space
// **************************
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#define Dimension_gen 2
#define Array1OfPoints TColgp_Array1OfPnt2d
#define BSplCLib_DataContainer BSplCLib_DataContainer_2d
#include <BSplCLib_CurveComputation.gxx>
-
// EvalBsplineBasis,
// EvalPolynomial : Horners method
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#include <Standard_Stream.hxx>
#include <BSplCLib.hxx>
struct BSplCLib_DataContainer
{
- BSplCLib_DataContainer(Standard_Integer Degree)
+ BSplCLib_DataContainer(Standard_Integer Degree)
{
- if ( Degree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25 )
- Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
+ Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree() ||
+ BSplCLib::MaxDegree() > 25,
+ "BSplCLib: bspline degree is greater than maximum supported");
}
Standard_Real poles[2*(25+1)];
for (ii = 1 ; ii <= num_new_poles ; ii++) {
contact_order_array(ii) = 0 ;
- (*FunctionPtr)(contact_order_array(ii),
+ FunctionPtr.Evaluate (contact_order_array(ii),
start_end,
parameters(ii),
result,
- error_code) ;
+ error_code);
if (error_code) {
Status = 1 ;
goto FINISH ;
for (ii = 1 ; ii <= num_new_poles ; ii++) {
contact_order_array(ii) = 0 ;
- (*FunctionPtr)(contact_order_array(ii),
+ FunctionPtr.Evaluate (contact_order_array(ii),
start_end,
parameters(ii),
result,
- error_code) ;
+ error_code);
if (error_code) {
Status = 1 ;
goto FINISH ;
// BSpline Curve in 3d space
// ***************************
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#define Dimension_gen 3
#define Array1OfPoints TColgp_Array1OfPnt
#define BSplCLib_DataContainer BSplCLib_DataContainer_3d
#include <BSplCLib_CurveComputation.gxx>
-
#include <PLib.hxx>
#include <math_Matrix.hxx>
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
//=======================================================================
//struct : BSplCLib_DataContainer
//purpose: Auxiliary structure providing buffers for poles and knots used in
{
BSplCLib_DataContainer(Standard_Integer Degree)
{
- if ( Degree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25 )
- Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
+ Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree() ||
+ BSplCLib::MaxDegree() > 25,
+ "BSplCLib: bspline degree is greater than maximum supported");
}
Standard_Real poles[(25+1)*(Dimension_gen+1)];
array_of_new_poles[0],
Status) ;
}
-
// Author: Xavier BENVENISTE
// <xab@zozox.paris1.matra-dtv.fr>
-
#ifndef _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
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#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
// pmn 07-10-96 : Correction de DN dans le cas rationnal.
// pmn 06-02-97 : Correction des poids dans RationalDerivative. (PRO700)
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#include <BSplSLib.ixx>
#include <PLib.hxx>
+#include <PLib_LocalArray.hxx>
#include <BSplCLib.hxx>
#include <TColgp_Array2OfXYZ.hxx>
#include <TColgp_Array1OfXYZ.hxx>
#include <math_Matrix.hxx>
// 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
#define M_SQRT2 1.4142135623730950488016887
#endif
// 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() ||
- VDegree > BSplCLib::MaxDegree() ||
- BSplCLib::MaxDegree() != 25 )
- Standard_OutOfRange::Raise ("BSplCLib: bspline degree is greater than maximum supported");
+ Standard_OutOfRange_Raise_if (UDegree > BSplCLib::MaxDegree() ||
+ VDegree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25,
+ "BSplSLib: bspline degree is greater than maximum supported");
}
Standard_Real poles[4*(25+1)*(25+1)];
Standard_Real ders[48];
};
-//=======================================================================
-//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;
-};
+typedef PLib_LocalArray BSplSLib_LocalArray;
//**************************************************************************
// Evaluation methods
iiM1 = - M1;
iiM3 = - M3;
- PLib::Binomial(N);
- PLib::Binomial(M);
for (ii = 0 ; ii <= N ; ii++) {
iiM1 += M1;
NewDenominator(ii,jj),
NewNumerator(ii,jj)) ;
- Function(0,
+ Function.Evaluate (0,
UParameters(ii),
VParameters(jj),
result,
Standard_ConstructionError::Raise();
}
}
-
// Author: Xavier BENVENISTE
// <xab@zozox.paris1.matra-dtv.fr>
-
#ifndef _BSplSLib_EvaluatorFunction_HeaderFile
#define _BSplSLib_EvaluatorFunction_HeaderFile
-
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#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
{
Standard_Integer i,j;
gp_Vec D(0,0,0),VG,VD,PV;
- PLib::Binomial(Nu);
- PLib::Binomial(Nv);
for(i=0;i<=Nu;i++)
for(j=0;j<=Nv;j++){
VG=DerSurf.Value(i+1,j);
{
Standard_Integer i,j;
gp_Vec D(0,0,0),VG,VD,PV;
- PLib::Binomial(Nu);
- PLib::Binomial(Nv);
for(i=0;i<=Nu;i++)
for(j=0;j<=Nv;j++){
VG=DerSurf1.Value(i+1,j);
Dnorm=DerNUV.Value(Iduref,Idvref)*DerVecNor.Value(0,0);
TabNorm.SetValue(0,0,Dnorm);
TabScal.SetValue(0,0,0.);
-PLib::Binomial(Kderiv + Iduref);
-PLib::Binomial(Kderiv + Idvref);
for ( Mderiv = 1;Mderiv <= Kderiv; Mderiv++)
for ( Pderiv = 0 ; Pderiv <= Mderiv ; Pderiv++)
{
Standard_Real co,si;
co=cos(X);
si=sin(X);
- PLib::Binomial(myK0);
for(Standard_Integer i=0;i<=myK0;i++){
F=F+PLib::Bin(myK0,i)*pow(co,i)*pow(si,(myK0-i))*myTABli(i);
return TheCurve;
}
-
-
//=======================================================================
-//function : law_evaluator
+//class : law_evaluator
//purpose :
//=======================================================================
-static Handle(Geom2d_BSplineCurve) Ancore = NULL ;
-
-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 ;
-}
+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;
+
+};
+
//=======================================================================
//function : MultNumandDenom
a->Poles(aPoles);
a->Multiplicities(aMults);
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,
a->Degree(),aKnots,aMults,
for (jj=1;jj<=2;jj++)
BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii));
//POP pour NT
- BSplCLib_EvaluatorFunction ev = law_evaluator;
+ Geom2dConvert_law_evaluator ev (anAncore);
BSplCLib::FunctionMultiply(ev,
BS->Degree(),
BSFlatKnots,
}
//=======================================================================
-//function :reparameterise_evaluator
+//class :reparameterise_evaluator
//purpose :
//=======================================================================
-static Standard_Real polynomial_coefficient[3] ;
-
-static void reparameterise_evaluator(
- const Standard_Integer DerivativeRequest,
-// const Standard_Real *StartEnd,
- const Standard_Real *,
- const Standard_Real Parameter,
- Standard_Real & Result,
- Standard_Integer & ErrorCode) {
- ErrorCode = 0 ;
- PLib::EvalPolynomial(Parameter,
- DerivativeRequest,
- 2,
- 1,
- polynomial_coefficient[0],
- Result) ;
-}
+class Geom2dConvert_reparameterise_evaluator : public BSplCLib_EvaluatorFunction
+{
+
+public:
+
+ Geom2dConvert_reparameterise_evaluator (const Standard_Real thePolynomialCoefficient[3])
+ {
+ memcpy(myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient));
+ }
+
+ virtual void Evaluate (const Standard_Integer theDerivativeRequest,
+ const Standard_Real* /*theStartEnd*/,
+ const Standard_Real theParameter,
+ Standard_Real& theResult,
+ Standard_Integer& theErrorCode) const
+ {
+ 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
index=0;
Pretreatment(ArrayOfCurves);
+ Standard_Real aPolynomialCoefficient[3];
+
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
indexmin=Indexmin(ArrayOfCurves);
if (indexmin!=(ArrayOfCurves.Length()-1))
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax);
- polynomial_coefficient[2]=a;
+ aPolynomialCoefficient[2] = a;
b=(1/lambda);
- polynomial_coefficient[1]=b;
+ aPolynomialCoefficient[1] = b;
c=umin;
- polynomial_coefficient[0]=c;
+ aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults);
for (jj=1;jj<=2;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour NT
- BSplCLib_EvaluatorFunction ev = reparameterise_evaluator;
+ Geom2dConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
Curve1FlatKnots,
Standard_Integer k=0;
index=0;
Pretreatment(ArrayOfCurves);
+ Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
ArrayOfIndices->SetValue(0,0);
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax);
- polynomial_coefficient[2]=a;
+ aPolynomialCoefficient[2] = a;
b=(1/lambda);
- polynomial_coefficient[1]=b;
+ aPolynomialCoefficient[1] = b;
c=umin;
- polynomial_coefficient[0]=c;
+ aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults);
for (jj=1;jj<=2;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour NT
- BSplCLib_EvaluatorFunction ev = reparameterise_evaluator;
+ Geom2dConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
// BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
//=======================================================================
-//function : law_evaluator
+//class : law_evaluator
//purpose : usefull to estimate the value of a function
//=======================================================================
-static Handle(Geom2d_BSplineCurve) Ancore = NULL ;
-
-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 ;
-}
+class GeomConvert_law_evaluator : public BSplCLib_EvaluatorFunction
+{
+
+public:
+
+ GeomConvert_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;
+
+};
//=======================================================================
//function : MultNumandDenom
a->Poles(aPoles);
a->Multiplicities(aMults);
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
a->Degree(),aKnots,aMults,
for (jj=1;jj<=3;jj++)
BSPoles(ii).SetCoord(jj,BSPoles(ii).Coord(jj)*BSWeights(ii));
//POP pour WNT
- BSplCLib_EvaluatorFunction ev = law_evaluator;
-
+ GeomConvert_law_evaluator ev (anAncore);
+
BSplCLib::FunctionMultiply(ev,
BS->Degree(),
BSFlatKnots,
}
//=======================================================================
-//function :reparameterise_evaluator
-//purpose :
+//class : reparameterise_evaluator
+//purpose :
//=======================================================================
-static Standard_Real polynomial_coefficient[3] ;
-
-static void reparameterise_evaluator(
- const Standard_Integer DerivativeRequest,
-// const Standard_Real *StartEnd,
- const Standard_Real *,
- const Standard_Real Parameter,
- Standard_Real & Result,
- Standard_Integer & ErrorCode) {
- ErrorCode = 0 ;
- PLib::EvalPolynomial(Parameter,
- DerivativeRequest,
- 2,
- 1,
- polynomial_coefficient[0],
- Result) ;
-}
+class GeomConvert_reparameterise_evaluator : public BSplCLib_EvaluatorFunction
+{
+
+public:
+
+ GeomConvert_reparameterise_evaluator (const Standard_Real thePolynomialCoefficient[3])
+ {
+ memcpy (myPolynomialCoefficient, thePolynomialCoefficient, sizeof(myPolynomialCoefficient));
+ }
+
+ virtual void Evaluate (const Standard_Integer theDerivativeRequest,
+ const Standard_Real* /*theStartEnd*/,
+ const Standard_Real theParameter,
+ Standard_Real& theResult,
+ Standard_Integer& theErrorCode) const
+ {
+ 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
index=0;
Pretreatment(ArrayOfCurves);
+ Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
indexmin=Indexmin(ArrayOfCurves);
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax);
- polynomial_coefficient[2]=a;
+ aPolynomialCoefficient[2] = a;
b=(1/lambda);
- polynomial_coefficient[1]=b;
+ aPolynomialCoefficient[1] = b;
c=umin;
- polynomial_coefficient[0]=c;
+ aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults);
for (jj=1;jj<=3;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour WNT
- BSplCLib_EvaluatorFunction ev = reparameterise_evaluator;
+ GeomConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
// BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
Standard_Integer k=0;
index=0;
Pretreatment(ArrayOfCurves);
+ Standard_Real aPolynomialCoefficient[3];
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
ArrayOfIndices->SetValue(0,0);
umin=Curve1->FirstParameter(),umax=Curve1->LastParameter();
tmax=2*lambda*(umax-umin)/(1+lambda*lambda2);
a=(lambda*lambda2-1)/(2*lambda*tmax);
- polynomial_coefficient[2]=a;
+ aPolynomialCoefficient[2] = a;
b=(1/lambda);
- polynomial_coefficient[1]=b;
+ aPolynomialCoefficient[1] = b;
c=umin;
- polynomial_coefficient[0]=c;
+ aPolynomialCoefficient[0] = c;
TColStd_Array1OfReal Curve1FlatKnots(1,Curve1->NbPoles()+Curve1->Degree()+1);
TColStd_Array1OfInteger KnotC1Mults(1,Curve1->NbKnots());
Curve1->Multiplicities(KnotC1Mults);
for (jj=1;jj<=3;jj++)
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour WNT
- BSplCLib_EvaluatorFunction ev = reparameterise_evaluator;
+ GeomConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
#include <TColStd_HArray1OfReal.hxx>
#include <AdvApprox_PrefAndRec.hxx>
-static Handle(Adaptor3d_HSurface) fonct;
+class GeomConvert_ApproxSurface_Eval : public AdvApp2Var_EvaluatorFunc2Var
+{
+
+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;
+
+};
+
-extern "C" void mySurfEval1(Standard_Integer * Dimension,
+void GeomConvert_ApproxSurface_Eval::Evaluate (Standard_Integer * Dimension,
// Dimension
Standard_Real * UStartEnd,
// StartEnd[2] in U
// Derivative Request in V
Standard_Real * Result,
// Result[Dimension,N]
- Standard_Integer * ErrorCode)
+ Standard_Integer * ErrorCode) const
// Error Code
{
*ErrorCode = 0;
// Initialisation
- fonct = fonct->UTrim(UStartEnd[0], UStartEnd[1], Precision::PConfusion());
- fonct = fonct->VTrim(VStartEnd[0], VStartEnd[1], Precision::PConfusion());
+ myAdaptor = myAdaptor->UTrim (UStartEnd[0], UStartEnd[1], Precision::PConfusion());
+ myAdaptor = myAdaptor->VTrim (VStartEnd[0], VStartEnd[1], Precision::PConfusion());
/*
for (idim=1;idim<=*Dimension;idim++) {
for (jpar=1;jpar<=*NbParams;jpar++) {
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
- pnt = fonct->Value(Upar,Vpar);
+ pnt = myAdaptor->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
- fonct->D1(Upar, Vpar, pnt, v1, v2);
+ myAdaptor->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
case 3 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v8.X();
Result[1+(jpar-1)*(*Dimension)] = v8.Y();
case 4 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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[1+(jpar-1)*(*Dimension)] = vect.Y();
Result[2+(jpar-1)*(*Dimension)] = vect.Z();
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
- pnt = fonct->Value(Upar,Vpar);
+ pnt = myAdaptor->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
- fonct->D1(Upar, Vpar, pnt, v1, v2);
+ myAdaptor->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
case 3 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v8.X();
Result[1+(jpar-1)*(*Dimension)] = v8.Y();
case 4 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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[1+(jpar-1)*(*Dimension)] = vect.Y();
Result[2+(jpar-1)*(*Dimension)] = vect.Z();
const Standard_Integer MaxSegments,
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);
// " Init des nombres de sous-espaces et des tolerances"
GeomAbs_IsoType IsoType = GeomAbs_IsoV;
Standard_Integer NbDec;
- NbDec = fonct->NbUIntervals(GeomAbs_C2);
+ NbDec = aSurfAdaptor->NbUIntervals(GeomAbs_C2);
TColStd_Array1OfReal UDec_C2(1, NbDec+1);
- fonct->UIntervals(UDec_C2, GeomAbs_C2);
- NbDec = fonct->NbVIntervals(GeomAbs_C2);
+ aSurfAdaptor->UIntervals(UDec_C2, GeomAbs_C2);
+ NbDec = aSurfAdaptor->NbVIntervals(GeomAbs_C2);
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);
- 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);
- fonct->VIntervals(VDec_C3, GeomAbs_C3);
+ aSurfAdaptor->VIntervals(VDec_C3, GeomAbs_C3);
// Approximation avec decoupe preferentiel
// aux lieux de discontinuitees C2
AdvApprox_PrefAndRec pUDec(UDec_C2,UDec_C3);
AdvApprox_PrefAndRec pVDec(VDec_C2,VDec_C3);
//POP pour WNT
- AdvApp2Var_EvaluatorFunc2Var ev = mySurfEval1;
+ GeomConvert_ApproxSurface_Eval ev (aSurfAdaptor);
AdvApp2Var_ApproxAFunc2Var approx(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
}
//=======================================================================
-//function : law_evaluator
-//purpose : usefull to estimate the value of a function of 2 variables
+//class : law_evaluator
+//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,
- const Standard_Real UParameter,
- const Standard_Real VParameter,
- Standard_Real & Result,
- Standard_Integer & ErrorCode) {
-
- ErrorCode = 0 ;
-
- if ((!(MyPtr == NULL)) &&
- (DerivativeRequest == 0)) {
- Result=MyPtr->Value(UParameter,VParameter);
- }
- else {
- ErrorCode = 1 ;
+ law_evaluator (const GeomLib_DenominatorMultiplierPtr theDenominatorPtr)
+ : myDenominator (theDenominatorPtr) {}
+
+ virtual void Evaluate (const Standard_Integer theDerivativeRequest,
+ const Standard_Real theUParameter,
+ const Standard_Real theVParameter,
+ Standard_Real& theResult,
+ Standard_Integer& theErrorCode) const
+ {
+ if ((myDenominator != NULL) && (theDerivativeRequest == 0))
+ {
+ theResult = myDenominator->Value (theUParameter, theVParameter);
+ theErrorCode = 0;
+ }
+ else
+ {
+ theErrorCode = 1;
+ }
}
-}
+
+private:
+
+ GeomLib_DenominatorMultiplierPtr myDenominator;
+
+};
+
//=======================================================================
//function : CheckIfKnotExists
//purpose : true if the knot already exists in the knot sequence
TColStd_Array1OfReal FlatKnots(1,length);
BSplCLib::KnotSequence(NewKnots->ChangeArray1(),NewMults->ChangeArray1(),FlatKnots);
- GeomLib_DenominatorMultiplier local_denominator(BSurf,FlatKnots) ;
- MyPtr = &local_denominator ; //definition of a(u,v)
+ GeomLib_DenominatorMultiplier aDenominator (BSurf, FlatKnots);
BuildFlatKnot(surface_u_knots,
surface_u_mults,
BSplCLib::KnotSequence(newuknots->ChangeArray1(),newumults->ChangeArray1(),newuflatknots);
BSplCLib::KnotSequence(newvknots->ChangeArray1(),newvmults->ChangeArray1(),newvflatknots);
//POP pour WNT
- BSplSLib_EvaluatorFunction ev = law_evaluator;
+ law_evaluator ev (&aDenominator);
// BSplSLib::FunctionMultiply(law_evaluator, //multiplication
BSplSLib::FunctionMultiply(ev, //multiplication
BSurf->UDegree(),
#include <Plate_Plate.hxx>
-static Handle(Geom_Surface) fonct = NULL;
+class GeomPlate_MakeApprox_Eval : public AdvApp2Var_EvaluatorFunc2Var
+{
+
+public:
+
+ 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:
-extern "C" void myPlateSurfEval(Standard_Integer * Dimension,
+ Handle(Geom_Surface) mySurf;
+
+};
+
+void GeomPlate_MakeApprox_Eval::Evaluate (Standard_Integer * Dimension,
// Dimension
Standard_Real * UStartEnd,
// StartEnd[2] in U
// Derivative Request in V
Standard_Real * Result,
// Result[Dimension,N]
- Standard_Integer * ErrorCode)
+ Standard_Integer * ErrorCode) const
// Error Code
-{
+{
*ErrorCode = 0;
Standard_Integer idim,jpar;
Standard_Real Upar,Vpar;
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
- pnt = fonct->Value(Upar,Vpar);
+ pnt = mySurf->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Vpar = Parameters[jpar-1];
- fonct->D1(Upar, Vpar, pnt, v1, v2);
+ mySurf->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
case 0 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
- pnt = fonct->Value(Upar,Vpar);
+ pnt = mySurf->Value (Upar, Vpar);
Result[(jpar-1)*(*Dimension)] = pnt.X();
Result[1+(jpar-1)*(*Dimension)] = pnt.Y();
Result[2+(jpar-1)*(*Dimension)] = pnt.Z();
case 1 :
for (jpar=1;jpar<=*NbParams;jpar++) {
Upar = Parameters[jpar-1];
- fonct->D1(Upar, Vpar, pnt, v1, v2);
+ mySurf->D1 (Upar, Vpar, pnt, v1, v2);
if (*UOrder==1) {
Result[(jpar-1)*(*Dimension)] = v1.X();
Result[1+(jpar-1)*(*Dimension)] = v1.Y();
case 2 :
for (jpar=1;jpar<=*NbParams;jpar++) {
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) {
Result[(jpar-1)*(*Dimension)] = v3.X();
Result[1+(jpar-1)*(*Dimension)] = v3.Y();
const Standard_Real EnlargeCoeff)
{
myPlate = SurfPlate;
- fonct = myPlate;
Standard_Real U0=0., U1=0., V0=0., V1=0.;
myPlate->RealBounds(U0, U1, V0, V1);
AdvApprox_DichoCutting myDec;
//POP pour WNT
- AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
+ GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
const Standard_Real EnlargeCoeff)
{
myPlate = SurfPlate;
- fonct = myPlate;
TColgp_SequenceOfXY Seq2d;
TColgp_SequenceOfXYZ Seq3d;
gp_Vec v1h,v2h,v3h;
if (CritOrder==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());
Seq3d.Append(P3d);
}
else {
// 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;
gp_XYZ P3d(v3h.X(),v3h.Y(),v3h.Z());
Seq3d.Append(P3d);
if (CritOrder==-1) {
myPrec = 1;
// POP pour NT
- AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
+ GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
else if (CritOrder==0) {
GeomPlate_PlateG0Criterion Crit0(Seq2d,Seq3d,seuil);
// POP pour NT
- AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
+ GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
else if (CritOrder==1) {
GeomPlate_PlateG1Criterion Crit1(Seq2d,Seq3d,seuil);
// POP pour NT
- AdvApp2Var_EvaluatorFunc2Var ev = myPlateSurfEval;
+ GeomPlate_MakeApprox_Eval ev (myPlate);
AdvApp2Var_ApproxAFunc2Var AppPlate(nb1, nb2, nb3,
nul1,nul1,eps3D,
nul2,nul2,epsfr,
//----------------------------------------------------------------------
-static Standard_Boolean AnErrorOccurred=Standard_False;
,const Standard_Real TheTol)
{
- AnErrorOccurred = Standard_False;
+ Standard_Boolean AnErrorOccurred = Standard_False;
this->ResetFields();
DomainOnCurve1=D1;
,const Standard_Real TheTol)
{
- AnErrorOccurred = Standard_False;
+ Standard_Boolean AnErrorOccurred = Standard_False;
this->ResetFields();
DomainOnCurve1=D1;
gp_Pnt2d P1,P2;
Standard_Integer nbsamples;
done = Standard_False;
+ Standard_Boolean AnErrorOccurred = Standard_False;
nbsamples = TheCurveTool::NbSamples(C1,D1.FirstParameter(),D1.LastParameter());
gp_Pnt2d P1,P2;
Standard_Integer nbsamplesOnC1,nbsamplesOnC2;
done = Standard_False;
+ Standard_Boolean AnErrorOccurred = Standard_False;
if(NbIter>NBITER_MAX_POLYGON) return;
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C.GetType();
- static Standard_Real nbsOther = 10.0;
+ const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType();
- static Standard_Real nbsOther = 10.0;
+ const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
const Standard_Integer NbMin,
Handle(TColStd_HArray1OfReal)& Pars) {
GeomAbs_CurveType typC = C->GetType();
- static Standard_Real nbsOther = 10.0;
+ const Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
case GeomAbs_Cone:
{
//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);
if(Abs(cn.SemiAngle()) < M_PI/2.0 - correction){
IntAna_IntConicQuad LinCone(Line,cn);
const Standard_Real V0,
const Standard_Real U1,
const Standard_Real V1) {
- static Standard_Integer DebugDump = 0;
+ const Standard_Integer DebugDump = 0;
Standard_Integer i1,i2;
Standard_Real U,V;
Standard_Real U1mU0sNbdeltaU = (U1-U0)/(Standard_Real)nbdeltaU;
void IntCurveSurface_Polyhedron::Init(const ThePSurface& Surface,
const TColStd_Array1OfReal& Upars,
const TColStd_Array1OfReal& Vpars) {
- static Standard_Integer DebugDump = 0;
+ const Standard_Integer DebugDump = 0;
Standard_Integer i1,i2;
Standard_Real U,V;
gp_Pnt TP;
math_FunctionSetRoot& Rsnld,
const IntImp_ConstIsoparametric ChoixIso )
{
- static math_Vector BornInf(1,3),BornSup(1,3),Tolerance(1,3),UVap(1,3);
- static TColStd_Array1OfReal Uvres(1,4);
+ Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
+ 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;
myZerParFunc.ComputeParameters(ChoixIso,Param,UVap,
BornInf,BornSup,Tolerance);
gp_Vec DPUV[4];
gp_Pnt P1,P2;
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];
IntImp_ConstIsoparametric ChoixIso[4];
IntImp_ConstIsoparametric BestChoix=ChoixRef[0];
}
return BestChoix;
}
-
-
-
const Standard_Real w0,
const Standard_Real w1) {
done = Standard_True;
- static math_Vector UVap(1,3);
- static math_Vector BornInf(1,3);
- static math_Vector BornSup(1,3);
- static math_Vector Tolerance(1,3);
+ Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
+ math_Vector BornInf (BornInfBuf, 1, 3), BornSup (BornSupBuf, 1, 3), Tolerance (ToleranceBuf, 1, 3), UVap (UVapBuf, 1, 3);
UVap(1) = U;
UVap(2) = V;
UVap(3) = W;
//purpose : Initialize for a deferred interference.
//=======================================================================
-static Standard_Integer debug=0;
-
Intf_Interference::Intf_Interference (const Standard_Boolean Self)
: SelfIntf(Self)
{}
Standard_Integer npcz=-1; // Number of points in the current 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 :
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 :
npcz=myTZones(Iz).NumberOfPoints();
Standard_Integer Ipz0, Ipz1, Ipz2;
Inserted =Standard_False;
}
- if (debug>0) {
- if (Inserted) {
- cout << "Zone agrandie : "<< lzin <<" \n";
- myTZones(lzin).Dump(2);
- cout << endl;
- }
- }
if (Inserted) {
Intf_TangentZone theNew=myTZones(lzin);
myTZones.Remove(lzin);
---Purpose: Computes the intersection between two segments
-- <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;
#include <Precision.hxx>
#include <TColStd_ListOfInteger.hxx>
-static Standard_Integer debug=0;
-
// Angular precision (sinus) below that value two right segments
// 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
//=======================================================================
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)
{}
//=======================================================================
//purpose : Constructor of the interference beetween two Polygon.
//=======================================================================
-static Standard_Boolean oClos, tClos;
-static Standard_Integer iObje1, iObje2, nbso;
-
Intf_InterferencePolygon2d::Intf_InterferencePolygon2d
(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
(ToolPolygon2d2::Bounding(Obje2))) {
Intf_InterferencePolygon2d::Intf_InterferencePolygon2d
(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;
if (Tolerance==0.)
//function : Interference
//purpose :
//=======================================================================
-static Standard_Boolean BeginOfNotClosedObje1;
-static Standard_Boolean BeginOfNotClosedObje2;
void Intf_InterferencePolygon2d::Interference
(const Polygon2d1& Obje1,
if (delta1<1. && delta2<1.) 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++) {
if (PI1.Incidence()<=PRCANG) {tsp=tsps=0;break;}
PI1.InfoFirst(dim1,addr1,par);
-- <BegT><EndT> and points <BegO>,<EndO>.
-fields IndexMin : Integer from Standard;
- MinimalDist : Real from Standard;
+fields IndexMin : Integer from Standard;
+ MinimalDist : Real from Standard;
+ iObje1, iObje2 : Integer from Standard;
+ beginOfNotClosedFirst: Boolean from Standard;
+ beginOfNotClosedSecon: Boolean from Standard;
+
end 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)
{}
//=======================================================================
//purpose : Constructor of the interference beetween two Polygon.
//=======================================================================
-static Standard_Integer iObje1, iObje2;
-
Intf_InterferencePolygon3d::Intf_InterferencePolygon3d
(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)+
ToolPolygon3d2::DeflectionOverEstimation(Obje2);
Intf_InterferencePolygon3d::Intf_InterferencePolygon3d
(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;
Interference(Obje);
//purpose :
//=======================================================================
-static Standard_Boolean beginOfNotClosedFirst=Standard_True;
-static Standard_Boolean beginOfNotClosedSecon=Standard_True;
-
void Intf_InterferencePolygon3d::Interference
(const Polygon3d1& Obje1,
const Polygon3d2& Obje2)
---Purpose: Computes the intersection between the segment <BegO><EndO>
-- and the triangle <TTri> of <thePolyh>.
+fields
+ BeginOfClosedPolygon: Boolean from Standard;
+ iLin : Integer from Standard;
+
end InterferencePolygonPolyhedron;
#include <Intf_SeqOfTangentZone.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_POnCurv.hxx>
+static const int Pourcent3[4] = {0, 1, 2, 0};
+
static Standard_Boolean IsInSegment(const gp_Vec& P1P2,
const gp_Vec& P1P,
const Standard_Real NP1P2,
//=======================================================================
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron()
-: Intf_Interference(Standard_False)
+: Intf_Interference (Standard_False),
+ BeginOfClosedPolygon (Standard_False),
+ iLin (0)
{}
//=======================================================================
// and a Polyhedron.
//=======================================================================
-static Standard_Boolean BeginOfClosedPolygon;
-static Standard_Integer iLin;
-
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Polygon3d& thePolyg, const Polyhedron& thePolyh)
-: Intf_Interference(Standard_False)
+: Intf_Interference (Standard_False),
+ BeginOfClosedPolygon (Standard_False),
+ iLin (0)
{
Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
ToolPolyh::DeflectionOverEstimation(thePolyh);
}
-
-
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Polygon3d& thePolyg, const Polyhedron& thePolyh,
Bnd_BoundSortBox &PolyhGrid)
-: Intf_Interference(Standard_False)
+: Intf_Interference (Standard_False),
+ BeginOfClosedPolygon (Standard_False),
+ iLin (0)
{
Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
ToolPolyh::DeflectionOverEstimation(thePolyh);
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const gp_Lin& theLin, const Polyhedron& thePolyh)
-: Intf_Interference(Standard_False)
+: Intf_Interference (Standard_False),
+ BeginOfClosedPolygon (Standard_False),
+ iLin (0)
{
Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
if (Tolerance==0.)
Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
(const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh)
-: Intf_Interference(Standard_False)
+: Intf_Interference (Standard_False),
+ BeginOfClosedPolygon (Standard_False),
+ iLin (0)
{
Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
if (Tolerance==0.)
}
-
-
-
-
-
-
-
-
-
-
-
-
-
//=======================================================================
//function : Intersect
//purpose : Compute the intersection beetween the segment or the line
Standard_Real dEndTri=(triNor*EndO.XYZ())-triDp; // Distance <EndO> plan
gp_XYZ segO=EndO.XYZ()-BegO.XYZ();
segO.Normalize();
-#if 0
- Standard_Real angl=triNor*segO;
-#endif
Standard_Boolean NoIntersectionWithTriangle = Standard_False;
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;
t = dBegTri-dEndTri;
if (t >= 1.e-16 || t<=-1.e-16)
if(NoIntersectionWithTriangle == Standard_False) {
gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
Standard_Real dPiE[3], dPtPi[3], sigd;
-#ifndef DEB
- Standard_Integer is =0;
-#else
- Standard_Integer is;
-#endif
+ Standard_Integer is = 0;
Standard_Integer sEdge=-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;
{ //-- is = 0
gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[1]).XYZ()-
}
}
}
-
+
if(tbreak==0) { //-- is = 1
gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[2]).XYZ()-
ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
if(NoIntersectionWithTriangle == Standard_False) {
gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
Standard_Real dPiE[3], dPtPi[3], sigd;
-#ifndef DEB
- Standard_Integer is =0;
-#else
- Standard_Integer is;
-#endif
+ Standard_Integer is = 0;
Standard_Integer sEdge=-1;
Standard_Integer sVertex=-1;
Standard_Integer tbreak=0;
}
}
}
-// end of File: Intf_InterferencePolygonPolyhedron.gxx
-- self interference of a polyhedron.
uses Pnt from gp,
+ XYZ from gp,
Box from Bnd,
SectionPoint from Intf,
SeqOfSectionPoint from Intf,
---Purpose: Computes the zone of tangence between the facet <Tri1> of
-- <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;
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <Bnd_BoundSortBox.hxx>
-//static Pourcent3[9]={0,1,2,0,1,2,0,1,2};
-static int 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};
//=======================================================================
//function : Intf_InterferencePolyhedron
//purpose :
//=======================================================================
-static Standard_Integer debug=0;
-
Intf_InterferencePolyhedron::Intf_InterferencePolyhedron
(const Polyhedron1& FirstPol, const Polyhedron2& SeconPol)
: Intf_Interference(Standard_False)
//purpose :
//=======================================================================
-static Standard_Integer iFirst, iSecon;
-
void Intf_InterferencePolyhedron::Interference
(const Polyhedron1&)
{}
Standard_Boolean gridOnFirst=Standard_True;
Standard_Integer NbTrianglesFirstPol = ToolPolyhe1::NbTriangles(FirstPol);
Standard_Integer NbTrianglesSecondPol = ToolPolyhe2::NbTriangles(SeconPol);
+ Standard_Integer iFirst, iSecon;
//------------------------------------------------------------------------------------------
//-- the same number of triangles it is necessary to test better on
//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
(const Standard_Integer Tri1, const Polyhedron1& FirstPol,
const Standard_Integer Tri2, const Polyhedron2& SeconPol)
(Abs(dpOfT[0]+dpOfT[1]+dpOfT[2])!=
Abs(dpOfT[0])+Abs(dpOfT[1])+Abs(dpOfT[2]))){
- if (TangentZoneValue(TheTZ, FirstPol, Tri1, SeconPol, Tri2)) {
- if (debug==2) {
- cout<< "Zone de tangence Couple Tri1, Tri2 : "
- << Tri1 << ", " << Tri2 << " : " << endl;
- TheTZ.Dump(2);
- }
+ if (TangentZoneValue(TheTZ, FirstPol, Tri1, SeconPol, Tri2))
+ {
if (!Insert(TheTZ)) myTZones.Append(TheTZ);
}
}
ifin=id[2]; //
}
else {
- if(debug==2) {
- cout << "Impossible calculation problem in pointersec!"
- << endl;
- }
ideb=-999; // No line of section possible
ifin=-999;
}
ifin=id[2]; //
}
else {
- if(debug==2) {
- cout << "Impossible calculation problem in pointersec !"
- << endl;
- }
ideb=-999; // No line of section possible
ifin=-999;
}
deOpT[nob][nou]*deOpT[nob][nou2]<0.) {
if (nbpInt>=6) {
- if(debug==2) {
- cout << "Nombre de P.I. > 6 dans une TZ ! " << endl;
- }
break;
}
else {
}
}
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;
while (nob>=0) {
Tpi(piToInsert[nob--]).Dump(4);
//purpose :
//=======================================================================
-void CoupleCharacteristics(const Polyhedron1& FirstPol,
- const Polyhedron2& SeconPol)
+void Intf_InterferencePolyhedron::CoupleCharacteristics (const Polyhedron1& FirstPol,
+ const Polyhedron2& SeconPol)
{
Standard_Integer n1, n2;
Standard_Real lg;
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
fields nbSeg : Integer from Standard;
beginOnCurve : 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;
//function : Hypr2dBox
//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,
const Bnd_Box2d& domain,
PLib_ChangeDim.gxx
PLib_JacobiPolynomial_0.hxx
+PLib_LocalArray.hxx
PLib_CMPLRS.edl
---Purpose: Get from FP the coordinates of the poles.
Bin(N,P : Integer) returns Real;
- ---Purpose: Returns the Binomial Cnp , without testing anything.
- ---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)
+ ---Purpose: Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
RationalDerivative(Degree : Integer;
N : Integer;
// Modified: 18/06/1996 by PMN : NULL reference.
// Modified: 19/02/1997 by JCT : EvalPoly2Var added
-#define No_Standard_RangeError
-#define No_Standard_OutOfRange
-
#include <PLib.ixx>
+#include <PLib_LocalArray.hxx>
#include <math_Matrix.hxx>
#include <math_Gauss.hxx>
#include <Standard_ConstructionError.hxx>
#include <math_Gauss.hxx>
#include <math.hxx>
-void PLib::InternalBinomial(const Standard_Integer N,
- Standard_Integer& maxbinom,
- Standard_Address& binom)
+class BinomAllocator
{
- if (N > maxbinom) {
- 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] =
- ((Standard_Integer**)binom)[i];
- delete [] ((Standard_Integer**)binom);
- }
- else {
- maxbinom = 0;
- nwbin[0] = new Standard_Integer [1];
- nwbin[0][0] = 1;
- }
- binom = nwbin;
-
- for (i = maxbinom + 1; i < np1; i++) {
+public:
+
+ //! Main constructor
+ BinomAllocator (const Standard_Integer theMaxBinom)
+ : myBinom (NULL),
+ myMaxBinom (theMaxBinom)
+ {
+ Standard_Integer i, im1, ip1, id2, md2, md3, j, k;
+ Standard_Integer np1 = myMaxBinom + 1;
+ myBinom = new Standard_Integer*[np1];
+ myBinom[0] = new Standard_Integer[1];
+ myBinom[0][0] = 1;
+ for (i = 1; i < np1; ++i)
+ {
im1 = i - 1;
ip1 = i + 1;
id2 = i >> 1;
md2 = im1 >> 1;
md3 = ip1 >> 1;
k = 0;
- ((Standard_Integer**)binom)[i] = new Standard_Integer [ip1];
+ myBinom[i] = new Standard_Integer[ip1];
- for (j = 0; j < id2; j++) {
- ((Standard_Integer**)binom)[i][j] =
- k + ((Standard_Integer**)binom)[im1][j];
- k = ((Standard_Integer**)binom)[im1][j];
+ for (j = 0; j < id2; ++j)
+ {
+ myBinom[i][j] = k + myBinom[im1][j];
+ k = myBinom[im1][j];
}
j = id2;
if (j > md2) j = im1 - j;
- ((Standard_Integer**)binom)[i][id2] =
- k + ((Standard_Integer**)binom)[im1][j];
+ myBinom[i][id2] = k + myBinom[im1][j];
- for (j = ip1 - md3; j < ip1; j++) {
- ((Standard_Integer**)binom)[i][j] =
- ((Standard_Integer**)binom)[i][i - j];
+ for (j = ip1 - md3; j < ip1; j++)
+ {
+ myBinom[i][j] = myBinom[i][i - j];
}
}
- maxbinom = N;
}
-}
-static Standard_Integer storage_size = 0 ;
-static Standard_Real *derivative_storage= NULL;
-static Standard_Integer binomial_size = 0;
-static Standard_Real *binomial_array = NULL;
+ //! Destructor
+ ~BinomAllocator()
+ {
+ // free memory
+ for (Standard_Integer i = 0; i <= myMaxBinom; ++i)
+ {
+ delete[] myBinom[i];
+ }
+ delete[] myBinom;
+ }
-static void LocalArray(const Standard_Integer newsize,
- Standard_Integer& size,
- Standard_Real** arr)
-{
- // update a local array
- if (newsize > size) {
- if (*arr) delete [] *arr;
- size = newsize;
- *arr = new Standard_Real [size];
+ Standard_Real Value (const Standard_Integer N,
+ const Standard_Integer P) const
+ {
+ 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
+{
+ // we do not call BSplCLib here to avoid Cyclic dependency detection by WOK
+ //static BinomAllocator THE_BINOM (BSplCLib::MaxDegree() + 1);
+ static BinomAllocator THE_BINOM (25 + 1);
+};
+
+//=======================================================================
+//function : Bin
+//purpose :
+//=======================================================================
+
+Standard_Real PLib::Bin(const Standard_Integer N,
+ const Standard_Integer P)
+{
+ return THE_BINOM.Value (N, P);
}
//=======================================================================
Standard_Real *RationalArray = &RDers;
Standard_Real Factor ;
Standard_Integer ii, Index, OtherIndex, Index1, Index2, jj;
+ PLib_LocalArray binomial_array;
+ PLib_LocalArray derivative_storage;
if (Dimension == 3) {
Standard_Integer DeRequest1 = DerivativeRequest + 1;
Standard_Integer MinDegRequ = DerivativeRequest;
if (MinDegRequ > Degree) MinDegRequ = Degree;
- if (DeRequest1 > binomial_size) {
- if (binomial_size > 0) {
- delete [] binomial_array;
- }
- binomial_array = new Standard_Real [DeRequest1];
- binomial_size = DeRequest1;
- }
+ binomial_array.Allocate (DeRequest1);
for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ;
}
if (!All) {
Standard_Integer DimDeRequ1 = (DeRequest1 << 1) + DeRequest1;
- if (storage_size < DimDeRequ1) {
- if (storage_size > 0)
- delete [] derivative_storage ;
- derivative_storage = new Standard_Real [DimDeRequ1];
- storage_size = DimDeRequ1;
- }
+ derivative_storage.Allocate (DimDeRequ1);
RationalArray = derivative_storage ;
}
Standard_Integer DeRequest1 = DerivativeRequest + 1;
Standard_Integer MinDegRequ = DerivativeRequest;
if (MinDegRequ > Degree) MinDegRequ = Degree;
- if (DeRequest1 > binomial_size) {
- if (binomial_size > 0) {
- delete [] binomial_array;
- }
- binomial_array = new Standard_Real [DeRequest1];
- binomial_size = DeRequest1;
- }
+ binomial_array.Allocate (DeRequest1);
for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ;
}
if (!All) {
Standard_Integer DimDeRequ1 = Dimension * DeRequest1;
- if (storage_size < DimDeRequ1) {
- if (storage_size > 0)
- delete [] derivative_storage ;
- derivative_storage = new Standard_Real [DimDeRequ1];
- storage_size = DimDeRequ1;
- }
+ derivative_storage.Allocate (DimDeRequ1);
RationalArray = derivative_storage ;
}
Standard_Integer ii, Index, Index1, Index2, jj;
Standard_Integer DeRequest1 = DerivativeRequest + 1;
- if (DeRequest1 > binomial_size) {
- if (binomial_size > 0) {
- delete [] binomial_array;
- }
- binomial_array = new Standard_Real [DeRequest1];
- binomial_size = DeRequest1;
- }
+ PLib_LocalArray binomial_array (DeRequest1);
+ PLib_LocalArray derivative_storage;
for (ii = 0 ; ii < DeRequest1 ; ii++) {
binomial_array[ii] = 1.0e0 ;
ResultArray = &Results ;
if (local_request >= Degree) {
local_request = Degree ;
- }
- LocalArray((Degree + 1) * Dimension,
- storage_divided, ÷d_differences_array) ;
+ }
+ PLib_LocalArray divided_differences_array ((Degree + 1) * Dimension);
//
// Build the divided differences array
//
if (local_request >= Degree) {
local_request = Degree ;
}
- LocalArray((Degree + 1) * Dimension,
- storage_size, ÷d_differences_array) ;
+ PLib_LocalArray divided_differences_array ((Degree + 1) * Dimension);
for (ii = 0, jj = 0 ; ii < 2 ; ii++, jj+= 2) {
ParametersArray[jj] =
}
Standard_Real Cnp;
- PLib::Binomial(reflen - 1);
-
for (i = 2; i < reflen; i++ ) {
Cnp = PLib::Bin(reflen - 1, i - 1);
if (rat) Weights (lowp + i - 1) = WCoefs (lowc + i - 1) / Cnp;
Standard_Integer I1, I2;
Standard_Integer NPoleu , NPolev;
gp_XYZ Temp;
- PLib::Binomial(RowLength - 1);
for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){
Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol);
}
}
}
- PLib::Binomial(ColLength - 1);
for (NPolev = LowerCol; NPolev <= UpperCol; NPolev++){
// Author: Laurent BOURESCHE
// <lbo@phylox>
-static Standard_Integer maxbinom = -1;
-static Standard_Address binom;
-
-inline TColStd_Array1OfReal& PLib::NoWeights()
+inline TColStd_Array1OfReal& PLib::NoWeights()
{
return (*((TColStd_Array1OfReal*) NULL ));
}
-inline TColStd_Array2OfReal& PLib::NoWeights2()
+inline TColStd_Array2OfReal& PLib::NoWeights2()
{
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);
-}
// Author: Sergey SOKOLOV
// <ssv@velox.nnov.matra-dtv.fr>
-
#include <PLib_HermitJacobi.ixx>
#include <PLib.hxx>
+#include <PLib_LocalArray.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
TColStd_Array1OfReal& BasisD2,
TColStd_Array1OfReal& BasisD3)
{
-// Tableaux en static
- static Standard_Real jac0[4*20];
- static Standard_Real jac1[4*20];
- static Standard_Real jac2[4*20];
- static Standard_Real jac3[4*20];
- static Standard_Real wvalues[4];
-
+ PLib_LocalArray jac0 (4 * 20);
+ PLib_LocalArray jac1 (4 * 20);
+ PLib_LocalArray jac2 (4 * 20);
+ PLib_LocalArray jac3 (4 * 20);
+ PLib_LocalArray wvalues (4);
Standard_Integer i, j;
Standard_Integer NivConstr = this->NivConstr(),
{
D0123(3,U,BasisValue,BasisD1,BasisD2,BasisD3);
}
-
--- /dev/null
+// 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
ddu : Real[10];
ddv : Real[10];
maxConstraintOrder : Integer;
- PolynomialPartOnly : Boolean;
+ PolynomialPartOnly : Boolean;
+ Uold, Vold, U2, R, L : Real; -- these fields should be mutable
end;
//purpose :
//=======================================================================
-Plate_Plate::Plate_Plate() :
- order(0), n_el(0), n_dim(0),
- solution(0),points(0),deru(0),derv(0),
- OK(Standard_False),maxConstraintOrder(0)
-
+Plate_Plate::Plate_Plate()
+: order(0), n_el(0), n_dim(0),
+ solution(0),points(0),deru(0),derv(0),
+ OK(Standard_False),maxConstraintOrder(0),
+ Uold (1.e20),
+ Vold (1.e20),
+ U2 (0.0),
+ R (0.0),
+ L (0.0)
{
PolynomialPartOnly = Standard_False;
}
//purpose :
//=======================================================================
-Plate_Plate::Plate_Plate(const Plate_Plate& Ref) :
- order(Ref.order),n_el(Ref.n_el),n_dim(Ref.n_dim),
- solution(0),points(0),deru(0),derv(0),
- OK(Ref.OK)
+Plate_Plate::Plate_Plate(const Plate_Plate& Ref)
+: order(Ref.order),n_el(Ref.n_el),n_dim(Ref.n_dim),
+ solution(0),points(0),deru(0),derv(0),
+ OK (Ref.OK),
+ Uold (1.e20),
+ Vold (1.e20),
+ U2 (0.0),
+ R (0.0),
+ L (0.0)
{
Standard_Integer i;
if (Ref.OK) {
// 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 U2;
-// Standard_Real R;
-// Standard_Real L;
-//
+ Plate_Plate* aThis = const_cast<Plate_Plate*>(this);
Standard_Real U,V;
Standard_Integer IU,IV;
}
else
{
- Uold = U;
- Vold = V;
- U2 = U*U;
- R = U2+V*V;
+ aThis->Uold = U;
+ aThis->Vold = V;
+ aThis->U2 = U*U;
+ aThis->R = U2+V*V;
if (R<1.e-20) return 0;
- L = log(R);
+ aThis->L = log(R);
}
Standard_Real DUV = 0;
Standard_Integer m = order;
Standard_Integer mm1 = m-1;
- Standard_Real &r = R;
+ Standard_Real &r = aThis->R;
//Standard_Real pr = pow(R, mm1 - IU - IV);
-- curve to project and surface
returns Real
raises NoSuchObject;
-
+
-- Methods for debugging
GetSequence(me) returns HSequenceOfHSequenceOfPnt from ProjLib
---C++: return const &
is static;
-
+
GetType(me) returns CurveType from GeomAbs
---Purpose: Returns the type of the curve in the current
-- interval : Line, Circle, Ellipse, Hyperbola,
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
is redefined static;
-
+
fields
- mySurface : HSurface from Adaptor3d;
- myCurve : HCurve from Adaptor3d;
- myNbCurves : Integer from Standard;
- mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
+ mySurface : HSurface from Adaptor3d;
+ myCurve : HCurve from Adaptor3d;
+ myNbCurves : Integer from Standard;
+ mySequence : HSequenceOfHSequenceOfPnt from ProjLib;
myTolU : Real from Standard;
- myTolV : Real from Standard;
- myMaxDist : Real from Standard;
+ myTolV : Real from Standard;
+ myMaxDist : Real from Standard;
myUIso : HArray1OfBoolean from TColStd;
myVIso : HArray1OfBoolean from TColStd;
- mySnglPnts : HArray1OfBoolean from TColStd;
- myMaxDistance : HArray1OfReal from TColStd;
-
+ mySnglPnts : HArray1OfBoolean from TColStd;
+ myMaxDistance : HArray1OfReal from TColStd;
+ myTabInt : HArray1OfReal from TColStd; -- this field should be mutable
+
end CompProjectedCurve;
#include <GeomAbs_CurveType.hxx>
#include <GeomLib.hxx>
-
#define FuncTol 1.e-10
-#if DEB
+#ifdef __OCC_DEBUG_CHRONO
#include <OSD_Timer.hxx>
static OSD_Chronometer chr_init_point, chr_dicho_bound;
}
#endif
-static Handle(TColStd_HArray1OfReal) TabInt;
//=======================================================================
//function : d1
//purpose : computes first derivative of the 3d projected curve
//=======================================================================
-#ifdef DEB
+#if 0
static void d1CurvOnSurf(const Standard_Real t,
const Standard_Real u,
const Standard_Real v,
const Handle(Adaptor3d_HCurve)& Curve,
const Handle(Adaptor3d_HSurface)& Surface)
{
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_dicho_bound);
#endif
}
else aNotSol = t;
}
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_dicho_bound,t_dicho_bound);
dicho_bound_count++;
#endif
void ProjLib_CompProjectedCurve::Init()
{
- TabInt.Nullify();
+ myTabInt.Nullify();
Standard_Real Tol;// Tolerance for ExactBound
Standard_Integer i, Nend = 0;
if (!initpoint)
{
myCurve->D0(t,CPoint);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
InitChron(chr_init_point);
#endif
initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V);
-#ifdef DEB
+#ifdef __OCC_DEBUG_CHRONO
ResultChron(chr_init_point,t_init_point);
init_point_count++;
#endif
Standard_Integer ProjLib_CompProjectedCurve::NbIntervals(const GeomAbs_Shape S) const
{
- TabInt.Nullify();
+ const_cast<ProjLib_CompProjectedCurve*>(this)->myTabInt.Nullify();
BuildIntervals(S);
- Standard_Integer NbInt;
- NbInt=TabInt->Length() - 1;
-
-#ifdef DEB
-// cout<<"NbIntervals = "<<NbInt<<endl;
-#endif
- return NbInt;
+ return myTabInt->Length() - 1;
}
//=======================================================================
void ProjLib_CompProjectedCurve::Intervals(TColStd_Array1OfReal& T,const GeomAbs_Shape S) const
{
- if(TabInt.IsNull()) BuildIntervals(S);
- T = TabInt->Array1();
-
-#if DEB
-/* cout<<"Intervals = ";
- for(Standard_Integer i = 1; i <= T.Length(); i++)
- cout<<T(i)<<" ";
- cout<<endl;
-*/
-#endif
+ if (myTabInt.IsNull()) BuildIntervals (S);
+ T = myTabInt->Array1();
}
//=======================================================================
void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const
{
-#ifndef DEB
GeomAbs_Shape SforS = GeomAbs_CN;
-#else
- GeomAbs_Shape SforS;
-#endif
switch(S) {
case GeomAbs_C0:
SforS = GeomAbs_C1;
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++)
- TabInt->ChangeValue(i) = BArr->Value(i);
+ myTabInt->ChangeValue(i) = BArr->Value(i);
}
{
return GeomAbs_OtherCurve;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-