different implementation of refine dialog, includes QEdgeLength widget

This commit is contained in:
Paolo Cignoni cignoni 2006-02-05 11:22:01 +00:00
parent 51836a98c2
commit 17820a303f
2 changed files with 231 additions and 0 deletions

View File

@ -0,0 +1,87 @@
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2004 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
/****************************************************************************
History
$Log$
Revision 1.1 2006/02/05 11:22:01 mariolatronico
different implementation of refine dialog, includes QEdgeLength widget
Revision 1.2 2006/01/31 14:46:39 mariolatronico
added license and log variable
*/
#ifndef REFINE_DIALOG2_H
#define REFINE_DIALOG2_H
// for options on refine and decimator
#include <QDialog>
#include "ui_refineDialog2.h"
class RefineDialog : public QDialog, Ui::Dialog {
Q_OBJECT
public:
RefineDialog() : QDialog()
{
setupUi( this );
threshold = 0.00;
selected = false;
}
public slots:
void on_refineSelectedCB_stateChanged(int selected) {
if (selected == Qt::Checked)
this->selected = true;
else
this->selected = false;
}
public:
inline double getThreshold() {
return edgeLength->getAbsoluteValue();
}
inline bool isSelected() {
return selected;
}
inline void setDiagonal(float diag) {
edgeLength->setDiagonal( diag );
}
private:
// affect only selected vertices ?
bool selected;
// threshold value for refine
double threshold;
};
#endif //REFINE_DIALOG_H

View File

@ -0,0 +1,144 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>299</width>
<height>221</height>
</rect>
</property>
<property name="windowTitle" >
<string>Refine</string>
</property>
<property name="windowIcon" >
<iconset>..\..\..\meshlab\images\eye128.png</iconset>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QGroupBox" name="thresholdGB" >
<property name="title" >
<string>Threshold</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QCheckBox" name="refineSelectedCB" >
<property name="text" >
<string>Affect Only selected vertices</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QEdgeLength" name="edgeLength" >
<property name="toolTip" >
<string>Edge Length widget</string>
</property>
<property name="whatsThis" >
<string>Edge Length widget set a length based on diagonal values.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>131</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton" >
<property name="text" >
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>QEdgeLength</class>
<extends></extends>
<header>QEdgeLength.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>okButton</sender>
<signal>clicked()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>278</x>
<y>253</y>
</hint>
<hint type="destinationlabel" >
<x>96</x>
<y>254</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>Dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>369</x>
<y>253</y>
</hint>
<hint type="destinationlabel" >
<x>179</x>
<y>282</y>
</hint>
</hints>
</connection>
</connections>
</ui>