Modification of the UI: widgets are now dockable.

This commit is contained in:
Laurent Rineau 2008-10-17 14:35:00 +00:00
parent 39de4b75ea
commit 37b4b17b3f
3 changed files with 198 additions and 150 deletions

View File

@ -42,8 +42,6 @@ MainWindow::MainWindow(MainWindow* other_window /* = 0 */) :
this, SLOT(close()));
}
show_only("");
this->addAboutCGAL();
this->addRecentFiles(this->menu_File,
this->action_Quit);
@ -51,6 +49,8 @@ MainWindow::MainWindow(MainWindow* other_window /* = 0 */) :
this, SLOT(surface_open(QString)));
this->readState();
show_only("");
}
void MainWindow::dragEnterEvent(QDragEnterEvent *event)

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1100</width>
<height>595</height>
<width>1147</width>
<height>648</height>
</rect>
</property>
<property name="windowTitle" >
@ -16,153 +16,19 @@
<iconset resource="../surface_mesher.qrc" >
<normaloff>:/icons/cgal_logo.xpm</normaloff>:/icons/cgal_logo.xpm</iconset>
</property>
<property name="dockNestingEnabled" >
<bool>true</bool>
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QGridLayout" name="gridLayout_2" >
<layout class="QGridLayout" name="gridLayout_4" >
<item row="0" column="0" >
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<widget class="Viewer" name="viewer" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="Viewer" name="viewer" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="QWidget" name="" >
<layout class="QVBoxLayout" name="verticalLayout_3" >
<item>
<widget class="QGroupBox" name="groupBoxImageType" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Image type</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QRadioButton" name="grayLevelRadioButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Grayscale image</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="labellizedRadioButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Segmented image</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxCriteria" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Criteria</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QCheckBox" name="manifoldCheckBox" >
<property name="text" >
<string>Manifold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sameIndexCheckBox" >
<property name="text" >
<string>Facets vertices have same index</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>&amp;Sizing bound:</string>
</property>
<property name="buddy" >
<cstring>spinBox_radius_bound</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QDoubleSpinBox" name="spinBox_radius_bound" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>&amp;Distance bound:</string>
</property>
<property name="buddy" >
<cstring>spinBox_distance_bound</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QDoubleSpinBox" name="spinBox_distance_bound" />
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Values_list" native="1" name="values" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@ -172,7 +38,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1100</width>
<width>1147</width>
<height>29</height>
</rect>
</property>
@ -264,6 +130,188 @@
<addaction name="actionMarching_cubes" />
<addaction name="actionSurface_mesher" />
</widget>
<widget class="QDockWidget" name="ImageOptions" >
<property name="allowedAreas" >
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle" >
<string>Images options</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<attribute name="dockWidgetArea" >
<number>1</number>
</attribute>
<widget class="QWidget" name="ImageOptionsContents" >
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" >
<layout class="QVBoxLayout" name="verticalLayout_3" >
<item>
<widget class="QGroupBox" name="groupBoxImageType" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>&amp;Image type</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QRadioButton" name="grayLevelRadioButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Grayscale image</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="labellizedRadioButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Segmented image</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxCriteria" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>&amp;Criteria</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QCheckBox" name="manifoldCheckBox" >
<property name="text" >
<string>Manifold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sameIndexCheckBox" >
<property name="text" >
<string>Facets vertices have same index</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>&amp;Sizing bound:</string>
</property>
<property name="buddy" >
<cstring>spinBox_radius_bound</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QDoubleSpinBox" name="spinBox_radius_bound" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>&amp;Distance bound:</string>
</property>
<property name="buddy" >
<cstring>spinBox_distance_bound</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QDoubleSpinBox" name="spinBox_distance_bound" />
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="ImageLabels" >
<property name="windowTitle" >
<string>Image sub-domaines</string>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
<attribute name="dockWidgetArea" >
<number>1</number>
</attribute>
<widget class="QWidget" name="ImageLabelsContents" >
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" >
<widget class="Values_list" native="1" name="values" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="show_only_in" stdset="0" >
<stringlist>
<string>volume</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<action name="action_Open" >
<property name="icon" >
<iconset resource="../surface_mesher.qrc" >

View File

@ -32,7 +32,7 @@ QString Viewer::helpString() const
void Viewer::interpolateToFitBoundingBox(double xmin, double ymin, double zmin,
double xmax, double ymax, double zmax)
{
QAction* auto_resize = parent()->parent()->parent()->findChild<QAction*>("actionAuto_resize");
QAction* auto_resize = parent()->parent()->findChild<QAction*>("actionAuto_resize");
Q_ASSERT_X(auto_resize, "Viewer::interpolateToFitBoundingBox", "cannot find action \"actionAuto_resize\"");
if(auto_resize && auto_resize->isChecked())
{