mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0022241: The bug is appendix to the Salome Bug 0021148
This commit is contained in:
parent
8dd4bd500e
commit
093fdf5ffc
@ -21,16 +21,14 @@
|
|||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gp_Ax1.hxx>
|
#include <gp_Ax1.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//class : ExtremaExtElC_TrigonometricRoots
|
||||||
//======================================================================
|
//purpose :
|
||||||
//== Classe Interne (Donne des racines classees d un polynome trigo)
|
//== Classe Interne (Donne des racines classees d un polynome trigo)
|
||||||
//== Code duplique avec IntAna_IntQuadQuad.cxx (lbr le 26 mars 98)
|
//== Code duplique avec IntAna_IntQuadQuad.cxx (lbr le 26 mars 98)
|
||||||
//== Solution fiable aux problemes de coefficients proches de 0
|
//== Solution fiable aux problemes de coefficients proches de 0
|
||||||
//== avec essai de rattrapage si coeff<1.e-10 (jct le 27 avril 98)
|
//== avec essai de rattrapage si coeff<1.e-10 (jct le 27 avril 98)
|
||||||
//======================================================================
|
//=======================================================================
|
||||||
static const Standard_Real PIpPI=Standard_PI+Standard_PI;
|
|
||||||
|
|
||||||
class ExtremaExtElC_TrigonometricRoots {
|
class ExtremaExtElC_TrigonometricRoots {
|
||||||
private:
|
private:
|
||||||
Standard_Real Roots[4];
|
Standard_Real Roots[4];
|
||||||
@ -38,132 +36,188 @@ class ExtremaExtElC_TrigonometricRoots {
|
|||||||
Standard_Integer NbRoots;
|
Standard_Integer NbRoots;
|
||||||
Standard_Boolean infinite_roots;
|
Standard_Boolean infinite_roots;
|
||||||
public:
|
public:
|
||||||
ExtremaExtElC_TrigonometricRoots(const Standard_Real CC
|
ExtremaExtElC_TrigonometricRoots(const Standard_Real CC,
|
||||||
,const Standard_Real SC
|
const Standard_Real SC,
|
||||||
,const Standard_Real C
|
const Standard_Real C,
|
||||||
,const Standard_Real S
|
const Standard_Real S,
|
||||||
,const Standard_Real Cte
|
const Standard_Real Cte,
|
||||||
,const Standard_Real Binf
|
const Standard_Real Binf,
|
||||||
,const Standard_Real Bsup);
|
const Standard_Real Bsup);
|
||||||
|
//
|
||||||
Standard_Boolean IsDone() { return(done); }
|
Standard_Boolean IsDone() {
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
//
|
||||||
Standard_Boolean IsARoot(Standard_Real u) {
|
Standard_Boolean IsARoot(Standard_Real u) {
|
||||||
|
Standard_Integer i;
|
||||||
|
Standard_Real PIpPI, aEps;
|
||||||
|
//
|
||||||
|
aEps=RealEpsilon();
|
||||||
|
PIpPI=Standard_PI+Standard_PI;
|
||||||
for(Standard_Integer i=0 ; i<NbRoots; i++) {
|
for(Standard_Integer i=0 ; i<NbRoots; i++) {
|
||||||
if(Abs(u - Roots[i])<=RealEpsilon()) return(Standard_True);
|
if(Abs(u - Roots[i])<=aEps) {
|
||||||
if(Abs(u - Roots[i]-PIpPI)<=RealEpsilon()) return(Standard_True);
|
return Standard_True ;
|
||||||
|
}
|
||||||
|
if(Abs(u - Roots[i]-PIpPI)<=aEps) {
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return(Standard_False);
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
Standard_Integer NbSolutions() {
|
Standard_Integer NbSolutions() {
|
||||||
if(!done) StdFail_NotDone::Raise();
|
if(!done) {
|
||||||
return(NbRoots);
|
StdFail_NotDone::Raise();
|
||||||
|
}
|
||||||
|
return NbRoots;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
Standard_Boolean InfiniteRoots() {
|
Standard_Boolean InfiniteRoots() {
|
||||||
if(!done) StdFail_NotDone::Raise();
|
if(!done) {
|
||||||
return(infinite_roots);
|
StdFail_NotDone::Raise();
|
||||||
|
}
|
||||||
|
return infinite_roots;
|
||||||
}
|
}
|
||||||
Standard_Real Value(const Standard_Integer& n) {
|
//
|
||||||
if((!done)||(n>NbRoots)) StdFail_NotDone::Raise();
|
Standard_Real Value(const Standard_Integer& n) {
|
||||||
return(Roots[n-1]);
|
if((!done)||(n>NbRoots)) {
|
||||||
|
StdFail_NotDone::Raise();
|
||||||
|
}
|
||||||
|
return Roots[n-1];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//----------------------------------------------------------------------
|
//=======================================================================
|
||||||
ExtremaExtElC_TrigonometricRoots::ExtremaExtElC_TrigonometricRoots(const Standard_Real CC
|
//function : ExtremaExtElC_TrigonometricRoots
|
||||||
,const Standard_Real SC
|
//purpose :
|
||||||
,const Standard_Real C
|
//=======================================================================
|
||||||
,const Standard_Real S
|
ExtremaExtElC_TrigonometricRoots::
|
||||||
,const Standard_Real Cte
|
ExtremaExtElC_TrigonometricRoots(const Standard_Real CC,
|
||||||
,const Standard_Real Binf
|
const Standard_Real SC,
|
||||||
,const Standard_Real Bsup) {
|
const Standard_Real C,
|
||||||
|
const Standard_Real S,
|
||||||
Standard_Integer i ;
|
const Standard_Real Cte,
|
||||||
Standard_Integer nbessai = 1;
|
const Standard_Real Binf,
|
||||||
Standard_Real cc = CC, sc = SC, c = C, s = S, cte = Cte;
|
const Standard_Real Bsup)
|
||||||
|
{
|
||||||
|
Standard_Integer i, nbessai;
|
||||||
|
Standard_Real cc ,sc, c, s, cte;
|
||||||
|
//
|
||||||
|
nbessai = 1;
|
||||||
|
cc = CC;
|
||||||
|
sc = SC;
|
||||||
|
c = C;
|
||||||
|
s = S;
|
||||||
|
cte = Cte;
|
||||||
done=Standard_False;
|
done=Standard_False;
|
||||||
while (nbessai<=2 && !done) {
|
while (nbessai<=2 && !done) {
|
||||||
//-- F= AA*CN*CN+2*BB*CN*SN+CC*CN+DD*SN+EE;
|
//-- F= AA*CN*CN+2*BB*CN*SN+CC*CN+DD*SN+EE;
|
||||||
math_TrigonometricFunctionRoots MTFR(cc,sc,c,s,cte,Binf,Bsup);
|
math_TrigonometricFunctionRoots MTFR(cc,sc,c,s,cte,Binf,Bsup);
|
||||||
|
//
|
||||||
if(MTFR.IsDone()) {
|
if(MTFR.IsDone()) {
|
||||||
done=Standard_True;
|
done=Standard_True;
|
||||||
if(MTFR.InfiniteRoots()) {
|
if(MTFR.InfiniteRoots()) {
|
||||||
infinite_roots=Standard_True;
|
infinite_roots=Standard_True;
|
||||||
}
|
}
|
||||||
else {
|
else { //else #1
|
||||||
NbRoots=MTFR.NbSolutions();
|
|
||||||
for( i=0;i<NbRoots;i++) {
|
|
||||||
Roots[i]=MTFR.Value(i+1);
|
|
||||||
if(Roots[i]<0.0) Roots[i]+=PI+PI;
|
|
||||||
if(Roots[i]>(PI+PI)) Roots[i]-=PI+PI;
|
|
||||||
}
|
|
||||||
Standard_Boolean Triee;
|
Standard_Boolean Triee;
|
||||||
Standard_Integer j;
|
Standard_Integer j, SvNbRoots;
|
||||||
|
Standard_Real aTwoPI, aMaxCoef, aPrecision;
|
||||||
|
//
|
||||||
|
aTwoPI=PI+PI;
|
||||||
|
NbRoots=MTFR.NbSolutions();
|
||||||
|
for(i=0;i<NbRoots;++i) {
|
||||||
|
Roots[i]=MTFR.Value(i+1);
|
||||||
|
if(Roots[i]<0.) {
|
||||||
|
Roots[i]=Roots[i]+aTwoPI;
|
||||||
|
}
|
||||||
|
if(Roots[i]>aTwoPI) {
|
||||||
|
Roots[i]=Roots[i]-aTwoPI;
|
||||||
|
}
|
||||||
|
}
|
||||||
//-- La recherche directe donne n importe quoi.
|
//-- La recherche directe donne n importe quoi.
|
||||||
// modified by OCC Tue Oct 3 18:41:27 2006.BEGIN
|
// modified by OCC Tue Oct 3 18:41:27 2006.BEGIN
|
||||||
Standard_Real aMaxCoef = Max(CC,SC);
|
aMaxCoef = Max(CC,SC);
|
||||||
aMaxCoef = Max(aMaxCoef,C);
|
aMaxCoef = Max(aMaxCoef,C);
|
||||||
aMaxCoef = Max(aMaxCoef,S);
|
aMaxCoef = Max(aMaxCoef,S);
|
||||||
aMaxCoef = Max(aMaxCoef,Cte);
|
aMaxCoef = Max(aMaxCoef,Cte);
|
||||||
const Standard_Real aPrecision = Max(1.e-8,1.e-12*aMaxCoef);
|
aPrecision = Max(1.e-8, 1.e-12*aMaxCoef);
|
||||||
// modified by OCC Tue Oct 3 18:41:33 2006.END
|
// modified by OCC Tue Oct 3 18:41:33 2006.END
|
||||||
|
|
||||||
Standard_Integer SvNbRoots=NbRoots;
|
SvNbRoots=NbRoots;
|
||||||
for(i=0;i<SvNbRoots;i++) {
|
for(i=0; i<SvNbRoots; ++i) {
|
||||||
Standard_Real y;
|
Standard_Real y;
|
||||||
Standard_Real co=cos(Roots[i]);
|
Standard_Real co=cos(Roots[i]);
|
||||||
Standard_Real si=sin(Roots[i]);
|
Standard_Real si=sin(Roots[i]);
|
||||||
y=co*(CC*co + (SC+SC)*si + C) + S*si + Cte;
|
y=co*(CC*co + (SC+SC)*si + C) + S*si + Cte;
|
||||||
// modified by OCC Tue Oct 3 18:43:00 2006
|
// modified by OCC Tue Oct 3 18:43:00 2006
|
||||||
if(Abs(y)>aPrecision) {
|
if(Abs(y)>aPrecision) {
|
||||||
#ifdef DEB
|
|
||||||
printf("\n**IntAna_IntQuadQuad** Solution : %g ( %g cos2 + 2 %g cos sin + %g cos + %g sin + %g) = %g\n",
|
|
||||||
Roots[i],CC,SC,C,S,Cte,y);
|
|
||||||
#endif
|
|
||||||
NbRoots--;
|
NbRoots--;
|
||||||
Roots[i]=1000.0;
|
Roots[i]=1000.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
do {
|
do {
|
||||||
|
Standard_Real t;
|
||||||
|
//
|
||||||
Triee=Standard_True;
|
Triee=Standard_True;
|
||||||
for(i=1,j=0;i<SvNbRoots;i++,j++) {
|
for(i=1, j=0; i<SvNbRoots; ++i, ++j) {
|
||||||
if(Roots[i]<Roots[j]) {
|
if(Roots[i]<Roots[j]) {
|
||||||
Triee=Standard_False;
|
Triee=Standard_False;
|
||||||
Standard_Real t=Roots[i]; Roots[i]=Roots[j]; Roots[j]=t;
|
t=Roots[i];
|
||||||
|
Roots[i]=Roots[j];
|
||||||
|
Roots[j]=t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(!Triee);
|
while(!Triee);
|
||||||
|
//
|
||||||
infinite_roots=Standard_False;
|
infinite_roots=Standard_False;
|
||||||
if(NbRoots==0) { //--!!!!! Detection du cas Pol = Cte ( 1e-50 ) !!!!
|
if(NbRoots==0) {
|
||||||
|
//--!!!!! Detection du cas Pol = Cte ( 1e-50 ) !!!!
|
||||||
if((Abs(CC) + Abs(SC) + Abs(C) + Abs(S)) < 1e-10) {
|
if((Abs(CC) + Abs(SC) + Abs(C) + Abs(S)) < 1e-10) {
|
||||||
if(Abs(Cte) < 1e-10) {
|
if(Abs(Cte) < 1e-10) {
|
||||||
infinite_roots=Standard_True;
|
infinite_roots=Standard_True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // else #1
|
||||||
}
|
} // if(MTFR.IsDone()) {
|
||||||
else {
|
else {
|
||||||
// on essaie en mettant les tres petits coeff. a ZERO
|
// on essaie en mettant les tres petits coeff. a ZERO
|
||||||
if (Abs(CC)<1e-10) cc = 0.0;
|
if (Abs(CC)<1e-10) {
|
||||||
if (Abs(SC)<1e-10) sc = 0.0;
|
cc = 0.0;
|
||||||
if (Abs(C)<1e-10) c = 0.0;
|
}
|
||||||
if (Abs(S)<1e-10) s = 0.0;
|
if (Abs(SC)<1e-10) {
|
||||||
if (Abs(Cte)<1e-10) cte = 0.0;
|
sc = 0.0;
|
||||||
|
}
|
||||||
|
if (Abs(C)<1e-10) {
|
||||||
|
c = 0.0;
|
||||||
|
}
|
||||||
|
if (Abs(S)<1e-10){
|
||||||
|
s = 0.0;
|
||||||
|
}
|
||||||
|
if (Abs(Cte)<1e-10){
|
||||||
|
cte = 0.0;
|
||||||
|
}
|
||||||
nbessai++;
|
nbessai++;
|
||||||
}
|
}
|
||||||
}
|
} // while (nbessai<=2 && !done) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
Extrema_ExtElC::Extrema_ExtElC () { myDone = Standard_False; }
|
//purpose :
|
||||||
//=============================================================================
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC ()
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Lin& C2,
|
{
|
||||||
|
myDone = Standard_False;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1,
|
||||||
|
const gp_Lin& C2,
|
||||||
const Standard_Real)
|
const Standard_Real)
|
||||||
// Fonction:
|
// Fonction:
|
||||||
// Recherche de la distance minimale entre 2 droites.
|
// Recherche de la distance minimale entre 2 droites.
|
||||||
@ -242,9 +296,12 @@ Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Lin& C2,
|
|||||||
}
|
}
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Circ& C2,
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1,
|
||||||
|
const gp_Circ& C2,
|
||||||
const Standard_Real)
|
const Standard_Real)
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
Fonction:
|
Fonction:
|
||||||
@ -343,10 +400,12 @@ Methode:
|
|||||||
}
|
}
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Elips& C2)
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1,
|
||||||
|
const gp_Elips& C2)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
Fonction:
|
Fonction:
|
||||||
@ -413,7 +472,17 @@ Methode:
|
|||||||
Standard_Real A2 =(R2*Dx*Dx -r2*Dy*Dy -R2 +r2)/2.0;
|
Standard_Real A2 =(R2*Dx*Dx -r2*Dy*Dy -R2 +r2)/2.0;
|
||||||
Standard_Real A3 = MinR*Vxyz.Y();
|
Standard_Real A3 = MinR*Vxyz.Y();
|
||||||
Standard_Real A4 = -MajR*Vxyz.X();
|
Standard_Real A4 = -MajR*Vxyz.X();
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Thu Feb 03 14:51:04 2011f
|
||||||
|
Standard_Real aEps=1.e-12;
|
||||||
|
//
|
||||||
|
if(fabs(A5) <= aEps) A5 = 0.;
|
||||||
|
if(fabs(A1) <= aEps) A1 = 0.;
|
||||||
|
if(fabs(A2) <= aEps) A2 = 0.;
|
||||||
|
if(fabs(A3) <= aEps) A3 = 0.;
|
||||||
|
if(fabs(A4) <= aEps) A4 = 0.;
|
||||||
|
//modified by NIZNHY-PKV Thu Feb 03 14:51:08 2011t
|
||||||
|
//
|
||||||
ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,PI+PI);
|
ExtremaExtElC_TrigonometricRoots Sol(A1,A2,A3,A4,A5,0.,PI+PI);
|
||||||
if (!Sol.IsDone()) { return; }
|
if (!Sol.IsDone()) { return; }
|
||||||
|
|
||||||
@ -433,9 +502,13 @@ Methode:
|
|||||||
}
|
}
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Hypr& C2)
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1,
|
||||||
|
const gp_Hypr& C2)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
Fonction:
|
Fonction:
|
||||||
@ -530,9 +603,12 @@ Methode:
|
|||||||
}
|
}
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1, const gp_Parab& C2)
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Lin& C1,
|
||||||
|
const gp_Parab& C2)
|
||||||
{
|
{
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
Fonction:
|
Fonction:
|
||||||
@ -615,107 +691,12 @@ Methode:
|
|||||||
}
|
}
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
//=============================================================================
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Elips&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Hypr&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Parab&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Elips&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Hypr&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Parab&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Hypr&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Parab&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Parab&, const gp_Parab&)
|
|
||||||
{
|
|
||||||
Standard_NotImplemented::Raise();
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Standard_Boolean Extrema_ExtElC::IsDone () const { return myDone; }
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Standard_Boolean Extrema_ExtElC::IsParallel () const
|
|
||||||
{
|
|
||||||
if (!IsDone()) { StdFail_NotDone::Raise(); }
|
|
||||||
return myIsPar;
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Standard_Integer Extrema_ExtElC::NbExt () const
|
|
||||||
{
|
|
||||||
if (IsParallel()) { StdFail_InfiniteSolutions::Raise(); }
|
|
||||||
return myNbExt;
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
Standard_Real Extrema_ExtElC::SquareDistance (const Standard_Integer N) const
|
|
||||||
{
|
|
||||||
if (!myDone) { StdFail_NotDone::Raise(); }
|
|
||||||
if (myIsPar) {
|
|
||||||
if (N < 1 || N > 2) { Standard_OutOfRange::Raise(); }
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (N < 1 || N > NbExt()) { Standard_OutOfRange::Raise(); }
|
|
||||||
}
|
|
||||||
return mySqDist[N-1];
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
void Extrema_ExtElC::Points (const Standard_Integer N,
|
|
||||||
Extrema_POnCurv& P1, Extrema_POnCurv& P2) const
|
|
||||||
{
|
|
||||||
if (N < 1 || N > NbExt()) { Standard_OutOfRange::Raise(); }
|
|
||||||
P1 = myPoint[N-1][0];
|
|
||||||
P2 = myPoint[N-1][1];
|
|
||||||
}
|
|
||||||
//=============================================================================
|
|
||||||
//=============================================================================
|
|
||||||
//
|
|
||||||
//modified by NIZNHY-PKV Fri Nov 21 10:48:46 2008f
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Extrema_ExtElC
|
//function : Extrema_ExtElC
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ& C1, const gp_Circ& C2)
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ& C1,
|
||||||
|
const gp_Circ& C2)
|
||||||
{
|
{
|
||||||
Standard_Boolean bIsSamePlane, bIsSameAxe;
|
Standard_Boolean bIsSamePlane, bIsSameAxe;
|
||||||
Standard_Real aTolD, aTolD2, aTolA, aD2, aDC2;
|
Standard_Real aTolD, aTolD2, aTolA, aD2, aDC2;
|
||||||
@ -865,4 +846,135 @@ Extrema_ExtElC::Extrema_ExtElC (const gp_Circ& C1, const gp_Circ& C2)
|
|||||||
}// if (!bOut || !bIn) {
|
}// if (!bOut || !bIn) {
|
||||||
}// else
|
}// else
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Fri Nov 21 10:48:56 2008t
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Elips&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Hypr&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Parab&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Elips&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Hypr&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Parab&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Hypr&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Parab&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Extrema_ExtElC::Extrema_ExtElC (const gp_Parab&, const gp_Parab&)
|
||||||
|
{
|
||||||
|
Standard_NotImplemented::Raise();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsDone
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean Extrema_ExtElC::IsDone () const {
|
||||||
|
return myDone;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsParallel
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean Extrema_ExtElC::IsParallel () const
|
||||||
|
{
|
||||||
|
if (!IsDone()) {
|
||||||
|
StdFail_NotDone::Raise();
|
||||||
|
}
|
||||||
|
return myIsPar;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : NbExt
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer Extrema_ExtElC::NbExt () const
|
||||||
|
{
|
||||||
|
if (IsParallel()) {
|
||||||
|
StdFail_InfiniteSolutions::Raise();
|
||||||
|
}
|
||||||
|
return myNbExt;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SquareDistance
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Real Extrema_ExtElC::SquareDistance (const Standard_Integer N) const
|
||||||
|
{
|
||||||
|
if (!myDone) {
|
||||||
|
StdFail_NotDone::Raise();
|
||||||
|
}
|
||||||
|
if (myIsPar) {
|
||||||
|
if (N < 1 || N > 2) {
|
||||||
|
Standard_OutOfRange::Raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (N < 1 || N > NbExt()) {
|
||||||
|
Standard_OutOfRange::Raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mySqDist[N-1];
|
||||||
|
}
|
||||||
|
void Extrema_ExtElC::Points (const Standard_Integer N,
|
||||||
|
Extrema_POnCurv& P1,
|
||||||
|
Extrema_POnCurv& P2) const
|
||||||
|
{
|
||||||
|
if (N < 1 || N > NbExt()) {
|
||||||
|
Standard_OutOfRange::Raise();
|
||||||
|
}
|
||||||
|
P1 = myPoint[N-1][0];
|
||||||
|
P2 = myPoint[N-1][1];
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user