Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:17:01

0001 // Created by: Eugeny MALTCHIKOV
0002 // Copyright (c) 2014 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 _BRepLib_CheckCurveOnSurface_HeaderFile
0016 #define _BRepLib_CheckCurveOnSurface_HeaderFile
0017 
0018 #include <GeomLib_CheckCurveOnSurface.hxx>
0019 
0020 //! Computes the max distance between edge and its 2d representation on the face.
0021 //! This class is not intended to process non-sameparameter edges.
0022 
0023 class BRepLib_CheckCurveOnSurface
0024 {
0025 public:
0026   DEFINE_STANDARD_ALLOC
0027 
0028   //! Default constructor
0029   BRepLib_CheckCurveOnSurface()
0030       : myIsParallel(false)
0031   {
0032   }
0033 
0034   //! Constructor
0035   Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge,
0036                                               const TopoDS_Face& theFace);
0037 
0038   //! Sets the data for the algorithm
0039   Standard_EXPORT void Init(const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
0040 
0041   //! Performs the calculation
0042   //! If myIsParallel == true then computation will be performed in parallel.
0043   Standard_EXPORT void Perform();
0044 
0045   //! Returns true if the max distance has been found
0046   bool IsDone() const { return myCOnSurfGeom.ErrorStatus() == 0; }
0047 
0048   //! Sets parallel flag
0049   void SetParallel(const bool theIsParallel) { myIsParallel = theIsParallel; }
0050 
0051   //! Returns true if parallel flag is set
0052   bool IsParallel() { return myIsParallel; }
0053 
0054   //! Returns error status
0055   //! The possible values are:
0056   //! 0 - OK;
0057   //! 1 - null curve or surface or 2d curve;
0058   //! 2 - invalid parametric range;
0059   //! 3 - error in calculations.
0060   int ErrorStatus() const { return myCOnSurfGeom.ErrorStatus(); }
0061 
0062   //! Returns max distance
0063   double MaxDistance() const { return myCOnSurfGeom.MaxDistance(); }
0064 
0065   //! Returns parameter in which the distance is maximal
0066   double MaxParameter() const { return myCOnSurfGeom.MaxParameter(); }
0067 
0068 protected:
0069   //! Computes the max distance for the 3d curve of <myCOnSurfGeom>
0070   //! and 2d curve <theCurveOnSurface>
0071   //! If isMultiThread == true then computation will be performed in parallel.
0072   Standard_EXPORT void Compute(const occ::handle<Adaptor3d_CurveOnSurface>& theCurveOnSurface);
0073 
0074 private:
0075   GeomLib_CheckCurveOnSurface           myCOnSurfGeom;
0076   occ::handle<Adaptor3d_CurveOnSurface> myAdaptorCurveOnSurface;
0077   occ::handle<Adaptor3d_CurveOnSurface> myAdaptorCurveOnSurface2;
0078   bool                                  myIsParallel;
0079 };
0080 
0081 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile