1 #include "ScriptSettingsVector.hh" 2 #include "ACG/Utils/ColorConversion.hh" 4 ScriptSettingsVector::ScriptSettingsVector()
11 ScriptSettingsVector::ScriptSettingsVector(
17 ScriptSettingsVector::ScriptSettingsVector(
20 widget_(other.widget_)
23 ScriptSettingsVector::~ScriptSettingsVector()
27 ScriptSettingsVector::Type ScriptSettingsVector::type()
const 29 if (widget_->vectors_edges_rb->isChecked()) {
32 if (widget_->vectors_strokes_rb->isChecked()) {
35 if (widget_->vectors_length_color_rb->isChecked()) {
36 return Type::LengthColor;
38 if (widget_->vectors_colors_rb->isChecked()) {
41 throw std::logic_error(
"No radiobutton selected?!");
44 void ScriptSettingsVector::setType(ScriptSettingsVector::Type type)
49 widget_->vectors_edges_rb->setChecked(
true);
52 widget_->vectors_strokes_rb->setChecked(
true);
54 case Type::LengthColor:
55 widget_->vectors_length_color_rb->setChecked(
true);
58 widget_->vectors_colors_rb->setChecked(
true);
63 bool ScriptSettingsVector::normalize()
const 65 return widget_->normalize->isChecked();
67 void ScriptSettingsVector::setNormalize(
bool normalize)
69 widget_->normalize->setChecked(normalize);
72 bool ScriptSettingsVector::doScale()
const 74 return widget_->scale ->isChecked();
77 void ScriptSettingsVector::setDoScale(
bool doScale)
79 widget_->scale ->setChecked(doScale);
82 double ScriptSettingsVector::scaleFactor()
const 84 return widget_->scaleBox->value();
87 void ScriptSettingsVector::setScaleFactor(
double scaleFactor)
89 widget_->scaleBox->setValue(scaleFactor);
92 Vector4 ScriptSettingsVector::lineColor()
const 94 return ACG::to_Vec4d(widget_->lineColor->color());
97 void ScriptSettingsVector::setLineColor(
const Vector4 &lineColor)
99 widget_->lineColor->setColor(ACG::to_QColor(lineColor));
102 double ScriptSettingsVector::lineWidth()
104 return widget_->lineWidth->value();
107 void ScriptSettingsVector::setLineWidth(
double width)
109 widget_->lineWidth->setValue(width);