CLAM-Development  1.4.0
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 
19  {
20  while (!mLinks.empty())
21  mLinks.front()->RemoveLink(*this);
22  if (mProcessing)
24  }
26  {
27  return out.IsConnectedTo(*this);
28  }
29 
31  {
32  return mBounded;
33  }
35  {
36  return mUpperBound;
37  }
39  {
40  return mLowerBound;
41  }
42  void InControlBase::SetBounds( float lower, float upper )
43  {
44  mLowerBound = lower;
45  mUpperBound = upper;
46  mBounded = true;
47  }
49  {
50  mDefaultValue = val;
51  mHasDefaultValue = true;
52  }
54  {
55  if (mHasDefaultValue) return mDefaultValue;
56  return (mUpperBound+mLowerBound)/2.f;
57  }
58 }