Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:41

0001 // Created by: Nikolai BUKHALOV
0002 // Copyright (c) 2015 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _GeomLib_CheckCurveOnSurface_HeaderFile
0016 #define _GeomLib_CheckCurveOnSurface_HeaderFile
0017 
0018 #include <Adaptor3d_Curve.hxx>
0019 #include <Precision.hxx>
0020 #include <Standard.hxx>
0021 
0022 class Adaptor3d_CurveOnSurface;
0023 
0024 //! Computes the max distance between 3D-curve and 2D-curve
0025 //! in some surface.
0026 class GeomLib_CheckCurveOnSurface 
0027 {
0028 public:
0029 
0030   DEFINE_STANDARD_ALLOC
0031 
0032   //! Default constructor
0033   Standard_EXPORT GeomLib_CheckCurveOnSurface(void);
0034   
0035   //! Constructor
0036   Standard_EXPORT
0037     GeomLib_CheckCurveOnSurface(const Handle(Adaptor3d_Curve)& theCurve,
0038                                 const Standard_Real theTolRange = 
0039                                                       Precision::PConfusion());
0040   
0041   //! Sets the data for the algorithm
0042   Standard_EXPORT void Init (const Handle(Adaptor3d_Curve)& theCurve,
0043                              const Standard_Real theTolRange = Precision::PConfusion());
0044 
0045   //! Initializes all members by default values
0046   Standard_EXPORT void Init();
0047 
0048   //! Computes the max distance for the 3d curve <myCurve>
0049   //! and 2d curve <theCurveOnSurface>
0050   //! If isMultiThread == Standard_True then computation will be performed in parallel.
0051   Standard_EXPORT void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface);
0052 
0053   //! Sets parallel flag
0054   void SetParallel(const Standard_Boolean theIsParallel)
0055   {
0056     myIsParallel = theIsParallel;
0057   }
0058 
0059   //! Returns true if parallel flag is set
0060   Standard_Boolean IsParallel()
0061   {
0062     return myIsParallel;
0063   }
0064 
0065   //! Returns true if the max distance has been found
0066   Standard_Boolean IsDone() const
0067   {
0068     return (myErrorStatus == 0);
0069   }
0070   
0071   //! Returns error status
0072   //! The possible values are:
0073   //! 0 - OK;
0074   //! 1 - null curve or surface or 2d curve;
0075   //! 2 - invalid parametric range;
0076   //! 3 - error in calculations.
0077   Standard_Integer ErrorStatus() const
0078   {
0079     return myErrorStatus;
0080   }
0081   
0082   //! Returns max distance
0083   Standard_Real MaxDistance() const
0084   {
0085     return myMaxDistance;
0086   }
0087   
0088   //! Returns parameter in which the distance is maximal
0089   Standard_Real MaxParameter() const
0090   {
0091     return myMaxParameter;
0092   }
0093 
0094 private:
0095 
0096   Handle(Adaptor3d_Curve) myCurve;
0097   Standard_Integer myErrorStatus;
0098   Standard_Real myMaxDistance;
0099   Standard_Real myMaxParameter;
0100   Standard_Real myTolRange;
0101   Standard_Boolean myIsParallel;
0102 };
0103 
0104 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile