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();
63 //! Returns TRUE in case the shrunk range is computed
64 Standard_Boolean IsDone() const
69 //! Returns FALSE in case the shrunk range is
70 //! too short and the edge cannot be split,
71 //! otherwise returns TRUE
72 Standard_Boolean IsSplittable() const
74 return myIsSplittable;
77 //! Returns the length of the edge if computed.
78 Standard_Real Length() const { return myLength; }
90 Handle(IntTools_Context) myCtx;
91 Standard_Boolean myIsDone;
92 Standard_Boolean myIsSplittable;
93 Standard_Real myLength;
99 #endif // _IntTools_ShrunkRange_HeaderFile