Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0027   DEFINE_STANDARD_ALLOC
0028 
0029   //! Default constructor
0030   BRepLib_CheckCurveOnSurface() 
0031     : myIsParallel(Standard_False)
0032   {
0033   }
0034   
0035   //! Constructor
0036   Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge,
0037                                               const TopoDS_Face& theFace);
0038   
0039   //! Sets the data for the algorithm
0040   Standard_EXPORT void Init (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
0041 
0042   //! Performs the calculation
0043   //! If myIsParallel == Standard_True then computation will be performed in parallel.
0044   Standard_EXPORT void Perform();
0045   
0046   //! Returns true if the max distance has been found
0047   Standard_Boolean IsDone() const
0048   {
0049     return myCOnSurfGeom.ErrorStatus() == 0;
0050   }
0051   
0052   //! Sets parallel flag
0053   void SetParallel(const Standard_Boolean theIsParallel)
0054   {
0055     myIsParallel = theIsParallel;
0056   }
0057 
0058   //! Returns true if parallel flag is set
0059   Standard_Boolean IsParallel()
0060   {
0061     return myIsParallel;
0062   }
0063 
0064   //! Returns error status
0065   //! The possible values are:
0066   //! 0 - OK;
0067   //! 1 - null curve or surface or 2d curve;
0068   //! 2 - invalid parametric range;
0069   //! 3 - error in calculations.
0070   Standard_Integer ErrorStatus() const
0071   {
0072     return myCOnSurfGeom.ErrorStatus();
0073   }
0074   
0075   //! Returns max distance
0076   Standard_Real MaxDistance() const
0077   {
0078     return myCOnSurfGeom.MaxDistance();
0079   }
0080   
0081   //! Returns parameter in which the distance is maximal
0082   Standard_Real MaxParameter() const
0083   {
0084     return myCOnSurfGeom.MaxParameter();
0085   }
0086 
0087 protected:
0088 
0089   //! Computes the max distance for the 3d curve of <myCOnSurfGeom>
0090   //! and 2d curve <theCurveOnSurface>
0091   //! If isMultiThread == Standard_True then computation will be performed in parallel.
0092   Standard_EXPORT void Compute (const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface);
0093 
0094 private:
0095 
0096   GeomLib_CheckCurveOnSurface myCOnSurfGeom;
0097   Handle(Adaptor3d_CurveOnSurface) myAdaptorCurveOnSurface;
0098   Handle(Adaptor3d_CurveOnSurface) myAdaptorCurveOnSurface2;
0099   Standard_Boolean myIsParallel;
0100 };
0101 
0102 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile