Commit f06f271d authored by Martin Schultz's avatar Martin Schultz

added a widget for selection parameters to meshobject selection plugin.

used the new inteface function to add the widget to the selectionBase plugin
parent a34a7f40
......@@ -48,6 +48,7 @@
\*===========================================================================*/
#include "MeshObjectSelectionPlugin.hh"
#include "ParameterWidget.hh"
#include <MeshTools/MeshSelectionT.hh>
......@@ -128,6 +129,7 @@ dihedral_angle_threshold_(0.0)
MeshObjectSelectionPlugin::~MeshObjectSelectionPlugin() {
delete conversionDialog_;
delete parameterWidget_;
}
void MeshObjectSelectionPlugin::initializePlugin() {
......@@ -152,6 +154,8 @@ void MeshObjectSelectionPlugin::initializePlugin() {
QString("Vertex Selection;Edge Selection;Halfedge Selection;Face Selection;" \
"Feature Vertices;Feature Edges;Feature Faces;Handle Region;Modeling Region").split(";"));
parameterWidget_ = new ParameterWidget(nullptr);
}
}
......@@ -254,6 +258,9 @@ void MeshObjectSelectionPlugin::pluginsInitialized() {
emit addSelectionOperations(environmentHandle_, hedgeOperations, "Halfedge Operations", halfedgeType_);
emit addSelectionOperations(environmentHandle_, faceOperations, "Face Operations", faceType_);
emit addSelectionOperations(environmentHandle_, colorOperations, "Highlight Operations");
if(!OpenFlipper::Options::nogui())
emit addSelectionParameters(environmentHandle_, parameterWidget_, "Selection Parameters");
// Register key shortcuts:
......@@ -2265,8 +2272,8 @@ double MeshObjectSelectionPlugin::get_dihedral_angle_threshold()
}
void MeshObjectSelectionPlugin::update_dihedral_angle_threshold_from_ui()
{
dihedral_angle_threshold_ = OpenFlipperQSettings().value("SelectionBasePlugin/MinDihedralAngle", double()).toDouble();
{
dihedral_angle_threshold_ = parameterWidget_->minDihedralAngle->value();
}
#if QT_VERSION < 0x050000
......
......@@ -76,6 +76,8 @@
#include "ConversionDialog.hh"
class ParameterWidget;
class MeshObjectSelectionPlugin : public QObject, BaseInterface, KeyInterface, LoadSaveInterface,
INIInterface, BackupInterface, ScriptInterface, LoggingInterface, SelectionInterface,
MouseInterface, OptionsInterface
......@@ -126,6 +128,7 @@ signals:
void registerType(QString _handleName, DataType _type);
void addPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle);
void addSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void addSelectionParameters(QString _handleName, QWidget* _widget, QString _category, SelectionInterface::PrimitiveType _type = 0u);
void showToggleSelectionMode(QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes);
......@@ -589,6 +592,8 @@ private:
ConversionDialog* conversionDialog_;
ParameterWidget* parameterWidget_;
/// Options
QtColorChooserButton* colorButtonSelection_;
QtColorChooserButton* colorButtonArea_;
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "ParameterWidget.hh"
ParameterWidget::ParameterWidget(QWidget* _parent)
: QWidget(_parent) {
setupUi(this);
}
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "ui_ParameterWidget.hh"
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
class ParameterWidget : public QWidget, public Ui::ParameterWidget
{
Q_OBJECT
public:
explicit ParameterWidget(QWidget* _parent = 0);
};
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ParameterWidget</class>
<widget class="QWidget" name="ParameterWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>38</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>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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