Developer Documentation
ScriptSettingsDouble.cc
1 #include "ScriptSettingsDouble.hh"
2 #include "ACG/Utils/ColorConversion.hh"
3 
4 ScriptSettingsDouble::ScriptSettingsDouble()
5  : ScriptSettings(nullptr),
6  widget_(nullptr)
7 {
8  assert(false);
9 }
10 
11 ScriptSettingsDouble::ScriptSettingsDouble(
12  DoubleWidget *widget)
13  : ScriptSettings(widget),
14  widget_(widget)
15 {}
16 
17 ScriptSettingsDouble::ScriptSettingsDouble(
18  const ScriptSettingsDouble &other)
19  : ScriptSettings(other.widget_),
20  widget_(other.widget_)
21 {}
22 
23 ScriptSettingsDouble::~ScriptSettingsDouble()
24 {}
25 
26 double ScriptSettingsDouble::rangeMin() const
27 {
28  return widget_->doubleFixedRangeMin->value();
29 }
30 
31 double ScriptSettingsDouble::rangeMax() const
32 {
33  return widget_->doubleFixedRangeMax->value();
34 }
35 
36 const Vector4 ScriptSettingsDouble::colorMin() const
37 {
38  return ACG::to_Vec4d( widget_->doubleMin->color());
39 }
40 
41 const Vector4 ScriptSettingsDouble::colorMax() const
42 {
43  return ACG::to_Vec4d( widget_->doubleMax->color());
44 }
45 
46 void ScriptSettingsDouble::setColorMin(const Vector4 &color)
47 {
48  widget_->doubleMin->setColor(ACG::to_QColor(color));
49 }
50 
51 void ScriptSettingsDouble::setColorMax(const Vector4 &color)
52 {
53  widget_->doubleMax->setColor(ACG::to_QColor(color));
54 }
55 
56 bool ScriptSettingsDouble::useFixedRange() const
57 {
58  return widget_->doubleFixedRange->isChecked();
59 }
60 
61 bool ScriptSettingsDouble::mapOutsideRange() const
62 {
63  return widget_->doubleMapOutsideRange->isChecked();
64 }
65 
66 bool ScriptSettingsDouble::absolute() const
67 {
68  return widget_->doubleAbsolute->isChecked();
69 }
70 
71 void ScriptSettingsDouble::setUseColorCoder(bool useColorCoder)
72 {
73  return widget_->doubleColorCoder->setChecked(useColorCoder);
74 }
75 
76 void ScriptSettingsDouble::setUseFixedRange(bool useFixedRange)
77 {
78  return widget_->doubleFixedRange->setChecked(useFixedRange);
79 }
80 
81 void ScriptSettingsDouble::setRangeMin(double val)
82 {
83  return widget_->doubleFixedRangeMin->setValue(val);
84 }
85 
86 void ScriptSettingsDouble::setRangeMax(double val)
87 {
88  return widget_->doubleFixedRangeMax->setValue(val);
89 }
90 
91 void ScriptSettingsDouble::setMapOutsideRange(bool mapOutsideRange)
92 {
93  return widget_->doubleMapOutsideRange->setChecked(mapOutsideRange);
94 }
95 
96 void ScriptSettingsDouble::setAbsolute(bool absolute)
97 {
98  return widget_->doubleAbsolute->setChecked(absolute);
99 }
100 
101 bool ScriptSettingsDouble::useColorCoder() const
102 {
103  return widget_->doubleColorCoder->isChecked();
104 }