0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / IntTools / IntTools_Root.hxx
CommitLineData
42cf5bc1 1// Created on: 2000-05-22
2// Created by: Peter KURNEV
3// Copyright (c) 2000-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _IntTools_Root_HeaderFile
17#define _IntTools_Root_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_DefineAlloc.hxx>
21#include <Standard_Handle.hxx>
22
23#include <Standard_Real.hxx>
24#include <Standard_Integer.hxx>
25#include <TopAbs_State.hxx>
26#include <Standard_Boolean.hxx>
27
28
29//! The class is to describe the root of
30//! function of one variable for Edge/Edge
31//! and Edge/Surface algorithms.
32class IntTools_Root
33{
34public:
35
36 DEFINE_STANDARD_ALLOC
37
38
39
40 //! Empty constructor
41 Standard_EXPORT IntTools_Root();
42
43
44 //! Initializes my by range of parameters
45 //! and type of root
46 Standard_EXPORT IntTools_Root(const Standard_Real aRoot, const Standard_Integer aType);
47
48
49 //! Sets the Root's value
50 Standard_EXPORT void SetRoot (const Standard_Real aRoot);
51
52
53 //! Sets the Root's Type
54 Standard_EXPORT void SetType (const Standard_Integer aType);
55
56
57 //! Set the value of the state before the root
58 //! (at t=Root-dt)
59 Standard_EXPORT void SetStateBefore (const TopAbs_State aState);
60
61
62 //! Set the value of the state after the root
63 //! (at t=Root-dt)
64 Standard_EXPORT void SetStateAfter (const TopAbs_State aState);
65
66
67 //! Not used in Edge/Edge algorithm
68 Standard_EXPORT void SetLayerHeight (const Standard_Real aHeight);
69
70
71 //! Sets the interval from which the Root was
72 //! found [t1,t2] and the corresponding values
73 //! of the function on the bounds f(t1), f(t2).
74 Standard_EXPORT void SetInterval (const Standard_Real t1, const Standard_Real t2, const Standard_Real f1, const Standard_Real f2);
75
76
77 //! Returns the Root value
78 Standard_EXPORT Standard_Real Root() const;
79
80
81 //! Returns the type of the root
82 //! =0 - Simple (was found by bisection method);
83 //! =2 - Smart when f1=0, f2!=0 or vice versa
84 //! (was found by Fibbonacci method);
85 //! =1 - Pure (pure zero for all t [t1,t2] );
86 Standard_EXPORT Standard_Integer Type() const;
87
88
89 //! Returns the state before the root
90 Standard_EXPORT TopAbs_State StateBefore() const;
91
92
93 //! Returns the state after the root
94 Standard_EXPORT TopAbs_State StateAfter() const;
95
96
97 //! Not used in Edge/Edge algorithm
98 Standard_EXPORT Standard_Real LayerHeight() const;
99
100
101 //! Returns the validity flag for the root,
102 //! True if
103 //! myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_IN or
104 //! myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_ON or
105 //! myStateBefore==TopAbs_ON && myStateAfter==TopAbs_OUT or
106 //! myStateBefore==TopAbs_IN && myStateAfter==TopAbs_OUT .
107 //! For other cases it returns False.
108 Standard_EXPORT Standard_Boolean IsValid() const;
109
110
111 //! Returns the values of interval from which the Root was
112 //! found [t1,t2] and the corresponding values
113 //! of the function on the bounds f(t1), f(t2).
114 Standard_EXPORT void Interval (Standard_Real& t1, Standard_Real& t2, Standard_Real& f1, Standard_Real& f2) const;
115
116
117
118
119protected:
120
121
122
123
124
125private:
126
127
128
129 Standard_Real myRoot;
130 Standard_Integer myType;
131 Standard_Real myLayerHeight;
132 TopAbs_State myStateBefore;
133 TopAbs_State myStateAfter;
134 Standard_Real myt1;
135 Standard_Real myt2;
136 Standard_Real myf1;
137 Standard_Real myf2;
138
139
140};
141
142
143
144
145
146
147
148#endif // _IntTools_Root_HeaderFile