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 | |
18 | #include <Geom_Curve.hxx> |
6ca1c746 |
19 | #include <Precision.hxx> |
5adae760 |
20 | #include <Standard.hxx> |
21 | |
22 | class Geom_Surface; |
23 | class Geom2d_Curve; |
24 | |
25 | //! Computes the max distance between 3D-curve and 2D-curve |
26 | //! in some surface. |
27 | class GeomLib_CheckCurveOnSurface |
28 | { |
29 | public: |
30 | |
31 | DEFINE_STANDARD_ALLOC |
32 | |
33 | //! Default contructor |
34 | Standard_EXPORT GeomLib_CheckCurveOnSurface(void); |
35 | |
36 | //! Contructor |
6ca1c746 |
37 | Standard_EXPORT |
38 | GeomLib_CheckCurveOnSurface(const Handle(Geom_Curve)& theCurve, |
39 | const Handle(Geom_Surface)& theSurface, |
40 | const Standard_Real theFirst, |
41 | const Standard_Real theLast, |
42 | const Standard_Real theTolRange = |
43 | Precision::PConfusion()); |
5adae760 |
44 | |
45 | //! Sets the data for the algorithm |
46 | Standard_EXPORT void Init (const Handle(Geom_Curve)& theCurve, |
47 | const Handle(Geom_Surface)& theSurface, |
48 | const Standard_Real theFirst, |
6ca1c746 |
49 | const Standard_Real theLast, |
50 | const Standard_Real theTolRange = Precision::PConfusion()); |
5adae760 |
51 | |
52 | //! Initializes all members by dafault values |
53 | Standard_EXPORT void Init(); |
54 | |
55 | //! Computes the max distance for the 3d curve <myCurve> |
56 | //! and 2d curve <thePCurve> |
57 | //! If isTheMultyTheadDisabled == TRUE then computation will be made |
58 | //! without any parallelization. |
59 | Standard_EXPORT void Perform(const Handle(Geom2d_Curve)& thePCurve, |
60 | const Standard_Boolean isTheMultyTheradDisabled = Standard_False); |
61 | |
62 | //! Returns my3DCurve |
63 | const Handle(Geom_Curve)& Curve() const |
64 | { |
65 | return myCurve; |
66 | } |
67 | |
68 | //! Returns mySurface |
69 | const Handle(Geom_Surface)& Surface() const |
70 | { |
71 | return mySurface; |
72 | } |
73 | |
74 | //! Returns first and last parameter of the curves |
75 | //! (2D- and 3D-curves are considered to have same range) |
76 | void Range (Standard_Real& theFirst, Standard_Real& theLast) |
77 | { |
78 | theFirst = myFirst; |
79 | theLast = myLast; |
80 | } |
81 | |
82 | //! Returns true if the max distance has been found |
83 | Standard_Boolean IsDone() const |
84 | { |
85 | return (myErrorStatus == 0); |
86 | } |
87 | |
88 | //! Returns error status |
89 | //! The possible values are: |
90 | //! 0 - OK; |
91 | //! 1 - null curve or surface or 2d curve; |
92 | //! 2 - invalid parametric range; |
93 | //! 3 - error in calculations. |
94 | Standard_Integer ErrorStatus() const |
95 | { |
96 | return myErrorStatus; |
97 | } |
98 | |
99 | //! Returns max distance |
100 | Standard_Real MaxDistance() const |
101 | { |
102 | return myMaxDistance; |
103 | } |
104 | |
105 | //! Returns parameter in which the distance is maximal |
106 | Standard_Real MaxParameter() const |
107 | { |
108 | return myMaxParameter; |
109 | } |
110 | |
111 | private: |
112 | |
113 | Handle(Geom_Curve) myCurve; |
114 | Handle(Geom_Surface) mySurface; |
115 | Standard_Real myFirst; |
116 | Standard_Real myLast; |
117 | Standard_Integer myErrorStatus; |
118 | Standard_Real myMaxDistance; |
119 | Standard_Real myMaxParameter; |
6ca1c746 |
120 | Standard_Real myTolRange; |
5adae760 |
121 | }; |
122 | |
123 | #endif // _BRepLib_CheckCurveOnSurface_HeaderFile |