|
From: <dhu...@us...> - 2007-01-24 12:38:59
|
Revision: 242
http://svn.sourceforge.net/qcell/?rev=242&view=rev
Author: dhubleizh
Date: 2007-01-24 04:38:54 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
- totally rewritten the GUI to QDockWidgets
Modified Paths:
--------------
trunk/qcell/baseheaders/basetools.h
trunk/qcell/baseheaders/basetools.ui
trunk/qcell/baseheaders/simulationwindow.h
trunk/qcell/baseheaders/simulationwindow.ui
trunk/qcell/baseheaders/view1dtexttools.ui
trunk/qcell/baseheaders/view2dtexttools.h
trunk/qcell/baseheaders/view2dtexttools.ui
trunk/qcell/baseheaders/view3dtools.h
trunk/qcell/baseheaders/view3dtools.ui
trunk/qcell/basesources/basetools.cpp
trunk/qcell/basesources/simulationwindow.cpp
trunk/qcell/basesources/view2dtexttools.cpp
trunk/qcell/visgui/MainWindow.cpp
trunk/qcell/visgui/MainWindow.h
Modified: trunk/qcell/baseheaders/basetools.h
===================================================================
--- trunk/qcell/baseheaders/basetools.h 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/basetools.h 2007-01-24 12:38:54 UTC (rev 242)
@@ -21,6 +21,8 @@
public slots:
void unlockGUI();
+ void setRowCount(int count);
+ void setItem(int row, int column, QTableWidgetItem* item);
protected slots:
void modeChangeSelect(void);
Modified: trunk/qcell/baseheaders/basetools.ui
===================================================================
--- trunk/qcell/baseheaders/basetools.ui 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/basetools.ui 2007-01-24 12:38:54 UTC (rev 242)
@@ -2,14 +2,14 @@
<class>BaseToolsClass</class>
<widget class="QWidget" name="BaseToolsClass" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
- <width>150</width>
- <height>503</height>
+ <width>118</width>
+ <height>438</height>
</rect>
</property>
<property name="windowTitle" >
@@ -24,6 +24,14 @@
</property>
<item>
<widget class="QGroupBox" name="ViewModeGroup" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>View Mode</string>
</property>
@@ -78,6 +86,14 @@
</item>
<item>
<widget class="QGroupBox" name="EditModeGroup" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>Edit Mode</string>
</property>
@@ -132,6 +148,14 @@
</item>
<item>
<widget class="QGroupBox" name="EditToolsGroup" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>Edit Tools</string>
</property>
@@ -191,21 +215,25 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="ValuesGroup" >
- <property name="title" >
- <string>Values</string>
+ <widget class="QTableWidget" name="valueTable" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
+ <row>
+ <property name="text" >
+ <string>1</string>
</property>
- <property name="spacing" >
- <number>6</number>
+ </row>
+ <column>
+ <property name="text" >
+ <string>Value</string>
</property>
- <item>
- <widget class="QTableWidget" name="valueTable" />
- </item>
- </layout>
+ </column>
</widget>
</item>
</layout>
Modified: trunk/qcell/baseheaders/simulationwindow.h
===================================================================
--- trunk/qcell/baseheaders/simulationwindow.h 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-24 12:38:54 UTC (rev 242)
@@ -31,7 +31,19 @@
class simulationWindow : public QWidget
{
Q_OBJECT
+signals:
+ void setRowCount(int count);
+ void setItem(int row, int column, QTableWidgetItem* item);
+ void set3DToolsRange(int x, int y, int z);
+ void set3DToolsVisible(bool visible);
+
+ void setZPlaneMax(int value);
+ void pure2DMode(bool flag);
+ void showZPlaneOnly(bool flag);
+ void set2DTextToolsVisible(bool visible);
+
+ void set1DTextToolsVisible(bool visible);
private:
Ui::simulationWindowClass ui;
@@ -51,8 +63,8 @@
QToolBox *tools;
BaseTools *basetools;
- View3DTools *view3DTools;
- View2DTextTools *view2DTextTools;
+// View3DTools *view3DTools;
+// View2DTextTools *view2DTextTools;
int view2DTextInterpretationMode;
@@ -78,6 +90,8 @@
QList< QVector<int> > dataToCopy;
+ int last_tab_index;
+
virtual void mouseMoveEvent(QMouseEvent * event);
virtual void mousePressEvent(QMouseEvent * event);
virtual void wheelEvent(QWheelEvent * event);
@@ -133,6 +147,7 @@
void maskChange(int x, int y, int z);
void unlockGUI();
+ void tabChanged(int index);
public:
void storeSelectedData(void);
Modified: trunk/qcell/baseheaders/simulationwindow.ui
===================================================================
--- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-24 12:38:54 UTC (rev 242)
@@ -20,103 +20,105 @@
<property name="windowTitle" >
<string>simulationWindow</string>
</property>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>10</y>
- <width>381</width>
- <height>281</height>
- </rect>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
</property>
- <property name="tabPosition" >
- <enum>QTabWidget::North</enum>
+ <property name="spacing" >
+ <number>6</number>
</property>
- <property name="tabShape" >
- <enum>QTabWidget::Rounded</enum>
- </property>
- <property name="currentIndex" >
- <number>5</number>
- </property>
- <widget class="QWidget" name="view3D" >
- <attribute name="title" >
- <string>3D View</string>
- </attribute>
- </widget>
- <widget class="QWidget" name="view2D" >
- <attribute name="title" >
- <string>2D Text View</string>
- </attribute>
- </widget>
- <widget class="QWidget" name="view2DGraph" >
- <attribute name="title" >
- <string>2D Graphics View</string>
- </attribute>
- </widget>
- <widget class="QWidget" name="view1D" >
- <attribute name="title" >
- <string>1D Text View</string>
- </attribute>
- </widget>
- <widget class="QWidget" name="symbolConfig" >
- <attribute name="title" >
- <string>Symbols Configuration</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="tabPosition" >
+ <enum>QTabWidget::North</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="tabShape" >
+ <enum>QTabWidget::Rounded</enum>
</property>
- <item>
- <layout class="QHBoxLayout" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="view3D" >
+ <attribute name="title" >
+ <string>3D View</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="view2D" >
+ <attribute name="title" >
+ <string>2D Text View</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="view2DGraph" >
+ <attribute name="title" >
+ <string>2D Graphics View</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="view1D" >
+ <attribute name="title" >
+ <string>1D Text View</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="symbolConfig" >
+ <attribute name="title" >
+ <string>Symbols Configuration</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
<property name="margin" >
- <number>0</number>
+ <number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
- <widget class="QPushButton" name="addSymbol" >
- <property name="text" >
- <string>Add Symbol</string>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
</property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="removeSymbol" >
- <property name="text" >
- <string>Remove Symbol</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- </widget>
+ <item>
+ <widget class="QPushButton" name="addSymbol" >
+ <property name="text" >
+ <string>Add Symbol</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="removeSymbol" >
+ <property name="text" >
+ <string>Remove Symbol</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="functionTab" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <attribute name="title" >
- <string>Function</string>
- </attribute>
- </widget>
- </widget>
+ </widget>
+ <widget class="QWidget" name="functionTab" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <attribute name="title" >
+ <string>Function</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
Modified: trunk/qcell/baseheaders/view1dtexttools.ui
===================================================================
--- trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-24 12:38:54 UTC (rev 242)
@@ -5,103 +5,123 @@
<rect>
<x>0</x>
<y>0</y>
- <width>115</width>
- <height>145</height>
+ <width>119</width>
+ <height>224</height>
</rect>
</property>
<property name="windowTitle" >
<string>View1DTextTools</string>
</property>
- <widget class="QGroupBox" name="groupBox" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>1</y>
- <width>113</width>
- <height>91</height>
- </rect>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
</property>
- <property name="title" >
- <string>View 1D Text</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- <widget class="QToolButton" name="SymbolsButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>60</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Symbols</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="ValuesButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>40</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Values</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="ColorsButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Colors</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>90</y>
- <width>113</width>
- <height>51</height>
- </rect>
- </property>
- <property name="title" >
- <string>Memory</string>
- </property>
- <widget class="QToolButton" name="MemoryClearButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Clear</string>
- </property>
- </widget>
- </widget>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>View 1D Text</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="ColorsButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Colors</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="ValuesButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Values</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="SymbolsButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Symbols</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Memory</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="MemoryClearButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Clear</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
Modified: trunk/qcell/baseheaders/view2dtexttools.h
===================================================================
--- trunk/qcell/baseheaders/view2dtexttools.h 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/view2dtexttools.h 2007-01-24 12:38:54 UTC (rev 242)
@@ -8,12 +8,13 @@
{
Q_OBJECT
+public slots:
+ void pure2DMode(bool flag=0);
+ void setZPlaneMax(int max);
+ void showZPlaneOnly(bool flag=0);
public:
View2DTextTools(QWidget *parent = 0);
~View2DTextTools();
- void Pure2DMode(bool flag=0);
- void setZPlaneMax(int max);
- void showZplaneOnly(bool flag=0);
private:
Ui::View2DTextToolsClass ui;
Modified: trunk/qcell/baseheaders/view2dtexttools.ui
===================================================================
--- trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-24 12:38:54 UTC (rev 242)
@@ -5,100 +5,111 @@
<rect>
<x>0</x>
<y>0</y>
- <width>115</width>
- <height>157</height>
+ <width>119</width>
+ <height>222</height>
</rect>
</property>
<property name="windowTitle" >
<string>View2DTextTools</string>
</property>
- <widget class="QGroupBox" name="ZPlaneGroup" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>100</y>
- <width>113</width>
- <height>51</height>
- </rect>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
</property>
- <property name="title" >
- <string>Z Plane</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- <widget class="QSpinBox" name="Zplane" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>22</height>
- </rect>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="View2DGroup" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>1</y>
- <width>113</width>
- <height>91</height>
- </rect>
- </property>
- <property name="title" >
- <string>View 2D Text</string>
- </property>
- <widget class="QToolButton" name="ColorsButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Colors</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="ValuesButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>40</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Values</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="SymbolsButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>60</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Symbols</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- </widget>
+ <item>
+ <widget class="QGroupBox" name="View2DGroup" >
+ <property name="title" >
+ <string>View 2D Text</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="ColorsButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Colors</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="ValuesButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Values</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="SymbolsButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Symbols</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="ZPlaneGroup" >
+ <property name="title" >
+ <string>Z Plane</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QSpinBox" name="Zplane" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
Modified: trunk/qcell/baseheaders/view3dtools.h
===================================================================
--- trunk/qcell/baseheaders/view3dtools.h 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/view3dtools.h 2007-01-24 12:38:54 UTC (rev 242)
@@ -11,7 +11,6 @@
public:
View3DTools(QWidget *parent = 0);
~View3DTools();
- void setRange(int x, int y, int z);
private:
Ui::View3DToolsClass ui;
@@ -31,6 +30,8 @@
signals:
void ViewModeUpdated(int mode);
void maskSet(int x, int y, int z);
+public slots:
+ void setRange(int x, int y, int z);
};
#endif // VIEW3DTOOLS_H
Modified: trunk/qcell/baseheaders/view3dtools.ui
===================================================================
--- trunk/qcell/baseheaders/view3dtools.ui 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/baseheaders/view3dtools.ui 2007-01-24 12:38:54 UTC (rev 242)
@@ -5,151 +5,168 @@
<rect>
<x>0</x>
<y>0</y>
- <width>115</width>
- <height>205</height>
+ <width>136</width>
+ <height>321</height>
</rect>
</property>
<property name="windowTitle" >
<string>View3DTools</string>
</property>
- <widget class="QGroupBox" name="ViewsTools" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>1</y>
- <width>113</width>
- <height>71</height>
- </rect>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
</property>
- <property name="title" >
- <string>View 3D</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- <widget class="QToolButton" name="PerspectiveButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Perspective</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="OrthoButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>40</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Ortho</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="SectionGroup" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>70</y>
- <width>113</width>
- <height>131</height>
- </rect>
- </property>
- <property name="title" >
- <string>Section</string>
- </property>
- <widget class="QToolButton" name="EnableButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Enable</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="xyButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>40</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>xy</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="zyButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>60</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>zy</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QToolButton" name="xzButton" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>80</y>
- <width>91</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>xz</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QSpinBox" name="maskValue" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>100</y>
- <width>91</width>
- <height>22</height>
- </rect>
- </property>
- </widget>
- </widget>
+ <item>
+ <widget class="QGroupBox" name="ViewsTools" >
+ <property name="title" >
+ <string>View 3D</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="PerspectiveButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Perspective</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="OrthoButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Ortho</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="SectionGroup" >
+ <property name="title" >
+ <string>Section</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="EnableButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Enable</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="xyButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>xy</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="zyButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>zy</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="xzButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>xz</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="maskValue" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
Modified: trunk/qcell/basesources/basetools.cpp
===================================================================
--- trunk/qcell/basesources/basetools.cpp 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/basesources/basetools.cpp 2007-01-24 12:38:54 UTC (rev 242)
@@ -4,6 +4,9 @@
: QWidget(parent)
{
ui.setupUi(this);
+ ui.valueTable->resizeColumnsToContents();
+ ui.valueTable->resizeRowsToContents();
+// ui.valueTable->adjustSize();
editMode = 0;
connect(ui.CopyButton, SIGNAL(clicked(bool)), SLOT(commandCopy()));
connect(ui.PasteButton, SIGNAL(clicked(bool)), SLOT(commandPaste()));
@@ -57,7 +60,7 @@
ui.LocalViewButton->setChecked(0);
ui.EditModeGroup->show();
ui.EditToolsGroup->show();
- ui.ValuesGroup->show();
+// ui.ValuesGroup->show();
if(editMode!=2)
{
editMode=2;
@@ -81,7 +84,7 @@
ui.LocalViewButton->setChecked(1);
ui.EditModeGroup->hide();
ui.EditToolsGroup->hide();
- ui.ValuesGroup->hide();
+// ui.ValuesGroup->hide();
if(editMode!=3)
{
editMode=3;
@@ -114,3 +117,13 @@
setEnabled(true);
}
+void BaseTools::setRowCount(int count)
+{
+ ui.valueTable->setRowCount(count);
+}
+
+void BaseTools::setItem(int row, int column, QTableWidgetItem* item)
+{
+ ui.valueTable->setItem(row, column, item);
+}
+
Modified: trunk/qcell/basesources/simulationwindow.cpp
===================================================================
--- trunk/qcell/basesources/simulationwindow.cpp 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-24 12:38:54 UTC (rev 242)
@@ -1,4 +1,5 @@
#include "../baseheaders/simulationwindow.h"
+#include <QDebug>
void simulationWindow::mouseMoveEvent(QMouseEvent * event)
{
@@ -75,103 +76,121 @@
void simulationWindow::resizeEvent(QResizeEvent * event)
{
+//
+// ui.tabWidget->resize(width() - 140, height() - 10);
+// ui.view1D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+// ui.view2D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+// ui.view3D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+// ui.view2DGraph->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+// ui.symbolConfig->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+// ui.functionTab->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
+//
+// renderer->move(1, 1);
+// renderer->resize(ui.view3D->width() - 1, ui.view3D->height() - 1);
+//
+// table2D->move(1, 1);
+// table2D->resize(ui.view2D->width() - 10 , ui.view2D->height() - 10);
+// graphicsView2D->resize(ui.view2DGraph->width() - 7, ui.view2DGraph->height() - 7);
+//
+// table1D->move(1, 1);
+// table1D->resize(ui.view1D->width() - 10, 75);
+//
+// table1DMem->move(0, 100);
+// table1DMem->resize(ui.view1D->width() - 7, ui.view1D->height() - 157);
+//
+// symbolTable->move(0, 35);
+// symbolTable->resize(ui.symbolConfig->width() - 7, ui.symbolConfig->height() -42);
- ui.tabWidget->resize(width() - 140, height() - 10);
- ui.view1D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
- ui.view2D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
- ui.view3D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
- ui.view2DGraph->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
- ui.symbolConfig->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
- ui.functionTab->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20);
-
- renderer->move(1, 1);
- renderer->resize(ui.view3D->width() - 1, ui.view3D->height() - 1);
-
- table2D->move(1, 1);
- table2D->resize(ui.view2D->width() - 10 , ui.view2D->height() - 10);
- graphicsView2D->resize(ui.view2DGraph->width() - 7, ui.view2DGraph->height() - 7);
-
- table1D->move(1, 1);
- table1D->resize(ui.view1D->width() - 10, 75);
-
- table1DMem->move(0, 100);
- table1DMem->resize(ui.view1D->width() - 7, ui.view1D->height() - 157);
-
- symbolTable->move(0, 35);
- symbolTable->resize(ui.symbolConfig->width() - 7, ui.symbolConfig->height() -42);
-
// basetools->move(width() - 116, 0);
// view3DTools->move(width() - 116, basetools->height() + 1);
// view2DTextTools->move(width() - 116, basetools->height() + 1);
// view1DTextTools->move(width() - 116, basetools->height() + 1);
- ft->resize(ui.functionTab->width() - 10 , ui.functionTab->height() - 10);
+// ft->resize(ui.functionTab->width() - 10 , ui.functionTab->height() - 10);
}
void simulationWindow::paintEvent(QPaintEvent * event)
{
- if(ui.view3D->isVisible())
- {
- view3DTools->show();
- }
- else
- view3DTools->hide();
+ // This is VERY bad, as is checked every repaint (veeery often)
+ // Moved to tabChanged slot
+// if(ui.view3D->isVisible())
+// {
+// emit set3DToolsVisible(true);
+// }
+// else
+// {
+// emit set3DToolsVisible(false);
+// }
- if(ui.view2D->isVisible())
- {
- view2DTextTools->show();
- view2DTextTools->showZplaneOnly(0);
- if(table2DUpdateRequest>0)
- {
- if(table2DUpdateRequest==1)
- update2DTable();
- else
- update2DTable(1);
- table2DUpdateRequest = 0;
- }
- }
- else
- {
- if(!ui.view2DGraph->isVisible())
- view2DTextTools->hide();
- }
+ // Same as above
+ // Moved to tabChanged (with additional functionality)
+// if(ui.view2D->isVisible())
+// {
+// emit set2DTextToolsVisible(true);
+//// view2DTextTools->show();
+// emit showZPlaneOnly(false);
+//// view2DTextTools->showZplaneOnly(0);
+// if(table2DUpdateRequest>0)
+// {
+// if(table2DUpdateRequest==1)
+// update2DTable();
+// else
+// update2DTable(1);
+// table2DUpdateRequest = 0;
+// }
+// }
+// else
+// {
+// if(!ui.view2DGraph->isVisible())
+// emit set2DTextToolsVisible(false);
+//// view2DTextTools->hide();
+// }
- if(ui.view2DGraph->isVisible())
- {
- view2DTextTools->show();
- view2DTextTools->showZplaneOnly(1);
- if(graph2DUpdateRequest)
- {
- update2DGraph();
- graph2DUpdateRequest = 0;
- }
- }
- else
- {
- if(!ui.view2D->isVisible())
- view2DTextTools->hide();
- }
+ // Moved with functionality to tabChanged
+// if(ui.view2DGraph->isVisible())
+// {
+// emit set2DTextToolsVisible(true);
+//// view2DTextTools->show();
+// emit showZPlaneOnly(true);
+//// view2DTextTools->showZplaneOnly(1);
+// if(graph2DUpdateRequest)
+// {
+// update2DGraph();
+// graph2DUpdateRequest = 0;
+// }
+// }
+// else
+// {
+// if(!ui.view2D->isVisible())
+// emit set2DTextToolsVisible(false);
+//// view2DTextTools->hide();
+// }
- if(ui.view1D->isVisible())
- {
- view1DTextTools->show();
- if(table1DUpdateRequest)
- {
- if(table1DUpdateRequest==1)
- update1DTable();
- else
- update1DTable(1);
- table1DUpdateRequest = 0;
- }
- }
- else
- view1DTextTools->hide();
+// if(ui.view1D->isVisible())
+// {
+// emit set1DTextToolsVisible(true);
+//// view1DTextTools->show();
+// if(table1DUpdateRequest)
+// {
+// if(table1DUpdateRequest==1)
+// update1DTable();
+// else
+// update1DTable(1);
+// table1DUpdateRequest = 0;
+// }
+// }
+// else
+// emit set1DTextToolsVisible(false);
+//// view1DTextTools->hide();
- if(ui.symbolConfig->isVisible())
- {
- updateSymbolTable();
- }
+ // I fear to think about what would happen to speed
+ // when the symbol table would grow a little
+ // Moved to tabChanged
+// if(ui.symbolConfig->isVisible())
+// {
+// updateSymbolTable();
+// }
}
void simulationWindow::localViewReinterprete(void)
@@ -498,8 +517,9 @@
{
symbolTable->setRowCount(renderer->getSymbolCount());
- basetools->getValueTablePointer()->setRowCount(renderer->getSymbolCount());
- basetools->getValueTablePointer()->setColumnWidth(0, 53);
+ emit setRowCount(renderer->getSymbolCount());
+// basetools->getValueTablePointer()->setRowCount(renderer->getSymbolCount());
+// basetools->getValueTablePointer()->setColumnWidth(0, 53);
for(int i=0;i<symbolTable->rowCount();++i)
{
@@ -512,7 +532,8 @@
item = new QTableWidgetItem(*item);
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- basetools->getValueTablePointer()->setItem(i, 0, item);
+ emit setItem(i, 0, item);
+// basetools->getValueTablePointer()->setItem(i, 0, item);
item = new QTableWidgetItem;
item->setTextAlignment(Qt::AlignCenter);
@@ -580,11 +601,19 @@
z_plane = 0;
zoom = 1.0;
ui.setupUi(this);
+ last_tab_index = 0;
+ connect(ui.tabWidget, SIGNAL(currentChanged(int)),
+ this, SLOT(tabChanged(int))
+ );
+ ui.view3D->setLayout(new QVBoxLayout(ui.view3D));
renderer = new Renderer(ui.view3D);
- renderer->resize(ui.view3D->width(), ui.view3D->height());
+ ui.view3D->layout()->addWidget(renderer);
+// renderer->resize(ui.view3D->width(), ui.view3D->height());
+ ui.view2DGraph->setLayout(new QVBoxLayout(ui.view2DGraph));
graphicsView2D = new QGraphicsView(ui.view2DGraph);
+ ui.view2DGraph->layout()->addWidget(graphicsView2D);
graphicsScene2D = new QGraphicsScene;
pixmap = new QPixmap(0, 0);
@@ -592,12 +621,14 @@
graphicsScene2DPixmap = graphicsScene2D->addPixmap(*pixmap);
graphicsScene2DPixmap->setFlag(QGraphicsItem::ItemIsMovable);
graphicsView2D->setScene(graphicsScene2D);
-
+ ui.view1D->setLayout(new QVBoxLayout(ui.view1D));
table1D = new QTableWidget(ui.view1D);
+ ui.view1D->layout()->addWidget(table1D);
table1D->setRowCount(1);
table1DMem = new QTableWidget(ui.view1D);
+ ui.view1D->layout()->addWidget(table1DMem);
symbolTable = new QTableWidget(ui.symbolConfig);
ui.symbolConfig->layout()->addWidget(symbolTable);
@@ -608,7 +639,9 @@
symbolTable->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Model")));
symbolTable->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Hide Flag")));
+ ui.view2D->setLayout(new QVBoxLayout(ui.view2D));
table2D = new QTableWidget(ui.view2D);
+ ui.view2D->layout()->addWidget(table2D);
bool ret = connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest()));
@@ -626,47 +659,43 @@
table2DUpdateRequest = 0;
table1DUpdateRequest = 0;
- basetools = new BaseTools(parent);
- basetools->getValueTablePointer()->setColumnCount(1);
- basetools->getValueTablePointer()->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value")));
+ // Done in Designer. Widget set up in MainWindow, as it should be
+// basetools = new BaseTools(parent);
+// basetools->getValueTablePointer()->setColumnCount(1);
+// basetools->getValueTablePointer()->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value")));
- // Let's make that basic tools widget into QDockWidget
- QDockWidget* dw = new QDockWidget(parent);
- dw->setWidget(basetools);
-// dw->hide();
- dw->setWindowTitle(tr("Base tools"));
- ((MainWindow*)parent)->addDockWidget(Qt::RightDockWidgetArea, dw);
-
- // Let's make it accessible from the `View' menu
- QAction* bt_action = dw->toggleViewAction();
- bt_action->setText("&" + dw->windowTitle());
- ((Ui_MainWindow*)parent)->menu_View->addAction(bt_action);
-
selectedSymbol = 0;
workMode = 0;
connect(table2D, SIGNAL(cellClicked(int, int)), SLOT(GridView2DEdit(int, int)));
connect(table1D, SIGNAL(cellClicked(int, int)), SLOT(GridView1DEdit(int, int)));
- connect(basetools, SIGNAL(toolsModeUpdate(int)), SLOT(workModeChange(int)));
- connect(basetools, SIGNAL(symbolSelected(int)), SLOT(selectSymbol(int)));
+ // Connects moved to MainWindow
+// connect(basetools, SIGNAL(toolsModeUpdate(int)), SLOT(workModeChange(int)));
+// connect(basetools, SIGNAL(symbolSelected(int)), SLOT(selectSymbol(int)));
- view3DTools = new View3DTools(this);
- connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int)));
+// // Widget creation moved to MainWindow
+// view3DTools = new View3DTools(this);
+// connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int)));
view2DTextInterpretationMode = 0;
- view2DTextTools = new View2DTextTools(this);
+ // Widget creation moved to MainWindow
+// view2DTextTools = new View2DTextTools(this);
- connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int)));
- connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int)));
+// // Moved to MainWindow
+// connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int)));
+// connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int)));
view1DTextInterpretationMode = 0;
- view1DTextTools = new View1DTextTools(this);
+ // Widget moved to MainWindow
+// view1DTextTools = new View1DTextTools(this);
- connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int)));
- connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear()));
+ // Moved to MainWindow
+// connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int)));
+// connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear()));
- connect(basetools, SIGNAL(command(int)), SLOT(commandExecute(int)));
+ // Moved to MainWindow
+// connect(basetools, SIGNAL(command(int)), SLOT(commandExecute(int)));
localObserverPosition.resize(3);
maxTime = 0;
@@ -677,7 +706,8 @@
connect(renderer, SIGNAL(objectSelected(int, int, int)), SLOT(view3DselectedObject(int, int, int)));
storeCurentTable = NULL;
- connect(view3DTools, SIGNAL(maskSet(int, int, int)), SLOT(maskChange(int, int, int)));
+ // Moved to MainWindow
+// connect(view3DTools, SIGNAL(maskSet(int, int, int)), SLOT(maskChange(int, int, int)));
ui.tabWidget->setTabEnabled(0, 0);
ui.tabWidget->setTabEnabled(1, 0);
@@ -686,7 +716,9 @@
ui.tabWidget->setTabEnabled(5, 0);
// for test only
+ ui.functionTab->setLayout(new QVBoxLayout(ui.functionTab));
ft = new FunctionTable(ui.functionTab);
+ ui.functionTab->layout()->addWidget(ft);
}
simulationWindow::~simulationWindow()
@@ -812,8 +844,10 @@
ui.tabWidget->setTabEnabled(3, 0);
table2DUpdateRequest = 2;
graph2DUpdateRequest = 1;
- view2DTextTools->setZPlaneMax(0);
- view2DTextTools->Pure2DMode(1);
+ emit setZPlaneMax(0);
+// view2DTextTools->setZPlaneMax(0);
+ emit pure2DMode(true);
+// view2DTextTools->Pure2DMode(1);
maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX()) + (float)(getStorage()->getSizeY() * getStorage()->getSizeY()));
//maxTime = max(getStorage()->getSizeX(), getStorage()->getSizeY()) + 1;
loclaViewMemory.resize(maxTime);
@@ -827,8 +861,10 @@
ui.tabWidget->setTabEnabled(3, 0);
table2DUpdateRequest = 2;
graph2DUpdateRequest = 1;
- view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1);
- view2DTextTools->Pure2DMode(0);
+ emit setZPlaneMax(getStorage()->getSizeZ()-1);
+// view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1);
+ emit pure2DMode(false);
+// view2DTextTools->Pure2DMode(0);
maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX()) + (float)(getStorage()->getSizeY() * getStorage()->getSizeY()) + (float)(getStorage()->getSizeZ() * getStorage()->getSizeZ()));
//maxTime = max(getStorage()->getSizeZ(), max(getStorage()->getSizeX(), getStorage()->getSizeY())) + 1;
loclaViewMemory.resize(maxTime);
@@ -850,7 +886,7 @@
getStorage()->setForeignDataPointer(localView.getDataPointer(), 1);
}
- view3DTools->setRange(getStorage()->getSizeX()-1, getStorage()->getSizeY()-1, getStorage()->getSizeZ()-1);
+ emit set3DToolsRange(getStorage()->getSizeX()-1, getStorage()->getSizeY()-1, getStorage()->getSizeZ()-1);
//****************************************************
repaint();
@@ -1389,9 +1425,94 @@
void simulationWindow::unlockGUI()
{
- basetools->unlockGUI();
+// basetools->unlockGUI();
ui.tabWidget->setTabEnabled(5, true);
ui.functionTab->setEnabled(true);
ft->unlockGUI();
}
+void simulationWindow::tabChanged(int index)
+{
+ switch (last_tab_index)
+ {
+ case 0:
+ {
+ emit set3DToolsVisible(false);
+ break;
+ }
+ case 1:
+ {
+ emit set2DTextToolsVisible(false);
+ break;
+ }
+ case 2:
+ {
+ emit set2DTextToolsVisible(false);
+ break;
+ }
+ case 3:
+ {
+ emit set1DTextToolsVisible(false);
+ break;
+ }
+ }
+
+ switch (index)
+ {
+ case 0:
+ {
+ emit set3DToolsVisible(true);
+ break;
+ }
+ case 1:
+ {
+ emit set2DTextToolsVisible(true);
+ emit showZPlaneOnly(false);
+ if(table2DUpdateRequest>0)
+ {
+ if(table2DUpdateRequest==1)
+ update2DTable();
+ else
+ update2DTable(1);
+ table2DUpdateRequest = 0;
+ }
+ break;
+ }
+ case 2:
+ {
+ emit set2DTextToolsVisible(true);
+ emit showZPlaneOnly(true);
+
+ if(graph2DUpdateRequest)
+ {
+ update2DGraph();
+ graph2DUpdateRequest = 0;
+ }
+ break;
+ }
+ case 3:
+ {
+ emit set1DTextToolsVisible(true);
+ if(table1DUpdateRequest)
+ {
+ if(table1DUpdateRequest==1)
+ update1DTable();
+ else
+ update1DTable(1);
+ table1DUpdateRequest = 0;
+ }
+ break;
+ }
+ case 4:
+ {
+ if(ui.symbolConfig->isVisible())
+ {
+ updateSymbolTable();
+ }
+ break;
+ }
+ }
+
+ last_tab_index = index;
+}
+
Modified: trunk/qcell/basesources/view2dtexttools.cpp
===================================================================
--- trunk/qcell/basesources/view2dtexttools.cpp 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/basesources/view2dtexttools.cpp 2007-01-24 12:38:54 UTC (rev 242)
@@ -18,7 +18,7 @@
{
}
-void View2DTextTools::Pure2DMode(bool flag)
+void View2DTextTools::pure2DMode(bool flag)
{
if(!flag)
ui.ZPlaneGroup->show();
@@ -31,7 +31,7 @@
ui.Zplane->setRange(0, max);
}
-void View2DTextTools::showZplaneOnly(bool flag)
+void View2DTextTools::showZPlaneOnly(bool flag)
{
if(!flag)
ui.View2DGroup->show();
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-24 12:38:54 UTC (rev 242)
@@ -20,40 +20,141 @@
sw, SLOT(unlockGUI())
);
+// QDockWidget* dw = new QDockWidget(this);
+// BaseTools* basetools = new BaseTools(dw);
+// dw->setWidget(basetools);
+// dw->setWindowTitle(tr("Base tools"));
+// ((QVBoxLayout*)dw->layout())->addStretch();
+// addDockWidget(Qt::RightDockWidgetArea, dw);
+//
+// // Let's make it accessible from the `View' menu
+// QAction* bt_action = dw->toggleViewAction();
+// bt_action->setText("&" + dw->windowTitle());
+// menu_View->addAction(bt_action);
+//
+// connect(basetools, SIGNAL(toolsModeUpdate(int)),
+// sw, SLOT(workModeChange(int))
+// );
+// connect(basetools, SIGNAL(symbolSelected(int)),
+// sw, SLOT(selectSymbol(int))
+// );
+// connect(basetools, SIGNAL(command(int)),
+// sw, SLOT(commandExecute(int))
+// );
+// connect(sw, SIGNAL(setRowCount(int)),
+// basetools, SLOT(setRowCount(int))
+// );
+// connect(sw, SIGNAL(setItem(int, int, QTableWidgetItem*)),
+// basetools, SLOT(setItem(int, int, QTableWidgetItem*))
+// );
+
+ // View 3D Tools
+ QDockWidget* dw = new QDockWidget(this);
+ dw->hide();
+ View3DTools* view3DTools = new View3DTools(this);
+ dw->setWindowTitle(tr("3D Tools"));
+ dw->setWidget(view3DTools);
+ ((QVBoxLayout*)dw->layout())->addStretch();
+ addDockWidget(Qt::RightDockWidgetArea, dw);
+
+ QAction* v3d_action = dw->toggleViewAction();
+ v3d_action->setText(tr("&3D Tools"));
+ menu_View->addAction(v3d_action);
+
+ connect(view3DTools, SIGNAL(ViewModeUpdated(int)),
+ sw, SLOT(perspectiveUpdate(int)));
+ connect(view3DTools, SIGNAL(maskSet(int, int, int)),
+ sw, SLOT(maskChange(int, int, int)));
+ connect(sw, SIGNAL(set3DToolsRange(int, int, int)),
+ view3DTools, SLOT(setRange(int, int, int))
+ );
+ connect(sw, SIGNAL(set3DToolsVisible(bool)),
+ dw, SLOT(setVisible(bool))
+ );
+
+ // View 2D Tools
+ dw = new QDockWidget(this);
+ dw->hide();
+ View2DTextTools* view2DTextTools = new View2DTextTools(this);
+ dw->setWindowTitle(tr("2D Text Tools"));
+ dw->setWidget(view2DTextTools);
+ ((QVBoxLayout*)dw->layout())->addStretch();
+ addDockWidget(Qt::RightDockWidgetArea, dw);
+
+ QAction* v2d_action = dw->toggleViewAction();
+ v2d_action->setText(tr("&2D Text Tools"));
+ menu_View->addAction(v2d_action);
+
+ connect(view2DTextTools, SIGNAL(newZPlaneSet(int)),
+ sw, SLOT(zPlaneChange(int)));
+ connect(view2DTextTools, SIGNAL(viewModeChenged(int)),
+ sw, SLOT(GrigView2DInterpretationMode(int)));
+ connect(sw, SIGNAL(setZPlaneMax(int)),
+ view2DTextTools, SLOT(setZPlaneMax(int))
+ );
+ connect(sw, SIGNAL(pure2DMode(bool)),
+ view2DTextTools, SLOT(pure2DMode(bool))
+ );
+ connect(sw, SIGNAL(showZPlaneOnly(bool)),
+ view2DTextTools, SLOT(showZPlaneOnly(bool))
+ );
+ connect(sw, SIGNAL(set2DTextToolsVisible(bool)),
+ dw, SLOT(setVisible(bool))
+ );
+
+ // View 1D Tools
+ dw = new QDockWidget(this);
+ dw->hide();
+ View1DTextTools* view1DTextTools = new View1DTextTools(this);
+ dw->setWindowTitle(tr("1D Text Tools"));
+ dw->setWidget(view1DTextTools);
+ ((QVBoxLayout*)dw->layout())->addStretch();
+ addDockWidget(Qt::RightDockWidgetArea, dw);
+
+ QAction* v1d_action = dw->toggleViewAction();
+ v1d_action->setText(tr("1D Text Tools"));
+ menu_View->addAction(v1d_action);
+
+ connect(view1DTextTools, SIGNAL(viewModeChenged(int)),
+ sw, SLOT(GrigView1DInterpretationMode(int))
+ );
+ connect(view1DTextTools, SIGNAL(memoryClear()),
+ sw, SLOT(GridView1DMemClear())
+ );
+ connect(sw, SIGNAL(set1DTextToolsVisible(bool)),
+ dw, SLOT(setVisible(bool))
+ );
+
// Adding delay setup
// An interlinked pair of QDoubleSpinBox and a QSlider
- delaySlider = new QSlider(Qt::Horizontal);
- delaySlider->setStatusTip(tr("Sets the delay between iteration steps in ms."));
- delaySlider->setFixedWidth(100);
- delaySpinBox = new QDoubleSpinBox();
- delaySpinBox->setStatusTip(delaySlider->statusTip());
- delaySpinBox->setMinimum(MIN_DELAY);
- delaySpinBox->setMaximum(MAX_DELAY);
- delaySpinBox->setSingleStep(DELAY_STEP);
- QLabel* tmp_label = new QLabel(tr("Delay"));
- tmp_label->setStatusTip(delaySlider->statusTip());
- statusBar()->addPermanentWidget(tmp_label);
- statusBar()->addPermanentWidget(delaySlider);
- statusBar()->addPermanentWidget(delaySpinBox);
+// delaySlider = new QSlider(Qt::Horizontal);
+// delaySlider->setStatusTip(tr("Sets the delay between iteration steps in ms."));
+// delaySlider->setFixedWidth(100);
+// delaySpinBox = new QDoubleSpinBox();
+// delaySpinBox->setStatusTip(delaySlider->statusTip());
+// delaySpinBox->setMinimum(MIN_DELAY);
+// delaySpinBox->setMaximum(MAX_DELAY);
+// delaySpinBox->setSingleStep(DELAY_STEP);
+// tmp_label->setStatusTip(delaySlider->statusTip());
+// statusBar()->addPermanentWidget(tmp_label);
+// statusBar()->addPermanentWidget(delaySlider);
+// statusBar()->addPermanentWidget(delaySpinBox);
// statusBar()->addPermanentWidget(new QLabel("ms"));
- /// @todo I won't make it in time, so commenting this out
- delaySlider->hide();
- delaySpinBox->hide();
- tmp_label->hide();
- // Interconnect both widgets - change in one will change the other as well
- connect(delaySlider, SIGNAL(valueChanged(int)),
- SLOT(sliderChanged(int))
- );
- connect(delaySpinBox, SIGNAL(valueChanged(double)),
- this, SLOT(spinBoxChanged(double)));
+// // Interconnect both widgets - change in one will change the other as well
+// connect(delaySlider, SIGNAL(valueChanged(int)),
+// SLOT(sliderChanged(int))
+// );
+// connect(delaySpinBox, SIGNAL(valueChanged(double)),
+// this, SLOT(spinBoxChanged(double)));
// Adding iteration counter
// Creating LCD counter
iterationLCD = new QLCDNumber();
iterationLCD->setSegmentStyle(QLCDNumber::Flat);
iterationLCD->setStatusTip(tr("Shows the current iteration number."));
+ QLabel* tmp_label = new QLabel(tr("Delay"));
tmp_label = new QLabel(tr("Iteration"));
tmp_label->setBuddy(iterationLCD);
tmp_label->setStatusTip(iterationLCD->statusTip());
Modified: trunk/qcell/visgui/MainWindow.h
===================================================================
--- trunk/qcell/visgui/MainWindow.h 2007-01-23 21:41:37 UTC (rev 241)
+++ trunk/qcell/visgui/MainWindow.h 2007-01-24 12:38:54 UTC (rev 242)
@@ -16,6 +16,10 @@
#include "ElementalRules.h"
#include "NewWorldWizard.h"
#include "NewNeighbourhoodWizard.h"
+#include <view3dtools.h>
+#include <view2dtexttools.h>
+#include <view1dtexttools.h>
+#include <basetools.h>
#include <QPluginLoader>
#include "GenericParserPlugin.h"
#include <QFileDialog>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|