CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Flow
Controls
InControlBase.cxx
Go to the documentation of this file.
1
#include <CLAM/InControlBase.hxx>
2
#include <CLAM/Processing.hxx>
3
4
namespace
CLAM
5
{
6
InControlBase::InControlBase(
const
std::string &name,
Processing
* proc)
7
: mName(name)
8
, mProcessing(proc)
9
, mUpperBound(1)
10
, mLowerBound(0)
11
, mBounded(false)
12
, mHasDefaultValue(false)
13
, _hasBeenRead(true)
14
{
15
if
(proc) proc->
RegisterInControl
(
this
);
16
}
17
18
InControlBase::~InControlBase
()
19
{
20
while
(!
mLinks
.empty())
21
mLinks
.front()->RemoveLink(*
this
);
22
if
(
mProcessing
)
23
mProcessing
->
GetInControls
().
ProcessingInterface_Unregister
(
this
);
24
}
25
bool
InControlBase::IsConnectedTo
(
OutControlBase
& out)
26
{
27
return
out.
IsConnectedTo
(*
this
);
28
}
29
30
bool
InControlBase::IsBounded
()
const
31
{
32
return
mBounded
;
33
}
34
float
InControlBase::UpperBound
()
const
35
{
36
return
mUpperBound
;
37
}
38
float
InControlBase::LowerBound
()
const
39
{
40
return
mLowerBound
;
41
}
42
void
InControlBase::SetBounds
(
float
lower,
float
upper )
43
{
44
mLowerBound
= lower;
45
mUpperBound
= upper;
46
mBounded
=
true
;
47
}
48
void
InControlBase::SetDefaultValue
(
float
val )
49
{
50
mDefaultValue
= val;
51
mHasDefaultValue
=
true
;
52
}
53
float
InControlBase::DefaultValue
()
const
54
{
55
if
(
mHasDefaultValue
)
return
mDefaultValue
;
56
return
(
mUpperBound
+
mLowerBound
)/2.f;
57
}
58
}
Generated by
1.8.1