Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:20

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   DEFINE_STANDARD_ALLOC
0030 
0031   //! Default constructor
0032   Standard_EXPORT GeomLib_CheckCurveOnSurface();
0033 
0034   //! Constructor
0035   Standard_EXPORT GeomLib_CheckCurveOnSurface(const occ::handle<Adaptor3d_Curve>& theCurve,
0036                                               const double theTolRange = Precision::PConfusion());
0037 
0038   //! Sets the data for the algorithm
0039   Standard_EXPORT void Init(const occ::handle<Adaptor3d_Curve>& theCurve,
0040                             const double theTolRange = Precision::PConfusion());
0041 
0042   //! Initializes all members by default values
0043   Standard_EXPORT void Init();
0044 
0045   //! Computes the max distance for the 3d curve <myCurve>
0046   //! and 2d curve <theCurveOnSurface>
0047   //! If isMultiThread == true then computation will be performed in parallel.
0048   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_CurveOnSurface>& theCurveOnSurface);
0049 
0050   //! Sets parallel flag
0051   void SetParallel(const bool theIsParallel) { myIsParallel = theIsParallel; }
0052 
0053   //! Returns true if parallel flag is set
0054   bool IsParallel() { return myIsParallel; }
0055 
0056   //! Returns true if the max distance has been found
0057   bool IsDone() const { return (myErrorStatus == 0); }
0058 
0059   //! Returns error status
0060   //! The possible values are:
0061   //! 0 - OK;
0062   //! 1 - null curve or surface or 2d curve;
0063   //! 2 - invalid parametric range;
0064   //! 3 - error in calculations.
0065   int ErrorStatus() const { return myErrorStatus; }
0066 
0067   //! Returns max distance
0068   double MaxDistance() const { return myMaxDistance; }
0069 
0070   //! Returns parameter in which the distance is maximal
0071   double MaxParameter() const { return myMaxParameter; }
0072 
0073 private:
0074   occ::handle<Adaptor3d_Curve> myCurve;
0075   int                          myErrorStatus;
0076   double                       myMaxDistance;
0077   double                       myMaxParameter;
0078   double                       myTolRange;
0079   bool                         myIsParallel;
0080 };
0081 
0082 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile