0026249: Visualization, TKV3d - fix possible division by zero in SelectMgr_Rectangula...
[occt.git] / src / BRepLib / BRepLib_CheckCurveOnSurface.lxx
CommitLineData
1b7ae951 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
e8862cf4 15#include <Geom_Curve.hxx>
16#include <Geom2d_Curve.hxx>
17
1b7ae951 18//=======================================================================
19//function : Curve
20//purpose :
21//=======================================================================
22inline const Handle(Geom_Curve)& BRepLib_CheckCurveOnSurface::Curve() const
23{
24 return myCurve;
25}
26
27//=======================================================================
28//function : PCurve
29//purpose :
30//=======================================================================
31inline const Handle(Geom2d_Curve)& BRepLib_CheckCurveOnSurface::PCurve() const
32{
33 return myPCurve;
34}
35
36//=======================================================================
37//function : PCurve2
38//purpose :
39//=======================================================================
40inline const Handle(Geom2d_Curve)& BRepLib_CheckCurveOnSurface::PCurve2() const
41{
42 return myPCurve2;
43}
44
45//=======================================================================
46//function : Surface
47//purpose :
48//=======================================================================
49inline const Handle(Geom_Surface)& BRepLib_CheckCurveOnSurface::Surface() const
50{
51 return mySurface;
52}
53
54//=======================================================================
55//function : Range
56//purpose :
57//=======================================================================
58inline void BRepLib_CheckCurveOnSurface::Range
59 (Standard_Real& theFirst,
60 Standard_Real& theLast)
61{
62 theFirst = myFirst;
63 theLast = myLast;
64}
65
66//=======================================================================
67//function : CheckData
68//purpose :
69//=======================================================================
70inline void BRepLib_CheckCurveOnSurface::CheckData()
71{
72 if (myCurve.IsNull() ||
73 myPCurve.IsNull() ||
74 mySurface.IsNull()) {
75 myErrorStatus = 1;
76 return;
77 }
78 //
79 if ((myCurve->FirstParameter() > myFirst) ||
80 (myCurve->LastParameter() < myLast) ||
81 (myPCurve->FirstParameter() > myFirst) ||
82 (myPCurve->LastParameter() < myLast)) {
83 myErrorStatus = 2;
84 }
85}
86
87//=======================================================================
88//function : IsDone
89//purpose :
90//=======================================================================
91inline Standard_Boolean BRepLib_CheckCurveOnSurface::IsDone() const
92{
93 return (myErrorStatus == 0);
94}
95
96//=======================================================================
97//function : MaxDistance
98//purpose :
99//=======================================================================
100inline Standard_Real BRepLib_CheckCurveOnSurface::MaxDistance() const
101{
102 return myMaxDistance;
103}
104
105//=======================================================================
106//function : MaxParameter
107//purpose :
108//=======================================================================
109inline Standard_Real BRepLib_CheckCurveOnSurface::MaxParameter() const
110{
111 return myMaxParameter;
112}