1 // Created by: Nikolai BUKHALOV
2 // Copyright (c) 2015 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 #ifndef _GeomLib_CheckCurveOnSurface_HeaderFile
16 #define _GeomLib_CheckCurveOnSurface_HeaderFile
18 #include <Geom_Curve.hxx>
19 #include <Precision.hxx>
20 #include <Standard.hxx>
25 //! Computes the max distance between 3D-curve and 2D-curve
27 class GeomLib_CheckCurveOnSurface
33 //! Default contructor
34 Standard_EXPORT GeomLib_CheckCurveOnSurface(void);
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());
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,
49 const Standard_Real theLast,
50 const Standard_Real theTolRange = Precision::PConfusion());
52 //! Initializes all members by dafault values
53 Standard_EXPORT void Init();
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);
63 const Handle(Geom_Curve)& Curve() const
69 const Handle(Geom_Surface)& Surface() const
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)
82 //! Returns true if the max distance has been found
83 Standard_Boolean IsDone() const
85 return (myErrorStatus == 0);
88 //! Returns error status
89 //! The possible values are:
91 //! 1 - null curve or surface or 2d curve;
92 //! 2 - invalid parametric range;
93 //! 3 - error in calculations.
94 Standard_Integer ErrorStatus() const
99 //! Returns max distance
100 Standard_Real MaxDistance() const
102 return myMaxDistance;
105 //! Returns parameter in which the distance is maximal
106 Standard_Real MaxParameter() const
108 return myMaxParameter;
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;
120 Standard_Real myTolRange;
123 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile