0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / IntTools / IntTools_ShrunkRange.hxx
1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-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 _IntTools_ShrunkRange_HeaderFile
16 #define _IntTools_ShrunkRange_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
21
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;
28 class TopoDS_Edge;
29 class TopoDS_Vertex;
30 class Bnd_Box;
31
32
33
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 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   Standard_EXPORT IntTools_ShrunkRange();
45 Standard_EXPORT virtual ~IntTools_ShrunkRange();
46   
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);
48   
49   Standard_EXPORT void SetContext (const Handle(IntTools_Context)& aCtx);
50   
51   Standard_EXPORT const Handle(IntTools_Context)& Context() const;
52   
53   Standard_EXPORT void SetShrunkRange (const Standard_Real aT1, const Standard_Real aT2);
54   
55   Standard_EXPORT void ShrunkRange (Standard_Real& aT1, Standard_Real& aT2) const;
56   
57   Standard_EXPORT const Bnd_Box& BndBox() const;
58   
59   Standard_EXPORT const TopoDS_Edge& Edge() const;
60   
61   Standard_EXPORT void Perform();
62   
63
64   //! Returns code of computing shrunk range
65   //! completion
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
70   //! last boundary
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;
76
77
78
79
80 protected:
81
82
83
84   TopoDS_Edge myEdge;
85   TopoDS_Vertex myV1;
86   TopoDS_Vertex myV2;
87   Standard_Real myT1;
88   Standard_Real myT2;
89   Standard_Real myTS1;
90   Standard_Real myTS2;
91   Bnd_Box myBndBox;
92   Handle(IntTools_Context) myCtx;
93   Standard_Integer myErrorStatus;
94
95
96 private:
97
98
99
100
101
102 };
103
104
105
106
107
108
109
110 #endif // _IntTools_ShrunkRange_HeaderFile