1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <math_FunctionSetRoot.hxx>
16 #include <math_Gauss.hxx>
17 #include <TColgp_Array1OfPnt.hxx>
18 #include <TColgp_Array2OfVec.hxx>
20 #include <IntSurf.hxx>
21 #include <Adaptor2d_HCurve2d.hxx>
23 #include <CSLib_NormalStatus.hxx>
24 #include <Precision.hxx>
27 #include <TColStd_Array1OfInteger.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29 #include <TColgp_Array1OfPnt2d.hxx>
30 #include <Geom_BSplineCurve.hxx>
33 #include <DrawTrSurf_BSplineCurve.hxx>
38 static Standard_Boolean sectioncalculee;
39 static Standard_Integer IndexOfSection = 0;
40 static Standard_Integer IndexOfRejection = 0;
41 static Standard_Integer nbcomputedsection;
42 extern Standard_Boolean Blend_GettraceDRAWSECT();
43 extern Standard_Boolean Blend_GetcontextNOTESTDEFL();
45 // Pour debug : visualisation de la section
46 static void Drawsect(const TheSurface& surf1,
47 const TheSurface& surf2,
48 const math_Vector& sol,
49 const Standard_Real param,
51 const Blend_Status State)
53 // if(!sectioncalculee) return;
54 Blend_Point BP(TheSurfaceTool::Value(surf1,sol(1),sol(2)),
55 TheSurfaceTool::Value(surf2,sol(3),sol(4)),
56 param,sol(1),sol(2),sol(3),sol(4));
57 Standard_Integer hp,hk,hd,hp2d;
58 Func.GetShape(hp,hk,hd,hp2d);
59 TColStd_Array1OfReal TK(1,hk);
61 TColStd_Array1OfInteger TMul(1,hk);
63 TColgp_Array1OfPnt TP(1,hp);
64 TColgp_Array1OfPnt2d TP2d(1,hp2d);
65 TColStd_Array1OfReal TW(1,hp);
66 Func.Section(BP,TP,TP2d,TW);
67 Handle(Geom_BSplineCurve) sect = new Geom_BSplineCurve
72 char* name = new char[100];
73 if ((State==Blend_StepTooLarge) ||(State==Blend_SamePoints)) {
75 sprintf(name,"%s_%d","Rejection",IndexOfRejection);
79 sprintf(name,"%s_%d","Section",IndexOfSection);
82 Handle(DrawTrSurf_BSplineCurve) BS
83 = new (DrawTrSurf_BSplineCurve)(sect);
86 if (State==Blend_StepTooLarge) BS->SetColor(Draw_violet);
87 if (State==Blend_SamePoints) BS->SetColor(Draw_rose);
92 static void Drawsect(const TheSurface& surf1,
93 const TheSurface& surf2,
94 const math_Vector& sol,
95 const Standard_Real param,
98 Drawsect(surf1, surf2, sol, param, Func, Blend_OK);
102 #include <Blend_Walking_1.gxx>
103 #include <Blend_Walking_2.gxx>
104 #include <Blend_Walking_3.gxx>
105 #include <Blend_Walking_4.gxx>