Commit 7e0be7e6 authored by Mike Kremer's avatar Mike Kremer
Browse files

Some more fancy functionality:

-Created buttons to clear vertex, edge, face selection.
-Cleaned up user interface.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6473 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7aa601d6
......@@ -341,6 +341,11 @@ bool SelectionPlugin::initializeToolbox(QWidget*& _widget)
tool_->convertTo->addItem("Edge Selection");
tool_->convertTo->addItem("Face Selection");
// Check checkboxes by default
tool_->checkAddArea->setChecked(true);
tool_->checkConvert->setChecked(true);
tool_->checkSelectionConvert->setChecked(true);
// Convert button
connect(tool_->convertButton, SIGNAL(clicked()), this, SLOT(slotConvertSelectionType()));
......@@ -361,11 +366,15 @@ bool SelectionPlugin::initializeToolbox(QWidget*& _widget)
connect( tool_->loadSelection, SIGNAL(clicked()), this,SLOT(slotLoadSelection()) );
connect( tool_->saveSelection, SIGNAL(clicked()), this,SLOT(slotSaveSelection()) );
//Clear Mesh Properties
// Clear Properties and Selections
connect( tool_->clearModelingArea, SIGNAL(clicked()), this,SLOT(slotClearArea()) );
connect( tool_->clearHandleRegion, SIGNAL(clicked()), this,SLOT(slotClearHandle()));
connect( tool_->clearFeatures, SIGNAL(clicked()), this,SLOT(slotClearFeatures()));
connect( tool_->clearVertexSelection, SIGNAL(clicked()), this,SLOT(slotClearAllVertexSelections()) );
connect( tool_->clearEdgeSelection, SIGNAL(clicked()), this,SLOT(slotClearAllEdgeSelections()));
connect( tool_->clearFaceSelection, SIGNAL(clicked()), this,SLOT(slotClearAllFaceSelections()));
return true;
}
......@@ -1234,6 +1243,75 @@ void SelectionPlugin::convertFtoESelection(bool _unselectAfter) {
//******************************************************************************
void SelectionPlugin::slotClearAllVertexSelections() {
PluginFunctions::IteratorRestriction restriction;
if ( !tool_->restrictOnTargets->isChecked() ) {
restriction = PluginFunctions::ALL_OBJECTS;
}
else {
restriction = PluginFunctions::TARGET_OBJECTS;
}
for ( PluginFunctions::ObjectIterator o_it(restriction, DataType( DATA_TRIANGLE_MESH | DATA_POLY_MESH ));
o_it != PluginFunctions::objectsEnd(); ++o_it) {
clearVertexSelection(o_it->id());
o_it->update();
}
emit updateView();
}
//******************************************************************************
void SelectionPlugin::slotClearAllEdgeSelections() {
PluginFunctions::IteratorRestriction restriction;
if ( !tool_->restrictOnTargets->isChecked() ) {
restriction = PluginFunctions::ALL_OBJECTS;
}
else {
restriction = PluginFunctions::TARGET_OBJECTS;
}
for ( PluginFunctions::ObjectIterator o_it(restriction, DataType( DATA_TRIANGLE_MESH | DATA_POLY_MESH ));
o_it != PluginFunctions::objectsEnd(); ++o_it) {
clearEdgeSelection(o_it->id());
o_it->update();
}
emit updateView();
}
//******************************************************************************
void SelectionPlugin::slotClearAllFaceSelections() {
PluginFunctions::IteratorRestriction restriction;
if ( !tool_->restrictOnTargets->isChecked() ) {
restriction = PluginFunctions::ALL_OBJECTS;
}
else {
restriction = PluginFunctions::TARGET_OBJECTS;
}
for ( PluginFunctions::ObjectIterator o_it(restriction, DataType( DATA_TRIANGLE_MESH | DATA_POLY_MESH ));
o_it != PluginFunctions::objectsEnd(); ++o_it) {
clearFaceSelection(o_it->id());
o_it->update();
}
emit updateView();
}
//******************************************************************************
void SelectionPlugin::saveSelections()
{
// process all target meshes
......
......@@ -339,6 +339,17 @@ class SelectionPlugin : public QObject, BaseInterface , MouseInterface, KeyInter
/// Convert selection types (modeling area, handle region or feature)
void slotConvertSelectionType();
//==========================================
/// clear all vertex selections of every object
void slotClearAllVertexSelections();
/// clear all edge selections of every object
void slotClearAllEdgeSelections();
/// clear all face selections of every object
void slotClearAllFaceSelections();
/** @} */
......@@ -482,7 +493,8 @@ class SelectionPlugin : public QObject, BaseInterface , MouseInterface, KeyInter
/// load Selection of one object
void loadSelection( int _objectId , QString _filename);
private slots:
private slots:
void saveSelection( TriMesh& _mesh, QString _filename);
void saveSelection( PolyMesh& _mesh, QString _filename);
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>397</width>
<height>934</height>
<width>345</width>
<height>688</height>
</rect>
</property>
<property name="windowTitle">
......@@ -314,21 +314,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Clear Property:</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
......@@ -353,7 +339,7 @@
<string>Clear the handle region of all (target) objects</string>
</property>
<property name="text">
<string>Clear Handle Region</string>
<string>Clear Handle Area</string>
</property>
</widget>
</item>
......@@ -366,7 +352,50 @@
<string>Clear the features of all (target) objects</string>
</property>
<property name="text">
<string>Clear Features</string>
<string>Clear Feature Area</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="clearVertexSelection">
<property name="toolTip">
<string>Clear the modeling area of all (target) objects</string>
</property>
<property name="statusTip">
<string>Clear the modeling area of all (target) objects</string>
</property>
<property name="text">
<string>Clear Vertex Selection</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearEdgeSelection">
<property name="toolTip">
<string>Clear the handle region of all (target) objects</string>
</property>
<property name="statusTip">
<string>Clear the handle region of all (target) objects</string>
</property>
<property name="text">
<string>Clear Edge Selection</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearFaceSelection">
<property name="toolTip">
<string>Clear the features of all (target) objects</string>
</property>
<property name="statusTip">
<string>Clear the features of all (target) objects</string>
</property>
<property name="text">
<string>Clear Face Selection</string>
</property>
</widget>
</item>
......@@ -374,14 +403,14 @@
</item>
</layout>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label">
......@@ -451,6 +480,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
......@@ -471,6 +506,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</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