1 // Created by: Eugeny MALTCHIKOV
2 // Copyright (c) 2014 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 _BRepLib_CheckCurveOnSurface_HeaderFile
16 #define _BRepLib_CheckCurveOnSurface_HeaderFile
18 #include <GeomLib_CheckCurveOnSurface.hxx>
20 //! Computes the max distance between edge and its
21 //! 2d representation on the face.
23 class BRepLib_CheckCurveOnSurface
29 //! Default contructor
30 BRepLib_CheckCurveOnSurface() {}
33 Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge,
34 const TopoDS_Face& theFace);
36 //! Sets the data for the algorithm
37 Standard_EXPORT void Init (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
39 //! Performs the calculation
40 //! If isTheMultyTheadDisabled == TRUE then computation will be made
41 //! without any parallelization.
42 Standard_EXPORT void Perform (const Standard_Boolean isTheMultyTheradDisabled = Standard_False);
44 //! Returns source 3D-Curve
45 const Handle(Geom_Curve)& Curve() const
47 return myCOnSurfGeom.Curve();
50 //! Returns mine 2D-Curve
51 const Handle(Geom2d_Curve)& PCurve() const
56 //! Returns 2nd 2D-Curve (if it exists, e.g. for seam-edge)
57 const Handle(Geom2d_Curve)& PCurve2() const
62 //! Returns source surface
63 const Handle(Geom_Surface)& Surface() const
65 return myCOnSurfGeom.Surface();
68 //! Returns first and last parameter of the curves
69 //! (2D- and 3D-curves are considered to have same range)
70 void Range (Standard_Real& theFirst, Standard_Real& theLast)
72 myCOnSurfGeom.Range(theFirst, theLast);
75 //! Returns true if the max distance has been found
76 Standard_Boolean IsDone() const
78 return myCOnSurfGeom.ErrorStatus() == 0;
81 //! Returns error status
82 //! The possible values are:
84 //! 1 - null curve or surface or 2d curve;
85 //! 2 - invalid parametric range;
86 //! 3 - error in calculations.
87 Standard_Integer ErrorStatus() const
89 return myCOnSurfGeom.ErrorStatus();
92 //! Returns max distance
93 Standard_Real MaxDistance() const
95 return myCOnSurfGeom.MaxDistance();
98 //! Returns parameter in which the distance is maximal
99 Standard_Real MaxParameter() const
101 return myCOnSurfGeom.MaxParameter();
106 //! Computes the max distance for the 3d curve of <myCOnSurfGeom>
107 //! and 2d curve <thePCurve>
108 //! If isTheMultyTheadDisabled == TRUE then computation will be made
109 //! without any parallelization.
110 Standard_EXPORT void Compute (const Handle(Geom2d_Curve)& thePCurve,
111 const Standard_Boolean isTheMultyTheradDisabled);
115 GeomLib_CheckCurveOnSurface myCOnSurfGeom;
116 Handle(Geom2d_Curve) myPCurve;
117 Handle(Geom2d_Curve) myPCurve2;
120 #endif // _BRepLib_CheckCurveOnSurface_HeaderFile