0030480: Visualization - Clear of Select3D_SensitiveGroup does not update internal...
[occt.git] / src / IntTools / IntTools_ShrunkRange.hxx
CommitLineData
42cf5bc1 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>
27class IntTools_Context;
28class TopoDS_Edge;
29class TopoDS_Vertex;
30class 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.
37class IntTools_ShrunkRange
38{
39public:
40
41 DEFINE_STANDARD_ALLOC
42
43
44 Standard_EXPORT IntTools_ShrunkRange();
45Standard_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
01b5b3df 63 //! Returns TRUE in case the shrunk range is computed
64 Standard_Boolean IsDone() const
65 {
66 return myIsDone;
67 }
68
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
73 {
74 return myIsSplittable;
75 }
42cf5bc1 76
d3578357 77 //! Returns the length of the edge if computed.
78 Standard_Real Length() const { return myLength; }
79
42cf5bc1 80protected:
81
42cf5bc1 82 TopoDS_Edge myEdge;
83 TopoDS_Vertex myV1;
84 TopoDS_Vertex myV2;
85 Standard_Real myT1;
86 Standard_Real myT2;
87 Standard_Real myTS1;
88 Standard_Real myTS2;
89 Bnd_Box myBndBox;
90 Handle(IntTools_Context) myCtx;
01b5b3df 91 Standard_Boolean myIsDone;
92 Standard_Boolean myIsSplittable;
d3578357 93 Standard_Real myLength;
42cf5bc1 94
95private:
96
42cf5bc1 97};
98
42cf5bc1 99#endif // _IntTools_ShrunkRange_HeaderFile