Commit 8e4c1b62 authored by Martin Heistermann's avatar Martin Heistermann

Feature: Allow setting line width for vector vis.

parent c778c304
......@@ -71,6 +71,8 @@ OMPropertyVisualizerVector2<MeshT, VectorType>::OMPropertyVisualizerVector2(Mesh
{
w->vectors_edges_rb->hide();
}
this->connect(w->lineWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
[this](double value) {lineNode->set_line_width(value);});
}
template <typename MeshT, typename VectorType>
......
......@@ -70,7 +70,8 @@ OMPropertyVisualizerVector<MeshT>::OMPropertyVisualizerVector(MeshT* _mesh, int
{
w->vectors_edges_rb->hide();
}
this->connect(w->lineWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
[this](double value) {lineNode->set_line_width(value);});
}
template <typename MeshT>
......
......@@ -66,8 +66,9 @@ OVMPropertyVisualizerVector<MeshT>::OVMPropertyVisualizerVector(MeshT* _mesh, in
BaseObjectData *bod;
PluginFunctions::getObject(objectID, bod);
lineNode = new ACG::SceneGraph::LineNode(ACG::SceneGraph::LineNode::LineSegmentsMode, bod->baseNode());
w->vectors_edges_rb->hide();
this->connect(w->lineWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
[this](double value) {lineNode->set_line_width(value);});
}
template <typename MeshT>
......
......@@ -94,7 +94,17 @@ Vector4 ScriptSettingsVector::lineColor() const
return ACG::to_Vec4d(widget_->lineColor->color());
}
void ScriptSettingsVector::setLineColor(Vector4 lineColor)
void ScriptSettingsVector::setLineColor(const Vector4 &lineColor)
{
widget_->lineColor->setColor(ACG::to_QColor(lineColor));
}
double ScriptSettingsVector::lineWidth()
{
return widget_->lineWidth->value();
}
void ScriptSettingsVector::setLineWidth(double width)
{
widget_->lineWidth->setValue(width);
}
......@@ -17,6 +17,7 @@ class ScriptSettingsVector : public ScriptSettings
Q_PROPERTY(bool doScale READ doScale WRITE setDoScale)
Q_PROPERTY(double scaleFactor READ scaleFactor WRITE setScaleFactor)
Q_PROPERTY(Vector4 lineColor READ lineColor WRITE setLineColor)
Q_PROPERTY(double lineWidth READ lineWidth WRITE setLineWidth)
public:
enum class Type {Strokes, Rgb, Edges, LengthColor};
......@@ -32,13 +33,15 @@ public:
bool doScale() const;
double scaleFactor() const;
Vector4 lineColor() const;
double lineWidth();
public slots:
void setType(Type type);
void setNormalize(bool normalize);
void setDoScale(bool doScale);
void setScaleFactor(double scaleFactor);
void setLineColor(Vector4 lineColor);
void setLineColor(const Vector4 &lineColor);
void setLineWidth(double width);
private:
VectorWidget *widget_;
......
......@@ -184,18 +184,8 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="scale">
<property name="text">
<string>Scale with factor</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="scaleBox">
<property name="enabled">
<bool>false</bool>
......@@ -211,6 +201,36 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="lineWidth">
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>50.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="scale">
<property name="text">
<string>Scale with factor</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lineWidthLabel">
<property name="text">
<string>Line width</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment