//
// This file is part of Open CASCADE Technology software library.
//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <GeomFill_LocationGuide.ixx>
-#include <gp.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Trsf.hxx>
-#include <gp_GTrsf.hxx>
-#include <gp_XYZ.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Pnt2d.hxx>
-
-#include <math_Vector.hxx>
-#include <math_Gauss.hxx>
-#include <math_FunctionSetRoot.hxx>
-#include <Precision.hxx>
-
-#include <Geom_SurfaceOfRevolution.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_Curve.hxx>
-#include <Adaptor3d_SurfaceOfRevolution.hxx>
+#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx>
-
-#include <IntCurveSurface_IntersectionPoint.hxx>
#include <Adaptor3d_Surface.hxx>
+#include <ElCLib.hxx>
+#include <Extrema_ExtCS.hxx>
+#include <Extrema_POnSurf.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_SurfaceOfRevolution.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor.hxx>
-#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_HCurve.hxx>
-
-
-#include <GeomFill_FunctionGuide.ixx>
-#include <GeomFill_UniformSection.hxx>
+#include <GeomAdaptor_HSurface.hxx>
+#include <GeomFill_FunctionGuide.hxx>
+#include <GeomFill_LocationGuide.hxx>
+#include <GeomFill_LocationLaw.hxx>
+#include <GeomFill_SectionLaw.hxx>
#include <GeomFill_SectionPlacement.hxx>
-#include <Geom_TrimmedCurve.hxx>
+#include <GeomFill_TrihedronWithGuide.hxx>
+#include <GeomFill_UniformSection.hxx>
#include <GeomLib.hxx>
-#include <ElCLib.hxx>
-
+#include <gp.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Dir.hxx>
+#include <gp_GTrsf.hxx>
+#include <gp_Mat.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Trsf.hxx>
+#include <gp_Vec.hxx>
+#include <gp_XYZ.hxx>
+#include <IntCurveSurface_IntersectionPoint.hxx>
+#include <math_FunctionSetRoot.hxx>
+#include <math_Gauss.hxx>
+#include <math_Matrix.hxx>
+#include <math_Vector.hxx>
+#include <Precision.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Standard_Type.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <Extrema_ExtCS.hxx>
-#include <Extrema_POnSurf.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(GeomFill_LocationGuide,GeomFill_LocationLaw)
#if DRAW
static Standard_Integer Affich = 0;
#include <Approx_Curve3d.hxx>
#include <DrawTrSurf.hxx>
+#include <GeomFill_TrihedronWithGuide.hxx>
#endif
//=======================================================================
//function : TraceRevol
//purpose : Trace la surface de revolution (Debug)
//=======================================================================
-#if DEB
+#ifdef OCCT_DEBUG
static void TraceRevol(const Standard_Real t,
const Standard_Real s,
const Handle(GeomFill_TrihedronWithGuide)& Law,
{
gp_Vec T, N, B;
gp_Pnt P;
- Standard_Boolean Ok;
gp_Ax3 Rep(gp::Origin(), gp::DZ(), gp::DX());
Curve->D0(t, P);
- Ok = Law->D0(t, T, N, B);
+ Law->D0(t, T, N, B);
gp_Mat M(N.XYZ(), B.XYZ(), T.XYZ());
M *= Trans;
gp_Vec T,N,B;
Standard_Integer ii, Deg;
Standard_Boolean isconst, israt=Standard_False;
- Standard_Real t, v,w, OldAngle=0, Angle, DeltaG, DeltaU, Diff;
+ Standard_Real t, v,w, OldAngle=0, Angle, DeltaG, Diff;
Standard_Real CurAngle = PrecAngle, a1/*, a2*/;
gp_Pnt2d p1,p2;
Handle(Geom_SurfaceOfRevolution) Revol; // surface de revolution
Sup(3) = Ul + Delta/10;
// JALONNEMENT
- DeltaU = (Ul-Uf)/(2+NbKnots);
if (uperiodic) UPeriod = Ul-Uf;
for (ii=1; ii<=myNbPts; ii++) {
Standard_Real theU = 0., theV = 0.;
if (!DistMini.IsDone() || DistMini.NbExt() == 0) {
-#if DEB
+#ifdef OCCT_DEBUG
cout <<"LocationGuide : Pas d'intersection"<<endl;
TraceRevol(t, U, myLaw, mySec, myCurve, Trans);
#endif
Standard_Boolean SOS=Standard_False;
if (ii>1) {
- // Intersection de secour entre surf revol et guide
- // equation
- X(1) = myPoles2d->Value(1,ii-1).Y();
- X(2) = myPoles2d->Value(2,ii-1).X();
- X(3) = myPoles2d->Value(2,ii-1).Y();
- GeomFill_FunctionGuide E (mySec, myGuide, U);
- E.SetParam(U, P, T.XYZ(), N.XYZ());
- // resolution => angle
- math_FunctionSetRoot Result(E, X, TolRes,
- Inf, Sup);
-
- if (Result.IsDone() &&
- (Result.FunctionSetErrors().Norm() < TolRes(1)*TolRes(1)) ) {
-#if DEB
- cout << "Ratrappage Reussi !" << endl;
+ // Intersection de secour entre surf revol et guide
+ // equation
+ X(1) = myPoles2d->Value(1,ii-1).Y();
+ X(2) = myPoles2d->Value(2,ii-1).X();
+ X(3) = myPoles2d->Value(2,ii-1).Y();
+ GeomFill_FunctionGuide E (mySec, myGuide, U);
+ E.SetParam(U, P, T.XYZ(), N.XYZ());
+ // resolution => angle
+ math_FunctionSetRoot Result(E, TolRes);
+ Result.Perform(E, X, Inf, Sup);
+
+ if (Result.IsDone() &&
+ (Result.FunctionSetErrors().Norm() < TolRes(1)*TolRes(1)) ) {
+#ifdef OCCT_DEBUG
+ cout << "Ratrappage Reussi !" << endl;
#endif
- SOS = Standard_True;
- math_Vector RR(1,3);
- Result.Root(RR);
- PInt.SetValues(P, RR(2), RR(3), RR(1), IntCurveSurface_Out);
- theU = PInt.U();
- theV = PInt.V();
- }
- else {
-#if DEB
- cout << "Echec du Ratrappage !" << endl;
+ SOS = Standard_True;
+ math_Vector RR(1,3);
+ Result.Root(RR);
+ PInt.SetValues(P, RR(2), RR(3), RR(1), IntCurveSurface_Out);
+ theU = PInt.U();
+ theV = PInt.V();
+ }
+ else {
+#ifdef OCCT_DEBUG
+ cout << "Echec du Ratrappage !" << endl;
#endif
- }
+ }
}
if (!SOS) {
myStatus = GeomFill_ImpossibleContact;
}
}
-#if DEB
+#ifdef OCCT_DEBUG
if (Abs(Diff) > DeltaG) {
cout << "Location :: Diff on Guide : " <<
Diff << endl;
InGoodPeriod (OldAngle, 2*M_PI, Angle);
Diff = Angle - OldAngle;
}
-#if DEB
+#ifdef OCCT_DEBUG
if (Abs(Diff) > M_PI/4) {
cout << "Diff d'angle trop grand !!" << endl;
}
InGoodPeriod (myPoles2d->Value(2, ii-1).Y(), UPeriod, v);
}
Diff = v - myPoles2d->Value(2, ii-1).Y();
-#if DEB
- if (Abs(Diff) > DeltaU) {
+#ifdef OCCT_DEBUG
+ if (Abs(Diff) > (Ul-Uf)/(2+NbKnots)) {
cout << "Diff sur section trop grand !!" << endl;
}
#endif
GeomFill_FunctionGuide E (mySec, myGuide, U);
E.SetParam(Param, P, t, n);
// resolution => angle
- math_FunctionSetRoot Result(E, X, TolRes,
- Inf, Sup, Iter);
+ math_FunctionSetRoot Result(E, TolRes, Iter);
+ Result.Perform(E, X, Inf, Sup);
if (Result.IsDone()) {
// solution
M.SetCols(n, b, t);
}
else {
-#if DEB
+#ifdef OCCT_DEBUG
cout << "LocationGuide::D0 : No Result !"<<endl;
TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
#endif
GeomFill_FunctionGuide E (mySec, myGuide, myFirstS +
(Param-myCurve->FirstParameter())*ratio);
E.SetParam(Param, P, t, n);
-
+
// resolution
- math_FunctionSetRoot Result(E, X, TolRes,
- Inf, Sup, Iter);
-
+ math_FunctionSetRoot Result(E, TolRes, Iter);
+ Result.Perform(E, X, Inf, Sup);
+
if (Result.IsDone()) {
// solution
Result.Root(R);
M.SetCols(n, b, t);
}
else {
-#if DEB
+#ifdef OCCT_DEBUG
Standard_Real U = myFirstS + ratio*(Param-myCurve->FirstParameter());
cout << "LocationGuide::D0 : No Result !"<<endl;
TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
if (rotation) {
return Standard_False;
/*
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Real U = myFirstS + ratio*(Param-myCurve->FirstParameter());
#else
myCurve->FirstParameter() ;
Ga.Solve (DEDT.Opposite(), DSDT);// resolution du syst.
}//if
else {
-#if DEB
+#ifdef OCCT_DEBUG
cout << "DEDX = " << DEDX << endl;
cout << "DEDT = " << DEDT << endl;
#endif
Standard_Real A = R(2);
Standard_Real Aprim = DSDT(2);
-#ifdef DEB
+#ifdef OCCT_DEBUG
gp_Mat M2 (Cos(A), -Sin(A),0, // rotation autour de T
Sin(A), Cos(A),0,
0,0,1);
}//if_Result
else {
-#if DEB
+#ifdef OCCT_DEBUG
cout << "LocationGuide::D1 : No Result !!"<<endl;
TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
#endif
}//if_result
else {
-#if DEB
+#ifdef OCCT_DEBUG
cout << "LocationGuide::D2 : No Result !!" <<endl;
TraceRevol(Param, U, myLaw, mySec, myCurve, Trans);
#endif