1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-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 _IntTools_ShrunkRange_HeaderFile
16 #define _IntTools_ShrunkRange_HeaderFile
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
22 #include <TopoDS_Edge.hxx>
23 #include <TopoDS_Vertex.hxx>
24 #include <Standard_Real.hxx>
25 #include <Bnd_Box.hxx>
26 #include <Standard_Integer.hxx>
27 class IntTools_Context;
34 //! The class provides the computation of
35 //! a working (shrunk) range [t1, t2] for
36 //! the 3D-curve of the edge.
37 class IntTools_ShrunkRange
44 Standard_EXPORT IntTools_ShrunkRange();
45 Standard_EXPORT virtual ~IntTools_ShrunkRange();
47 Standard_EXPORT void SetData (const TopoDS_Edge& aE, const Standard_Real aT1, const Standard_Real aT2, const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2);
49 Standard_EXPORT void SetContext (const Handle(IntTools_Context)& aCtx);
51 Standard_EXPORT const Handle(IntTools_Context)& Context() const;
53 Standard_EXPORT void SetShrunkRange (const Standard_Real aT1, const Standard_Real aT2);
55 Standard_EXPORT void ShrunkRange (Standard_Real& aT1, Standard_Real& aT2) const;
57 Standard_EXPORT const Bnd_Box& BndBox() const;
59 Standard_EXPORT const TopoDS_Edge& Edge() const;
61 Standard_EXPORT void Perform();
64 //! Returns code of computing shrunk range
66 //! 0 - means successful completion
67 //! 1 - nothing has been done
68 //! 2 - initial range is out of edge's range
69 //! 3 - first boundary of initial range is more than
71 //! 4 - projection of first vertex failed
72 //! 5 - projection of second vertex failed
73 //! 6 - shrunk range can not be computed
74 //! shrunk range is setted to initial range
75 Standard_EXPORT Standard_Integer ErrorStatus() const;
92 Handle(IntTools_Context) myCtx;
93 Standard_Integer myErrorStatus;
110 #endif // _IntTools_ShrunkRange_HeaderFile