From: <le...@us...> - 2007-01-26 11:44:29
|
Revision: 260 http://svn.sourceforge.net/qcell/?rev=260&view=rev Author: lessm Date: 2007-01-26 03:44:22 -0800 (Fri, 26 Jan 2007) Log Message: ----------- - Neigborhood view start to work and have some tools working - some cosmetic changes in tool windows Modified Paths: -------------- trunk/qcell/baseheaders/basetools.ui trunk/qcell/baseheaders/neigborhoodtools.h trunk/qcell/baseheaders/neigborhoodtools.ui trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/view1dtexttools.ui trunk/qcell/baseheaders/view2dtexttools.ui trunk/qcell/baseheaders/view3dtools.ui trunk/qcell/basesources/Neighbourhood.cpp trunk/qcell/basesources/neigborhoodtools.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/basetools.ui 2007-01-26 11:44:22 UTC (rev 260) @@ -8,8 +8,8 @@ <rect> <x>0</x> <y>0</y> - <width>148</width> - <height>519</height> + <width>154</width> + <height>421</height> </rect> </property> <property name="windowTitle" > @@ -32,6 +32,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>75</height> + </size> + </property> <property name="title" > <string>View Mode</string> </property> @@ -52,6 +58,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Global</string> </property> @@ -73,6 +85,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Local</string> </property> @@ -94,6 +112,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>75</height> + </size> + </property> <property name="title" > <string>Edit Mode</string> </property> @@ -114,6 +138,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Select</string> </property> @@ -135,6 +165,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Edit</string> </property> @@ -156,6 +192,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>95</height> + </size> + </property> <property name="title" > <string>Edit Tools</string> </property> @@ -176,6 +218,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Copy</string> </property> @@ -191,6 +239,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Paste</string> </property> @@ -206,6 +260,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>110</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Fill</string> </property> Modified: trunk/qcell/baseheaders/neigborhoodtools.h =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.h 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/neigborhoodtools.h 2007-01-26 11:44:22 UTC (rev 260) @@ -8,12 +8,40 @@ { Q_OBJECT +protected: + void setFloating(bool floating); + public: NeigborhoodTools(QWidget *parent = 0); ~NeigborhoodTools(); private: Ui::NeigborhoodToolsClass ui; + + int viewMode; + int mx, my, mz; + int maxNaigbours; + +protected slots: + void ViewChangePerspective(void); + void ViewChangeOrtho(void); + + void xyPress(void); + void zyPress(void); + void xzPress(void); + void EnablePress(void); + void maskValueSet(int value); + void addNeigbor(void); + void delNeigbor(void); + +signals: + void ViewModeUpdated(int mode); + void maskSet(int x, int y, int z); + +public slots: + void setRange(int x, int y, int z); + void setNeigborNumber(int num); + }; #endif // NEIGBORHOODTOOLS_H Modified: trunk/qcell/baseheaders/neigborhoodtools.ui =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.ui 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/neigborhoodtools.ui 2007-01-26 11:44:22 UTC (rev 260) @@ -5,216 +5,278 @@ <rect> <x>0</x> <y>0</y> - <width>139</width> - <height>488</height> + <width>145</width> + <height>469</height> </rect> </property> + <property name="maximumSize" > + <size> + <width>145</width> + <height>16777215</height> + </size> + </property> <property name="windowTitle" > <string>NeigborhoodTools</string> </property> - <widget class="QGroupBox" name="NeigborhoodGroup" > - <property name="geometry" > - <rect> - <x>10</x> - <y>280</y> - <width>120</width> - <height>201</height> - </rect> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> </property> - <property name="title" > - <string>Heigborhood</string> + <property name="spacing" > + <number>6</number> </property> - <widget class="QTableWidget" name="tableWidget" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>101</width> - <height>111</height> - </rect> - </property> - </widget> - <widget class="QToolButton" name="SetNButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>140</y> - <width>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Set Selected</string> - </property> - </widget> - <widget class="QToolButton" name="SetZeroButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>170</y> - <width>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Set Zero Point</string> - </property> - </widget> - </widget> - <widget class="QGroupBox" name="ZPlanegroup" > - <property name="geometry" > - <rect> - <x>10</x> - <y>230</y> - <width>120</width> - <height>51</height> - </rect> - </property> - <property name="title" > - <string>Z Plane</string> - </property> - <widget class="QSpinBox" name="spinBox" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>101</width> - <height>22</height> - </rect> - </property> - <property name="maximum" > - <number>0</number> - </property> - </widget> - </widget> - <widget class="QGroupBox" name="SectionGroup" > - <property name="geometry" > - <rect> - <x>10</x> - <y>80</y> - <width>120</width> - <height>151</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>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Enable</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - <widget class="QToolButton" name="XYButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>60</y> - <width>101</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="XZButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>90</y> - <width>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>XZ</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - </widget> - <widget class="QToolButton" name="ZYButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>120</y> - <width>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>ZY</string> - </property> - <property name="checkable" > - <bool>true</bool> - </property> - </widget> - </widget> - <widget class="QGroupBox" name="Viewgroup" > - <property name="geometry" > - <rect> - <x>9</x> - <y>0</y> - <width>121</width> - <height>80</height> - </rect> - </property> - <property name="title" > - <string>View Mode</string> - </property> - <widget class="QToolButton" name="OrthhoButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>50</y> - <width>101</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Ortho</string> - </property> - </widget> - <widget class="QToolButton" name="PerspectiveButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>101</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> + <item> + <widget class="QGroupBox" name="Viewgroup" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>75</height> + </size> + </property> + <property name="title" > + <string>View Mode</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="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </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="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </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="maximumSize" > + <size> + <width>16777215</width> + <height>135</height> + </size> + </property> + <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="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </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="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </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="xzButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>XZ</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="zyButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>ZY</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="maskValue" > + <property name="minimumSize" > + <size> + <width>80</width> + <height>20</height> + </size> + </property> + <property name="maximum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="NeigborhoodGroup" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>190</height> + </size> + </property> + <property name="title" > + <string>Neigborhood</string> + </property> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QTableWidget" name="neigborTable" > + <property name="columnCount" > + <number>1</number> + </property> + <column/> + </widget> + </item> + <item> + <widget class="QToolButton" name="ClearSelectedButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Clear selected</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SetNButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Set selected</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="SetZeroButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Set zero point</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="AddNeigborButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Add neigbor</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="DelNeigborButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Del neigbor</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-26 11:44:22 UTC (rev 260) @@ -44,6 +44,8 @@ void set2DTextToolsVisible(bool visible); void set1DTextToolsVisible(bool visible); + + void setNToolsVisible(bool visible); private: Ui::simulationWindowClass ui; @@ -161,6 +163,11 @@ void setSelectedCell(QVector<int> coord); void setSelectedFunctionRule(int index); + +public slots: + void NViewModeChange(int mode); + void NViewMaskSet(int maskx, int masky, int maskz); + }; #endif // SIMULATIONWINDOW_H Modified: trunk/qcell/baseheaders/view1dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-26 11:44:22 UTC (rev 260) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>119</width> - <height>224</height> + <width>144</width> + <height>177</height> </rect> </property> <property name="windowTitle" > @@ -21,6 +21,12 @@ </property> <item> <widget class="QGroupBox" name="groupBox" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>95</height> + </size> + </property> <property name="title" > <string>View 1D Text</string> </property> @@ -41,6 +47,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Colors</string> </property> @@ -59,6 +71,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Values</string> </property> @@ -80,6 +98,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Symbols</string> </property> @@ -93,6 +117,12 @@ </item> <item> <widget class="QGroupBox" name="groupBox_2" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>60</height> + </size> + </property> <property name="title" > <string>Memory</string> </property> @@ -113,6 +143,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Clear</string> </property> Modified: trunk/qcell/baseheaders/view2dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-26 11:44:22 UTC (rev 260) @@ -5,10 +5,16 @@ <rect> <x>0</x> <y>0</y> - <width>119</width> - <height>222</height> + <width>144</width> + <height>175</height> </rect> </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>175</height> + </size> + </property> <property name="windowTitle" > <string>View2DTextTools</string> </property> @@ -21,6 +27,12 @@ </property> <item> <widget class="QGroupBox" name="View2DGroup" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>95</height> + </size> + </property> <property name="title" > <string>View 2D Text</string> </property> @@ -41,6 +53,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Colors</string> </property> @@ -59,6 +77,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Values</string> </property> @@ -80,6 +104,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Symbols</string> </property> @@ -93,6 +123,12 @@ </item> <item> <widget class="QGroupBox" name="ZPlaneGroup" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>60</height> + </size> + </property> <property name="title" > <string>Z Plane</string> </property> Modified: trunk/qcell/baseheaders/view3dtools.ui =================================================================== --- trunk/qcell/baseheaders/view3dtools.ui 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/baseheaders/view3dtools.ui 2007-01-26 11:44:22 UTC (rev 260) @@ -5,10 +5,16 @@ <rect> <x>0</x> <y>0</y> - <width>136</width> - <height>321</height> + <width>144</width> + <height>250</height> </rect> </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>250</height> + </size> + </property> <property name="windowTitle" > <string>View3DTools</string> </property> @@ -21,6 +27,12 @@ </property> <item> <widget class="QGroupBox" name="ViewsTools" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>75</height> + </size> + </property> <property name="title" > <string>View 3D</string> </property> @@ -41,6 +53,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Perspective</string> </property> @@ -62,6 +80,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Ortho</string> </property> @@ -75,6 +99,12 @@ </item> <item> <widget class="QGroupBox" name="SectionGroup" > + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>150</height> + </size> + </property> <property name="title" > <string>Section</string> </property> @@ -95,6 +125,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>Enable</string> </property> @@ -113,6 +149,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>xy</string> </property> @@ -134,6 +176,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>zy</string> </property> @@ -152,6 +200,12 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> <property name="text" > <string>xz</string> </property> Modified: trunk/qcell/basesources/Neighbourhood.cpp =================================================================== --- trunk/qcell/basesources/Neighbourhood.cpp 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/basesources/Neighbourhood.cpp 2007-01-26 11:44:22 UTC (rev 260) @@ -494,6 +494,24 @@ QVector<NContainer> ng = getNeighbours(); + if(minv[0]>0) + minv[0]=0; + + if(minv[1]>0) + minv[1]=0; + + if(minv[2]>0) + minv[2]=0; + + if(maxv[0]<0) + maxv[0]=0; + + if(maxv[1]<0) + maxv[1]=0; + + if(maxv[2]<0) + maxv[2]=0; + int sx = maxv[0] - minv[0], sy = maxv[1] - minv[1], sz = maxv[2] - minv[2]; //if(minv[0]<0) sx++; Modified: trunk/qcell/basesources/neigborhoodtools.cpp =================================================================== --- trunk/qcell/basesources/neigborhoodtools.cpp 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/basesources/neigborhoodtools.cpp 2007-01-26 11:44:22 UTC (rev 260) @@ -4,9 +4,171 @@ : QWidget(parent) { ui.setupUi(this); + + viewMode = 0; + + connect(ui.PerspectiveButton, SIGNAL(clicked(bool)), SLOT(ViewChangePerspective())); + connect(ui.OrthoButton, SIGNAL(clicked(bool)), SLOT(ViewChangeOrtho())); + + connect(ui.xyButton, SIGNAL(clicked(bool)), SLOT(xyPress())); + connect(ui.zyButton, SIGNAL(clicked(bool)), SLOT(zyPress())); + connect(ui.xzButton, SIGNAL(clicked(bool)), SLOT(xzPress())); + + connect(ui.EnableButton, SIGNAL(clicked(bool)), SLOT(EnablePress())); + + connect(ui.maskValue, SIGNAL(valueChanged(int)), SLOT(maskValueSet(int))); + + connect(ui.AddNeigborButton, SIGNAL(clicked(bool)), SLOT(addNeigbor(void))); + connect(ui.DelNeigborButton, SIGNAL(clicked(bool)), SLOT(delNeigbor(void))); + mx = my = mz = 0; + + ui.neigborTable->setColumnWidth(0, 35); } NeigborhoodTools::~NeigborhoodTools() { } + +void NeigborhoodTools::setRange(int x, int y, int z) +{ + mx = x; + my = y; + mz = z; + + maxNaigbours = mx * (my>0 ? my : 1) * (mz>0 ? mz : 1); + + if(mz==0 || my==0) + { + ui.SectionGroup->setDisabled(1); + return; + } + else + ui.SectionGroup->setDisabled(0); + + if(ui.xyButton->isChecked()) + { + ui.maskValue->setMaximum(mz); + } + + if(ui.zyButton->isChecked()) + { + ui.maskValue->setMaximum(mx); + } + + if(ui.xzButton->isChecked()) + { + ui.maskValue->setMaximum(my); + } + + maskValueSet(ui.maskValue->value()); +} + +void NeigborhoodTools::ViewChangePerspective(void) +{ + ui.PerspectiveButton->setChecked(1); + ui.OrthoButton->setChecked(0); + if(viewMode!=0) + { + viewMode = 0; + emit ViewModeUpdated(0); + } +} + +void NeigborhoodTools::ViewChangeOrtho(void) +{ + ui.PerspectiveButton->setChecked(0); + ui.OrthoButton->setChecked(1); + if(viewMode!=1) + { + viewMode = 1; + emit ViewModeUpdated(1); + } +} + +void NeigborhoodTools::xyPress(void) +{ + ui.xyButton->setChecked(1); + ui.zyButton->setChecked(0); + ui.xzButton->setChecked(0); + ui.maskValue->setMaximum(mz-1); + maskValueSet(ui.maskValue->value()); +} + +void NeigborhoodTools::zyPress(void) +{ + ui.xyButton->setChecked(0); + ui.zyButton->setChecked(1); + ui.xzButton->setChecked(0); + ui.maskValue->setMaximum(mx-1); + maskValueSet(ui.maskValue->value()); +} + +void NeigborhoodTools::xzPress(void) +{ + ui.xyButton->setChecked(0); + ui.zyButton->setChecked(0); + ui.xzButton->setChecked(1); + ui.maskValue->setMaximum(my-1); + maskValueSet(ui.maskValue->value()); +} + +void NeigborhoodTools::EnablePress(void) +{ + if(ui.EnableButton->isChecked()) + { + maskValueSet(ui.maskValue->value()); + } + else + { + emit maskSet(-1, -1, -1); + } +} + +void NeigborhoodTools::maskValueSet(int value) +{ + if(ui.EnableButton->isChecked()) + { + if(ui.xyButton->isChecked()) + { + emit maskSet(-1, -1, value); + } + + if(ui.zyButton->isChecked()) + { + emit maskSet(value, -1, -1); + } + + if(ui.xzButton->isChecked()) + { + emit maskSet(-1, value, -1); + } + } +} + +void NeigborhoodTools::setFloating(bool floating) +{ + qDebug("Tutaj!"); + this->adjustSize(); +} + +void NeigborhoodTools::setNeigborNumber(int num) +{ + ui.neigborTable->setRowCount(num); +} + +void NeigborhoodTools::addNeigbor(void) +{ + if(ui.neigborTable->rowCount()<maxNaigbours) + { + ui.neigborTable->setRowCount(ui.neigborTable->rowCount()+1); + } +} + +void NeigborhoodTools::delNeigbor(void) +{ + if(ui.neigborTable->rowCount()>1) + { + ui.neigborTable->setRowCount(ui.neigborTable->rowCount()-1); + } +} \ No newline at end of file Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-26 11:44:22 UTC (rev 260) @@ -1481,6 +1481,9 @@ emit set1DTextToolsVisible(false); break; } + case 6: + emit setNToolsVisible(false); + break; } switch (index) @@ -1537,8 +1540,32 @@ } break; } + + case 6: + emit setNToolsVisible(true); + break; } last_tab_index = index; } + +void simulationWindow::NViewModeChange(int mode) +{ + if(mode==0) + { + getNeighbourhoodEditor()->setRealPerspective(0); + nRrenderer->repaint(); + } + else + { + getNeighbourhoodEditor()->setOrtoPerspective(0); + nRrenderer->repaint(); + } +} + +void simulationWindow::NViewMaskSet(int maskx, int masky, int maskz) +{ + nRrenderer->maskSet(maskx, masky, maskz); + nRrenderer->repaint(); +} \ No newline at end of file Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-26 11:44:22 UTC (rev 260) @@ -136,6 +136,31 @@ dock1D, SLOT(setVisible(bool)) ); + +// add Neigborhood Tools + dockNtools = new BetterDockWidget(this); + dockNtools->hide(); + //dockNtools->setDisabled(true); + NeigborhoodTools * neigborhoodTools = new NeigborhoodTools(this); + dockNtools->setWindowTitle(tr("Neigborhood Tools")); + dockNtools->setWidget(neigborhoodTools); + + ((QVBoxLayout*)dockNtools->layout())->addStretch(); + dockNtools->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + tabifyDockWidget(baseDock, dockNtools); + + QAction* vnt_action = dockNtools->toggleViewAction(); + vnt_action->setText(tr("&Neigborhood Tools")); + menu_View->addAction(vnt_action); + + connect(sw, SIGNAL(setNToolsVisible(bool)), + dockNtools, SLOT(setVisible(bool)) + ); + + connect(neigborhoodTools, SIGNAL(ViewModeUpdated(int)), sw, SLOT(NViewModeChange(int))); + connect(this, SIGNAL(neigborhoodSet(int, int, int)), neigborhoodTools, SLOT(setRange(int, int, int))); + connect(neigborhoodTools, SIGNAL(maskSet(int, int, int)), sw, SLOT(NViewMaskSet(int, int, int))); + connect(this, SIGNAL(neigborCount(int)), neigborhoodTools, SLOT(setNeigborNumber(int))); // Adding delay setup // An interlinked pair of QDoubleSpinBox and a QSlider // delaySlider = new QSlider(Qt::Horizontal); @@ -1231,10 +1256,21 @@ *sw->getNeighbourhoodEditor()->getStorage() = *((CalculationData*)&neighbourhood->toCalculationData()); sw->getNeighbourhoodEditor()->setTranslation(0.0f, 0.0f, -10.0f); sw->getNeighbourhoodEditor()->setSymbolColor(1, QColor(128, 128, 128)); - nStartPos = neighbourhood->getMinNeighbourhoodValues(); - sw->getNeighbourhoodEditor()->setObserverPosition(-nStartPos[0], -nStartPos[1], -nStartPos[2]); - sw->getNeighbourhoodEditor()->showObserver(1); - //*************************************************** + nStartPos = neighbourhood->getMinNeighbourhoodValues(); + if(nStartPos[0]>0) + nStartPos[0] = 0; + + if(nStartPos[1]>0) + nStartPos[1] = 0; + + if(nStartPos[2]>0) + nStartPos[2] = 0; + + sw->getNeighbourhoodEditor()->setObserverPosition(-nStartPos[0], -nStartPos[1], -nStartPos[2]); + sw->getNeighbourhoodEditor()->showObserver(1); + emit neigborhoodSet(sw->getNeighbourhoodEditor()->getStorage()->getSizeX(), sw->getNeighbourhoodEditor()->getStorage()->getSizeY(), sw->getNeighbourhoodEditor()->getStorage()->getSizeZ()); + emit neigborCount(neighbourhood->getNeighbourNumber()); + //*************************************************** } void MainWindow::setupLocalFunction() Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-01-25 20:04:10 UTC (rev 259) +++ trunk/qcell/visgui/MainWindow.h 2007-01-26 11:44:22 UTC (rev 260) @@ -32,6 +32,7 @@ #include <Renderer.h> #include <simulationwindow.h> #include <Calculator.h> +#include <neigborhoodtools.h> #define MIN_DELAY 0.0 #define MAX_DELAY 5.0 @@ -114,6 +115,7 @@ BetterDockWidget* dock3D; BetterDockWidget* dock2D; BetterDockWidget* dock1D; + BetterDockWidget* dockNtools; BetterDockWidget* baseDock; QList<CalculationData*> data; LocalFunction* local_function; @@ -138,6 +140,9 @@ */ void deserialize(QByteArray content); +signals: + void neigborhoodSet(int sizex, int sizey, int sizez); + void neigborCount(int count); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |