0026506: Change class BRepLib_CheckCurveOnSurface
[occt.git] / src / BRepLib / BRepLib_CheckCurveOnSurface.hxx
CommitLineData
42cf5bc1 1// Created by: Eugeny MALTCHIKOV
2// Copyright (c) 2014 OPEN CASCADE SAS
3//
4// This file is part of Open CASCADE Technology software library.
5//
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.
11//
12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
14
15#ifndef _BRepLib_CheckCurveOnSurface_HeaderFile
16#define _BRepLib_CheckCurveOnSurface_HeaderFile
17
5adae760 18#include <GeomLib_CheckCurveOnSurface.hxx>
42cf5bc1 19
20//! Computes the max distance between edge and its
21//! 2d representation on the face.
5adae760 22
42cf5bc1 23class BRepLib_CheckCurveOnSurface
24{
25public:
26
27 DEFINE_STANDARD_ALLOC
28
5adae760 29 //! Default contructor
30 BRepLib_CheckCurveOnSurface() {}
42cf5bc1 31
42cf5bc1 32 //! Contructor
5adae760 33 Standard_EXPORT BRepLib_CheckCurveOnSurface(const TopoDS_Edge& theEdge,
34 const TopoDS_Face& theFace);
42cf5bc1 35
42cf5bc1 36 //! Sets the data for the algorithm
37 Standard_EXPORT void Init (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace);
42cf5bc1 38
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);
43
5adae760 44 //! Returns source 3D-Curve
45 const Handle(Geom_Curve)& Curve() const
46 {
47 return myCOnSurfGeom.Curve();
48 }
49
50 //! Returns mine 2D-Curve
51 const Handle(Geom2d_Curve)& PCurve() const
52 {
53 return myPCurve;
54 }
55
56 //! Returns 2nd 2D-Curve (if it exists, e.g. for seam-edge)
57 const Handle(Geom2d_Curve)& PCurve2() const
58 {
59 return myPCurve2;
60 }
61
62 //! Returns source surface
63 const Handle(Geom_Surface)& Surface() const
64 {
65 return myCOnSurfGeom.Surface();
66 }
67
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)
71 {
72 myCOnSurfGeom.Range(theFirst, theLast);
73 }
74
42cf5bc1 75 //! Returns true if the max distance has been found
5adae760 76 Standard_Boolean IsDone() const
77 {
78 return myCOnSurfGeom.ErrorStatus() == 0;
79 }
42cf5bc1 80
42cf5bc1 81 //! Returns error status
82 //! The possible values are:
83 //! 0 - OK;
84 //! 1 - null curve or surface or 2d curve;
85 //! 2 - invalid parametric range;
86 //! 3 - error in calculations.
5adae760 87 Standard_Integer ErrorStatus() const
88 {
89 return myCOnSurfGeom.ErrorStatus();
90 }
42cf5bc1 91
42cf5bc1 92 //! Returns max distance
5adae760 93 Standard_Real MaxDistance() const
94 {
95 return myCOnSurfGeom.MaxDistance();
96 }
42cf5bc1 97
42cf5bc1 98 //! Returns parameter in which the distance is maximal
5adae760 99 Standard_Real MaxParameter() const
100 {
101 return myCOnSurfGeom.MaxParameter();
102 }
42cf5bc1 103
104protected:
105
5adae760 106 //! Computes the max distance for the 3d curve of <myCOnSurfGeom>
42cf5bc1 107 //! and 2d curve <thePCurve>
108 //! If isTheMultyTheadDisabled == TRUE then computation will be made
109 //! without any parallelization.
5adae760 110 Standard_EXPORT void Compute (const Handle(Geom2d_Curve)& thePCurve,
111 const Standard_Boolean isTheMultyTheradDisabled);
42cf5bc1 112
113private:
114
5adae760 115 GeomLib_CheckCurveOnSurface myCOnSurfGeom;
42cf5bc1 116 Handle(Geom2d_Curve) myPCurve;
117 Handle(Geom2d_Curve) myPCurve2;
42cf5bc1 118};
119
42cf5bc1 120#endif // _BRepLib_CheckCurveOnSurface_HeaderFile