42cf5bc1 |
1 | // Created on: 1993-11-26 |
2 | // Created by: Modelistation |
3 | // Copyright (c) 1993-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 _IntPatch_ALineToWLine_HeaderFile |
18 | #define _IntPatch_ALineToWLine_HeaderFile |
19 | |
e2e0498b |
20 | #include <IntPatch_SequenceOfLine.hxx> |
21 | #include <IntSurf_Quadric.hxx> |
42cf5bc1 |
22 | #include <Standard_DefineAlloc.hxx> |
23 | #include <Standard_Handle.hxx> |
e2e0498b |
24 | #include <Standard_Macro.hxx> |
42cf5bc1 |
25 | |
e2e0498b |
26 | class Adaptor3d_HSurface; |
42cf5bc1 |
27 | class IntPatch_ALine; |
e2e0498b |
28 | class IntSurf_PntOn2S; |
42cf5bc1 |
29 | |
30 | class IntPatch_ALineToWLine |
31 | { |
32 | public: |
33 | |
34 | DEFINE_STANDARD_ALLOC |
35 | |
e2e0498b |
36 | //! Constructor |
37 | Standard_EXPORT IntPatch_ALineToWLine(const Handle(Adaptor3d_HSurface)& theS1, |
38 | const Handle(Adaptor3d_HSurface)& theS2, |
39 | const Standard_Integer theNbPoints = 200); |
42cf5bc1 |
40 | |
41 | Standard_EXPORT void SetTolOpenDomain (const Standard_Real aT); |
42 | |
43 | Standard_EXPORT Standard_Real TolOpenDomain() const; |
44 | |
45 | Standard_EXPORT void SetTolTransition (const Standard_Real aT); |
46 | |
47 | Standard_EXPORT Standard_Real TolTransition() const; |
48 | |
49 | Standard_EXPORT void SetTol3D (const Standard_Real aT); |
50 | |
51 | Standard_EXPORT Standard_Real Tol3D() const; |
52 | |
e2e0498b |
53 | //! Converts aline to the set of Walking-lines and adds |
54 | //! them in theLines. |
55 | Standard_EXPORT void MakeWLine (const Handle(IntPatch_ALine)& aline, |
56 | IntPatch_SequenceOfLine& theLines) const; |
42cf5bc1 |
57 | |
e2e0498b |
58 | //! Converts aline (limitted by paraminf and paramsup) to the set of |
59 | //! Walking-lines and adds them in theLines. |
60 | Standard_EXPORT void MakeWLine (const Handle(IntPatch_ALine)& aline, |
61 | const Standard_Real paraminf, |
62 | const Standard_Real paramsup, |
63 | IntPatch_SequenceOfLine& theLines) const; |
42cf5bc1 |
64 | |
65 | protected: |
e2e0498b |
66 | //! Computes step value to construct point-line. The step depends on |
67 | //! the local curvature of the intersection line computed in thePOn2S. |
68 | //! theTgMagnitude is the magnitude of tangent vector to the intersection |
69 | //! line (in the point thePOn2S). |
70 | //! Computed step is always in the range [theStepMin, theStepMax]. |
71 | //! Returns FALSE if the step cannot be computed. In this case, its value |
72 | //! will not be changed. |
73 | Standard_EXPORT Standard_Boolean StepComputing(const Handle(IntPatch_ALine)& theALine, |
74 | const IntSurf_PntOn2S& thePOn2S, |
75 | const Standard_Real theLastParOfAline, |
76 | const Standard_Real theCurParam, |
77 | const Standard_Real theTgMagnitude, |
78 | const Standard_Real theStepMin, |
79 | const Standard_Real theStepMax, |
80 | const Standard_Real theMaxDeflection, |
81 | Standard_Real& theStep) const; |
42cf5bc1 |
82 | |
3306fdd9 |
83 | //! Compares distances from theMidPt to every quadrics with theMaxDeflection |
84 | //! (maximal distance of two ones is taken into account). |
85 | //! Returns the result of this comparison: -1 - small distance, +1 - big distance, |
86 | //! 0 - Dist == theMaxDeflection. Comparisons are done with internal tolerances. |
e2e0498b |
87 | Standard_EXPORT Standard_Integer CheckDeflection(const gp_XYZ& theMidPt, |
88 | const Standard_Real theMaxDeflection) const; |
42cf5bc1 |
89 | |
3306fdd9 |
90 | //! Returns radius of a circle obtained by intersection the quadric with a plane |
91 | //! goes through thePnt3d perpendicular to the quadric axis. This radius is computed |
92 | //! for both quadrics and minimal value is returned. |
93 | //! This check is made for cone and sphere only. |
94 | Standard_EXPORT Standard_Real GetSectionRadius(const gp_Pnt& thePnt3d) const; |
42cf5bc1 |
95 | |
96 | private: |
97 | |
98 | |
e2e0498b |
99 | Handle(Adaptor3d_HSurface) myS1; |
100 | Handle(Adaptor3d_HSurface) myS2; |
101 | IntSurf_Quadric myQuad1; |
102 | IntSurf_Quadric myQuad2; |
42cf5bc1 |
103 | |
e2e0498b |
104 | //! Approximate number of points in resulting |
105 | //! WLine (precise number of points is computed |
106 | //! by the algorithms) |
107 | Standard_Integer myNbPointsInWline; |
42cf5bc1 |
108 | Standard_Real myTolOpenDomain; |
109 | Standard_Real myTolTransition; |
110 | Standard_Real myTol3D; |
42cf5bc1 |
111 | }; |
112 | |
42cf5bc1 |
113 | #endif // _IntPatch_ALineToWLine_HeaderFile |