5adae760 |
1 | // Created by: Nikolai BUKHALOV |
2 | // Copyright (c) 2015 OPEN CASCADE SAS |
3 | // |
4 | // This file is part of Open CASCADE Technology software library. |
5 | // |
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. |
11 | // |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
14 | |
15 | #ifndef _GeomLib_CheckCurveOnSurface_HeaderFile |
16 | #define _GeomLib_CheckCurveOnSurface_HeaderFile |
17 | |
9ae88397 |
18 | #include <Adaptor3d_Curve.hxx> |
6ca1c746 |
19 | #include <Precision.hxx> |
5adae760 |
20 | #include <Standard.hxx> |
21 | |
9ae88397 |
22 | class Adaptor3d_CurveOnSurface; |
5adae760 |
23 | |
24 | //! Computes the max distance between 3D-curve and 2D-curve |
25 | //! in some surface. |
26 | class GeomLib_CheckCurveOnSurface |
27 | { |
28 | public: |
29 | |
30 | DEFINE_STANDARD_ALLOC |
31 | |
a25d5aaa |
32 | //! Default constructor |
5adae760 |
33 | Standard_EXPORT GeomLib_CheckCurveOnSurface(void); |
34 | |
a25d5aaa |
35 | //! Constructor |
6ca1c746 |
36 | Standard_EXPORT |
9ae88397 |
37 | GeomLib_CheckCurveOnSurface(const Handle(Adaptor3d_Curve)& theCurve, |
6ca1c746 |
38 | const Standard_Real theTolRange = |
39 | Precision::PConfusion()); |
5adae760 |
40 | |
41 | //! Sets the data for the algorithm |
9ae88397 |
42 | Standard_EXPORT void Init (const Handle(Adaptor3d_Curve)& theCurve, |
6ca1c746 |
43 | const Standard_Real theTolRange = Precision::PConfusion()); |
5adae760 |
44 | |
316ea293 |
45 | //! Initializes all members by default values |
5adae760 |
46 | Standard_EXPORT void Init(); |
47 | |
48 | //! Computes the max distance for the 3d curve <myCurve> |
9ae88397 |
49 | //! and 2d curve <theCurveOnSurface> |
c9337e33 |
50 | //! If isMultiThread == Standard_True then computation will be performed in parallel. |
9ae88397 |
51 | Standard_EXPORT void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface, |
52 | const Standard_Boolean isMultiThread = Standard_False); |
5adae760 |
53 | |
54 | //! Returns true if the max distance has been found |
55 | Standard_Boolean IsDone() const |
56 | { |
57 | return (myErrorStatus == 0); |
58 | } |
59 | |
60 | //! Returns error status |
61 | //! The possible values are: |
62 | //! 0 - OK; |
63 | //! 1 - null curve or surface or 2d curve; |
64 | //! 2 - invalid parametric range; |
65 | //! 3 - error in calculations. |
66 | Standard_Integer ErrorStatus() const |
67 | { |
68 | return myErrorStatus; |
69 | } |
70 | |
71 | //! Returns max distance |
72 | Standard_Real MaxDistance() const |
73 | { |
74 | return myMaxDistance; |
75 | } |
76 | |
77 | //! Returns parameter in which the distance is maximal |
78 | Standard_Real MaxParameter() const |
79 | { |
80 | return myMaxParameter; |
81 | } |
82 | |
83 | private: |
84 | |
9ae88397 |
85 | Handle(Adaptor3d_Curve) myCurve; |
5adae760 |
86 | Standard_Integer myErrorStatus; |
87 | Standard_Real myMaxDistance; |
88 | Standard_Real myMaxParameter; |
6ca1c746 |
89 | Standard_Real myTolRange; |
5adae760 |
90 | }; |
91 | |
92 | #endif // _BRepLib_CheckCurveOnSurface_HeaderFile |