0027035: General fuse algorithm loses face
[occt.git] / src / GeomLib / GeomLib_CheckCurveOnSurface.hxx
CommitLineData
5adae760 1// Created by: Nikolai BUKHALOV
2// Copyright (c) 2015 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 _GeomLib_CheckCurveOnSurface_HeaderFile
16#define _GeomLib_CheckCurveOnSurface_HeaderFile
17
18#include <Geom_Curve.hxx>
19#include <Standard.hxx>
20
21class Geom_Surface;
22class Geom2d_Curve;
23
24//! Computes the max distance between 3D-curve and 2D-curve
25//! in some surface.
26class GeomLib_CheckCurveOnSurface
27{
28public:
29
30 DEFINE_STANDARD_ALLOC
31
32 //! Default contructor
33 Standard_EXPORT GeomLib_CheckCurveOnSurface(void);
34
35 //! Contructor
36 Standard_EXPORT GeomLib_CheckCurveOnSurface(const Handle(Geom_Curve)& theCurve,
37 const Handle(Geom_Surface)& theSurface,
38 const Standard_Real theFirst,
39 const Standard_Real theLast);
40
41 //! Sets the data for the algorithm
42 Standard_EXPORT void Init (const Handle(Geom_Curve)& theCurve,
43 const Handle(Geom_Surface)& theSurface,
44 const Standard_Real theFirst,
45 const Standard_Real theLast);
46
47 //! Initializes all members by dafault values
48 Standard_EXPORT void Init();
49
50 //! Computes the max distance for the 3d curve <myCurve>
51 //! and 2d curve <thePCurve>
52 //! If isTheMultyTheadDisabled == TRUE then computation will be made
53 //! without any parallelization.
54 Standard_EXPORT void Perform(const Handle(Geom2d_Curve)& thePCurve,
55 const Standard_Boolean isTheMultyTheradDisabled = Standard_False);
56
57 //! Returns my3DCurve
58 const Handle(Geom_Curve)& Curve() const
59 {
60 return myCurve;
61 }
62
63 //! Returns mySurface
64 const Handle(Geom_Surface)& Surface() const
65 {
66 return mySurface;
67 }
68
69 //! Returns first and last parameter of the curves
70 //! (2D- and 3D-curves are considered to have same range)
71 void Range (Standard_Real& theFirst, Standard_Real& theLast)
72 {
73 theFirst = myFirst;
74 theLast = myLast;
75 }
76
77 //! Returns true if the max distance has been found
78 Standard_Boolean IsDone() const
79 {
80 return (myErrorStatus == 0);
81 }
82
83 //! Returns error status
84 //! The possible values are:
85 //! 0 - OK;
86 //! 1 - null curve or surface or 2d curve;
87 //! 2 - invalid parametric range;
88 //! 3 - error in calculations.
89 Standard_Integer ErrorStatus() const
90 {
91 return myErrorStatus;
92 }
93
94 //! Returns max distance
95 Standard_Real MaxDistance() const
96 {
97 return myMaxDistance;
98 }
99
100 //! Returns parameter in which the distance is maximal
101 Standard_Real MaxParameter() const
102 {
103 return myMaxParameter;
104 }
105
106private:
107
108 Handle(Geom_Curve) myCurve;
109 Handle(Geom_Surface) mySurface;
110 Standard_Real myFirst;
111 Standard_Real myLast;
112 Standard_Integer myErrorStatus;
113 Standard_Real myMaxDistance;
114 Standard_Real myMaxParameter;
115};
116
117#endif // _BRepLib_CheckCurveOnSurface_HeaderFile