0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / BRepBlend / BRepBlend_SurfRstLineBuilder.hxx
1 // Created on: 1997-01-23
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _BRepBlend_SurfRstLineBuilder_HeaderFile
18 #define _BRepBlend_SurfRstLineBuilder_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <math_Vector.hxx>
26 #include <Standard_Real.hxx>
27 #include <Blend_Point.hxx>
28 #include <Standard_Integer.hxx>
29 #include <Blend_Status.hxx>
30 #include <TopAbs_State.hxx>
31 class BRepBlend_Line;
32 class Adaptor3d_HSurface;
33 class Adaptor3d_TopolTool;
34 class Adaptor2d_HCurve2d;
35 class Blend_SurfRstFunction;
36 class Blend_FuncInv;
37 class Blend_SurfPointFuncInv;
38 class Blend_SurfCurvFuncInv;
39 class gp_Pnt2d;
40 class Adaptor3d_HVertex;
41 class IntSurf_Transition;
42 class BRepBlend_Extremity;
43 class Blend_Point;
44
45
46 //! This  class processes data  resulting  from
47 //! Blend_CSWalking  taking  in consideration the Surface
48 //! supporting  the curve to detect the breakpoint.
49 //!
50 //! The criteria of  distribution  of  points on  the  line are  detailed
51 //! because  it  is  to  be  used  in  the  calculatuon of values approached
52 //! by an approximation of functions continued  basing on
53 //! Blend_SurfRstFunction.
54 //!
55 //! Thus this pseudo path necessitates 3 criteria of regrouping :
56 //!
57 //! 1) exit of the domain of  the curve
58 //!
59 //! 2) exit of the domain of  the  surface
60 //!
61 //! 3)  stall as there  is a solution to  the problem
62 //! surf/surf  within  the  domain of  the surface
63 //! of  support  of  the   restriction.
64 //!
65 //! Construction of a BRepBlend_Line between a surface and
66 //! a pcurve on surface from an approached
67 //! starting solution. The output entries of this builder
68 //! are of the same nature as of the traditional walking
69 //! but the requirements on the Line are not the same
70 //! If the determination of validity range is always
71 //! guaranteed, the criteria of correct repartition of sections
72 //! before smoothing are not respected. The resulting Line
73 //! is f(t) oriented.
74 class BRepBlend_SurfRstLineBuilder 
75 {
76 public:
77
78   DEFINE_STANDARD_ALLOC
79
80   
81   Standard_EXPORT BRepBlend_SurfRstLineBuilder(const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(Adaptor2d_HCurve2d)& Rst, const Handle(Adaptor3d_TopolTool)& Domain2);
82   
83   Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
84   
85   Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
86   
87   Standard_EXPORT Standard_Boolean Complete (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pmin);
88   
89   Standard_EXPORT Standard_Integer ArcToRecadre (const math_Vector& Sol, const Standard_Integer PrevIndex, gp_Pnt2d& pt2d, gp_Pnt2d& lastpt2d, Standard_Real& ponarc);
90   
91     Standard_Boolean IsDone() const;
92   
93     const Handle(BRepBlend_Line)& Line() const;
94   
95     Standard_Boolean DecrochStart() const;
96   
97     Standard_Boolean DecrochEnd() const;
98
99
100
101
102 protected:
103
104
105
106
107
108 private:
109
110   
111   Standard_EXPORT void InternalPerform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Bound);
112   
113   Standard_EXPORT Standard_Boolean Recadre (Blend_SurfCurvFuncInv& FinvC, math_Vector& Solinv, Handle(Adaptor2d_HCurve2d)& Arc, Standard_Boolean& IsVtx, Handle(Adaptor3d_HVertex)& Vtx);
114   
115   Standard_EXPORT Standard_Boolean Recadre (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, math_Vector& Solinv, Standard_Boolean& IsVtx, Handle(Adaptor3d_HVertex)& Vtx);
116   
117   Standard_EXPORT Standard_Boolean Recadre (Blend_SurfPointFuncInv& FinvP, math_Vector& Solinv, Standard_Boolean& IsVtx, Handle(Adaptor3d_HVertex)& Vtx);
118   
119   Standard_EXPORT void Transition (const Standard_Boolean OnFirst, const Handle(Adaptor2d_HCurve2d)& Arc, const Standard_Real Param, IntSurf_Transition& TLine, IntSurf_Transition& TArc);
120   
121   Standard_EXPORT void MakeExtremity (BRepBlend_Extremity& Extrem, const Standard_Boolean OnFirst, const Handle(Adaptor2d_HCurve2d)& Arc, const Standard_Real Param, const Standard_Boolean IsVtx, const Handle(Adaptor3d_HVertex)& Vtx);
122   
123   Standard_EXPORT Blend_Status CheckDeflectionOnSurf (const Blend_Point& CurPoint);
124   
125   Standard_EXPORT Blend_Status CheckDeflectionOnRst (const Blend_Point& CurPoint);
126   
127   Standard_EXPORT Blend_Status TestArret (Blend_SurfRstFunction& Func, const Standard_Boolean TestDeflection, const Blend_Status State);
128   
129   Standard_EXPORT Standard_Boolean CheckInside (Blend_SurfRstFunction& Func, TopAbs_State& SituOnC, TopAbs_State& SituOnS, Standard_Boolean& Decroch);
130
131
132   Standard_Boolean done;
133   Handle(BRepBlend_Line) line;
134   math_Vector sol;
135   Handle(Adaptor3d_HSurface) surf1;
136   Handle(Adaptor3d_TopolTool) domain1;
137   Handle(Adaptor3d_HSurface) surf2;
138   Handle(Adaptor2d_HCurve2d) rst;
139   Handle(Adaptor3d_TopolTool) domain2;
140   Standard_Real tolesp;
141   Standard_Real tolgui;
142   Standard_Real pasmax;
143   Standard_Real fleche;
144   Standard_Real param;
145   Blend_Point previousP;
146   Standard_Boolean rebrou;
147   Standard_Boolean iscomplete;
148   Standard_Boolean comptra;
149   Standard_Real sens;
150   Standard_Boolean decrochdeb;
151   Standard_Boolean decrochfin;
152
153
154 };
155
156
157 #include <BRepBlend_SurfRstLineBuilder.lxx>
158
159
160
161
162
163 #endif // _BRepBlend_SurfRstLineBuilder_HeaderFile