mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-07 05:08:13 +08:00
Coding - Remove unused code and comments across various files (#968)
- Removed conditional compilation blocks (`#if 0`) that contained unused code in: - BRepTools_Modifier.cxx - AdvApp2Var_Data_f2c.hxx - AdvApp2Var_SysBase_baseinit.cxx - Extrema_FuncExtCS.cxx - Extrema_FuncExtSS.cxx - GeomProjLib.cxx - IntAna_IntLinTorus.cxx - IntAna2d_AnaIntersection_8.cxx - IntAna2d_Outils.cxx - ProjLib_CompProjectedCurve.cxx - ProjLib_ComputeApprox.cxx - ProjLib_ComputeApproxOnPolarSurface.cxx - Cleaned up header files by ensuring proper end-of-file newlines in: - TKBRep_pch.hxx - GeomLib_Tool.hxx - MeshVS_SymmetricPairHasher.hxx - OpenGl_ShaderProgramDumpLevel.hxx - Graphic3d_ToneMappingMethod.hxx
This commit is contained in:
@@ -40,12 +40,6 @@ typedef long int logical;
|
||||
typedef short int shortlogical;
|
||||
typedef char logical1;
|
||||
typedef char integer1;
|
||||
#if 0 /* Adjust for integer*8. */
|
||||
typedef long long longint; /* system-dependent */
|
||||
typedef unsigned long long ulongint; /* system-dependent */
|
||||
#define qbit_clear(a, b) ((a) & ~((ulongint)1 << (b)))
|
||||
#define qbit_set(a, b) ((a) | ((ulongint)1 << (b)))
|
||||
#endif
|
||||
|
||||
#define TRUE_ (1)
|
||||
#define FALSE_ (0)
|
||||
|
||||
@@ -20,10 +20,6 @@ static int init_STBAS()
|
||||
{
|
||||
int ICODE = 0;
|
||||
// allocation tables are now local, so no global initialization is required
|
||||
#if 0
|
||||
// Init du Tableau des allocs
|
||||
AdvApp2Var_SysBase::mainial_();
|
||||
#endif
|
||||
// Init de LEC IBB IMP
|
||||
AdvApp2Var_SysBase::macinit_(&ICODE, &ICODE);
|
||||
//
|
||||
|
||||
@@ -168,12 +168,6 @@ int Extrema_FuncExtCS::GetStateNumber()
|
||||
{
|
||||
if (!myCinit || !mySinit)
|
||||
throw Standard_TypeMismatch();
|
||||
#if 0
|
||||
math_Vector Sol(1, 3), UVSol(1, 3);
|
||||
UVSol(1) = myt; UVSol(2) = myU; UVSol(3) = myV;
|
||||
Value(UVSol, Sol);
|
||||
std::cout <<"F(1)= "<<Sol(1)<<" F(2)= "<<Sol(2)<<" F(3)= "<<Sol(3)<<std::endl;
|
||||
#endif
|
||||
// comparison of solution with previous solutions
|
||||
constexpr double tol2d = Precision::SquarePConfusion();
|
||||
int i = 1, nbSol = mySqDist.Length();
|
||||
|
||||
@@ -188,12 +188,6 @@ int Extrema_FuncExtSS::GetStateNumber()
|
||||
{
|
||||
if (!myS1init || !myS2init)
|
||||
throw Standard_TypeMismatch();
|
||||
#if 0
|
||||
math_Vector Sol(1, 4), UVSol(1, 4);
|
||||
UVSol(1) = myU1; UVSol(2) = myV1; UVSol(3) = myU2; UVSol(4) = myV2;
|
||||
Value(UVSol, Sol);
|
||||
std::cout <<"F(1)= "<<Sol(1)<<" F(2)= "<<Sol(2)<<" F(3)= "<<Sol(3)<<" F(4)= "<<Sol(4)<<std::endl;
|
||||
#endif
|
||||
|
||||
mySqDist.Append(myP1.SquareDistance(myP2));
|
||||
myPoint1.Append(Extrema_POnSurf(myU1, myV1, myP1));
|
||||
|
||||
@@ -121,4 +121,4 @@ public:
|
||||
double* const thePrmOnCurve = nullptr);
|
||||
};
|
||||
|
||||
#endif // _GeomLib_Tool_HeaderFile
|
||||
#endif // _GeomLib_Tool_HeaderFile
|
||||
|
||||
@@ -48,11 +48,6 @@
|
||||
#include <ProjLib_ProjectOnPlane.hxx>
|
||||
|
||||
#include <cstdio>
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
static bool Affich = false;
|
||||
static int NBPROJ = 1;
|
||||
#endif
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -66,17 +61,6 @@ occ::handle<Geom2d_Curve> GeomProjLib::Curve2d(const occ::handle<Geom_Curve>&
|
||||
const double VFin,
|
||||
double& Tolerance)
|
||||
{
|
||||
#ifdef DRAW
|
||||
if (Affich)
|
||||
{
|
||||
char name[256];
|
||||
Sprintf(name, "PROJCURV_%d", NBPROJ);
|
||||
DrawTrSurf::Set(name, C);
|
||||
Sprintf(name, "PROJSURF_%d", NBPROJ);
|
||||
DrawTrSurf::Set(name, S);
|
||||
NBPROJ++;
|
||||
}
|
||||
#endif
|
||||
|
||||
Tolerance = std::max(Precision::PConfusion(), Tolerance);
|
||||
|
||||
@@ -144,13 +128,6 @@ occ::handle<Geom2d_Curve> GeomProjLib::Curve2d(const occ::handle<Geom_Curve>&
|
||||
G2dC = new Geom2d_TrimmedCurve(G2dC, U1, U2);
|
||||
}
|
||||
|
||||
#ifdef DRAW
|
||||
if (Affich)
|
||||
{
|
||||
static const char* aprojcurv = "projcurv";
|
||||
DrawTrSurf::Set(aprojcurv, G2dC);
|
||||
}
|
||||
#endif
|
||||
Tolerance = Proj.GetTolerance();
|
||||
return G2dC;
|
||||
}
|
||||
|
||||
@@ -103,11 +103,6 @@ void IntAna_IntLinTorus::Perform(const gp_Lin& L, const gp_Torus& T)
|
||||
if (a0 > 0.0000000001)
|
||||
{
|
||||
aNbBadSol++;
|
||||
#if 0
|
||||
std::cout<<" ------- Erreur : P Ligne < > P Tore "<<std::endl;
|
||||
std::cout<<"Ligne : X:"<<PSolL.X()<<" Y:"<<PSolL.Y()<<" Z:"<<PSolL.Z()<<" l:"<<t<<std::endl;
|
||||
std::cout<<"Tore : X:"<<PSolT.X()<<" Y:"<<PSolT.Y()<<" Z:"<<PSolT.Z()<<" u:"<<u<<" v:"<<v<<std::endl;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -135,272 +130,3 @@ void IntAna_IntLinTorus::Perform(const gp_Lin& L, const gp_Torus& T)
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void MULT_A3_B1(double& c4,
|
||||
double& c3,
|
||||
double& c2,
|
||||
double& c1,
|
||||
double& c0,
|
||||
const double a3,
|
||||
const double a2,
|
||||
const double a1,
|
||||
const double a0,
|
||||
const double b1,
|
||||
const double b0) {
|
||||
c4 = a3 * b1;
|
||||
c3 = a3 * b0 + a2 * b1;
|
||||
c2 = a2 * b0 + a1 * b1;
|
||||
c1 = a1 * b0 + a0 * b1;
|
||||
c0 = a0 * b0;
|
||||
}
|
||||
|
||||
static void MULT_A2_B2(double& c4,
|
||||
double& c3,
|
||||
double& c2,
|
||||
double& c1,
|
||||
double& c0,
|
||||
const double a2,
|
||||
const double a1,
|
||||
const double a0,
|
||||
const double b2,
|
||||
const double b1,
|
||||
const double b0) {
|
||||
c4 = a2 * b2;
|
||||
c3 = a2 * b1 + a1 * b2;
|
||||
c2 = a2 * b0 + a1 * b1 + a0 * b2;
|
||||
c1 = a1 * b0 + a0 * b1;
|
||||
c0 = a0 * b0;
|
||||
}
|
||||
|
||||
static void MULT_A2_B1(double& c3,
|
||||
double& c2,
|
||||
double& c1,
|
||||
double& c0,
|
||||
const double a2,
|
||||
const double a1,
|
||||
const double a0,
|
||||
const double b1,
|
||||
const double b0) {
|
||||
c3 = a2 * b1;
|
||||
c2 = a2 * b0 + a1 * b1;
|
||||
c1 = a1 * b0 + a0 * b1;
|
||||
c0 = a0 * b0;
|
||||
}
|
||||
|
||||
void IntAna_IntLinTorus::Perform (const gp_Lin& L, const gp_Torus& T) {
|
||||
NCollection_Array1<double> C(1,31);
|
||||
T.Coefficients(C);
|
||||
const gp_Pnt& PL=L.Location();
|
||||
const gp_Dir& DL=L.Direction();
|
||||
|
||||
//----------------------------------------------------------------
|
||||
//-- X = ax1 l + ax0
|
||||
//-- X2 = ax2 l2 + 2 ax1 ax0 l + bx2
|
||||
//-- X3 = ax3 l3 + 3 ax2 ax0 l2 + 3 ax1 bx2 l + bx3
|
||||
//-- X4 = ax4 l4 + 4 ax3 ax0 l3 + 6 ax2 bx2 l2 + 4 ax1 bx3 l + bx4
|
||||
|
||||
double ax1,ax2,ax3,ax4,ax0,bx2,bx3,bx4;
|
||||
double ay1,ay2,ay3,ay4,ay0,by2,by3,by4;
|
||||
double az1,az2,az3,az4,az0,bz2,bz3,bz4;
|
||||
double c0,c1,c2,c3,c4;
|
||||
ax1=DL.X(); ax0=PL.X(); ay1=DL.Y(); ay0=PL.Y(); az1=DL.Z(); az0=PL.Z();
|
||||
ax2=ax1*ax1; ax3=ax2*ax1; ax4=ax3*ax1; bx2=ax0*ax0; bx3=bx2*ax0; bx4=bx3*ax0;
|
||||
ay2=ay1*ay1; ay3=ay2*ay1; ay4=ay3*ay1; by2=ay0*ay0; by3=by2*ay0; by4=by3*ay0;
|
||||
az2=az1*az1; az3=az2*az1; az4=az3*az1; bz2=az0*az0; bz3=bz2*az0; bz4=bz3*az0;
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X**4
|
||||
double c=C(1);
|
||||
double a4 = c *ax4;
|
||||
double a3 = c *4.0*ax3*ax0;
|
||||
double a2 = c *6.0*ax2*bx2;
|
||||
double a1 = c *4.0*ax1*bx3;
|
||||
double a0 = c *bx4;
|
||||
//--------------------------------------------------------------------------- Terme Y**4
|
||||
c = C(2);
|
||||
a4+= c*ay4;
|
||||
a3+= c*4.0*ay3*ay0;
|
||||
a2+= c*6.0*ay2*by2;
|
||||
a1+= c*4.0*ay1*by3;
|
||||
a0+= c*by4;
|
||||
//--------------------------------------------------------------------------- Terme Z**4
|
||||
c = C(3);
|
||||
a4+= c*az4 ;
|
||||
a3+= c*4.0*az3*az0;
|
||||
a2+= c*6.0*az2*bz2;
|
||||
a1+= c*4.0*az1*bz3;
|
||||
a0+= c*bz4;
|
||||
//--------------------------------------------------------------------------- Terme X**3 Y
|
||||
c = C(4);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, ax3, 3.0*ax2*ax0, 3.0*ax1*bx2, bx3, ay1,ay0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme X**3 Z
|
||||
c = C(5);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, ax3, 3.0*ax2*ax0, 3.0*ax1*bx2, bx3, az1,az0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Y**3 X
|
||||
c = C(6);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, ay3, 3.0*ay2*ay0, 3.0*ay1*by2, by3, ax1,ax0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Y**3 Z
|
||||
c = C(7);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, ay3, 3.0*ay2*ay0, 3.0*ay1*by2, by3, az1,az0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Z**3 X
|
||||
c = C(8);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, az3, 3.0*az2*az0, 3.0*az1*bz2, bz3, ax1,ax0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Z**3 Y
|
||||
c = C(9);
|
||||
MULT_A3_B1(c4,c3,c2,c1,c0, az3, 3.0*az2*az0, 3.0*az1*bz2, bz3, ay1,ay0);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X**2 Y**2
|
||||
c = C(10);
|
||||
MULT_A2_B2(c4,c3,c2,c1,c0, ax2, 2.0*ax1*ax0, bx2, ay2,2.0*ay1*ay0, by2);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme X**2 Z**2
|
||||
c = C(11);
|
||||
MULT_A2_B2(c4,c3,c2,c1,c0, ax2, 2.0*ax1*ax0, bx2, az2,2.0*az1*az0, bz2);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Y**2 Z**2
|
||||
c = C(12);
|
||||
MULT_A2_B2(c4,c3,c2,c1,c0, ay2, 2.0*ay1*ay0, by2, az2,2.0*az1*az0, bz2);
|
||||
a4+= c*c4; a3+= c*c3; a2+= c*c2; a1+= c*c1; a0+= c*c0;
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X**3
|
||||
c = C(13);
|
||||
a3+= c*( ax3 );
|
||||
a2+= c*( 3.0*ax2*ax0 );
|
||||
a1+= c*( 3.0*ax1*bx2 );
|
||||
a0+= c*( bx3 );
|
||||
//--------------------------------------------------------------------------- Terme Y**3
|
||||
c = C(14);
|
||||
a3+= c*( ay3 );
|
||||
a2+= c*( 3.0*ay2*ay0 );
|
||||
a1+= c*( 3.0*ay1*by2 );
|
||||
a0+= c*( by3 );
|
||||
//--------------------------------------------------------------------------- Terme Y**3
|
||||
c = C(15);
|
||||
a3+= c*( az3 );
|
||||
a2+= c*( 3.0*az2*az0 );
|
||||
a1+= c*( 3.0*az1*bz2 );
|
||||
a0+= c*( bz3 );
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X**2 Y
|
||||
c = C(16);
|
||||
MULT_A2_B1(c3,c2,c1,c0, ax2, 2.0*ax1*ax0, bx2, ay1,ay0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme X**2 Z
|
||||
c = C(17);
|
||||
MULT_A2_B1(c3,c2,c1,c0, ax2, 2.0*ax1*ax0, bx2, az1,az0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Y**2 X
|
||||
c = C(18);
|
||||
MULT_A2_B1(c3,c2,c1,c0, ay2, 2.0*ay1*ay0, by2, ax1,ax0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Y**2 Z
|
||||
c = C(19);
|
||||
MULT_A2_B1(c3,c2,c1,c0, ay2, 2.0*ay1*ay0, by2, az1,az0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Z**2 X
|
||||
c = C(20);
|
||||
MULT_A2_B1(c3,c2,c1,c0, az2, 2.0*az1*az0, bz2, ax1,ax0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
//--------------------------------------------------------------------------- Terme Z**2 Y
|
||||
c = C(21);
|
||||
MULT_A2_B1(c3,c2,c1,c0, az2, 2.0*az1*az0, bz2, ay1,ay0);
|
||||
a3+= c*c3; a2+= c* c2; a1+= c* c1; a0+= c*c0;
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X**2
|
||||
c = C(22);
|
||||
a2+= c*ax2;
|
||||
a1+= c*2.0*ax1*ax0;
|
||||
a0+= c*bx2;
|
||||
//--------------------------------------------------------------------------- Terme Y**2
|
||||
c = C(23);
|
||||
a2+= c*ay2;
|
||||
a1+= c*2.0*ay1*ay0;
|
||||
a0+= c*by2;
|
||||
//--------------------------------------------------------------------------- Terme Z**2
|
||||
c = C(24);
|
||||
a2+= c*az2;
|
||||
a1+= c*2.0*az1*az0;
|
||||
a0+= c*bz2;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X Y
|
||||
c = C(25);
|
||||
a2+= c*(ax1*ay1);
|
||||
a1+= c*(ax1*ay0 + ax0*ay1);
|
||||
a0+= c*(ax0*ay0);
|
||||
//--------------------------------------------------------------------------- Terme X Z
|
||||
c = C(26);
|
||||
a2+= c*(ax1*az1);
|
||||
a1+= c*(ax1*az0 + ax0*az1);
|
||||
a0+= c*(ax0*az0);
|
||||
//--------------------------------------------------------------------------- Terme Y Z
|
||||
c = C(27);
|
||||
a2+= c*(ay1*az1);
|
||||
a1+= c*(ay1*az0 + ay0*az1);
|
||||
a0+= c*(ay0*az0);
|
||||
|
||||
//--------------------------------------------------------------------------- Terme X
|
||||
c = C(28);
|
||||
a1+= c*ax1;
|
||||
a0+= c*ax0;
|
||||
//--------------------------------------------------------------------------- Terme Y
|
||||
c = C(29);
|
||||
a1+= c*ay1;
|
||||
a0+= c*ay0;
|
||||
//--------------------------------------------------------------------------- Terme Z
|
||||
c = C(30);
|
||||
a1+= c*az1;
|
||||
a0+= c*az0;
|
||||
|
||||
//--------------------------------------------------------------------------- Terme Constant
|
||||
c = C(31);
|
||||
a0+=c;
|
||||
|
||||
std::cout<<"\n ---------- Coefficients Line - Torus : "<<std::endl;
|
||||
std::cout<<" a0 : "<<a0<<std::endl;
|
||||
std::cout<<" a1 : "<<a1<<std::endl;
|
||||
std::cout<<" a2 : "<<a2<<std::endl;
|
||||
std::cout<<" a3 : "<<a3<<std::endl;
|
||||
std::cout<<" a4 : "<<a4<<std::endl;
|
||||
|
||||
double u,v;
|
||||
math_DirectPolynomialRoots mdpr(a4,a3,a2,a1,a0);
|
||||
if(mdpr.IsDone()) {
|
||||
int nbsolvalid = 0;
|
||||
int n = mdpr.NbSolutions();
|
||||
for(int i = 1; i<=n ; i++) {
|
||||
double t = mdpr.Value(i);
|
||||
gp_Pnt PSolL(ax0+ax1*t, ay0+ay1*t, az0+az1*t);
|
||||
ElSLib::Parameters(T,PSolL,u,v);
|
||||
gp_Pnt PSolT(ElSLib::Value(u,v,T));
|
||||
|
||||
a0 = PSolT.SquareDistance(PSolL);
|
||||
if(a0>0.0000000001) {
|
||||
std::cout<<" ------- Erreur : P Ligne < > P Tore ";
|
||||
std::cout<<"Ligne : X:"<<PSolL.X()<<" Y:"<<PSolL.Y()<<" Z:"<<PSolL.Z()<<" l:"<<t<<std::endl;
|
||||
std::cout<<"Tore : X:"<<PSolL.X()<<" Y:"<<PSolL.Y()<<" Z:"<<PSolL.Z()<<" u:"<<u<<" v:"<<v<<std::endl;
|
||||
}
|
||||
else {
|
||||
theParam[nbsolvalid] = t;
|
||||
theFi[nbsolvalid] = v;
|
||||
theTheta[nbsolvalid] = u;
|
||||
thePoint[nbsolvalid] = PSolL;
|
||||
nbsolvalid++;
|
||||
}
|
||||
}
|
||||
nbpt = nbsolvalid;
|
||||
done = true;
|
||||
}
|
||||
else {
|
||||
nbpt = 0;
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -106,23 +106,12 @@ void IntAna2d_AnaIntersection::Perform(const gp_Hypr2d& H, const IntAna2d_Conic&
|
||||
//--- (le point a ete obtenu par parametrage)
|
||||
//--- ??? la tolerance a ete fixee a 1e-10 ?????????????
|
||||
|
||||
#if 0
|
||||
double ecart_sur_courbe2;
|
||||
ecart_sur_courbe2=Conic.Value(tx,ty);
|
||||
if(ecart_sur_courbe2<=1e-10 && ecart_sur_courbe2>=-1e-10) {
|
||||
nb_sol_valides++;
|
||||
Coord_Ancien_Repere(tx,ty,Axe_rep);
|
||||
lpnt[nb_sol_valides-1].SetValue(tx,ty,Log(S));
|
||||
}
|
||||
#else
|
||||
|
||||
nb_sol_valides++;
|
||||
Coord_Ancien_Repere(tx, ty, Axe_rep);
|
||||
S = std::log(S);
|
||||
if (!HIsDirect)
|
||||
S = -S;
|
||||
lpnt[nb_sol_valides - 1].SetValue(tx, ty, S);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
nbp = nb_sol_valides;
|
||||
|
||||
@@ -313,39 +313,3 @@ void Coord_Ancien_Repere(double& x1, double& y1, const gp_Ax2d& Dir1)
|
||||
x1 = x0;
|
||||
y1 = y0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
//-- A Placer dans les ressources de la classe Conic ??
|
||||
//-----------------------------------------------------------------------------
|
||||
//--- Calcul des Coefficients A,..F dans le repere lie a Dir1
|
||||
//--- A Partir des Coefficients dans le repere "Absolu"
|
||||
|
||||
void Coeff_Nouveau_Repere(double& A,double& B,double& C
|
||||
,double& D,double& E,double& F
|
||||
,const gp_Ax2d Dir1) {
|
||||
double t11,t12,t13; // x = t11 X + t12 Y + t13
|
||||
double t21,t22,t23; // y = t21 X + t22 Y + t23
|
||||
double A1,B1,C1,D1,E1,F1;
|
||||
|
||||
// On a P0(x,y)=A x x + B y y + ... + F =0 (x et y ds le repere "Absolu")
|
||||
// et on cherche P1(X(x,y),Y(x,y))=P0(x,y)
|
||||
// Avec P1(X,Y)= A1 X X + B1 Y Y + 2 C1 X Y + 2 D1 X + 2 E1 Y + F1
|
||||
// = A x x + B y y + 2 C x y + 2 D x + 2 E y + f
|
||||
|
||||
Dir1.Direction().Coord(t11,t21);
|
||||
Dir1.Location().Coord(t13,t23);
|
||||
|
||||
t22=t11;
|
||||
t12=-t21;
|
||||
|
||||
A1=(t11*(A*t11 + 2*C*t21) + B*t21*t21);
|
||||
B1=(t12*(A*t12 + 2*C*t22) + B*t22*t22);
|
||||
C1=(t12*(A*t11 + C*t21) + t22*(C*t11 + B*t21));
|
||||
D1=(t11*(D + A*t13) + t21*(E + C*t13) + t23*(C*t11 + B*t21));
|
||||
E1=(t12*(D + A*t13) + t22*(E + C*t13) + t23*(C*t12 + B*t22));
|
||||
F1=F + t13*(2.0*D + A*t13) + t23*(2.0*E + 2.0*C*t13 + B*t23);
|
||||
|
||||
A=A1; B=B1; C=C1; D=D1; E=E1; F=F1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -238,40 +238,6 @@ static void d2(const double t,
|
||||
// purpose : computes first derivative of the 3d projected curve
|
||||
//=======================================================================
|
||||
|
||||
#if 0
|
||||
static void d1CurvOnSurf(const double t,
|
||||
const double u,
|
||||
const double v,
|
||||
gp_Vec& V,
|
||||
const occ::handle<Adaptor3d_Curve>& Curve,
|
||||
const occ::handle<Adaptor3d_Surface>& Surface)
|
||||
{
|
||||
gp_Pnt S, C;
|
||||
gp_Vec2d V2d;
|
||||
gp_Vec DS1_u, DS1_v, DS2_u, DS2_uv, DS2_v, DC1_t;
|
||||
Surface->D2(u, v, S, DS1_u, DS1_v, DS2_u, DS2_v, DS2_uv);
|
||||
Curve->D1(t, C, DC1_t);
|
||||
gp_Vec Ort(C, S);// Ort = S - C
|
||||
|
||||
gp_Vec2d dE_dt(-DC1_t*DS1_u, -DC1_t*DS1_v);
|
||||
gp_XY dE_du(DS1_u*DS1_u + Ort*DS2_u,
|
||||
DS1_u*DS1_v + Ort*DS2_uv);
|
||||
gp_XY dE_dv(DS1_v*DS1_u + Ort*DS2_uv,
|
||||
DS1_v*DS1_v + Ort*DS2_v);
|
||||
|
||||
double det = dE_du.X()*dE_dv.Y() - dE_du.Y()*dE_dv.X();
|
||||
if (fabs(det) < gp::Resolution()) throw Standard_ConstructionError();
|
||||
|
||||
gp_Mat2d M(gp_XY(dE_dv.Y()/det, -dE_du.Y()/det),
|
||||
gp_XY(-dE_dv.X()/det, dE_du.X()/det));
|
||||
|
||||
V2d = - gp_Vec2d(gp_Vec2d(M.Row(1))*dE_dt, gp_Vec2d(M.Row(2))*dE_dt);
|
||||
|
||||
V = DS1_u * V2d.X() + DS1_v * V2d.Y();
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
// function : d2CurveOnSurf
|
||||
// purpose : computes second derivative of the 3D projected curve
|
||||
|
||||
@@ -43,10 +43,6 @@
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
|
||||
// #define DRAW
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
#endif
|
||||
#ifdef OCCT_DEBUG
|
||||
// static bool AffichValue = false;
|
||||
#endif
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
// #include <GeomLib_CheckSameParameter.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
#ifdef DRAW
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#endif
|
||||
// static int compteur = 0;
|
||||
#endif
|
||||
|
||||
@@ -2002,17 +1998,9 @@ occ::handle<Geom2d_BSplineCurve> ProjLib_ComputeApproxOnPolarSurface::ProjectUsi
|
||||
}
|
||||
occ::handle<Geom2d_BSplineCurve> DummyC2d =
|
||||
new Geom2d_BSplineCurve(DummyPoles, DummyKnots, DummyMults, 1);
|
||||
#ifdef DRAW
|
||||
const char* Temp = "bs2d";
|
||||
DrawTrSurf::Set(Temp, DummyC2d);
|
||||
#endif
|
||||
// DrawTrSurf::Set((const char* ) "bs2d",DummyC2d);
|
||||
occ::handle<Geom2dAdaptor_Curve> DDD = occ::down_cast<Geom2dAdaptor_Curve>(InitCurve2d);
|
||||
|
||||
#ifdef DRAW
|
||||
Temp = "initc2d";
|
||||
DrawTrSurf::Set(Temp, DDD->ChangeCurve2d().Curve());
|
||||
#endif
|
||||
// DrawTrSurf::Set((const char* ) "initc2d",DDD->ChangeCurve2d().Curve());
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user