Commit b87deb90 authored by Martin Schultz's avatar Martin Schultz

removed maxAngle from slots in SelectionMeshObject and SelectionVolumeMesh plugins

added a widget to SelectionVolumeMesh plugin to control maxAngle.
added maxAngle spinbox to parameter widget of MeshObjectSelection plugin.
added get and set functions for maxAngle to both plugins.
parent 57dd54c4
......@@ -123,7 +123,8 @@ colorButtonSelection_(0),
colorButtonArea_(0),
colorButtonHandle_(0),
colorButtonFeature_(0),
dihedral_angle_threshold_(0.0)
dihedral_angle_threshold_(0.0),
max_angle_( 2*M_PI)
{
}
......@@ -1393,7 +1394,7 @@ void MeshObjectSelectionPlugin::slotClosestBoundarySelection(QMouseEvent* _event
}
}
void MeshObjectSelectionPlugin::slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, PrimitiveType _currentType, bool _deselect) {
void MeshObjectSelectionPlugin::slotFloodFillSelection(QMouseEvent* _event, PrimitiveType _currentType, bool _deselect) {
// Return if none of the currently active types is handled by this plugin
if((_currentType & allSupportedTypes_) == 0) return;
......@@ -1401,6 +1402,9 @@ void MeshObjectSelectionPlugin::slotFloodFillSelection(QMouseEvent* _event, doub
size_t node_idx, target_idx;
ACG::Vec3d hit_point;
if(!OpenFlipper::Options::nogui())
max_angle_ = parameterWidget_->maxAngle->value();
// pick Anything to find all possible objects
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_ANYTHING,
_event->pos(), node_idx, target_idx, &hit_point)) {
......@@ -1419,7 +1423,7 @@ void MeshObjectSelectionPlugin::slotFloodFillSelection(QMouseEvent* _event, doub
if(object->dataType(DATA_TRIANGLE_MESH)) {
floodFillSelection(
PluginFunctions::triMesh(object),
object->id(), target_idx, _maxAngle,
object->id(), target_idx, max_angle_,
_currentType, _deselect);
emit updatedObject(object->id(), UPDATE_SELECTION);
emit createBackup(object->id(), "FloodFill Selection", UPDATE_SELECTION);
......@@ -1437,7 +1441,7 @@ void MeshObjectSelectionPlugin::slotFloodFillSelection(QMouseEvent* _event, doub
if(object->dataType(DATA_POLY_MESH)) {
floodFillSelection(
PluginFunctions::polyMesh(object),
object->id(), target_idx, _maxAngle,
object->id(), target_idx, max_angle_,
_currentType, _deselect);
emit updatedObject(object->id(), UPDATE_SELECTION);
emit createBackup(object->id(), "FloodFill Selection", UPDATE_SELECTION);
......@@ -2272,6 +2276,16 @@ double MeshObjectSelectionPlugin::get_dihedral_angle_threshold()
return dihedral_angle_threshold_;
}
void MeshObjectSelectionPlugin::set_max_angle(const double _a)
{
max_angle_ = _a;
}
double MeshObjectSelectionPlugin::get_max_angle()
{
return max_angle_;
}
void MeshObjectSelectionPlugin::update_dihedral_angle_threshold_from_ui()
{
dihedral_angle_threshold_ = parameterWidget_->minDihedralAngle->value();
......
......@@ -176,7 +176,7 @@ private slots:
void slotVolumeLassoSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotSphereSelection(QMouseEvent* _event, double _radius, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotClosestBoundarySelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotFloodFillSelection(QMouseEvent* _event, double _maxAngle, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotFloodFillSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotComponentsSelection(QMouseEvent* _event, SelectionInterface::PrimitiveType _currentType, bool _deselect);
void slotLoadSelection(const INIFile& _file);
......@@ -491,6 +491,11 @@ public:
/// get dihedral angle threshold for edge selection
double get_dihedral_angle_threshold();
/// set max angle for flood fill selection
void set_max_angle(const double _a);
/// get max angle for flood fill selection
double get_max_angle();
private:
void update_dihedral_angle_threshold_from_ui();
......@@ -606,6 +611,7 @@ private:
ACG::Vec4f featureColor_;
double dihedral_angle_threshold_;
double max_angle_;
/** @} */
......
......@@ -6,35 +6,81 @@
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>38</height>
<width>343</width>
<height>184</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Select Above Dihedral Angle:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="minDihedralAngle">
<property name="toolTip">
<string>Maximum angle between faces that get flood filled</string>
</property>
<property name="statusTip">
<string>Maximum angle between faces that get flood filled</string>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Flood Fill</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Select Above Dihedral Angle:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="minDihedralAngle">
<property name="toolTip">
<string>Maximum angle between faces that get flood filled</string>
</property>
<property name="statusTip">
<string>Maximum angle between faces that get flood filled</string>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Maximum Angle</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="maxAngle">
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="value">
<double>15.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
......
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