From: <le...@us...> - 2007-01-24 15:52:35
|
Revision: 249 http://svn.sourceforge.net/qcell/?rev=249&view=rev Author: lessm Date: 2007-01-24 07:52:32 -0800 (Wed, 24 Jan 2007) Log Message: ----------- - Neighbourhood tab show window properly Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/Renderer.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-24 15:35:25 UTC (rev 248) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-24 15:52:32 UTC (rev 249) @@ -36,7 +36,7 @@ <enum>QTabWidget::Rounded</enum> </property> <property name="currentIndex" > - <number>6</number> + <number>4</number> </property> <widget class="QWidget" name="view3D" > <attribute name="title" > Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-24 15:35:25 UTC (rev 248) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-24 15:52:32 UTC (rev 249) @@ -263,6 +263,7 @@ primitives<<generateBox(); generateObserver(); + renderText(0.0f , 0.0f, 0.0f, "init"); } void Renderer::paintGL() @@ -811,10 +812,9 @@ } if(showValues) { + counter = 0; glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); - QFont font("Curier New"); - font.setStyleHint(QFont::AnyStyle, QFont::PreferBitmap); for(int z=0;z<sz;++z) { @@ -822,7 +822,12 @@ { for(int x=0;x<sx;++x) { - renderText(mx + (float)x * 2.0f , my + (float)y * 2.0f, mz + (float)z * 2.0f, tr("%1").arg(storage.getValueAt_i(x, y-1, z)), font); + if(selectetObjects.contains(counter)) + glColor3f(1.0f, 0.0f, 0.0f); + else + glColor3f(1.0f, 1.0f, 1.0f); + renderText(mx + (float)x * 2.0f , my + (float)y * 2.0f, mz + (float)z * 2.0f, tr("%1").arg(storage.getValueAt_i(x, y-1, z))); + counter++; } } } Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-24 15:35:25 UTC (rev 248) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-24 15:52:32 UTC (rev 249) @@ -438,7 +438,7 @@ } //*************************************************** -// *sw->getNeighbourhoodEditor()->getStorage() = neighbourhood->toCalculationData(); + *sw->getNeighbourhoodEditor()->getStorage() = neighbourhood->toCalculationData(); sw->getNeighbourhoodEditor()->setTranslation(0.0f, 0.0f, -10.0f); sw->getNeighbourhoodEditor()->setSymbolColor(1, QColor(128, 128, 128)); //*************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-24 16:24:46
|
Revision: 250 http://svn.sourceforge.net/qcell/?rev=250&view=rev Author: lessm Date: 2007-01-24 08:23:56 -0800 (Wed, 24 Jan 2007) Log Message: ----------- - Neighbourhood tab updated Modified Paths: -------------- trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/NewWorldDialog.ui Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-24 15:52:32 UTC (rev 249) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-24 16:23:56 UTC (rev 250) @@ -826,7 +826,10 @@ glColor3f(1.0f, 0.0f, 0.0f); else glColor3f(1.0f, 1.0f, 1.0f); - renderText(mx + (float)x * 2.0f , my + (float)y * 2.0f, mz + (float)z * 2.0f, tr("%1").arg(storage.getValueAt_i(x, y-1, z))); + if(storage.getValueAt_i(counter)>0) + { + renderText(mx + (float)x * 2.0f , my + (float)y * 2.0f, mz + (float)z * 2.0f, tr("%1").arg(storage.getValueAt_i(counter))); + } counter++; } } Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-24 15:52:32 UTC (rev 249) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-24 16:23:56 UTC (rev 250) @@ -640,6 +640,7 @@ symbolTable->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Color"))); symbolTable->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Model"))); symbolTable->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Hide Flag"))); + updateSymbolTable(); ui.view2D->setLayout(new QVBoxLayout(ui.view2D)); table2D = new QTableWidget(ui.view2D); Modified: trunk/qcell/visgui/NewWorldDialog.ui =================================================================== --- trunk/qcell/visgui/NewWorldDialog.ui 2007-01-24 15:52:32 UTC (rev 249) +++ trunk/qcell/visgui/NewWorldDialog.ui 2007-01-24 16:23:56 UTC (rev 250) @@ -93,6 +93,9 @@ <property name="enabled" > <bool>false</bool> </property> + <property name="minimum" > + <number>1</number> + </property> </widget> </item> <item row="1" column="1" > @@ -100,6 +103,9 @@ <property name="enabled" > <bool>false</bool> </property> + <property name="minimum" > + <number>1</number> + </property> </widget> </item> <item row="0" column="1" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-24 20:54:52
|
Revision: 253 http://svn.sourceforge.net/qcell/?rev=253&view=rev Author: lessm Date: 2007-01-24 12:54:46 -0800 (Wed, 24 Jan 2007) Log Message: ----------- - LocalFunction save bug resolved Modified Paths: -------------- trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-01-24 18:34:40 UTC (rev 252) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-01-24 20:54:46 UTC (rev 253) @@ -35,14 +35,18 @@ if(functionMode==LocalFunction::SCRIPT) return -1; - temp.resize(maxArgVal); + temp.resize(maxArgVal+1); for(i=0;i<numElements;++i) { - remapValue = valueTable[i]; - if(remapValue>=maxArgVal) - remapValue = maxArgVal - 1; + remapValue = valueTable[i] + 1; + if(remapValue>=maxArgVal + 1) + remapValue = maxArgVal; + + if(remapValue<0) + remapValue = 0; + if(temp[remapValue]>numElements/2) - return remapValue; + return remapValue - 1; else temp[remapValue]++; } @@ -55,7 +59,7 @@ if(t<temp[i]) { t = temp[i]; - out = i; + out = i - 1; } } return out; @@ -151,15 +155,23 @@ { int count=0; int mod; - QVector<int> output; + QVector<int> output, trueOutput; count = sumArguments.size() + freeArguments.size(); output.resize(count); + trueOutput.resize(count); count--; + //count = 0; for(int i=0;i<freeArguments.size();++i) + { + trueOutput[sumArguments.size() + i] = count; output[count--] = getAlphabetSize(); + } for(int i=0;i<sumArguments.size();++i) + { + trueOutput[i] = count; output[count--] = sumArguments[i].size() * getAlphabetSize(); + } for(int i=sumArguments.size() + freeArguments.size() - 1;i>=0;--i) { @@ -182,7 +194,14 @@ output[i] = 0; } } - return output; + + // back to front order + + for(int i=0;i<trueOutput.size();++i) + trueOutput[i] = output[trueOutput[i]]; + //return output; + + return trueOutput; } QString LocalFunction::valueFormTableToString(int index) @@ -455,8 +474,8 @@ { if(valueTable.empty()) resizeValueTable(); - if(val < 0) - val = 0; + if(val < -1) + val = -1; if(val > maxArgVal - 1) val = maxArgVal - 1; Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-24 18:34:40 UTC (rev 252) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-24 20:54:46 UTC (rev 253) @@ -1097,6 +1097,7 @@ qDebug(tr("Error parsing Neighbourhood element") .toAscii() ); + return; } root->removeChild(root->firstChild()); @@ -1225,7 +1226,7 @@ // Setup Neighbourhood editor //*************************************************** - // *sw->getNeighbourhoodEditor()->getStorage() = neighbourhood->toCalculationData(); + *(sw->getNeighbourhoodEditor()->getStorage()) = neighbourhood->toCalculationData(); sw->getNeighbourhoodEditor()->setTranslation(0.0f, 0.0f, -10.0f); sw->getNeighbourhoodEditor()->setSymbolColor(1, QColor(128, 128, 128)); //*************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-24 23:33:23
|
Revision: 254 http://svn.sourceforge.net/qcell/?rev=254&view=rev Author: lessm Date: 2007-01-24 15:33:20 -0800 (Wed, 24 Jan 2007) Log Message: ----------- - Neighbourhood Window updated - some problems with LocalFunction and Neighbourhood resolved Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/baseheaders/basetools.ui trunk/qcell/basesources/Neighbourhood.cpp trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/basetools.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-24 23:33:20 UTC (rev 254) @@ -73,6 +73,7 @@ QVector<int> maskValue; bool showValues; + QString textureName; protected: void initializeGL(); @@ -148,6 +149,7 @@ void maskSet(int x, int y, int z); void showCellValues(bool show = 1); + void setTextureName(QString name); protected slots: void resizeDataEvent(void); Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/baseheaders/basetools.ui 2007-01-24 23:33:20 UTC (rev 254) @@ -256,16 +256,14 @@ <height>110</height> </size> </property> + <property name="rowCount" > + <number>1</number> + </property> <row> <property name="text" > <string>1</string> </property> </row> - <row> - <property name="text" > - <string>2</string> - </property> - </row> <column> <property name="text" > <string>Value</string> Modified: trunk/qcell/basesources/Neighbourhood.cpp =================================================================== --- trunk/qcell/basesources/Neighbourhood.cpp 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/basesources/Neighbourhood.cpp 2007-01-24 23:33:20 UTC (rev 254) @@ -495,11 +495,11 @@ QVector<NContainer> ng = getNeighbours(); int sx = maxv[0] - minv[0], sy = maxv[1] - minv[1], sz = maxv[2] - minv[2]; - if(minv[0]<0) + //if(minv[0]<0) sx++; - if(minv[1]<0) + //if(minv[1]<0) sy++; - if(minv[2]<0) + //if(minv[2]<0) sz++; switch(getDimension()) Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-24 23:33:20 UTC (rev 254) @@ -158,7 +158,7 @@ void Renderer::generateObserver(void) { glEnable(GL_TEXTURE_2D); - observerTexture = bindTexture(QPixmap(QString("./observer.png")), GL_TEXTURE_2D); + observerTexture = bindTexture(QPixmap(textureName), GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); @@ -795,11 +795,12 @@ { glPushMatrix(); - glTranslatef(mx + (float)localObserverCoords[0] * 2.0f , my + (storage.getSizeY() - (float)localObserverCoords[1]) * 2.0f, mz + (float)localObserverCoords[2] * 2.0f); + glTranslatef(mx + (float)localObserverCoords[0] * 2.0f , my + (sy - (float)localObserverCoords[1]) * 2.0f, mz + (float)localObserverCoords[2] * 2.0f); glRotatef(rotation[2], 0.0f, 0.0f, -1.0f); glRotatef(rotation[1], 0.0f, -1.0f, 0.0f); glRotatef(rotation[0], -1.0f, 0.0f, 0.0f); + glDisable(GL_DEPTH_TEST); glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); glDisable(GL_LIGHTING); @@ -808,6 +809,7 @@ glDisable(GL_TEXTURE_2D); glEnable(GL_LIGHTING); glDisable(GL_BLEND); + glEnable(GL_DEPTH_TEST); glPopMatrix(); } if(showValues) @@ -1032,6 +1034,11 @@ showValues = show; } +void Renderer::setTextureName(QString name) +{ + textureName = name; +} + void Renderer::setOrtoPerspective(bool noClear) { float aspect = (float)width()/(float)height(); Modified: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/basesources/basetools.cpp 2007-01-24 23:33:20 UTC (rev 254) @@ -20,6 +20,10 @@ connect(ui.LocalViewButton, SIGNAL(clicked(bool)), SLOT(modeChangeLocalView())); connect(ui.valueTable, SIGNAL(cellClicked(int, int)), SLOT(updateSelectedSymbol(int, int))); + + ui.valueTable->setRowCount(2); + ui.valueTable->setItem(0, 0, new QTableWidgetItem("0")); + ui.valueTable->setItem(1, 0, new QTableWidgetItem("1")); } BaseTools::~BaseTools() Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-24 23:33:20 UTC (rev 254) @@ -499,16 +499,18 @@ { QTableWidgetItem *item, *memItem; table1DMem->blockSignals(1); - table1DMem->setRowCount(table1DMem->rowCount()+1); + table1DMem->insertRow(0); for(int x=0;x<renderer->getStorage()->getSizeX();++x) { item = table1D->item(0, x); memItem = new QTableWidgetItem(*item); - table1DMem->setItem(table1DMem->rowCount() - 1, x, memItem); + table1DMem->setItem(0, x, memItem); } + table1DMem->blockSignals(0); if(table1DMem->rowCount()>30) - table1DMem->removeRow(0); - table1DMem->blockSignals(0); + { + table1DMem->removeRow(table1DMem->rowCount()-1); + } } void simulationWindow::updateSymbolTable(void) @@ -610,6 +612,7 @@ ui.view3D->setLayout(new QVBoxLayout(ui.view3D)); renderer = new Renderer(ui.view3D); + renderer->setTextureName("./observer.png"); ui.view3D->layout()->addWidget(renderer); // renderer->resize(ui.view3D->width(), ui.view3D->height()); @@ -725,8 +728,10 @@ ui.NeighbourhoodTab->setLayout(new QVBoxLayout(ui.NeighbourhoodTab)); nRrenderer = new Renderer(ui.NeighbourhoodTab); + nRrenderer->setTextureName("./zeropoint.png"); ui.NeighbourhoodTab->layout()->addWidget(nRrenderer); nRrenderer->showCellValues(); + nRrenderer->showSymbol(0); } simulationWindow::~simulationWindow() Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-24 20:54:46 UTC (rev 253) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-24 23:33:20 UTC (rev 254) @@ -1217,6 +1217,7 @@ void MainWindow::setupNeighbourhood() { + QVector<int> nStartPos; // Pass Neighbourhood to Calculator calc.setNeighbourhood(neighbourhood); @@ -1229,6 +1230,9 @@ *(sw->getNeighbourhoodEditor()->getStorage()) = 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); //*************************************************** } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-25 08:56:54
|
Revision: 255 http://svn.sourceforge.net/qcell/?rev=255&view=rev Author: lessm Date: 2007-01-25 00:56:53 -0800 (Thu, 25 Jan 2007) Log Message: ----------- - Neighbourhood tools added Modified Paths: -------------- trunk/qcell/visgui/visgui.pro Added Paths: ----------- trunk/qcell/baseheaders/neigborhoodtools.h trunk/qcell/baseheaders/neigborhoodtools.ui trunk/qcell/basesources/neigborhoodtools.cpp Added: trunk/qcell/baseheaders/neigborhoodtools.h =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.h (rev 0) +++ trunk/qcell/baseheaders/neigborhoodtools.h 2007-01-25 08:56:53 UTC (rev 255) @@ -0,0 +1,19 @@ +#ifndef NEIGBORHOODTOOLS_H +#define NEIGBORHOODTOOLS_H + +#include <QWidget> +#include "ui_neigborhoodtools.h" + +class NeigborhoodTools : public QWidget +{ + Q_OBJECT + +public: + NeigborhoodTools(QWidget *parent = 0); + ~NeigborhoodTools(); + +private: + Ui::NeigborhoodToolsClass ui; +}; + +#endif // NEIGBORHOODTOOLS_H Added: trunk/qcell/baseheaders/neigborhoodtools.ui =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.ui (rev 0) +++ trunk/qcell/baseheaders/neigborhoodtools.ui 2007-01-25 08:56:53 UTC (rev 255) @@ -0,0 +1,222 @@ +<ui version="4.0" > + <class>NeigborhoodToolsClass</class> + <widget class="QWidget" name="NeigborhoodToolsClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>139</width> + <height>488</height> + </rect> + </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> + </property> + <property name="title" > + <string>Heigborhood</string> + </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> + </widget> + <layoutdefault spacing="6" margin="11" /> + <resources/> + <connections/> +</ui> Added: trunk/qcell/basesources/neigborhoodtools.cpp =================================================================== --- trunk/qcell/basesources/neigborhoodtools.cpp (rev 0) +++ trunk/qcell/basesources/neigborhoodtools.cpp 2007-01-25 08:56:53 UTC (rev 255) @@ -0,0 +1,12 @@ +#include "../baseheaders/neigborhoodtools.h" + +NeigborhoodTools::NeigborhoodTools(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); +} + +NeigborhoodTools::~NeigborhoodTools() +{ + +} Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-01-24 23:33:20 UTC (rev 254) +++ trunk/qcell/visgui/visgui.pro 2007-01-25 08:56:53 UTC (rev 255) @@ -17,7 +17,8 @@ ../baseheaders/view3dtools.ui \ ../baseheaders/view2dtexttools.ui \ ../baseheaders/view1dtexttools.ui \ - ../baseheaders/functiontable.ui + ../baseheaders/functiontable.ui \ + ../baseheaders/neigborhoodtools.ui HEADERS = MainWindow.h \ ExperimentSetup.h \ @@ -42,7 +43,8 @@ ../baseheaders/view2dtexttools.h \ ../baseheaders/view1dtexttools.h \ ../baseheaders/ElementalRules.h \ - ../baseheaders/functiontable.h + ../baseheaders/functiontable.h \ + ../baseheaders/neigborhoodtools.h SOURCES = ../basesources/GenericParserPlugin.cpp \ main.cpp \ @@ -66,7 +68,8 @@ ../basesources/view2dtexttools.cpp \ ../basesources/view1dtexttools.cpp \ ../basesources/ElementalRules.cpp \ - ../basesources/functiontable.cpp + ../basesources/functiontable.cpp \ + ../basesources/neigborhoodtools.cpp LIBS = -L../libs -lN -lFQT -lKI -lREAK -lLTFL -lZIFW -lZIFWP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-25 16:36:48
|
Revision: 258 http://svn.sourceforge.net/qcell/?rev=258&view=rev Author: dhubleizh Date: 2007-01-25 08:27:30 -0800 (Thu, 25 Jan 2007) Log Message: ----------- - table height size fixed now - nasty hack - I'm proud of it :> Modified Paths: -------------- trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-25 15:52:38 UTC (rev 257) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-25 16:27:30 UTC (rev 258) @@ -614,6 +614,7 @@ renderer = new Renderer(ui.view3D); renderer->setTextureName("./observer.png"); ui.view3D->layout()->addWidget(renderer); + // Not needed anymore // renderer->resize(ui.view3D->width(), ui.view3D->height()); ui.view2DGraph->setLayout(new QVBoxLayout(ui.view2DGraph)); @@ -631,6 +632,13 @@ table1D = new QTableWidget(ui.view1D); ui.view1D->layout()->addWidget(table1D); table1D->setRowCount(1); + // A little hack to determine the height of one line (it could change + // with the font size) and make the table not grow beyond that! + // Nasty - I know ]:-> + QTableWidgetItem height_determiner("fooBAR"); + table1D->setItem(0, 0, &height_determiner); + table1D->setMaximumHeight((2*table1D->rowHeight(0))+ 20); + table1D->clear(); table1DMem = new QTableWidget(ui.view1D); ui.view1D->layout()->addWidget(table1DMem); Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-25 15:52:38 UTC (rev 257) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-25 16:27:30 UTC (rev 258) @@ -1231,9 +1231,9 @@ *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(); + sw->getNeighbourhoodEditor()->setObserverPosition(-nStartPos[0], -nStartPos[1], -nStartPos[2]); + sw->getNeighbourhoodEditor()->showObserver(1); //*************************************************** } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-25 20:04:12
|
Revision: 259 http://svn.sourceforge.net/qcell/?rev=259&view=rev Author: dhubleizh Date: 2007-01-25 12:04:10 -0800 (Thu, 25 Jan 2007) Log Message: ----------- - proper REAK file parsing - now passing data to LocalFunction - fix bug in LocalFunction Modified Paths: -------------- trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/parsers/REAK/REAKParserPlugin.cpp trunk/qcell/parsers/REAK/REAKParserPlugin.h Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-01-25 16:27:30 UTC (rev 258) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-01-25 20:04:10 UTC (rev 259) @@ -516,7 +516,10 @@ switch(functionMode) { case LocalFunction::SWITCH: - valueTable[calculateSwitchIndex(args)]; + /// @todo I've changed this from line: + /// valueTable[calculateSwitchIndex()]; + /// Does the above line do anything? + valueTable[calculateSwitchIndex(args)] = value; break; default: Modified: trunk/qcell/parsers/REAK/REAKParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-01-25 16:27:30 UTC (rev 258) +++ trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-01-25 20:04:10 UTC (rev 259) @@ -20,7 +20,7 @@ // Used to double check the format of a line in file QRegExp format; // Stores function values of given neighbourhood - QMap<QVector<int>, int> function; + QMultiHash<int, QVector<int> > function; // To be able to print the line in which some error occured int line_nr = 1; // To be able to identify which argument went wrong @@ -52,17 +52,20 @@ if(format.exactMatch(result[0])) { splitted = result[0].section('K',1); - dimensions = splitted.toInt(); - - // dimensions sanity check - if ((dimensions < 1) || (dimensions > 3)) + if(result[0].size() > 4) { - qDebug(tr("You should specify dimensions number from 1-3 in line %1") - .arg(line_nr) - .toAscii() - ); + dimensions = splitted.toInt(); - return QString(); + // dimensions sanity check + if ((dimensions < 1) || (dimensions > 3)) + { + qDebug(tr("You should specify dimensions number from 1-3 in line %1") + .arg(line_nr) + .toAscii() + ); + + return QString(); + } } result.removeFirst(); @@ -118,6 +121,7 @@ QVector<int> tmp_arguments; foreach(QString line, result) { + line = line.trimmed(); x = 0; if(!format.exactMatch(line)) @@ -132,7 +136,7 @@ } // Breaking into arguments and return value - splitted_list = result[0].split(' '); + splitted_list = line.split(' '); // Return value parsing tmp_result = splitted_list.last()[0].toAscii(); @@ -157,7 +161,7 @@ } // Adding to a map is so much cool, as we can get the values sorted - // instatly + // instantly tmp_arguments.clear(); foreach(QChar sign, splitted_list.first()) { @@ -206,19 +210,42 @@ x++; } +// if (function.values().contains(tmp_arguments)) +// { +// qDebug(tr("Error adding new Elemental Rule in line %1. The rule added earlier.") +// .arg(line_nr) +// .toAscii() +// ); +// return QString(); +// } + function.insert(tmp_result, tmp_arguments); + // Tracking line number line_nr++; } /// @todo input the retrieved data into LF + // Init the function + lf.init(arguments, alphabet_size, alphabet_size); + lf.setFunctonType(LocalFunction::SWITCH); +// lf.setSumArguments(QVector<int>(1,0)); -// return lf.toXmlString(); - return QString(); + // Finally pass the function to the engine + QHashIterator<int, QVector<int> > i(function); + while (i.hasNext()) + { + i.next(); + lf.setFunctionValue(i.key(), i.value()); + qDebug() << i.key() << " : " << i.value(); + } + + qDebug(lf.toXmlString().toAscii()); + return lf.toXmlString(); } QByteArray REAKParserPlugin::parseOut(QString content, const QString type, const QString subtype) { - /// @todo Write paring out of REAK - this WILL be hard + /// @todo Write parsing out of REAK - this WILL be hard // // The resulting array to write to file by the end backend // QByteArray result; // // Generic class for parsing out XMLString Modified: trunk/qcell/parsers/REAK/REAKParserPlugin.h =================================================================== --- trunk/qcell/parsers/REAK/REAKParserPlugin.h 2007-01-25 16:27:30 UTC (rev 258) +++ trunk/qcell/parsers/REAK/REAKParserPlugin.h 2007-01-25 20:04:10 UTC (rev 259) @@ -11,6 +11,7 @@ #include <QVector> #include <QMap> +#include <QMultiHash> #include "GenericParserPlugin.h" #include "LocalFunction.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <dhu...@us...> - 2007-02-03 11:24:51
|
Revision: 280 http://svn.sourceforge.net/qcell/?rev=280&view=rev Author: dhubleizh Date: 2007-02-03 03:24:48 -0800 (Sat, 03 Feb 2007) Log Message: ----------- - commented out deprecated pointers to dock boxes Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/doc/licenciate_thesis/CMakeLists.txt trunk/qcell/doc/licenciate_thesis/acronyms.gdf trunk/qcell/doc/licenciate_thesis/thesis.bib trunk/qcell/doc/licenciate_thesis/thesis.tex trunk/qcell/doc/licenciate_thesis/titlepage.tex trunk/qcell/visgui/ElementalRulesWidget.cpp trunk/qcell/visgui/ElementalRulesWidget.h Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-03 11:24:48 UTC (rev 280) @@ -64,13 +64,13 @@ QToolBox *tools; - BaseTools *basetools; +// BaseTools *basetools; // View3DTools *view3DTools; // View2DTextTools *view2DTextTools; int view2DTextInterpretationMode; - View1DTextTools *view1DTextTools; +// View1DTextTools *view1DTextTools; int view1DTextInterpretationMode; Modified: trunk/qcell/doc/licenciate_thesis/CMakeLists.txt =================================================================== --- trunk/qcell/doc/licenciate_thesis/CMakeLists.txt 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/doc/licenciate_thesis/CMakeLists.txt 2007-02-03 11:24:48 UTC (rev 280) @@ -3,7 +3,7 @@ FIND_PACKAGE(LATEX REQUIRED) FIND_PROGRAM(GLOSSTEX_COMPILER NAMES glosstex) FIND_FILE(GLOSSTEX_IST NAMES glosstex.ist PATHS /usr/share/texmf/tex/latex/glosstex) -SET(LATEX_ARGS --interaction=batchmode --translate-file=il2-pl) +SET(LATEX_ARGS --interaction=nonstopmode) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thesis.aux ${CMAKE_CURRENT_BINARY_DIR}/titlepage.tex.aux ${CMAKE_CURRENT_BINARY_DIR}/thesis.out ${CMAKE_CURRENT_BINARY_DIR}/thesis.toc ${CMAKE_CURRENT_BINARY_DIR}/thesis.pdf @@ -49,7 +49,7 @@ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thesis.bbl ${CMAKE_CURRENT_BINARY_DIR}/thesis.blg DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glosstex2 ${CMAKE_CURRENT_SOURCE_DIR}/thesis.bib COMMAND ${BIBTEX_COMPILER} - ARGS -terse ${CMAKE_CURRENT_BINARY_DIR}/thesis + ARGS -min-crossrefs=0 -terse ${CMAKE_CURRENT_BINARY_DIR}/thesis COMMENT "Bibtex" ) Modified: trunk/qcell/doc/licenciate_thesis/acronyms.gdf =================================================================== --- trunk/qcell/doc/licenciate_thesis/acronyms.gdf 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/doc/licenciate_thesis/acronyms.gdf 2007-02-03 11:24:48 UTC (rev 280) @@ -2,24 +2,25 @@ @entry{DAK, DAK, Dwuwymiarowy Automat Kom\xF3rkowy} @entry{DSZ, DSZ, Dyskretne Systemy Z\xB3o\xBFone} @entry{EPS, EPS, Encapsulated PostScript} Jest to format plik\xF3w, b\xEAd\xB9cy podzbiorem j\xEAzyka PostScript, kt\xF3rego g\xB3\xF3wnym przeznaczeniem jest przechowywanie pojedynczych stron zawieraj\xB9cych grafik\xEA komputerow\xB9 w postaci umo\xBFliwiaj\xB9cej osadzanie ich w innych dokumentach.\citep{plwiki} -@entry{FL, FL, Funkcja Lokalna} \label{gls:test}Mechanizm obliczeniowy maj\xB9cy na celu wyznaczy\xE6 kolejn\xB9 warto\x9C\xE6 kom\xF3rki na podstawie argument\xF3w wyznaczonych na podstawie s\xB9siedztwa.\glxref*{N}. +@entry{FL, FL, Funkcja Lokalna} \label{gls:test}Mechanizm obliczeniowy maj\xB9cy na celu wyznaczy\xE6 kolejn\xB9 warto\x9C\xE6 kom\xF3rki na podstawie argument\xF3w uzyskanych z analisy s\xB9siedztwa\glxref*{N}. @entry{FQT, FQT, Funkcja kwazi-totalistyczna} -@entry{GUI, GUI, Graphical User Interface} Cz\xEAsto nazywany te\xBF \x9Crodowiskiem graficznym --- og\xF3lne okre\x9Clenie sposobu prezentacji informacji przez komputer oraz interakcji z u\xBFytkownikiem, polegaj\xB9cego na rysowaniu i obs\xB3ugiwaniu widget\xF3w.\citep{plwiki} -@entry{GUST, GUST, Grupa U\xBFytkownik\xF3w System \TeX{}} Polski oddzia\xB3 \ac{TUG}~-~a.\\\url{http://www.gust.org.pl/} +@entry{GUI, GUI, Graphical User Interface} Cz\xEAsto nazywany te\xBF \x9Crodowiskiem graficznym. Og\xF3lne okre\x9Clenie sposobu prezentacji informacji przez komputer oraz interakcji z u\xBFytkownikiem, polegaj\xB9cego na rysowaniu i obs\xB3ugiwaniu widget\xF3w.\citep{plwiki} +@entry{GUST, GUST, Grupa U\xBFytkownik\xF3w System \TeX{}} Polski oddzia\xB3 \glxref{TUG}~-a.\\\url{http://www.gust.org.pl/} @entry{IDE, IDE, Integrated Development Environment} zintegrowane \x9Crodowisko programistyczne --- jest to aplikacja lub zesp\xF3\xB3 aplikacji (\x9Crodowisko) s\xB3u\xBF\xB9cych do tworzenia, modyfikowania, testowania i konserwacji oprogramowania.\citep{plwiki} @entry{KB, KB, Konfiguracja Bie\xBF\xB9ca} Termin okre\x9Claj\xB9cy wzajemny rozk\xB3ad kom\xF3rek oraz ich warto\x9Cci po ostatniej iteracji. -@entry{KP, KP, Konfiguracja Pocz\xB9tkowa} Termin okre\x9Claj\xB9cy wzajemny rozk\xB3ad kom\xF3rek oraz ich warto\x9Cci inicjuj\xB9cy \ac{AK}, czyli przed pierwsz\xB9 iteracj\xB9. -@entry{LAK, LAK, Liniowy Automat Kom\xF3rkowy} Inaczej jednowymiarowy \ac{AK}. -@entry{N, N, Neighbourhood} Cz\xEA\x9C\xE6 modelu \ac{AK}. Odpowiada za okre\x9Clenie po\xB3o\xBFenia i kolejno\x9Cci argument\xF3w branych pod uwag\xEA przy obliczeniu kolejnej warto\x9Cci kom\xF3rki. +@entry{KN, KN, Konfiguracja Nast\xEApna} Termin okre\x9Claj\xB9cy wzajemny rozk\xB3ad kom\xF3rek oraz ich warto\x9Cci powsta\xB3y w wyniku przetwarzania \glxref{KB}. +@entry{KP, KP, Konfiguracja Pocz\xB9tkowa} Termin okre\x9Claj\xB9cy wzajemny rozk\xB3ad kom\xF3rek oraz ich warto\x9Cci inicjuj\xB9cy \glxref{AK}, czyli przed pierwsz\xB9 iteracj\xB9. +@entry{LAK, LAK, Liniowy Automat Kom\xF3rkowy} Inaczej jednowymiarowy \glxref{AK}. +@entry{MVC, MVC, Model View Controller} Jest to wzorzec charakteryzuj\xB9cy si\xEA rozdzieleniem komponent\xF3w aplikacji, tj. modelu danych, interfejsu u\xBFytkownika i logiki sterowania w taki spos\xF3b, aby modyfikacje jednego komponentu minimalnie wp\xB3ywa\xB3y na pozosta\xB3e.\citep{plwiki} +@entry{N, N, Neighbourhood} Cz\xEA\x9C\xE6 modelu \glxref{AK}. Odpowiada za okre\x9Clenie po\xB3o\xBFenia i kolejno\x9Cci argument\xF3w branych pod uwag\xEA przy obliczeniu kolejnej warto\x9Cci kom\xF3rki. @entry{NP, NP, Nondeterministic Polynomia} Problem NP (nieokre\x9Clony wielomianowo) to problem decyzyjny, dla kt\xF3rego rozwi\xB9zanie mo\xBFna zweryfikowa\xE6 w czasie wielomianowym. R\xF3wnowa\xBFna definicja m\xF3wi, \xBFe problem jest w klasie NP, je\xBFeli mo\xBFe by\xE6 rozwi\xB9zany w wielomianowym czasie na niedeterministycznej maszynie Turinga.\citep{plwiki} -@entry{RE, RE, Regu\xB3y Elementarne} Jest to spos\xF3b opisu \ac{FL} w \ac{AK}, kt\xF3ry \xB3\xB9czy s\xB9siedztwo z wynikiem, jakie to s\xB9siedztwo implikuje. -@entry{SN, SN, Symbol Nieokre\x9Clony} Umowny znak przy specyfikacji \ac{FL} oraz \ac{KP} wskazuj\xB9cy, i\xBF funkcja b\xB9d\x9F konfiguracja s\xB9 nie w pe\xB3ni okre\x9Clone. -@entry{SVG, SVG, Scalable Vector Graphics} Uniwersalny format dwuwymiarowej, statycznej i animowanej grafiki wektorowej, nieobwarowany licencjami i patentami, stworzony w 1999 roku przez W3C z my\x9Cl\xB9 o zastosowaniu go na stronach WWW. U\xBFywany r\xF3wnie\xBF jako niezale\xBFny od platformy systemowej format grafiki. SVG nale\xBFy do rodziny XML, wi\xEAc mo\xBFe by\xE6 integrowany z innymi j\xEAzykami, jak na przyk\xB3ad XHTML.\citep{plwiki} -@entry{TAK, TAK, Tr\xF3jwymiarowy Automat Kom\xF3rkowy} -@entry{TUG, TUG, \TeX{} User Group} Grupy u\xBFytkownik\xF3w systemu \TeX{}. Opr\xF3cz centralnej grupy mi\xEAdzynarodowej tworzone s\xB9 r\xF3wnie\xBF odzia\xB3y krajowe. Polskim oddzia\xB3em jest \ac{GUST}\\\url{http://www.tug.org/} @entry{OG, OG, Obserwator Globalny} Termin okre\x9Claj\xB9cy spos\xF3b prezentowania przebiegu eksperymentu z punktu widzenia obserwatora, kt\xF3ry ma natychmiastowy dost\xEAp do wszystkich obiekt\xF3w symulowanej przestrzeni. @entry{OL, OL, Obserwator Lokalny} Termin okre\x9Claj\xB9cy spos\xF3b prezentowania przebiegu eksperymentu z punktu widzenia obserwatora, kt\xF3ry jest cz\xEA\x9Cci\xB9 symulowanej przestrzeni i jego percepcja ograniczona jest do najbli\xBFszych s\xB9siad\xF3w, a informacje o dalszych wydarzeniach dochodz\xB9 do niego z op\xF3\x9Fnieniem. -@entry{XML, XML, Extensive Markup Language} Jest to uniwersalny j\xEAzyk formalny przeznaczony do reprezentowania r\xF3\xBFnych danych w ustrukturalizowany spos\xF3b. XML jest niezale\xBFny od platformy, co umo\xBFliwia \xB3atw\xB9 wymian\xEA dokument\xF3w pomi\xEAdzy r\xF3\xBFnymi systemami i znacz\xB9co przyczyni\xB3o si\xEA do popularno\x9Cci tego j\xEAzyka w dobie Internetu. XML jest podzbiorem j\xEAzyka SGML, tj. ka\xBFdy dokument XML jest te\xBF dokumentem SGML. XML jest rekomendowany oraz specyfikowany przez organizacj\xEA W3C.\citep{plwiki} -@entry{KN, KN, Konfiguracja Nast\xEApna} Termin okre\x9Claj\xB9cy wzajemny rozk\xB3ad kom\xF3rek oraz ich warto\x9Cci powsta\xB3y w wyniku przetwarzania \ac{KB}. +@entry{RE, RE, Regu\xB3y Elementarne} Jest to spos\xF3b opisu \glxref{FL} w \glxref{AK}, kt\xF3ry \xB3\xB9czy s\xB9siedztwo z wynikiem, jakie to s\xB9siedztwo implikuje. +@entry{SN, SN, Symbol Nieokre\x9Clony} Umowny znak przy specyfikacji \glxref{FL} oraz \glxref{KP} wskazuj\xB9cy, i\xBF funkcja b\xB9d\x9F konfiguracja s\xB9 nie w pe\xB3ni okre\x9Clone. +@entry{SVG, SVG, Scalable Vector Graphics} Uniwersalny format dwuwymiarowej, statycznej i animowanej grafiki wektorowej, nieobwarowany licencjami i patentami, stworzony w 1999 roku przez W3C z my\x9Cl\xB9 o zastosowaniu go na stronach WWW. U\xBFywany r\xF3wnie\xBF jako niezale\xBFny od platformy systemowej format grafiki. SVG nale\xBFy do rodziny \glxref{XML}, wi\xEAc mo\xBFe by\xE6 integrowany z innymi j\xEAzykami, jak na przyk\xB3ad XHTML.\citep{plwiki} +@entry{TAK, TAK, Tr\xF3jwymiarowy Automat Kom\xF3rkowy} +@entry{TUG, TUG, \TeX{} User Group} Grupy u\xBFytkownik\xF3w systemu \TeX{}. Opr\xF3cz centralnej grupy mi\xEAdzynarodowej tworzone s\xB9 r\xF3wnie\xBF odzia\xB3y krajowe. Polskim oddzia\xB3em jest \glxref{GUST}\\\url{http://www.tug.org/} +@entry{XML, XML, eXtensive Markup Language} Jest to uniwersalny j\xEAzyk formalny przeznaczony do reprezentowania r\xF3\xBFnych danych w ustrukturalizowany spos\xF3b. XML jest niezale\xBFny od platformy, co umo\xBFliwia \xB3atw\xB9 wymian\xEA dokument\xF3w pomi\xEAdzy r\xF3\xBFnymi systemami i znacz\xB9co przyczyni\xB3o si\xEA do popularno\x9Cci tego j\xEAzyka w dobie Internetu. XML jest podzbiorem j\xEAzyka SGML, tj. ka\xBFdy dokument XML jest te\xBF dokumentem SGML. XML jest rekomendowany oraz specyfikowany przez organizacj\xEA W3C.\citep{plwiki} % vim:fencs=cp1250:fenc=cp1250 Modified: trunk/qcell/doc/licenciate_thesis/thesis.bib =================================================================== --- trunk/qcell/doc/licenciate_thesis/thesis.bib 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/doc/licenciate_thesis/thesis.bib 2007-02-03 11:24:48 UTC (rev 280) @@ -14,3 +14,45 @@ organization = {Wikimedia Foundation Inc.} } +@BOOK{latex, + author = {Tobias Oetiker and Hubert Partl and Irene Hyana and Elisabeth Schlegl}, + title = {The Not So Short Introduction to \LaTeX2e{}}, + publisher = {}, + year = {2006}, + otherinfo = {} +} + +@BOOK{cac, + author = {Stephen Wolfram}, + title = {Cellular Automata and Complexity}, + publisher = {Addison-Wesley}, + year = {1994}, + otherinfo = {} +} + +@BOOK{nks, + author = {Stephen Wolfram}, + title = {A New Kind Of Science}, + publisher = {Wolfram Media}, + year = {2002}, + otherinfo = {} +} + +@BOOK{kul, + author = {K. Ku\xB3akowski}, + editor = {}, + title = {Automaty kom\xF3rkowe}, + publisher = {AGH}, + year = {2000}, + otherinfo = {} +} + +@BOOK{qt4, + author = {Jasmin Blanchette and Mark Summerfield}, + editor = {}, + title = {GUI Programming with Qt 4}, + publisher = {Prentice Hall PTR}, + year = {2006}, + otherinfo = {} +} + Modified: trunk/qcell/doc/licenciate_thesis/thesis.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-02-03 11:24:48 UTC (rev 280) @@ -10,6 +10,8 @@ % Typ rekomendowany na prac\xEA PhD \documentclass[12pt,a4paper]{report} +\usepackage{tocloft} + %grafika \usepackage{graphicx} @@ -36,6 +38,8 @@ \glxheading{glo}{\chapter{\glossaryname}} \glxheading{acr}{\chapter{\listacronymname}} +\usepackage{lscape} + % Skorowidz %\usepackage{makeindex} @@ -63,13 +67,37 @@ \newcommand{\CA}{Comarch\textsuperscript{\textregistered}} % \xA3adne numerowanie stron wraz z nag\xB3\xF3wkami -\pagestyle{headings} +%\pagestyle{headings} % Spis tre\x9Cci automagicznie generowany z tytu\xB3\xF3w rozdzia\xB3\xF3w i sekcji +\def\author{\cftdot} +\renewcommand{\cftchapleader}{\cftdotfill{4.5}\author} +\renewcommand{\cftsecleader}{\cftdotfill{4.5}\author \cftdotfill{4.5}} +\renewcommand{\cftsubsecleader}{\cftdotfill{4.5}\author} \tableofcontents +% Tego nale\xBFy u\xBFywa\xE6 zamiast rozdzia\xB3\xF3w, \xBFeby umie\x9Cci\xE6 autora +% #1 - Autor +% #2 - Tytu\xB3 rozdzia\xB3u +\newcommand{\chapterauthor}[2]{% +\addtocontents{toc}{\def\protect\author{ \emph{#1}}}% +\chapter{#2} +\addtocontents{toc}{\def\protect\author{\cftdot}}} + +% J/w tylko sekcja +\newcommand{\sectionauthor}[2]{% +\addtocontents{toc}{\def\protect\author{ \emph{#1}}}% +\section{#2}% +\addtocontents{toc}{\def\protect\author{\cftdot}}} + +% J/w tylko subsekcja +\newcommand{\subsectionauthor}[2]{% +\addtocontents{toc}{\def\protect\author{ \emph{#1}}}% +\subsection{#2}% +\addtocontents{toc}{\def\protect\author{\cftdot}}} + %Jedziemy z koksem -\chapter{Wprowadzenie} +\chapterauthor{Cezary Krzy\xBFanowski}{Wprowadzenie} \label{chap:wpr} \section{Cel i~zakres pracy} Celem niniejszego opracowania jest stworzenie \x9Crodowiska do efektywnego przeprowadzania symulacji jedno-, dwu- oraz tr\xF3jwymiarowych automat\xF3w kom\xF3rkowych. @@ -98,7 +126,8 @@ Przez \x9Crodki intensyfikacji eksperyment\xF3w rozumiane s\xB9 dodatkowe narz\xEAdzia i~tryby wspomagaj\xB9ce zmiany w~modelu b\xB9d\x9F danych na bie\xBF\xB9co celem uzyskania \xBF\xB9danej \ac{KB}. \subsubsection{Testy programu} Przeprowadzone zostan\xB9 dwie fazy test\xF3w. W~pierwszej fazie pakiet przetestowany zostanie pod wzgl\xEAdem poprawno\x9Cci prowadzonych oblicze\xF1 oraz zgodno\x9Cci z~ustalon\xB9 wcze\x9Cniej list\xB9 funkcjonalno\x9Cci. W drugiej fazie pakiet zostanie poddany testom wydajno\x9Cciowym oraz subiektywnym testom ergonomii u\xBFytkowania. -\subsection{Zadania szczeg\xF3\xB3owe - Leszek Smentek} + +\subsectionauthor{Leszek Smentek}{Zadania szczeg\xF3\xB3owe} \label{subsec:lsm} \subsubsection {Symulator modelu \ac{AK}} @@ -113,7 +142,7 @@ \subsubsection {Opracowanie i wdro\xBFenie \x9Crodk\xF3w dokumentowania eksperyment\xF3w} Powy\xBFsze zadanie szczeg\xF3\xB3owe ma na celu opracowanie metod dokumentowania eksperyment\xF3w umo\xBFliwiaj\xB9cych prezentacje wynik\xF3w symulacji niezale\xBFnie od pakietu. -\chapter{Zakres problematyki} +\chapterauthor{Cezary Krzy\xBFanowski}{Zakres problematyki} \label{chap:zpr} \section{Synteza optymalnej funkcjonalno\x9Cci symulatora przetwarza\xF1 kom\xF3rkowych} @@ -237,7 +266,7 @@ Dodatkowo nale\xBFy zwr\xF3ci\xE6 uwag\xEA na fakt, i\xBF forma multimedialna pozwala prezentowa\xE6 w~p\xB3ynny spos\xF3b przebieg symulacji, kt\xF3ra w~rzeczywisto\x9Cci mog\xB3a by\xE6 generowana na przestrzeni wielu godzin. -\section{Przegl\xB9d mo\xBFliwo\x9Cci znanych automat\xF3w kom\xF3rkowych} +\sectionauthor{Leszek Smentek}{Przegl\xB9d mo\xBFliwo\x9Cci znanych automat\xF3w kom\xF3rkowych} \label{sec:pmz} \subsection {MCell} @@ -304,12 +333,11 @@ \subsection {Por\xF3wnanie dost\xEApnych AK} -\rotatebox{90} -{ -\begin{table}[!hpt] +\begin{landscape} +\begin{table}[!p] \centering -\begin{tabular}{c|c|c|c|c|c|c|c|c} -AK & Dynamika globalna & Definiowanie dowolnych funkcji lokalnych & Wymiana danych pomi\xEAdzy pakietami & Graficzna reprezentacja symulacji & Tekstowa reprezentacja symulaci & Obserwator lokalny & Wspomaganie doboru modelu\\ +\begin{tabular}{p{5em}|p{5em}|p{5em}|p{5em}|p{5em}|p{5em}|p{5em}|p{5em}} +AK & Dynamika globalna & Definiowanie dowolnych funkcji lokalnych & Wymiana danych pomi\xEAdzy pakietami & Graficzna reprezentacja symulacji & Tekstowa reprezentacja symulacji & Obserwator lokalny & Wspomaganie doboru modelu\\ \hline MCell & Nie & Tak & Tak & Tak & Nie & Nie & Nie\\ \hline @@ -319,26 +347,14 @@ \hline CelLab & Nie & Tak & Tak & Tak & Nie & Nie & Nie\\ \hline -WinLife & Nie & Nie & Nie & Tak & Nie & Nie & Nie\\ - +WinLife & Nie & Nie & Nie & Tak & Nie & Nie & Nie \end{tabular} \caption{Por\xF3wnanie dost\xEApnych AK} \label{tab:} \end{table} -} +\end{landscape} -\begin{itemize} -\item DG - dynamika globalna -\item DF - definiowanie dowolnych funkcji lokalnych -\item W - wymiana danych pomi\xEAdzy pakietami -\item TG - graficzna reprezentacja symulacji -\item TT - tekstowa reprezentacja danych -\item OL - obserwator lokalny -\item WD - wspomaganie doboru modelu -\end{itemize} - - -\chapter{Za\xB3o\xBFenia szczeg\xF3\xB3owe} +\chapterauthor{Leszek Smentek}{Za\xB3o\xBFenia szczeg\xF3\xB3owe} \label{chap:zsz} \section{Mo\xBFliwo\x9Cci funkcjonalne pakietu} \subsection {Podstawowe funkcje programu} @@ -442,37 +458,40 @@ \end{itemize} -\chapter{Implementacja} +\chapterauthor{Cezary Krzy\xBFanowski}{Implementacja} \label{chap:imp} \section{Stosowane narz\xEAdzia} +\label{sec:sna} -\subsection{Przy pisaniu projektu} +\subsection{Narz\xEAdzia stosowane przy implementacji} +\label{subsec:npi} \begin{description} \item [autotools] GNU Build System --- Zestaw narz\xEAdzi stworzonych przez projekt GNU\footnote{\url{http://www.gnu.org/}} , kt\xF3re pomagaj\xB9 w budowaniu pakiet\xF3w w wielu systemach UNIXopodobnych. Jest cz\xEA\x9Cci\xB9 GNU Toolchain.\citep{plwiki}\\\url{http://sources.redhat.com/autobook/} \item[gcc] Wieloplatformowy zestaw kompilator\xF3w. W szczeg\xF3lno\x9Cci u\xBFywany by\xB3 kompilator j\xEAzyka C++~--- gcc-c++ w wersji 4.2.\\\url{http://gcc.gnu.org/} \item[gdb] Wieloplatformowy \gls{debugger} w wersji 6.6.\\\url{http://www.gnu.org/software/gdb/} \item[Microsoft Visual Studio .Net 2003] Narz\xEAdzie do edycji i kompilacji program\xF3w w \x9Crodowisku Microsoft Windows. G\xB3\xF3wnie u\xBFyto kompilatora j\xEAzyka C++.\\\url{http://msdn.microsoft.com/vstudio/previous/2003/} - \item[\Qt{}] Zestaw bibliotek firmy Trolltech\textsuperscript{\textregistered} do wieloplatformowego tworzenia oprogramowania, w szczeg\xF3lno\x9Cci do tworzenia \ac{GUI} o natywnym, dla danej platformy, wygl\xB9dzie. Biblioteki te zawieraj\xB9 szerok\xB9 gam\xEA klas og\xF3lnego zastosowania, oraz w\xB3asny system kompilacji. U\xBFyto wersji 4.2.\\\url{http://www.trolltech.com/products/qt/} + \item[\Qt{}] Zestaw bibliotek firmy Trolltech\textsuperscript{\textregistered} do wieloplatformowego tworzenia oprogramowania, w szczeg\xF3lno\x9Cci \ac{GUI} o natywnym, dla danej platformy, wygl\xB9dzie. Biblioteki te zawieraj\xB9 szerok\xB9 gam\xEA klas og\xF3lnego zastosowania, oraz w\xB3asny system kompilacji. U\xBFyto wersji 4.2.\\\url{http://www.trolltech.com/products/qt/} \item[Vim] Niezwykle rozszerzalny, wieloplatformowy edytor tekstu (i nie tylko) z szerok\xB9 gam\xB9 wtyczek do pracy z niemal\xBFe dowolnym typem plik\xF3w. Stanowi\xB3 na zmian\xEA \ac{IDE}, \gls{debugger} oraz program do sk\xB3adu tekstu. U\xBFyto wersji 7.0.\\\url{http://www.vim.org/} \end{description} -\subsection{Przy pisaniu pracy} +\subsection{Narz\xEAdzia stosowane Przy pisaniu tekstu pracy} +\label{subsec:npt} \begin{description} \item [AcrobatReader] Interpreter plik\xF3w pdf.\\\url{http://www.adobe.com/products/acrobat/readstep2.html}. \item [aspell] Wolnodost\xEApny program do sprawdzania pisowni i gramatyki wraz ze s\xB3ownikami w wielu j\xEAzykach.\\\url{http://aspell.sourceforge.net/} \item [cmake] Wieloplatformowy generator skrypt\xF3w budowania.\\\url{http://www.cmake.org/} \item [Evince] Interpreter plik\xF3w pdf w \x9Crodowisku \gls{GNOME} na platformie Linux.\\\url{http://www.gnome.org/projects/evince/} - \item [GIMP] Program do tworzenia grafiki rastrowej i przekszta\xB3cania obraz\xF3w do formatu \ac{EPS} wykorzystywanego w \TeX{}ie.\\\url{http://www.gimp.org/} + \item [GIMP] Program do tworzenia grafiki rastrowej i przekszta\xB3cania obraz\xF3w do formatu \ac{EPS} wykorzystywanego w \TeX{}-u.\\\url{http://www.gimp.org/} \item [Inkspace] Program do tworzenia grafiki wektorowej, g\xB3\xF3wnie w formacie \ac{SVG}.\\\url{http://www.inkscape.org/} - \item [TeTex] Implementacja j\xEAzyka sk\xB3adania tekstu \TeX{} na platformach UNIX-owych, wraz z zainstalowanym systemem makr \LaTeXe{}.\\\url{http://www.tug.org/tetex/} + \item [TeTex] Implementacja j\xEAzyka sk\xB3adania tekstu \TeX{} na platformach UNIX-owych, wraz z zainstalowanym systemem makr \LaTeXe{}\citep{latex}.\\\url{http://www.tug.org/tetex/} \item [TexLive 2005] Kompletne \x9Crodowisko \TeX{}-a tworzone przez \ac{TUG}. \end{description} \section{Za\xB3o\xBFenia wst\xEApne} \label{sec:zws} -Fundamentalnym elementem pakietu, kt\xF3ry determinuje wszystkie p\xF3\x9Fniejsze ograniczenia, jest biblioteka \Qt{}. W~szczeg\xF3lno\x9Cci jej podstawowe struktury, takie jak QVector, czy QString, kt\xF3re indeksowane s\xB9 liczbami ca\xB3kowitymi (int). +Fundamentalnym elementem pakietu, kt\xF3ry determinuje wszystkie p\xF3\x9Fniejsze ograniczenia, jest biblioteka \Qt{}. W~szczeg\xF3lno\x9Cci jej podstawowe struktury, takie jak QVector czy QString, kt\xF3re indeksowane s\xB9 liczbami ca\xB3kowitymi (int). -Pakiet powsta\xB3 przy intensywnym wykorzystaniu mechanizm\xF3w dostarczanych przez bibliotek\xEA \Qt{}. Modularn\xB9 (wtyczkow\xB9) architektur\xEA programu zapewni\xB3a klasa QPlugin. Do implementacji graficznej reprezentacji \ac{AK} u\xBFyto bibliotek OpenGL w~standardzie 1.1 (dla kompatybilno\x9Cci z~mo\xBFliwie szerok\xB9 gam\xB9 uk\xB3ad\xF3w graficznych), opakowanych przez modu\xB3 QtOpenGL. QtXML zapewni\xB3 parser \ac{XML}-a. +Pakiet powsta\xB3 przy intensywnym wykorzystaniu mechanizm\xF3w dostarczanych przez bibliotek\xEA \Qt{}. Modularn\xB9 (wtyczkow\xB9) architektur\xEA programu zapewni\xB3a klasa QPlugin. Do implementacji graficznej reprezentacji \ac{AK} u\xBFyto bibliotek OpenGL w~standardzie 1.1 (dla kompatybilno\x9Cci z~mo\xBFliwie najszersz\xB9 gam\xB9 uk\xB3ad\xF3w graficznych), opakowanych przez modu\xB3 QtOpenGL. QtXML zapewni\xB3 parser \ac{XML}-a. Pozosta\xB3e elementy pakietu opieraj\xB9 si\xEA na g\xB3\xF3wnym module bibliotek \Qt{} (QtCore), implementuj\xB9cym podstawowe struktury og\xF3lnego u\xBFytku (listy, mapy, wektory), natomiast \ac{GUI} powsta\xB3o z~u\xBFyciem QtGui. @@ -491,7 +510,7 @@ \end{figure} \begin{description} - \item[\ac{GUI}] prezentuj\xB9ce wynik u\xBFytkownikowi i~przekazuj\xB9ce polecenia u\xBFytkownika do + \item[\ac{GUI}] prezentuj\xB9ce wynik u\xBFytkownikowi i~przekazuj\xB9ce polecenia u\xBFytkownika do j\xB9dra logicznego \label{it:GUI} \item[Baza danych] odpowiedzialna za przechowywanie element\xF3w sk\xB3adowych \ac{AK} (\ac{N}, \ac{FL}, historia przetwarzania \ac{KP}). \label{it:bda} @@ -504,13 +523,19 @@ \end{description} \section{Ograniczenia pakietu} +\label{sec:opa} + \subsection{Liczba r\xF3wnoleg\xB3ych eksperyment\xF3w} -Zaimplementowany pakiet pozwala przeprowadza\xE6 jeden eksperyment na raz. Nie jest zatem mo\xBFliwe prowadzenie eksperyment\xF3w por\xF3wnawczych, polegaj\xB9cych na obserwowaniu r\xF3wnoleg\xB3ego przetwarzania dw\xF3ch lub wi\xEAcej \ac{KB}. +\label{subsec:lre} +Zaimplementowany pakiet pozwala przeprowadza\xE6 do dw\xF3ch eksperyment\xF3w na raz. Jest zatem mo\xBFliwe prowadzenie eksperyment\xF3w por\xF3wnawczych, polegaj\xB9cych na obserwowaniu r\xF3wnoleg\xB3ego przetwarzania dw\xF3ch \ac{KB}. + \subsection{Wielowymiarowe przestrzenie} +\label{subsec:wpr} Pakiet pozwala na obserwowanie przetwarzania jedno-, dwu- i~tr\xF3jwymiarowych \ac{AK}. Implementacja wi\xEAcej ni\xBF tr\xF3jwymiarowych \ac{AK} jest osi\xB9galna, jednak\xBFe efektywna wizualizacja przestrzeni wielowymiarowych pozostaje kwesti\xB9 sporn\xB9. \subsection{Ograniczenia s\xB9siedztwa} -Implementacja silnika przetwarzaj\xB9cego pozwala na s\xB9siedztwo sk\xB3adaj\xB9ce si\xEA z~maksymalnie \maxint{} s\xB9siad\xF3w, oddalonych od punktu centralnego s\xB9siedztwa o~maksymalnie \maxint{} kom\xF3rek, jednak\xBFe spos\xF3b wczytywania s\xB9siedztwa z~pliku tekstowego nak\xB3ada ograniczenia wynikaj\xB9ce z~liczby znak\xF3w czytelnych dla u\xBFytkownika ko\xF1cowego. Ograniczenia te zebrane s\xB9 w~tabeli \ref{tab:os} +\label{subsec:osa} +Implementacja silnika obliczeniowego pozwala na s\xB9siedztwo sk\xB3adaj\xB9ce si\xEA z~maksymalnie \maxint{} s\xB9siad\xF3w, oddalonych od punktu centralnego o~maksymalnie \maxint{} kom\xF3rek. Jednak\xBFe spos\xF3b wczytywania s\xB9siedztwa z~pliku tekstowego nak\xB3ada ograniczenia wynikaj\xB9ce z~liczby znak\xF3w czytelnych dla u\xBFytkownika ko\xF1cowego. Ograniczenia te zebrane s\xB9 w~tabeli \ref{tab:os} \begin{table}[!hpt] \centering @@ -561,7 +586,7 @@ Rozmiar \ac{KP}, a~co za tym idzie \ac{KB}, jest kluczowym elementem wp\xB3ywaj\xB9cym na z\xB3o\xBFono\x9C\xE6 obliczeniow\xB9 pojedynczej iteracji, a~wi\xEAc p\xB3ynno\x9Cci eksperymentu. Szczeg\xF3\xB3owe testy dotycz\xB9ce rozmiaru \ac{KP} pozwalaj\xB9cego na komfortow\xB9 prac\xEA znajduj\xB9 si\xEA w~rozdziale \ref{sec:wyd} -\chapter{Testy} +\chapterauthor{Cezary Krzy\xBFanowski}{Ocena dzia\xB3ania systemu} \label{chap:tes} \section{Dane} \label{sec:dan} @@ -570,11 +595,11 @@ \label{subsec:two} Przeprowadzono dwie grupy test\xF3w tworzenia danych - wczytywanie z~pliku oraz z~wykorzystaniem kreatora i~narz\xEAdzi graficznych. -W~celu weryfikacji poprawno\x9Cci parsowania wygenerowano po 5 plik\xF3w losowych z~poprawnymi danymi, 5 plik\xF3w losowych z~dowolnymi danymi (r\xF3wnie\xBF niepoprawnymi) oraz po jednym pliku wyczerpuj\xB9cym wszystkie poprawne symbole, dla ka\xBFdego obs\xB3ugiwanego przez program formatu. +W~celu weryfikacji poprawno\x9Cci parsowania wygenerowano po pi\xEAc plik\xF3w losowych z~poprawnymi danymi, pi\xEA\xE6 plik\xF3w losowych z~dowolnymi danymi (r\xF3wnie\xBF niepoprawnymi) oraz po jednym pliku wyczerpuj\xB9cym wszystkie poprawne symbole dla ka\xBFdego obs\xB3ugiwanego przez program formatu. -Aplikacja poprawnie rozpozna\xB3a pliki zgodne z~formatem oraz te niezgodne, sugeruj\xB9c przy tym przyczyn\xEA b\xB3\xEAdu i~miejsce jego wyst\xB9pienia, oraz przypomnia\xB3a poprawny format. W~przypadku plik\xF3w wyczerpuj\xB9cych zbi\xF3r symboli, program zachowa\xB3 si\xEA poprawnie i s\xB3usznie zwr\xF3ci\xB3 uwag\xEA na b\xB3\xEAdy logiczne plik\xF3w (np. nie mo\xBFna stworzy\xE6 poprawnej funkcji FQT u\xBFywaj\xB9c ka\xBFdego dozwolonego symbolu jednokrotnie). +Aplikacja poprawnie rozpozna\xB3a pliki zgodne i~niezgodne z~formatem. Sugerowa\xB3a przy tym przyczyn\xEA b\xB3\xEAdu i~miejsce jego wyst\xB9pienia. W~przypadku plik\xF3w wyczerpuj\xB9cych zbi\xF3r symboli, program zachowa\xB3 si\xEA poprawnie i s\xB3usznie zwr\xF3ci\xB3 uwag\xEA na b\xB3\xEAdy logiczne plik\xF3w (np. nie mo\xBFna stworzy\xE6 poprawnej funkcji FQT u\xBFywaj\xB9c ka\xBFdego dozwolonego symbolu jednokrotnie). -Testy graficznych narz\xEAdzi do tworzenia danych polega\xB3y na pr\xF3bie wygenerowania plik\xF3w wynikowych to\xBFsamych z~u\xBFytymi w~testach plik\xF3w wej\x9Cciowych. Powsta\xB3e pliki poprawne sk\xB3adniowo by\xB3y identyczne do tych stworzonych wcze\x9Cniej. Program uniemo\xBFliwi\xB3 stworzenie funkcji niepoprawnych logicznie, informuj\xB9c na bie\xBF\xB9co o~przyczynach b\xB3\xEAd\xF3w. Stworzenie plik\xF3w niepoprawnych sk\xB3adniowo by\xB3o niemo\xBFliwe. +Testy graficznych narz\xEAdzi do tworzenia danych polega\xB3y na pr\xF3bie wygenerowania plik\xF3w wynikowych to\xBFsamych z~tymi u\xBFytymi w~wcze\x9Cniej. Powsta\xB3e pliki, poprawne sk\xB3adniowo, by\xB3y identyczne. Program uniemo\xBFliwi\xB3 stworzenie funkcji niepoprawnych logicznie, informuj\xB9c na bie\xBF\xB9co o~przyczynach b\xB3\xEAd\xF3w. Stworzenie plik\xF3w niepoprawnych sk\xB3adniowo by\xB3o niemo\xBFliwe. \subsection{Modyfikacja} \label{subsec:mod} @@ -584,12 +609,13 @@ \subsection{Utrwalanie} \label{subsec:utr} -Osobno testowano dwa tryby utrwalania: pojedynczych element\xF3w \ac{AK} (\ac{N}, \ac{FL}, \ac{KB}) oraz ca\xB3o\x9Cci eksperymentu w~raz z~histori\xB9. +Osobno testowano dwa tryby utrwalania: pojedynczych element\xF3w \ac{AK} (\ac{N}, \ac{FL}, \ac{KB}) oraz ca\xB3o\x9Cci eksperymentu wraz z~histori\xB9. -Testy zapisywania pojedynczych element\xF3w \ac{AK} przeprowadzono wraz z~testami modyfikacji z~rozdzia\xB3u \ref{subsec:mod}. Dla ka\xBFdej dokonanej zmiany zachowywano jej wynik do pliku i~weryfikowano jego poprawno\x9C\xE6. Program poprawnie utrwali\xB3 wszystkie modyfikacje. -Testy zachowywania ca\xB3o\x9Cci eksperymentu zosta\xB3y przeprowadzone natomiast r\xF3wnolegle z~testami poprawno\x9Cci oblicze\xF1 z~rozdzia\xB3u \ref{sec:pob}. Ka\xBFdy z~nich uruchamiany by\xB3 dwukrotnie: raz poprzez wczytanie danych z~osobnych plik\xF3w, raz przy u\xBFyciu opcji zachowania ca\xB3o\x9Cci eksperymentu i~ponownego jego wczytania. Nast\xEApnie por\xF3wnano wyniki. Wszystkie symulacje z~rozdzia\xB3u \ref{sec:pob} przebiega\xB3y identycznie dla obu tryb\xF3w inicjowania oblicze\xF1. +Testy zapisywania pojedynczych element\xF3w \ac{AK} przeprowadzono razem z~testami modyfikacji z~rozdzia\xB3u \ref{subsec:mod}. Dla ka\xBFdej dokonanej zmiany zachowywano jej wynik do pliku i~weryfikowano jego poprawno\x9C\xE6. Program poprawnie utrwali\xB3 wszystkie modyfikacje. +Natomiast testy zachowywania ca\xB3o\x9Cci eksperymentu zosta\xB3y przeprowadzone r\xF3wnolegle z~testami poprawno\x9Cci oblicze\xF1 z~rozdzia\xB3u \ref{sec:pob}. Ka\xBFdy z~nich uruchamiany by\xB3 dwukrotnie: raz poprzez wczytanie danych z~osobnych plik\xF3w, raz przy u\xBFyciu opcji zachowania ca\xB3o\x9Cci eksperymentu i~ponownego jego wczytania. Nast\xEApnie por\xF3wnano wyniki. Wszystkie symulacje z~rozdzia\xB3u \ref{sec:pob} przebiega\xB3y identycznie dla obu tryb\xF3w inicjowania oblicze\xF1. + \section{Poprawno\x9C\xE6 oblicze\xF1} \label{sec:pob} Poprawno\x9C\xE6 oblicze\xF1 weryfikowana by\xB3a przy pomocy powszechnie znanych i~udokumentowanych obiekt\xF3w \ac{AK}. Wykorzystano w~tym celu g\xB3\xF3wnie ,,\xB3aziki'' i~,,\xB3\xF3deczki'' w~r\xF3\xBFnych wariantach. Zachowanie w~testowanym pakiecie por\xF3wnywane by\xB3o ze wzorcowym. Dodatkowo wykorzystano mo\xBFliwo\x9C\xE6 importu z~pakietu MCell por\xF3wnuj\xB9c przeniesione eksperymenty z~ich orygina\xB3ami. @@ -603,11 +629,11 @@ Procedura polega\xB3a na przeprowadzeniu test\xF3w poprawno\x9Cci oblicze\xF1 z~rozdzia\xB3u \ref{sec:pob} oraz powi\xB9zanych z~nimi testami utrwalania (por. \ref{subsec:utr}. -Og\xF3lny wystr\xF3j pakietu oraz czytelno\x9C\xE6 interfejsu zosta\xB3a oceniona jako zadowalaj\xB9ca. Opcje rozmieszczono poprawnie ze zrozumia\xB3ymi nazwami i~obja\x9Cnieniami. Pakiet poprawnie reagowa\xB3 na polecenia operatora i~informowa\xB3 o~jego b\xB3\xEAdach~--- w~razie potrzeby sugerowa\xB3 metody ich poprawienia. +Og\xF3lny wystr\xF3j pakietu oraz czytelno\x9C\xE6 interfejsu zosta\xB3a oceniona jako zadowalaj\xB9ca. Opcje rozmieszczono poprawnie ze zrozumia\xB3ymi nazwami i~obja\x9Cnieniami. Pakiet reagowa\xB3 na polecenia operatora i~informowa\xB3 o~jego b\xB3\xEAdach~--- w~razie potrzeby sugerowa\xB3 metody ich poprawienia. Jako og\xF3ln\xB9 wade pakietu wskazano brak menu kontekstowego specyficznego dla ka\xBFdego elementu symulacji. W~szczeg\xF3lno\x9Cci manipulowanie przestrzeniami tr\xF3jwymiarowymi - kopiowanie, wklejanie, utrudnione jest przez ci\xB9g\xB3e si\xEAganie do zasobnika bocznego. -Uwag\xB9 dodatkow\xB9 jest brak ikon/kursor\xF3w u\xB3atwiaj\xB9cych oszacowanie przeznaczenia poszczeg\xF3lnych tryb\xF3w i~opcji. +Uwag\xB9 dodatkow\xB9 jest brak ikon/kursor\xF3w u\xB3atwiaj\xB9cych odgadni\xEAcie przeznaczenia poszczeg\xF3lnych tryb\xF3w i~opcji. \section{Wydajno\x9Cci} \label{sec:wyd} @@ -635,12 +661,12 @@ \subsection{Procedura testowa} \label{subsec:pte} -Do test\xF3w wykorzystano scenariusze stworzone na potrzeby test\xF3w poprawno\x9Cci oblicze\xF1 z~rozdzia\xB3u \ref{sec:pob}. Dla ka\xBFdego z~obiekt\xF3w przeprowadzono 10,000 iteracji. Kluczowym parametrem by\xB3 czas, mierzony osobno dla tryb\xF3w graficznych, jak i~tekstowych. +Wykorzystano scenariusze stworzone na potrzeby test\xF3w poprawno\x9Cci oblicze\xF1 z~rozdzia\xB3u \ref{sec:pob}. Dla ka\xBFdego z~obiekt\xF3w przeprowadzono 10,000 iteracji. Kluczowym parametrem by\xB3 czas, mierzony osobno dla tryb\xF3w graficznych, jak i~tekstowych. \subsection{Automaty jednowymiarowe} \label{subsec:aje} - Wyniki wszystkich pomiar\xF3w oscylowa\xB3y w~granicy 2:40 min.~Zauwa\xBFalna jest wyra\x9Fna zale\xBFno\x9C\xE6 wydajno\x9Cci od liczby wierszy widocznych na ekranie. Spowodowane jest to znacznym nak\xB3adem potrzebnym do uaktualniania ca\xB3o\x9Cci tabeli, w~kt\xF3rej wy\x9Cwietlone s\xB9 kolejne iteracje. Z~ka\xBFdym nowym wierszem na ekranie przetwarzanie wyra\x9Fnie zwalnia, a\xBF do momentu zape\xB3nienia ca\xB3ej dost\xEApnej przestrzeni. Nast\xEApnie przetwarzanie obywa si\xEA ze sta\xB3a pr\xEAdko\x9Cci\xB9, w~zasadzie niezale\xBFn\xB9 od ilo\x9Cci przechowywanych iteracji. + Wyniki wszystkich pomiar\xF3w oscylowa\xB3y w~granicy dw\xF3ch minut i~czterdziestu sekund.~Zauwa\xBFalna jest wyra\x9Fna zale\xBFno\x9C\xE6 wydajno\x9Cci od liczby wierszy widocznych na ekranie. Spowodowane jest to znacznym nak\xB3adem potrzebnym do uaktualniania ca\xB3o\x9Cci tabeli, w~kt\xF3rej wy\x9Cwietlone s\xB9 kolejne iteracje. Z~ka\xBFdym nowym wierszem pojawiaj\xB9cym sie na ekranie przetwarzanie wyra\x9Fnie zwalnia, a\xBF dociera do momentu zape\xB3nienia ca\xB3ej dost\xEApnej przestrzeni. Nast\xEApnie przetwarzanie obywa si\xEA ze sta\xB3a pr\xEAdko\x9Cci\xB9, w~zasadzie niezale\xBFn\xB9 od ilo\x9Cci przechowywanych iteracji. Tryb rejestrowania \ac{RE} nie wp\xB3ywa znacz\xB9co na pr\xEAdko\x9C\xE6 oblicze\xF1 \ac{LAK}-a (w~por\xF3wnaniu do wielowymiarowych \ac{AK}). @@ -649,18 +675,18 @@ Tryb tekstowy dwuwymiarowych \ac{AK} osi\xB9ga\xB3 podobne rezultaty do \ac{LAK}-\xF3w. Czasy nieco si\xEA wyd\xB3u\xBFy\xB3y i~wynios\xB3y \x9Crednio 3:22 min.~Spos\xF3b prezentacji danych, identyczny do trybu jednowymiarowego, charakteryzuje si\xEA tym samym spowalnianiem do momentu ca\xB3kowitego wype\xB3nienia ekranu. -Graficzna reprezentacja \ac{DAK}-a, a~co za tym idzie wykorzystanie karty graficznej do uaktualniania stanu kom\xF3rek, zdecydowanie poprawia wyniki. D\xB3ugo\x9C\xE6 eksperymentu spad\xB3a \x9Crednio o~$23\%$, oscyluj\xB9c wok\xF3\xB3 2:43, rekompensuj\xB9c tym samym przyrost oblicze\xF1 wynikaj\xB9cych z~dodatkowego wymiaru. +Graficzna reprezentacja \ac{DAK}-a, a~co za tym idzie wykorzystanie karty graficznej do uaktualniania stanu kom\xF3rek, zdecydowanie poprawia wyniki. D\xB3ugo\x9C\xE6 eksperymentu spad\xB3a \x9Crednio o~$23\%$, oscyluj\xB9c wok\xF3\xB3 dw\xF3ch minut i~czterdziestu trzech sekund, rekompensuj\xB9c tym samym przyrost oblicze\xF1 wynikaj\xB9cych z~dodatkowego wymiaru. -Rejestrowanie \ac{RE} zauwa\xBFalnie wyd\xB3u\xBFa czas obliczania pojedynczej iteracji. Wynika to przede wszystkim ze znacznym wzrostem liczby \ac{RE} generowanych przez \ac{DAK}. Wp\xB3yw ten jest jednakowy zar\xF3wno na tryb tekstowy, jak i~graficzny. +Rejestrowanie \ac{RE} zauwa\xBFalnie wyd\xB3u\xBFa czas obliczania pojedynczej iteracji. Wynika to przede wszystkim ze znacznego wzrostu liczby \ac{RE} generowanych przez \ac{DAK}. Wp\xB3yw ten jest jednakowy zar\xF3wno dla trybu tekstowego, jak i~graficzny. \subsection{Automaty tr\xF3jwymiarowe} \label{subsec:atr} -W~przypadku \ac{TAK}-\xF3w dost\xEApny jest jedynie tryb graficzny. Wyniki osi\xB9gni\xEAte s\xB9 do\x9C\xE6 kontrowersyjne i~sprzeczne na pierwszy rzut oka. \x8Credni czas trwania eksperymentu nie przekracza\xB3 3:10. Wydawa\xE6 by si\xEA mog\xB3o, i\xBF wprowadzenie trzeciego wymiaru zdecydowanie pogorszy osi\xB9gi programu. Jednak\xBFe nowoczesne karty graficzne optymalizowane s\xB9 pod wzgl\xEAdem przetwarzania grafiki 3D. Nowe rozwi\xB9zania sprz\xEAtowe i~algorytmiczne nie s\xB9 wykorzystywane do wy\x9Cwietlania grafiki 2D. Zysk wynikaj\xB9cy z~ukierunkowania uk\xB3ad\xF3w graficznych jest szczeg\xF3lnie widoczny, gdy podczas przeprowadzania testu wydajno\x9Cci opr\xF3cz prowadzenia oblicze\xF1 dodatkowo manipulujemy wy\x9Cwietlaniem. Powoduje to znaczny spadek og\xF3lnej wydajno\x9Cci w~trybie 2D, podczas gdy tryb tr\xF3jwymiarowy w~zasadzie nie jest widocznie spowolniony, a~jedyne op\xF3\x9Fnienia wynikaj\xB9 raczej z~procedur obs\xB3ugi ruch\xF3w myszki, ni\xBF z~samych manipulacji. +W~przypadku \ac{TAK}-\xF3w dost\xEApny jest jedynie tryb graficzny. Osi\xB9gni\xEAte wyniki s\xB9 do\x9C\xE6 kontrowersyjne i~sprzeczne na pierwszy rzut oka. \x8Credni czas trwania eksperymentu nie przekracza\xB3 trzech minut i~dziesi\xEAciu sekund. Wydawa\xE6 by si\xEA mog\xB3o, i\xBF wprowadzenie trzeciego wymiaru zdecydowanie pogorszy osi\xB9gi programu. Jednak\xBFe nowoczesne karty graficzne optymalizowane s\xB9 pod wzgl\xEAdem przetwarzania grafiki 3D. Nowe rozwi\xB9zania sprz\xEAtowe i~algorytmiczne nie s\xB9 wykorzystywane do wy\x9Cwietlania grafiki 2D. Zysk wynikaj\xB9cy z~ukierunkowania uk\xB3ad\xF3w graficznych jest szczeg\xF3lnie widoczny, gdy podczas przeprowadzania testu wydajno\x9Cci opr\xF3cz prowadzenia oblicze\xF1 dodatkowo manipulujemy wy\x9Cwietlaniem. Powoduje to znaczny spadek og\xF3lnej wydajno\x9Cci w~trybie 2D, podczas gdy tryb tr\xF3jwymiarowy w~zasadzie nie jest widocznie spowolniony, a~jedyne op\xF3\x9Fnienia wynikaj\xB9 raczej z~procedur obs\xB3ugi ruch\xF3w myszki, ni\xBF z~samych manipulacji. Natomiast tworzenie listy \ac{RE} w~bardzo znacz\xB9cy spos\xF3b pogarsza osi\xB9gi. Pr\xEAdko\x9C\xE6 spada do $25\%$. Przetwarzanie zwalania do tego stopnia, i\xBF wyra\x9Fnie wida\xE6 przerwy mi\xEAdzy ka\xBFd\xB9 pojedyncz\xB9 iteracj\xB9. Liczba \ac{RE} tworzona w~\ac{TAK}-u stanowi znaczn\xB9 cz\xEA\x9C\xE6 og\xF3lnej liczby kom\xF3rek do obliczenia. -\chapter{Instrukcja obs\xB3ugi pakietu} +\chapterauthor{Leszek Smentek}{Instrukcja obs\xB3ugi pakietu} \label{chap:iop} \section{Typowy przebieg eksperymentu} @@ -678,7 +704,7 @@ Aby rozpocz\xB9\xE6 symulacje nale\xBFy za\xB3adowa\xE6 pliki zawieraj\xB9ce funkcje lokaln\xB9, s\xB9siedztwo oraz konfiguracje inicjaln\xB9. -Po za\xB3adowaniu wszystkich niezb\xEAdnych element\xF3w dost\xEApne jest menu symulacji, a tak\xBFe zak\xB3adki dost\xEApne dla danej symulacji. +Po wczytaniu niezb\xEAdnych element\xF3w dost\xEApne jest menu eksperymentu, a tak\xBFe zak\xB3adki charakterystyczne dla danej konfiguracji AK. \subsection {Zak\xB3adki wizualizacji} @@ -692,9 +718,9 @@ Narz\xEAdzia trybu 1D: \begin{itemize} \item kolory - tryb widoku uwzgl\xEAdniaj\xB9cy kolory dla symboli -\item warto\x9Cci - tryb domy\x9Clny +\item warto\x9Cci - tryb domy\x9Clny przedstawiaj\xB9cy liczbow\xB9 reprezentacje kom\xF3rek. \item symbole - warto\x9Cci kom\xF3rek zamieniane s\xB9 na symbole graficzne -\item wyczy\x9C\xE6 - powoduje usuni\xEAcie wszystkich zachowanych chwil czasowych z diagramu +\item wyczy\x9C\xE6 - powoduje usuni\xEAcie wszystkich zachowanych chwil czasowych z diagramu historii przetwarzania \end{itemize} \subsubsection {Tekstowy widok 2D} @@ -708,9 +734,9 @@ \begin{itemize} \item kolory - tryb widoku uwzgl\xEAdniaj\xB9cy kolory dla symboli -\item warto\x9Cci - tryb domy\x9Clny +\item warto\x9Cci - tryb domy\x9Clny przedstawiaj\xB9cy liczbow\xB9 reprezentacje kom\xF3rek \item symbole - warto\x9Cci kom\xF3rek zamieniane s\xB9 na symbole graficzne -\item p\xB3aszczyzna z - warto\x9C\xE6 wsp\xF3\xB3rz\xEAdnej z p\xB3aszczyzny na znajduje si\xEA przekr\xF3j(wyst\xEApuje jedynie dla konfiguracji 3D) +\item p\xB3aszczyzna z - warto\x9C\xE6 przesuni\xEAcia w~p\xB3aszczy\x9Fnie XY ) \end{itemize} \subsubsection {Graficzny widok 2D} @@ -720,6 +746,8 @@ \caption{Graficzny widok 2D} \end{figure} +Widok ten obrazuje KB z~zastosowaniem konfiguracji kolor\xF3w. + \subsubsection {Widok 3D} \begin{figure}[h] \centering @@ -730,8 +758,8 @@ Narz\xEAdzia trybu 3D: \begin{itemize} -\item Perspektywa - tryb perspektywy -\item Ortho - tryb perspektywy +\item Perspektywa - tryb perspektywy odzwierciedlaj\xB9cy spos\xF3b postrzegania \x9Cwiata przez ludzkie oko +\item Ortho - tryb perspektywy ortogonalnej. \item przekr\xF3j - zbi\xF3r narz\xEAdzi umo\xBFliwiaj\xB9cych wykonywania przekroj\xF3w w przestrzeni 3D \end{itemize} @@ -742,10 +770,8 @@ \caption{Zak\xB3adka funkcja} \end{figure} -Widok przedstawia tabele funkcji lokalnej. Kolumny przedstawiaj\xB9 sumy argument\xF3w totalizowanych. +Widok przedstawia tabele funkcji lokalnej. Warto\x9Cci nieokre\x9Clone w tablicy funkcji przedstawione s\xB9 w postaci symbolu "?". -Warto\x9Cci nieokre\x9Clone w tablicy funkcji przedstawione s\xB9 w postaci symbolu "?". - \subsection {Zak\xB3adka s\xB9siedztwo} \begin{figure}[h] \centering @@ -765,12 +791,12 @@ \end{itemize} \subsection {Edycja funkcji lokalnej} -W celu zmiany warto\x9Cci funkcji nale\xBFy wybra\xE6 pozycje w tabeli a nast\xEApnie wprowadzi\xE6 now\xB9 warto\x9C\xE6 za pomoc\xB9 klawiatury. Wprowadzenie warto\x9Cci ujemnej lub znaku "?" spowoduje i\xBF funkcja dla danych argument\xF3w jest nieokre\x9Clona. Po natrafieniu na warto\x9C\xE6 nieokre\x9Clon\xB9 podczas oblicze\xF1 spowoduje zatrzymanie symulacji i zaznaczenie w tabeli miejsca nieokre\x9Clonego, oraz w widokach 1D, tekstowym 2D i 3D miejsca, dla kt\xF3rego wyst\xB9pi\xB3a nieokre\x9Clono\x9C\xE6. +W celu zmiany warto\x9Cci funkcji nale\xBFy wybra\xE6 pole w tabeli a nast\xEApnie wprowadzi\xE6 now\xB9 warto\x9C\xE6 za pomoc\xB9 klawiatury. Wprowadzenie warto\x9Cci ujemnej lub znaku "?" spowoduje, i\xBF funkcja dla danych argument\xF3w jest nieokre\x9Clona. Po natrafieniu na warto\x9C\xE6 nieokre\x9Clon\xB9 podczas oblicze\xF1 spowoduje zatrzymanie symulacji, i zaznaczenie w tabeli miejsca nieokre\x9Clonego, oraz w widokach 1D, tekstowym 2D i 3D miejsca, dla kt\xF3rego wyst\xB9pi\xB3a nieokre\x9Clono\x9C\xE6. \subsection {Edycja s\xB9siedztwa} Edycja s\xB9siedztwa nast\xEApuje poprzez zaznaczenie wybranej kom\xF3rki w przestrzeni 3D i u\xBFycia przycisku "Ustaw zaznaczone". Zmiana zostaje dokonana na warto\x9C\xE6 wybran\xB9 z tabeli "S\xB9siedztwo". -Aby zmiany zosta\xB3y zachowane nale\xBF u\xBFy\xE6 przycisku "Zatwierd\x9F". Przycisku "Prze\xB3aduj" spowoduje powr\xF3t do poprzedniej konfiguracji. +Aby zmiany zosta\xB3y zachowane nale\xBF u\xBFy\xE6 przycisku "Zatwierd\x9F". Naci\x9Cni\xEAcie "Prze\xB3aduj" prze\xB3adowanie poprzedniej konfiguracji. \chapter{Podzia\xB3 pracy} \label{chap:ppr} @@ -816,15 +842,23 @@ Tabela \ref{tab:apm} mo\xBFe mylnie sugerowa\xE6 rozk\xB3ad pracy. Modu\xB3 silnika obliczeniowego jest najbardziej pracoch\xB3onn\xB9 cz\xEA\x9Cci\xB9 symulatora. -\chapter{Wnioski} +\chapterauthor{Cezary Krzy\xBFanowski}{Wnioski} \label{chap:wni} -Stworzenie bogato wyposa\xBFonego pakietu symulacyjnego jest zadaniem nietrywialnym. Nie tylko z~uwagi na z\xB3o\xBFono\x9C\xE6 programistyczn\xB9 zagadnienia, ale r\xF3wnie\xBF precyzyjne sformu\xB3owanie za\xB3o\xBFe\xF1. Trzy miesi\xB9ce pracy w~zespole pozwoli\xB3y obiektywnie oszacowa\xE6 swoje mo\xBFliwo\x9Cci oraz wypracowa\xE6 metody pracy grupowej. Szczeg\xF3lnie pouczaj\xB9ca okaza\xB3a si\xEA wsp\xF3\xB3praca z~operatorem ko\xF1cowym pakietu, kt\xF3ry, podobnie jak klient sp\xF3\xB3ki programistycznej, nie jest zainteresowany technikaliami, a~ko\xF1cow\xB9 funkcjonalno\x9Cci\xB9 wytwarzanego produktu. +Obiektywnie por\xF3wnuj\xB9c pakiet stworzony w~wyniku tej pracy z~istniej\xB9cymi rozwi\xB9zaniami stwierdzono, i\xBF nie wykorzystuj\xB9 bie\xBF\xB9cych mo\xBFliwo\x9Cci. Mowa tutaj zar\xF3wno nowoczesnych uk\xB3adach graficznych, jak i~wynikaj\xB9cych z~literatury i~praktyki nowych funkcjonalno\x9Cciach. Szczeg\xF3lnie wspomaganie dobierania modelu jest pomijane w~przeanalizowanych aplikacjach. -Najbardziej owocn\xB9 decyzj\xB9 projektu by\xB3o wykorzystanie paradygmatu \ac{MVC} w~implementacji. Dodatkowy nak\xB3ad pracy wynikaj\xB9cy z~budowy infrastruktury komunikacyjnej mi\xEAdzy modelem a~jego widokiem zwraca\xB3 si\xEA bardzo szybko, gdy system nabiera\xB3 na z\xB3o\xBFono\x9Cci. Przemy\x9Clane interfejsy zmniejsza\xB3y pracoch\xB3onno\x9C\xE6 dodawania nowych funkcjonalno\x9Cci do pakietu, jakkolwiek i~tak coraz wi\xEAksz\xB9 si\xEA z~ka\xBFd\xB9, cho\xE6by trywialn\xB9, zmian\xB9. +Wytworzony symulator\ac{AK} zawiera mo\xBFliwo\x9Cci funkcjonalne nie implementowane wcze\x9Cniej, w~szczeg\xF3lno\x9Cci koncepcja \ac{OL} w~przestrzeni tr\xF3jwymiarowej. -Perspektyw\xB9 na rozw\xF3j, naszym zdaniem, jest przeniesienie ci\xEA\xBFaru oblicze\xF1 w~symulatorach \ac{AK} z~silnika obliczeniowego na dobrze zaprojektowany modu\xB3 przechowywania i~indeksowania \ac{RE}. Wydajno\x9C\xE6 ca\xB3ego systemu wzros\xB3a by znacznie, gdy\xBF po skompletowaniu listy \ac{RE} dla danej symulacji, co dzieje zwykle po kilku pierwszych iteracjach, warto\x9Cci kolejnych kom\xF3rek mo\xBFna by bezpo\x9Crednio wpisywa\xE6, bez potrzeby ponownego ich wyznaczania. Ponadto przechowywanie pe\xB3nej listy \ac{RE} umo\xBFliwia implementowanie nowych funkcjonalno\x9Cci, zwi\xB9zanych z~analizowaniem dzia\xB3ania \ac{FL}. +Podczas eksperyment\xF3w pakietu zauwa\xBFono, i\xBF nie wszystkie kom\xF3rki wymagaj\xB9 uaktualniania w~ka\xBFdej iteracji. Prowadzi to do wniosku, i\xBF mo\xBFliwa jest optymalizacja oblicze\xF1 poprzez u\xBFycie konceptu listy uaktualnie\xF1. +Zaprojektowanie bogato wyposa\xBFonego pakietu symulacyjnego jest zadaniem nietrywialnym. Nie tylko z~uwagi na z\xB3o\xBFono\x9C\xE6 programistyczn\xB9 zagadnienia, ale r\xF3wnie\xBF precyzyjne sformu\xB3owanie za\xB3o\xBFe\xF1. Interkcja w~zespole pozwoli\xB3a obiektywnie oszacowa\xE6 swoje mo\xBFliwo\x9Cci oraz wypracowa pracy grupowej. Szczeg\xF3lnie pouczaj\xB9ca okaza\xB3a si\xEA wsp\xF3\xB3praca z~operatorem ko\xF1cowym pakietu, kt\xF3ry, podobnie jak klient sp\xF3\xB3ki programistycznej, nie jest zainteresowany technikaliami, a~ko\xF1cow\xB9 funkcjonalno\x9Cci\xB9 wytwarzanego produktu. + +Najbardziej owocn\xB9 decyzj\xB9 projektu by\xB3o wykorzystanie paradygmatu \ac{MVC} w~implementacji. Dodatkowy nak\xB3ad pracy wynikaj\xB9cy z~budowy infrastruktury komunikacyjnej, mi\xEAdzy modelem a~jego widokiem, procentowa\xB3, gdy system nabiera\xB3 na z\xB3o\xBFono\x9Cci. + % Bibliografia w zewn\xEAtrznym pliku w/g standardu natbib +\nocite{cac} +\nocite{nks} +\nocite{kul} +\nocite{qt4} \bibliographystyle{plain} \bibliography{thesis} @@ -852,9 +886,8 @@ Dr~Krzysztofowi Zwierzy\xF1skiemu za ponowne obudzenie mojej pasji programistycznej. Andrzejowi Dopierale, developerowi PLD i~serdecznemu przyjacielowi, kt\xF3ry zasia\xB3 u~mnie ziarno Wolnego Oprogramowania i~Linuxa w~najodpowiedniejszej chwili~--- to on skierowa\xB3 mnie na t\xEA drog\xEA informatyki, kt\xF3r\xB9 tak pokocha\xB3em. Dr~Tomaszowi Bilskiemu (w~chwili pisania tych s\xB3\xF3w koreferentem tej pracy mia\xB3 by\xE6 prof.~Janusz Stok\xB3osa) za natchnienie do przestudiowania materia\xB3\xF3w CISCO. Mgr~Tomaszowi Kokowskiemu za zrzucenie mnie z~piedesta\xB3u omnipotencji podczas praktyk w~Centrum Zarz\xB9dzania Sieci\xB9 Komputerow\xB9 oraz prof.~Czes\xB3awowi J\xEAdrzejkowi za zdmuchni\xEAcie nowych pok\xB3ad\xF3w omnipotencji zbudowanych od momentu praktyk, ale przede wszystkim za wsparcie - zawsze, wsz\xEAdzie i~w~ka\xBFdej sprawie. -Wreszcie Justynie Zi\xF3\xB3kowskiej, kt\xF3ra nadzorowa\xB3a, \xBFeby ten tekst potwierdza\xB3, i\xBF zda\xB3em z~wynikiem pozytywnym matur\xEA z~j\xEAzyka polskiego. +Wreszcie Justynie Zi\xF3\xB3kowskiej, kt\xF3ra nadzorowa\xB3a, \xBFeby ten tekst potwierdza\xB3, i\xBF zda\xB3em z~wynikiem pozytywnym matur\xEA z~j\xEAzyka polskiego oraz dr~Andrzejowi Szwabe za zadanie kluczowego pytanie ,,dlaczego''. -\section*{Leszek Smentek} \end{document} % vim:fencs=cp1250:fenc=cp1250 Modified: trunk/qcell/doc/licenciate_thesis/titlepage.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/titlepage.tex 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/doc/licenciate_thesis/titlepage.tex 2007-02-03 11:24:48 UTC (rev 280) @@ -22,7 +22,8 @@ % Tytu\xB3 \begin{Huge} - ,,Wizualizacja przetwarzania w automacie kom\xF3rkowym z wybranym obserwatorem'' + \bfseries + Wizualizacja przetwarzania w automacie kom\xF3rkowym z wybranym obserwatorem \end{Huge} \end{center} @@ -34,17 +35,17 @@ \item[Promotor:] dr~in\xBF.~Pawe\xB3 Siwak \item[Recenzent:] dr~in\xBF.~Tomasz Bilski \end{description} + + \cleardoublepage + \pagestyle{empty} + \vspace*{\fill} + {\hfill\sffamily\itshape ...} + \begin{flushright} + Cezary Krzy\xBFanowski:\\ + \emph{Mamie\ldots po prostu} + \end{flushright} + \rmfamily + \normalfont \end{titlepage} -\pagestyle{empty} -\vspace*{\fill} -{\hfill\sffamily\itshape ...} -\begin{flushright} -Cezary Krzy\xBFanowski:\\ -\emph{Mamie\ldots po prostu} -Leszek Smentek: -\end{flushright} -\rmfamily -\normalfont - Modified: trunk/qcell/visgui/ElementalRulesWidget.cpp =================================================================== --- trunk/qcell/visgui/ElementalRulesWidget.cpp 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/visgui/ElementalRulesWidget.cpp 2007-02-03 11:24:48 UTC (rev 280) @@ -94,7 +94,7 @@ rules.append(item->text(0).toInt()); } - emit rulesSelected(rules); +// emit rulesSelected(rules); } void ElementalRulesWidget::setVisible(bool visible) @@ -140,7 +140,7 @@ // Make it look good rp.rulePropertiesTable->resizeColumnsToContents(); - // Finally if the dialog is accepted, set the resulg + // Finally if the dialog is accepted, set the result // in the tree if (rp.exec() == QDialog::Accepted) { @@ -151,3 +151,8 @@ } } +//void ElementalRulesWidget::rulesSelected(QHash<int, QList<QVector<int> > > rules) +//{ +// +//} + Modified: trunk/qcell/visgui/ElementalRulesWidget.h =================================================================== --- trunk/qcell/visgui/ElementalRulesWidget.h 2007-01-30 10:56:35 UTC (rev 279) +++ trunk/qcell/visgui/ElementalRulesWidget.h 2007-02-03 11:24:48 UTC (rev 280) @@ -13,6 +13,9 @@ #include <QStringList> #include <QTreeWidgetItem> #include <QTableWidgetItem> +#include <QList> +#include <QVector> +#include <QHash> #include "ui_ElementalRulesWidget.h" #include "RuleProperties.h" @@ -21,7 +24,7 @@ Q_OBJECT signals: void visible(bool visible); - void rulesSelected(QVector<int> rules); +// void rulesSelected(QHash<int, QList<QVector<int> > > rules); public slots: void setVisible(bool visible); void show(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-09 13:17:01
|
Revision: 299 http://svn.sourceforge.net/qcell/?rev=299&view=rev Author: dhubleizh Date: 2007-02-09 05:16:59 -0800 (Fri, 09 Feb 2007) Log Message: ----------- - supported Import function in menu - make import call parsers, like LIF Modified Paths: -------------- trunk/qcell/parsers/parsers.pro trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h trunk/qcell/visgui/MainWindow.ui trunk/qcell/visgui/main.cpp trunk/qcell/visgui/visgui.pro Modified: trunk/qcell/parsers/parsers.pro =================================================================== --- trunk/qcell/parsers/parsers.pro 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/parsers/parsers.pro 2007-02-09 13:16:59 UTC (rev 299) @@ -5,4 +5,5 @@ REAK \ LTFL \ ZIFW \ - ZIFWP + ZIFWP \ + Life-1.05 Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-09 13:16:59 UTC (rev 299) @@ -262,6 +262,14 @@ world_parsers[extension] = iParser; } } + if (type == "Import") + { + file_types = iParser->fileTypes("Import"); + foreach(QString extension, file_types) + { + import_parsers[extension] = iParser; + } + } } } } @@ -529,6 +537,69 @@ setupWorld(); } + else if (type == "Import") + { + if (!import_parsers.contains(subtype)) + { + qDebug(tr("The file extensions %1 isn't supported.") + .arg(subtype) + .toAscii() + ); + return; + } + + // Not every file will provide all the elements of CA, so let's warn the user + QString warning; + + // Try to parse Neighbourhood + neighbourhood = new Neighbourhood; + if (neighbourhood->fromXmlString(&neighbourhood_parsers[subtype]->parse(file_content, "Neighbourhood", subtype))) + { + setupNeighbourhood(); + } + else + { + warning.append(tr("The imported file didn't contain Neighbourhood specification.\n")); + delete neighbourhood; + } + + // Try to parse LocalFunction + local_function = new LocalFunction(); + if (local_function->fromXmlString(&function_parsers[subtype]->parse(file_content, "LocalFunction", subtype))) + { + setupLocalFunction(); + } + else + { + warning.append(tr("The imported file didn't contain LocalFunction specification.\n")); + delete local_function; + } + + // And try to parse the World + CalculationData *tempCD = new CalculationData(); + if(tempCD->setFromXmlString(&world_parsers[subtype]->parse(file_content, "World", subtype))) + { + data.clear(); + data.append(tempCD); + + setupWorld(); + } + else + { + warning.append(tr("The imported file didn't contain World specification.")); + delete tempCD; + } + + if ((neighbourhood == NULL) || (local_function == NULL) || (tempCD == NULL)) + { + qDebug(warning.toAscii()); + } + else if ((neighbourhood == NULL) && (local_function == NULL) && (tempCD == NULL)) + { + qCritical(warning.toAscii()); + return; + } + } else { qDebug(tr("Unsupported file type to parse.").toAscii()); @@ -1007,6 +1078,55 @@ } } +void MainWindow::on_action_Import_activated() +{ + if(import_parsers.count() == 0) + { + QMessageBox::warning( + /*parent*/ this, + /*title*/ tr("Plugins warning"), + /*message*/ tr("There are no plugins loaded to handle importing.") + ); + + return; + + } + + QFileDialog fd( + /*parent*/ this, + /*cation*/ tr("Import"), + /*dir*/ "." + ); + + fd.setFileMode(QFileDialog::ExistingFile); + + QStringList filters; + QString default_filter(tr("Supported files")); + default_filter.append(" ("); + QString filter; + // Add filter in format %{name} files (*.%{name}) + foreach(QString key, import_parsers.keys()) + { + // Don't shorten this, as it is made for translations + // purposes + default_filter.append("*." + key + ' '); + filter = key + " " + tr("files") + " (*." + key + ")"; + filters << filter; + } + default_filter.append(')'); + filters.prepend(default_filter); + fd.setFilters(filters); + + if(fd.exec()) + { + if(!fd.selectedFiles().isEmpty()) + { + callParser(fd.selectedFiles().first(), "Import"); + } + + } +} + QByteArray MainWindow::serialize() { QDomDocument doc; @@ -1344,3 +1464,4 @@ action_World_save->setEnabled(true); } + Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/visgui/MainWindow.h 2007-02-09 13:16:59 UTC (rev 299) @@ -56,6 +56,7 @@ void on_action_Neighbourhood_activated(); void on_action_Function_activated(); void on_action_World_activated(); + void on_action_Import_activated(); void on_action_World_save_activated(); void on_action_Neighbourhood_save_activated(); @@ -90,6 +91,7 @@ QMap<QString, ParserInterface*> neighbourhood_parsers; QMap<QString, ParserInterface*> function_parsers; QMap<QString, ParserInterface*> world_parsers; + QMap<QString, ParserInterface*> import_parsers; void callParser(QString filename, QString type); void callSaver(const QString filename, const QString type); Modified: trunk/qcell/visgui/MainWindow.ui =================================================================== --- trunk/qcell/visgui/MainWindow.ui 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/visgui/MainWindow.ui 2007-02-09 13:16:59 UTC (rev 299) @@ -101,6 +101,7 @@ <addaction name="menu_Open" /> <addaction name="action_Open_experiment" /> <addaction name="action_Continue_experiment" /> + <addaction name="action_Import" /> <addaction name="menu_Save" /> <addaction name="action_Save_experiment" /> <addaction name="separator" /> @@ -322,6 +323,17 @@ <string>&Function</string> </property> </action> + <action name="action_Import" > + <property name="enabled" > + <bool>true</bool> + </property> + <property name="text" > + <string>&Import</string> + </property> + <property name="statusTip" > + <string>Imports experiments from other programs.</string> + </property> + </action> </widget> <resources/> <connections/> Modified: trunk/qcell/visgui/main.cpp =================================================================== --- trunk/qcell/visgui/main.cpp 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/visgui/main.cpp 2007-02-09 13:16:59 UTC (rev 299) @@ -16,6 +16,7 @@ Q_IMPORT_PLUGIN(LTFLFileParser); Q_IMPORT_PLUGIN(ZIFWFileParser); //Q_IMPORT_PLUGIN(ZIFWPFileParser); +Q_IMPORT_PLUGIN(Life105FileParser); /** * @brief Displays all debug messages in GUI Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-02-09 13:16:03 UTC (rev 298) +++ trunk/qcell/visgui/visgui.pro 2007-02-09 13:16:59 UTC (rev 299) @@ -71,7 +71,7 @@ ../basesources/functiontable.cpp \ ../basesources/neigborhoodtools.cpp -LIBS = -L../libs -lN -lFQT -lKI -lREAK -lLTFL -lZIFW -lZIFWP +LIBS = -L../libs -lN -lFQT -lKI -lREAK -lLTFL -lZIFW -lZIFWP -lLife105 TRANSLATIONS = visgui_pl.ts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-09 20:26:38
|
Revision: 300 http://svn.sourceforge.net/qcell/?rev=300&view=rev Author: dhubleizh Date: 2007-02-09 12:26:35 -0800 (Fri, 09 Feb 2007) Log Message: ----------- - exporting works - no data checks - if it isn't a LIF function, things could happen... - menu Export option and so on... Modified Paths: -------------- trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.cpp trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.h trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h trunk/qcell/visgui/MainWindow.ui Modified: trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.cpp 2007-02-09 13:16:59 UTC (rev 299) +++ trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.cpp 2007-02-09 20:26:35 UTC (rev 300) @@ -13,10 +13,10 @@ << "Neighbourhood" << "LocalFunction" << "World"; - supported_file_types << "LIF"; + supported_file_types << "LIF" + << "LIFE"; } -/// @todo Incorporate genreal Function file to output resulting XML QString Life105ParserPlugin::realParser(const QByteArray content, const QString type, const QString subtype) { QStringList lines; @@ -28,8 +28,8 @@ LocalFunction lf; // Keep track of header bool header = true; - CalculationData cd; - QHash<QPoint, Universe> objects; + CalculationData *cd; + int version = -1; // Set up MCells Neighbourhood (Conways) Neighbourhood N; @@ -69,25 +69,31 @@ } // Function type - format = QRegExp("^#Life1\\.05$"); + format = QRegExp("^#Life 1\\.05$"); + QRegExp format2("^#Life 1\\.06$"); lines[0] = lines[0].trimmed(); if(format.exactMatch(lines[0])) { - lines.removeFirst(); - line_nr++; + version = 105; } + else if (format2.exactMatch(lines[0])) + { + version = 106; + } else { qDebug(tr("Wrong file specification in header line %1. Should be %2, but is %3.") .arg(line_nr) - .arg("#Life1.05") + .arg("#Life 1.05") .arg(lines[0]) .toAscii() ); return QString(); } + lines.removeFirst(); + line_nr++; // Dealing with the header - QRegExp comment("^#D.*$"); + QRegExp comment("^#(D|C|O).*$"); QRegExp conway("^#N$"); QRegExp rule("^#R [1-8]{1,8}/[1-8]{1,8}"); while (header) @@ -169,18 +175,178 @@ return QString(); } lines[0] = lines[0].trimmed(); - format = QRegExp("^(\\.|\\*)*$"); + switch (version) + { + case 105: + { + cd = parseIn105(&lines, line_nr); + break; + } + case 106: + { + cd = parseIn106(&lines, line_nr); + break; + } + } + // If error occurred while parsing, cd could be null + if (cd == NULL) + { + return QString(); + } + + if (type == "Neighbourhood") + { +// qDebug(N.toXmlString().toAscii()); + delete cd; + return N.toXmlString(); + } + else if (type == "LocalFunction") + { +// qDebug(lf.toXmlString().toAscii()); + delete cd; + return lf.toXmlString(); + } + else if (type == "World") + { +// qDebug(cd->toXmlString().toAscii()); + QString ret = cd->toXmlString(); + delete cd; + return ret; + } +} + +/// @todo Check N LF and CD if they really are apropriate to save them in LIF +QByteArray Life105ParserPlugin::parseOut(QString content, const QString type, const QString subtype) +{ + // The resulting array to write to file by the backend + QByteArray result; + + if (type == "Neighbourhood") + { + Neighbourhood N; + N.fromXmlString(&content); + // Check if we can use the generic type from the XML string + if(!N.fromXmlString(&content)) + { + qDebug(tr("Unable to parse out LocalFunction data!").toAscii()); + return QByteArray(); + } + + // Header + result.append("#Life 1.05\n"); + result.append("#D Generated by QCell\n"); + result.append("#D http://www.qcell.sourceforge.net"); + result.append("#O Cezary Krzy\xBFanowsky & Leszek Smentek 2007"); + } + else if (type == "LocalFunction") + { + LocalFunction lf; + // Check if we can use the generic type from the XML string + if(!lf.fromXmlString(&content)) + { + qDebug(tr("Unable to parse out Neighbourhood data!").toAscii()); + return QByteArray(); + } + + // Parse out LocalFunction + QList<int> survive_sums, born_sums; + for (int i = 0; i < 8; i++) + { + // When cell is 0 + if (lf.getValueAt(i * 2) == 1) + { + survive_sums.append(i); + } + // When cell i 1 + if (lf.getValueAt(i * 2 + 1)) + { + born_sums.append(i); + } + } + + result.append("#R "); + // Write down survive values + for (int i = 0; i < survive_sums.size(); i++) + { + result.append(QString::number(survive_sums[i]).toAscii()); + } + // Separator + result.append('/'); + // Write down born values + for (int i = 0; i < born_sums.size(); i++) + { + result.append(QString::number(born_sums[i]).toAscii()); + } + // Finally the line ends + result.append('\n'); + } + else if (type == "World") + { + CalculationData cd; + // Check if we can use the generic type from the XML string + if (!cd.setFromXmlString(&content)) + { + qDebug(tr("Unable to parse out Neighbourhood data!").toAscii()); + return QByteArray(); + } + // #P to place the object in the middle + result.append(QString("#P %1 %2\n") + .arg(-(cd.getSizeX() / 2 + 1)) + .arg(-(cd.getSizeY() / 2 + 1)) + .toAscii() + ); + + // Finally the universe writing + for (int y = 0; y < cd.getSizeY(); y++) + { + for (int x = 0; x < cd.getSizeX(); x++) + { + if (cd.getValueAt_i(x, y) == 0) + { + result.append('.'); + } + else + { + result.append('*'); + } + } + + // Break for each line + result.append('\n'); + } + } + + return result; +} + +CalculationData* Life105ParserPlugin::parseIn105(QStringList *lines, int line_nr) +{ + // The return object + CalculationData* cd = new CalculationData; + // Parsed objects holder + QHash<QPoint, Universe> objects; + + // Content line fotmat + QRegExp format = QRegExp("^(\\.|\\*)*$"); + // Coordinates line QRegExp coords("^#P (-)?(\\d)* (-)?(\\d)*$"); + // Empty line QRegExp line_separator("^\\.$"); + // Needed for universe size determination int min_x, max_x, min_y, max_y; min_x = max_x = min_y = max_y = 0; + // Holds the #P's line value QPoint tmp_point(0, 0); + // The object being read Universe tmp_object; - foreach(QString line, lines) + foreach(QString line, *lines) { if(format.exactMatch(line)) { + // Append new line to output for each input line tmp_object.append(QVector<bool>(line.size(), 0)); + // Parse the line in search of 1-s, as the resulting + // table is filled with 0-s by default for (int i = 0; i < line.size(); i++) { if (line[i] == '*') @@ -189,6 +355,7 @@ } } + // Check max exceeding if ((tmp_point.x() + line.size()) > max_x) { max_x = tmp_point.x() + line.size(); @@ -227,6 +394,7 @@ } else if (line_separator.exactMatch(line)) { + // Empty line while separator tmp_object.append(QVector<bool>()); } else if (!line.isEmpty()) @@ -236,7 +404,7 @@ .toAscii() ); - return QString(); + return NULL; } // To keep count of current line nr @@ -266,7 +434,7 @@ qDebug(tr("This file doesn't contain any object.") .toAscii() ); - return QString(); + return NULL; } //// Prepare the actual structures in QCell @@ -281,10 +449,10 @@ { size_y++; } - cd.resizeData(size_x, size_y); - QPoint center(cd.getSizeX()/2, cd.getSizeY()/2); + cd->resizeData(size_x, size_y); + QPoint center(cd->getSizeX()/2, cd->getSizeY()/2); // Fill the whole universe with 0-s - cd.fillData(0); + cd->fillData(0); // Actual object placement in the universe QHash<QPoint, Universe>::const_iterator i = objects.begin(); @@ -294,7 +462,7 @@ { for (int dx = 0; dx < i.value()[dy].size(); dx++) { - cd.setValueAt( + cd->setValueAt( (int)i.value()[dy][dx], /*value*/ center.x() + (i.key().x() + dx), /*x*/ center.y() + (i.key().y() + dy) /*y*/ @@ -304,68 +472,93 @@ ++i; } - if (type == "Neighbourhood") - { -// qDebug(N.toXmlString().toAscii()); - return N.toXmlString(); - } - else if (type == "LocalFunction") - { -// qDebug(lf.toXmlString().toAscii()); - return lf.toXmlString(); - } - else if (type == "World") - { -// qDebug(cd.toXmlString().toAscii()); - return cd.toXmlString(); - } + return cd; } - -QByteArray Life105ParserPlugin::parseOut(QString content, const QString type, const QString subtype) +CalculationData* Life105ParserPlugin::parseIn106(QStringList *lines, int line_nr) { - // The resulting array to write to file by the backend - QByteArray result; - // Generic type to parse XML request - LocalFunction lf; + CalculationData* cd = new CalculationData; - // Check if we can use the generic type from the XML string - if(!lf.fromXmlString(&content)); + QRegExp format = QRegExp("^-?(\\d)* -?(\\d)*$"); + QRegExp line_separator("^\\.$"); + int min_x, max_x, min_y, max_y; + min_x = max_x = min_y = max_y = 0; + QList<QPoint> points; + QPoint tmp_point; + QStringList numbers; + foreach(QString line, *lines) { - qDebug(tr("Unable to parse out internal data!").toAscii()); + if(format.exactMatch(line)) + { + // Split the line + numbers = line.split(' '); + tmp_point.setX(numbers[0].toInt()); + tmp_point.setY(numbers[1].toInt()); - return QByteArray(); + // Actually append the point + points.append(tmp_point); + + // Borders check + if (tmp_point.x() > max_x) + { + max_x = tmp_point.x(); + } + else if (tmp_point.x() < min_x) + { + min_x = tmp_point.x(); + } + + if (tmp_point.y() > max_y) + { + max_y = tmp_point.y(); + } + else if (tmp_point.y() < min_y) + { + min_y = tmp_point.y(); + } + } + else if (!line.isEmpty()) + { + qDebug(tr("Bogus characters in line %1.") + .arg(line_nr) + .toAscii() + ); + + return NULL; + } + + // To keep count of current line nr + line_nr++; } - // Header - result.append("Life105"); - result.append('\n'); - - // Second line - // Num of args - result.append(lf.getNumberOfArgs()); - result.append(' '); - // Num of arg values - result.append(lf.getAlphabetSize()); - result.append(' '); - // Num of return values - result.append(lf.getMaxReturnValues()); - result.append(' '); - result.append('\n'); + //// Prepare the actual structures in QCell + // Scale the universe to be SCALE times bigger then the object from file take + int size_x = (abs(min_x) + max_x) * SCALE; + if ((size_x % 2) == 0) + { + size_x++; + } + int size_y = (abs(min_y) + max_y) * SCALE; + if ((size_y % 2) == 0) + { + size_y++; + } - // Third line - summed args - foreach(int arg, lf.getSummedArguments()) + cd->resizeData(size_x, size_y); + QPoint center(cd->getSizeX()/2, cd->getSizeY()/2); + // Fill the whole universe with 0-s + cd->fillData(0); + + for (int i = 0; i < points.size(); i++) { - result.append(QString::number(arg)[0].toAscii()); - result.append(','); + cd->setValueAt( + 1, /*value*/ + center.x() + points[i].x(), /*x*/ + center.y() + points[i].y() /*y*/ + ); } - // Get rid of the penging `,' - result.chop(1); - result.append('\n'); - /// @todo Main function writing - - return result; + return cd; } Q_EXPORT_PLUGIN2(Life105FileParser, Life105ParserPlugin) Modified: trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.h =================================================================== --- trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.h 2007-02-09 13:16:59 UTC (rev 299) +++ trunk/qcell/parsers/Life-1.05/Life105ParserPlugin.h 2007-02-09 20:26:35 UTC (rev 300) @@ -14,6 +14,7 @@ #include <QList> #include <QHash> #include <QPoint> +#include <QDomDocument> #include "GenericParserPlugin.h" #include "Neighbourhood.h" @@ -21,7 +22,7 @@ #include "CalculationData.h" #define LIFE105_PARSER_TYPE "Function" -#define SCALE 5 +#define SCALE 2 typedef QVector<QVector<bool> > Universe; int qHash(const QPoint &point) @@ -33,6 +34,8 @@ { protected: QString realParser(const QByteArray content, const QString type, const QString subtype); + CalculationData* parseIn105(QStringList *lines, int line_nr); + CalculationData* parseIn106(QStringList *lines, int line_nr); public: Life105ParserPlugin(); Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-09 13:16:59 UTC (rev 299) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-09 20:26:35 UTC (rev 300) @@ -275,7 +275,6 @@ } /// @todo This function doesn't belong here. It initializes things not fore GUI setupEngine(); - } void MainWindow::on_action_About_activated() @@ -667,6 +666,46 @@ /// @todo Wait for toXmlString file.write(world_parsers[subtype]->parseOut(sw->getStorage()->toXmlString(), type, subtype)); } + else if (type == "Import") + { + if (!import_parsers.contains(subtype)) + { + qDebug(tr("Exporting to %1 isn't supported") + .arg(subtype) + .toAscii() + ); + return; + } + + QByteArray result, tmp_result; + + // Neighbourhood checking + tmp_result = import_parsers[subtype]->parseOut(neighbourhood->toXmlString(), "Neighbourhood", subtype); + if (tmp_result.isEmpty()) + { + return; + } + result.append(QByteArray(tmp_result)); + + // LocalFunction parsing + tmp_result = import_parsers[subtype]->parseOut(local_function->toXmlString(), "LocalFunction", subtype); + if (tmp_result.isEmpty()) + { + return; + } + result.append(QByteArray(tmp_result)); + + // World parsing + tmp_result = import_parsers[subtype]->parseOut(sw->getStorage()->toXmlString(), "World", subtype); + if (tmp_result.isEmpty()) + { + return; + } + result.append(QByteArray(tmp_result)); + + // Finally - write to the file + file.write(result); + } else { qDebug(tr("Unsupported file type to parse.").toAscii()); @@ -1464,4 +1503,49 @@ action_World_save->setEnabled(true); } +void MainWindow::on_action_Export_activated() +{ + if(import_parsers.count() == 0) + { + QMessageBox::warning( + /*parent*/ this, + /*title*/ tr("Plugins warning"), + /*message*/ tr("There are no plugins loaded to handle exporting.") + ); + return; + } + + QFileDialog fd( + /*parent*/ this, + /*cation*/ tr("Export Experiment"), + /*dir*/ "." + ); + + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setFileMode(QFileDialog::AnyFile); + + QStringList filters; + QString filter; + // Add filter in format %{name} files (*.%{name}) + foreach(QString key, import_parsers.keys()) + { + // Don't shorten this, as it is made for translations + // purposes + filter = key + " " + tr("files") + " (*." + key + ")"; + filters << filter; + } + fd.setFilters(filters); + /// @todo Forge some real suffix adding + fd.setDefaultSuffix("*"); + + if(fd.exec()) + { + if(!fd.selectedFiles().isEmpty()) + { + callSaver(fd.selectedFiles().first(), "Import"); + + } + } +} + Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-02-09 13:16:59 UTC (rev 299) +++ trunk/qcell/visgui/MainWindow.h 2007-02-09 20:26:35 UTC (rev 300) @@ -57,6 +57,7 @@ void on_action_Function_activated(); void on_action_World_activated(); void on_action_Import_activated(); + void on_action_Export_activated(); void on_action_World_save_activated(); void on_action_Neighbourhood_save_activated(); Modified: trunk/qcell/visgui/MainWindow.ui =================================================================== --- trunk/qcell/visgui/MainWindow.ui 2007-02-09 13:16:59 UTC (rev 299) +++ trunk/qcell/visgui/MainWindow.ui 2007-02-09 20:26:35 UTC (rev 300) @@ -102,6 +102,7 @@ <addaction name="action_Open_experiment" /> <addaction name="action_Continue_experiment" /> <addaction name="action_Import" /> + <addaction name="action_Export" /> <addaction name="menu_Save" /> <addaction name="action_Save_experiment" /> <addaction name="separator" /> @@ -167,7 +168,7 @@ <bool>false</bool> </property> <property name="text" > - <string>Open &experiment</string> + <string>Open ex&periment</string> </property> <property name="statusTip" > <string>Opens a predefined experiment.</string> @@ -334,6 +335,11 @@ <string>Imports experiments from other programs.</string> </property> </action> + <action name="action_Export" > + <property name="text" > + <string>&Export</string> + </property> + </action> </widget> <resources/> <connections/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-02-11 18:42:15
|
Revision: 302 http://svn.sourceforge.net/qcell/?rev=302&view=rev Author: lessm Date: 2007-02-11 10:42:06 -0800 (Sun, 11 Feb 2007) Log Message: ----------- -2d view change Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/baseheaders/Neighbourhood.h trunk/qcell/baseheaders/Renderer.h trunk/qcell/baseheaders/neigborhoodtools.h trunk/qcell/baseheaders/neigborhoodtools.ui trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/baseheaders/view3dtools.h trunk/qcell/baseheaders/view3dtools.ui trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/Neighbourhood.cpp trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/neigborhoodtools.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/basesources/view3dtools.cpp trunk/qcell/parsers/ZIFW/ZIFWParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/main.cpp trunk/qcell/visgui/visgui.pro Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/CalculationData.h 2007-02-11 18:42:06 UTC (rev 302) @@ -16,7 +16,7 @@ private: protected: DATA_TYPES dataType; - int sizeX, sizeY, sizeZ, sizeT; + int sizeX, sizeY, sizeZ; int dimension, dataSize; char *data; bool haveForeignDataPointer; @@ -24,7 +24,7 @@ protected: void clearData(void); bool resizeData(bool foreignDataPointer=0, char *dataPointer=NULL); - void * getAddressAt(int x, int y, int z, int t); + void * getAddressAt(int x, int y, int z); public: @@ -35,13 +35,11 @@ int getValueAt_i(int x); int getValueAt_i(int x, int y); int getValueAt_i(int x, int y, int z); - int getValueAt_i(int x, int y, int z, int t); int getValueAt_i(QVector<int> pos); void setValueAt(int val, int x); void setValueAt(int val, int x, int y); void setValueAt(int val, int x, int y, int z); - void setValueAt(int val, int x, int y, int z, int t); void setValueAt(int val, QVector<int> pos); double getValueAt_d(int x); @@ -63,18 +61,16 @@ bool resizeData(int x, char *dataPointer=NULL, bool foreignDataPointer=0); bool resizeData(int x, int y, char *dataPointer=NULL, bool foreignDataPointer=0); bool resizeData(int x, int y, int z, char *dataPointer=NULL, bool foreignDataPointer=0); - bool resizeData(int x, int y, int z, int t, char *dataPointer=NULL, bool foreignDataPointer=0); bool resizeData(QVector<int> newSize, char *dataPointer=NULL, bool foreignDataPointer=0); int getSizeX(void); int getSizeY(void); int getSizeZ(void); - int getSizeT(void); int getSizeInByte(void); int getDimension(void); QVector<int> getSize(void); - /*const*/ char *getDataPointer(void); + char *getDataPointer(void); void fillData(char *dataPointer); void fillData(int value); void setForeignDataPointer(char *dataPointer, bool silent=0); @@ -85,8 +81,6 @@ CalculationData & operator = (CalculationData &cData); - //CalculationData & operator = (Neighbourhood &neighbourhood); - signals: void dataUpdated(); void dataResized(); Modified: trunk/qcell/baseheaders/Neighbourhood.h =================================================================== --- trunk/qcell/baseheaders/Neighbourhood.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/Neighbourhood.h 2007-02-11 18:42:06 UTC (rev 302) @@ -41,13 +41,11 @@ void addNeighbour(int x); void addNeighbour(int x, int y); void addNeighbour(int x, int y, int z); - void addNeighbour(int x, int y, int z, int t); void addNeighbour(QVector<int> v); void setNeighbourAt(int index, int x); void setNeighbourAt(int index, int x, int y); void setNeighbourAt(int index, int x, int y, int z); - void setNeighbourAt(int index, int x, int y, int z, int t); void setNeighbourAt(int index, QVector<int> v); void clearNeighbourhood(void); @@ -62,7 +60,7 @@ int getIntValueOf(int index); double getDoubleValueOf(int index); - void calculateOffsets(int sizeX, int sizeY, int sizeZ, int sizeT, baseDataTypes::DATA_TYPES type); + void calculateOffsets(int sizeX, int sizeY, int sizeZ, baseDataTypes::DATA_TYPES type); void resolveValues(const char *address); QVector<int> valuesToVector_i(void); Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/Renderer.h 2007-02-11 18:42:06 UTC (rev 302) @@ -26,34 +26,29 @@ QChar textSybmol; }; -class Renderer : /*public CalculationData,*/ public QGLWidget +class Renderer : public QGLWidget { Q_OBJECT private: protected: QVector<SYMBOL> symbolsMap; GLuint greed; - QGLPixelBuffer *OGLpBuffer; - QImage *imageBuffer; - QPainter painter; bool discretValues; bool corectPerspective; QVector<GLuint> primitives; GLuint observer; GLuint observerTexture; + GLuint quad; QVector<double> rotation, translation; GLuint generateBox(void); + GLuint generateQuad(void); void generateGreed(void); void generateObserver(void); int cursor_x, cursor_y; - QImage render1D(void); - QImage render2D(int zval=0); - QImage render3D(void); - CalculationData storage; Qt::MouseButtons mouseButtons; @@ -66,15 +61,16 @@ bool showSelectRect; int workMode; int editValue; + bool showLocalObserver; - QVector<int> localObserverCoords; - QVector<int> maskValue; bool showValues; QString textureName; + bool force2D; + protected: void initializeGL(); void paintGL(); @@ -95,18 +91,12 @@ bool selectOne(int x, int y); void multiSelect(int x, int y, int width, int height); void drawRect(int x1, int y1, int x2, int y2); -/* - void setDataType(baseDataTypes::DATA_TYPES type = baseDataTypes::CHAR); - bool resizeData(int x, char *dataPointer=NULL, bool foreignDataPointer=0); - bool resizeData(int x, int y, char *dataPointer=NULL, bool foreignDataPointer=0); - bool resizeData(int x, int y, int z, char *dataPointer=NULL, bool foreignDataPointer=0); - bool resizeData(int x, int y, int z, int t, char *dataPointer=NULL, bool foreignDataPointer=0); - bool resizeData(QVector<int> newSize, char *dataPointer=NULL, bool foreignDataPointer=0); -*/ - void render(bool renderGreed=1); - QImage renderToQImage(int zplane=-1); - void renderToPixmap(QPixmap *pixmap, int zval); + void render3D(bool selectMode=0); + void render2D(bool selectMode=0); + void renderGreed(void); + void renderObserver(void); + void renderValues(void); bool setSymbolColor(int index, QColor color); bool hideSymbol(int index); bool showSymbol(int index); @@ -117,6 +107,10 @@ int getSymbolCount(void); void removeSymbol(void); + void force2DView(bool flag = 1); + +public slots: + void setTranslation(float x, float y, float z); void setRotation(float x, float y, float z); void rotateX(float rot); @@ -127,13 +121,17 @@ void translateY(float trans); void translateZ(float trans); + void setZValue(float zVal); +public: CalculationData * getStorage(void); void setOrtoPerspective(bool noClear=1); void setRealPerspective(bool noClear=1); +public slots: void fillSelected(int value); +public: QVector<int> getSelectedCoord(void); void modeSelect(void); @@ -141,14 +139,19 @@ void setEditValue(int value); void showObserver(bool flag); +public slots: void setObserverPosition(int x, int y, int z); void selectCell(int x, int y, int z); +public: QList< QVector<int> > getSelectData(void); + +public slots: void maskSet(int x, int y, int z); void showCellValues(bool show = 1); +public: void setTextureName(QString name); protected slots: @@ -157,6 +160,7 @@ signals: void objectSelected(int x, int y, int z); + void newPositionSet(float x, float y, float z); }; #endif Modified: trunk/qcell/baseheaders/neigborhoodtools.h =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/neigborhoodtools.h 2007-02-11 18:42:06 UTC (rev 302) @@ -20,7 +20,7 @@ int viewMode; int mx, my, mz; - int maxNaigbours; + int maxNaigbours, selectedNaigbour; protected slots: void ViewChangePerspective(void); @@ -33,10 +33,15 @@ void maskValueSet(int value); void addNeigbor(void); void delNeigbor(void); + void tableChange(int row, int column); + void setButtonPress(void); + void clearButtonPress(void); + void setZeroButtonPress(void); signals: void ViewModeUpdated(int mode); void maskSet(int x, int y, int z); + void setSelectedPress(int v); public slots: void setRange(int x, int y, int z); Modified: trunk/qcell/baseheaders/neigborhoodtools.ui =================================================================== --- trunk/qcell/baseheaders/neigborhoodtools.ui 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/neigborhoodtools.ui 2007-02-11 18:42:06 UTC (rev 302) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>145</width> - <height>469</height> + <height>507</height> </rect> </property> <property name="maximumSize" > @@ -187,7 +187,7 @@ <property name="minimumSize" > <size> <width>0</width> - <height>190</height> + <height>270</height> </size> </property> <property name="title" > @@ -273,6 +273,32 @@ </property> </widget> </item> + <item> + <widget class="QToolButton" name="toolButton" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Reload</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_2" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="text" > + <string>Apply</string> + </property> + </widget> + </item> </layout> </widget> </item> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-11 18:42:06 UTC (rev 302) @@ -76,11 +76,14 @@ char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; - QGraphicsView *graphicsView2D; - QGraphicsScene *graphicsScene2D; - QGraphicsPixmapItem *graphicsScene2DPixmap; - QPixmap *pixmap; + Renderer *graphicsView2D; + + //QGraphicsView *graphicsView2D; + //QGraphicsScene *graphicsScene2D; + //QGraphicsPixmapItem *graphicsScene2DPixmap; + //QPixmap *pixmap; + int selectedSymbol, workMode; QVector<CalculationData> loclaViewMemory; Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-02-11 18:42:06 UTC (rev 302) @@ -60,7 +60,7 @@ </widget> <widget class="QWidget" name="symbolConfig" > <attribute name="title" > - <string>Symbols Configuration</string> + <string>Symbols</string> </attribute> <layout class="QVBoxLayout" > <property name="margin" > Modified: trunk/qcell/baseheaders/view3dtools.h =================================================================== --- trunk/qcell/baseheaders/view3dtools.h 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/view3dtools.h 2007-02-11 18:42:06 UTC (rev 302) @@ -32,8 +32,11 @@ signals: void ViewModeUpdated(int mode); void maskSet(int x, int y, int z); + void newPositionZ(float z); public slots: void setRange(int x, int y, int z); + void PositionChange(float x, float y, float z); + void usrPosChange(double v); }; #endif // VIEW3DTOOLS_H Modified: trunk/qcell/baseheaders/view3dtools.ui =================================================================== --- trunk/qcell/baseheaders/view3dtools.ui 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/baseheaders/view3dtools.ui 2007-02-11 18:42:06 UTC (rev 302) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>144</width> - <height>250</height> + <height>324</height> </rect> </property> <property name="minimumSize" > @@ -220,6 +220,37 @@ </layout> </widget> </item> + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + <property name="title" > + <string>Distans</string> + </property> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QDoubleSpinBox" name="range" > + <property name="minimumSize" > + <size> + <width>100</width> + <height>20</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> <layoutdefault spacing="6" margin="11" /> Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/basesources/CalculationData.cpp 2007-02-11 18:42:06 UTC (rev 302) @@ -31,23 +31,22 @@ { data = dataPointer; haveForeignDataPointer = 1; - //emit dataUpdated(); emit dataResized(); } return 1; } -void * CalculationData::getAddressAt(int x, int y, int z, int t) +void * CalculationData::getAddressAt(int x, int y, int z) { if(dataType==baseDataTypes::NONE) return NULL; - return data + dataSize * (x + y * sizeX + z * sizeX * sizeY + t * sizeX * sizeY * sizeZ); + return data + dataSize * (x + y * sizeX + z * sizeX * sizeY); } CalculationData::CalculationData() { dataType = baseDataTypes::CHAR; - sizeX = sizeY = sizeZ = sizeT = 0; + sizeX = sizeY = sizeZ = 0; dimension = -1; dataSize = sizeof(char); data = NULL; @@ -57,7 +56,7 @@ CalculationData::CalculationData(CalculationData &cData) { dataType = baseDataTypes::CHAR; - sizeX = sizeY = sizeZ = sizeT = 0; + sizeX = sizeY = sizeZ = 0; dimension = -1; dataSize = sizeof(char); data = NULL; @@ -69,7 +68,7 @@ CalculationData::~CalculationData() { dataType = baseDataTypes::NONE; - sizeX = sizeY = sizeZ = sizeT = 0; + sizeX = sizeY = sizeZ = 0; dimension = -1; dataSize = 0; clearData(); @@ -83,19 +82,19 @@ break; case baseDataTypes::CHAR: - return *((char *)getAddressAt(x, 0, 0, 0)); + return *((char *)getAddressAt(x, 0, 0)); case baseDataTypes::INT: - return *((int *)(getAddressAt(x, 0, 0, 0))); + return *((int *)(getAddressAt(x, 0, 0))); case baseDataTypes::SHORT: - return *((short *)(getAddressAt(x, 0, 0, 0))); + return *((short *)(getAddressAt(x, 0, 0))); case baseDataTypes::FLOAT: - return (int)(*((float *)(getAddressAt(x, 0, 0, 0)))); + return (int)(*((float *)(getAddressAt(x, 0, 0)))); case baseDataTypes::DOUBLE: - return (int)(*((double *)(getAddressAt(x, 0, 0, 0)))); + return (int)(*((double *)(getAddressAt(x, 0, 0)))); } return 0; } @@ -108,18 +107,18 @@ break; case baseDataTypes::CHAR: - return *((char *)getAddressAt(x, y, 0, 0)); + return *((char *)getAddressAt(x, y, 0)); case baseDataTypes::INT: - return *((int *)(getAddressAt(x, y, 0, 0))); + return *((int *)(getAddressAt(x, y, 0))); case baseDataTypes::SHORT: - return *((short *)(getAddressAt(x, y, 0, 0))); + return *((short *)(getAddressAt(x, y, 0))); case baseDataTypes::FLOAT: - return (int)(*((float *)(getAddressAt(x, y, 0, 0)))); + return (int)(*((float *)(getAddressAt(x, y, 0)))); case baseDataTypes::DOUBLE: - return (int)(*((double *)(getAddressAt(x, y, 0, 0)))); + return (int)(*((double *)(getAddressAt(x, y, 0)))); } return 0; } @@ -132,49 +131,23 @@ break; case baseDataTypes::CHAR: - return *((char *)getAddressAt(x, y, z, 0)); + return *((char *)getAddressAt(x, y, z)); case baseDataTypes::INT: - return *((int *)(getAddressAt(x, y, z, 0))); + return *((int *)(getAddressAt(x, y, z))); case baseDataTypes::SHORT: - return *((short *)(getAddressAt(x, y, z, 0))); + return *((short *)(getAddressAt(x, y, z))); case baseDataTypes::FLOAT: - return (int)(*((float *)(getAddressAt(x, y, z, 0)))); + return (int)(*((float *)(getAddressAt(x, y, z)))); case baseDataTypes::DOUBLE: - return (int)(*((double *)(getAddressAt(x, y, z, 0)))); + return (int)(*((double *)(getAddressAt(x, y, z)))); } return 0; } -int CalculationData::getValueAt_i(int x, int y, int z, int t) -{ - switch(dataType) - { - case baseDataTypes::BOOL: - break; - - case baseDataTypes::CHAR: - return *((char *)getAddressAt(x, y, z, t)); - - case baseDataTypes::INT: - return *((int *)(getAddressAt(x, y, z, t))); - - case baseDataTypes::SHORT: - return *((short *)(getAddressAt(x, y, z, t))); - - case baseDataTypes::FLOAT: - return (int)(*((float *)(getAddressAt(x, y, z, t)))); - - case baseDataTypes::DOUBLE: - return (int)(*((double *)(getAddressAt(x, y, z, t)))); - - } - return 0; -} - int CalculationData::getValueAt_i(QVector<int> pos) { switch(pos.size()) @@ -185,8 +158,6 @@ return getValueAt_i(pos[0], pos[1]); case 3: return getValueAt_i(pos[0], pos[1], pos[2]); - case 4: - return getValueAt_i(pos[0], pos[1], pos[2], pos[3]); } return 0; } @@ -199,15 +170,15 @@ break; case baseDataTypes::CHAR: - *((char *)getAddressAt(x, 0, 0, 0)) = (char)val; + *((char *)getAddressAt(x, 0, 0)) = (char)val; break; case baseDataTypes::INT: - *((int *)(getAddressAt(x, 0, 0, 0))) = val; + *((int *)(getAddressAt(x, 0, 0))) = val; break; case baseDataTypes::SHORT: - *((short *)(getAddressAt(x, 0, 0, 0))) = (short)val; + *((short *)(getAddressAt(x, 0, 0))) = (short)val; break; } } @@ -220,15 +191,15 @@ break; case baseDataTypes::CHAR: - *((char *)getAddressAt(x, y, 0, 0)) = (char)val; + *((char *)getAddressAt(x, y, 0)) = (char)val; break; case baseDataTypes::INT: - *((int *)(getAddressAt(x, y, 0, 0))) = val; + *((int *)(getAddressAt(x, y, 0))) = val; break; case baseDataTypes::SHORT: - *((short *)(getAddressAt(x, y, 0, 0))) = (short)val; + *((short *)(getAddressAt(x, y, 0))) = (short)val; break; } } @@ -241,40 +212,20 @@ break; case baseDataTypes::CHAR: - *((char *)getAddressAt(x, y, z, 0)) = (char)val; + *((char *)getAddressAt(x, y, z)) = (char)val; break; case baseDataTypes::INT: - *((int *)(getAddressAt(x, y, z, 0))) = val; + *((int *)(getAddressAt(x, y, z))) = val; break; case baseDataTypes::SHORT: - *((short *)(getAddressAt(x, y, z, 0))) = (short)val; + *((short *)(getAddressAt(x, y, z))) = (short)val; break; } } -void CalculationData::setValueAt(int val, int x, int y, int z, int t) -{ - switch(dataType) - { - case baseDataTypes::BOOL: - break; - case baseDataTypes::CHAR: - *((char *)getAddressAt(x, y, z, t)) = (char)val; - break; - - case baseDataTypes::INT: - *((int *)(getAddressAt(x, y, z, t))) = val; - break; - - case baseDataTypes::SHORT: - *((short *)(getAddressAt(x, y, z, t))) = (short)val; - break; - } -} - double CalculationData::getValueAt_d(int x) { switch(dataType) @@ -283,19 +234,19 @@ break; case baseDataTypes::CHAR: - return (double)*((char *)getAddressAt(x, 0, 0, 0)); + return (double)*((char *)getAddressAt(x, 0, 0)); case baseDataTypes::INT: - return (double)*((int *)(getAddressAt(x, 0, 0, 0))); + return (double)*((int *)(getAddressAt(x, 0, 0))); case baseDataTypes::SHORT: - return (double)*((short *)(getAddressAt(x, 0, 0, 0))); + return (double)*((short *)(getAddressAt(x, 0, 0))); case baseDataTypes::DOUBLE: - return *((double *)(getAddressAt(x, 0, 0, 0))); + return *((double *)(getAddressAt(x, 0, 0))); case baseDataTypes::FLOAT: - return *((float *)(getAddressAt(x, 0, 0, 0))); + return *((float *)(getAddressAt(x, 0, 0))); } return 0.0; } @@ -308,19 +259,19 @@ break; case baseDataTypes::CHAR: - return (double)*((char *)getAddressAt(x, y, 0, 0)); + return (double)*((char *)getAddressAt(x, y, 0)); case baseDataTypes::INT: - return (double)*((int *)(getAddressAt(x, y, 0, 0))); + return (double)*((int *)(getAddressAt(x, y, 0))); case baseDataTypes::SHORT: - return (double)*((short *)(getAddressAt(x, y, 0, 0))); + return (double)*((short *)(getAddressAt(x, y, 0))); case baseDataTypes::DOUBLE: - return *((double *)(getAddressAt(x, y, 0, 0))); + return *((double *)(getAddressAt(x, y, 0))); case baseDataTypes::FLOAT: - return *((float *)(getAddressAt(x, y, 0, 0))); + return *((float *)(getAddressAt(x, y, 0))); } return 0.0; } @@ -333,48 +284,23 @@ break; case baseDataTypes::CHAR: - return (double)*((char *)getAddressAt(x, y, z, 0)); + return (double)*((char *)getAddressAt(x, y, z)); case baseDataTypes::INT: - return (double)*((int *)(getAddressAt(x, y, z, 0))); + return (double)*((int *)(getAddressAt(x, y, z))); case baseDataTypes::SHORT: - return (double)*((short *)(getAddressAt(x, y, z, 0))); + return (double)*((short *)(getAddressAt(x, y, z))); case baseDataTypes::DOUBLE: - return *((double *)(getAddressAt(x, y, z, 0))); + return *((double *)(getAddressAt(x, y, z))); case baseDataTypes::FLOAT: - return *((float *)(getAddressAt(x, y, z, 0))); + return *((float *)(getAddressAt(x, y, z))); } return 0.0; } -double CalculationData::getValueAt_d(int x, int y, int z, int t) -{ - switch(dataType) - { - case baseDataTypes::BOOL: - break; - - case baseDataTypes::CHAR: - return (double)*((char *)getAddressAt(x, y, z, t)); - - case baseDataTypes::INT: - return (double)*((int *)(getAddressAt(x, y, z, t))); - - case baseDataTypes::SHORT: - return (double)*((short *)(getAddressAt(x, y, z, t))); - - case baseDataTypes::DOUBLE: - return *((double *)(getAddressAt(x, y, z, t))); - - case baseDataTypes::FLOAT: - return *((float *)(getAddressAt(x, y, z, t))); - } - return 0.0; -} - double CalculationData::getValueAt_d(QVector<int> pos) { switch(pos.size()) @@ -385,8 +311,6 @@ return getValueAt_d(pos[0], pos[1]); case 3: return getValueAt_d(pos[0], pos[1], pos[2]); - case 4: - return getValueAt_d(pos[0], pos[1], pos[2], pos[3]); } return 0.0; } @@ -396,11 +320,11 @@ switch(dataType) { case baseDataTypes::DOUBLE: - *((double *)(getAddressAt(x, 0, 0, 0))) = val; + *((double *)(getAddressAt(x, 0, 0))) = val; break; case baseDataTypes::FLOAT: - *((float *)(getAddressAt(x, 0, 0, 0))) = (float)val; + *((float *)(getAddressAt(x, 0, 0))) = (float)val; break; } } @@ -410,11 +334,11 @@ switch(dataType) { case baseDataTypes::DOUBLE: - *((double *)(getAddressAt(x, y, 0, 0))) = val; + *((double *)(getAddressAt(x, y, 0))) = val; break; case baseDataTypes::FLOAT: - *((float *)(getAddressAt(x, y, 0, 0))) = (float)val; + *((float *)(getAddressAt(x, y, 0))) = (float)val; break; } } @@ -424,29 +348,15 @@ switch(dataType) { case baseDataTypes::DOUBLE: - *((double *)(getAddressAt(x, y, z, 0))) = val; + *((double *)(getAddressAt(x, y, z))) = val; break; case baseDataTypes::FLOAT: - *((float *)(getAddressAt(x, y, z, 0))) = (float)val; + *((float *)(getAddressAt(x, y, z))) = (float)val; break; } } -void CalculationData::setValueAt(double val, int x, int y, int z, int t) -{ - switch(dataType) - { - case baseDataTypes::DOUBLE: - *((double *)(getAddressAt(x, y, z, t))) = val; - break; - - case baseDataTypes::FLOAT: - *((float *)(getAddressAt(x, y, z, t))) = (float)val; - break; - } -} - void CalculationData::setDataType(DATA_TYPES type) { if(type!=dataType) @@ -498,9 +408,8 @@ if(sizeX!=x || dimension!=1) { sizeX = x; - sizeY = 0; - sizeZ = 0; - sizeT = 0; + sizeY = 1; + sizeZ = 1; dimension = 1; return resizeData(foreignDataPointer, dataPointer); } @@ -518,8 +427,7 @@ { sizeX = x; sizeY = y; - sizeZ = 0; - sizeT = 0; + sizeZ = 1; dimension = 2; return resizeData(foreignDataPointer, dataPointer); } @@ -538,7 +446,6 @@ sizeX = x; sizeY = y; sizeZ = z; - sizeT = 0; dimension = 3; return resizeData(foreignDataPointer, dataPointer); } @@ -550,25 +457,6 @@ return 1; } -bool CalculationData::resizeData(int x, int y, int z, int t, char *dataPointer, bool foreignDataPointer) -{ - if(sizeX!=x || sizeY!=y || sizeZ!=z || sizeT!=z || dimension!=3) - { - sizeX = x; - sizeY = y; - sizeZ = z; - sizeT = t; - dimension = 4; - return resizeData(foreignDataPointer, dataPointer); - } - else - { - if(dataPointer && foreignDataPointer) - setForeignDataPointer(dataPointer); - } - return 1; -} - bool CalculationData::resizeData(QVector<int> newSize, char *dataPointer, bool foreignDataPointer) { switch(newSize.size()) @@ -579,8 +467,6 @@ return resizeData(newSize[0], newSize[1], dataPointer, foreignDataPointer); case 3: return resizeData(newSize[0], newSize[1], newSize[2], dataPointer, foreignDataPointer); - case 4: - return resizeData(newSize[0], newSize[1], newSize[2], newSize[3], dataPointer, foreignDataPointer); } return 0; } @@ -600,82 +486,28 @@ return sizeZ; } -int CalculationData::getSizeT(void) -{ - return sizeT; -} - int CalculationData::getSizeInByte(void) { switch(dataType) { case baseDataTypes::BOOL: - return (sizeX * sizeY * sizeZ * sizeT)/8 + 1; + return sizeX * sizeY * sizeZ; case baseDataTypes::CHAR: - switch(dimension) - { - case 1: - return sizeX * sizeof(char); - case 2: - return sizeX * sizeY * sizeof(char); - case 3: - return sizeX * sizeY * sizeZ * sizeof(char); - case 4: - return sizeX * sizeY * sizeZ * sizeT * sizeof(char); - } + return sizeX * sizeY * sizeZ * sizeof(char); case baseDataTypes::DOUBLE: - switch(dimension) - { - case 1: - return sizeX * sizeof(double); - case 2: - return sizeX * sizeY * sizeof(double); - case 3: - return sizeX * sizeY * sizeZ * sizeof(double); - case 4: - return sizeX * sizeY * sizeZ * sizeT * sizeof(double); - } + return sizeX * sizeY * sizeZ * sizeof(double); case baseDataTypes::FLOAT: - switch(dimension) - { - case 1: - return sizeX * sizeof(float); - case 2: - return sizeX * sizeY * sizeof(float); - case 3: - return sizeX * sizeY * sizeZ * sizeof(float); - case 4: - return sizeX * sizeY * sizeZ * sizeT * sizeof(float); - } + return sizeX * sizeY * sizeZ * sizeof(float); case baseDataTypes::INT: - switch(dimension) - { - case 1: - return sizeX * sizeof(int); - case 2: - return sizeX * sizeY * sizeof(int); - case 3: - return sizeX * sizeY * sizeZ * sizeof(int); - case 4: - return sizeX * sizeY * sizeZ * sizeT * sizeof(int); - } + return sizeX * sizeY * sizeZ * sizeof(int); case baseDataTypes::SHORT: - switch(dimension) - { - case 1: - return sizeX * sizeof(short); - case 2: - return sizeX * sizeY * sizeof(short); - case 3: - return sizeX * sizeY * sizeZ * sizeof(short); - case 4: - return sizeX * sizeY * sizeZ * sizeT * sizeof(short); - } + return sizeX * sizeY * sizeZ * sizeof(short); + } return 0; } @@ -699,14 +531,11 @@ case 3: out<<sizeX<<sizeY<<sizeZ; break; - case 4: - out<<sizeX<<sizeY<<sizeZ<<sizeT; - break; } return out; } -/*const*/ char *CalculationData::getDataPointer(void) +char *CalculationData::getDataPointer(void) { return data; } @@ -730,21 +559,7 @@ int counter = 0; if(data) { - switch(dimension) - { - case 1: - counter = sizeX; - break; - case 2: - counter = sizeX * sizeY; - break; - case 3: - counter = sizeX * sizeY * sizeZ; - break; - case 4: - counter = sizeX * sizeY * sizeZ * sizeT; - break; - } + counter = sizeX * sizeY * sizeZ; switch(dataType) { @@ -801,8 +616,6 @@ switch(dimension) { - case 4: - root.setAttribute("time", sizeT); case 3: root.setAttribute("depth", sizeZ); case 2: @@ -883,29 +696,24 @@ else return 0; - if(root->hasAttribute("time")) + if(root->hasAttribute("depth")) { - resizeData(root->attribute("width").toInt(), root->attribute("hight").toInt(), root->attribute("depth").toInt(), root->attribute("time").toInt()); + resizeData(root->attribute("width").toInt(), root->attribute("hight").toInt(), root->attribute("depth").toInt()); + } else - if(root->hasAttribute("depth")) + if(root->hasAttribute("hight")) { - resizeData(root->attribute("width").toInt(), root->attribute("hight").toInt(), root->attribute("depth").toInt()); - + resizeData(root->attribute("width").toInt(), root->attribute("hight").toInt()); + } else - if(root->hasAttribute("hight")) + if(root->hasAttribute("width")) { - resizeData(root->attribute("width").toInt(), root->attribute("hight").toInt()); - + resizeData(root->attribute("width").toInt()); } else - if(root->hasAttribute("width")) - { - resizeData(root->attribute("width").toInt()); - } - else - return 0; + return 0; if(root->hasAttribute("fill")) fillData(root->attribute("fill").toInt()); @@ -933,37 +741,7 @@ CalculationData & CalculationData::operator = (CalculationData &cData) { setDataType(cData.getDataType()); - - switch(cData.getDimension()) - { - case 1: - resizeData(cData.getSizeX()); - break; - case 2: - resizeData(cData.getSizeX(), cData.getSizeY()); - break; - case 3: - resizeData(cData.getSizeX(), cData.getSizeY(), cData.getSizeZ()); - break; - case 4: - resizeData(cData.getSizeX(), cData.getSizeY(), cData.getSizeZ(), cData.getSizeT()); - break; - } - + resizeData(cData.getSize()); fillData(cData.getDataPointer()); return *this; -} -/* -CalculationData & CalculationData::operator = (Neighbourhood &neighbourhood) -{ - clearData(); - int mx, my, mz; - QVector<int> nmin = neighbourhood.getMinNeighbourhoodValues(); - QVector<int> nmax = neighbourhood.getMaxNeighbourhoodValues(); - mx = nmax[0] - nmax[0]; - mz = nmax[2] - nmax[2]; - my = nmax[1] - nmax[1]; - - return *this; -} -*/ \ No newline at end of file +} \ No newline at end of file Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/basesources/Calculator.cpp 2007-02-11 18:42:06 UTC (rev 302) @@ -11,75 +11,52 @@ void Calculator::copyData(void) { int offset; - int sy = tempDataSize[1], sz = tempDataSize[2], st = tempDataSize[3]; - int ty, tz, tt; + int sy = tempDataSize[1], sz = tempDataSize[2]; + int ty, tz; - if(sy==0) - sy=1; - - if(sz==0) - sz=1; - - if(st==0) - st=1; - - for(int t=0;t<st;++t) + for(int z=0;z<sz;++z) { - for(int z=0;z<sz;++z) + for(int y=0;y<sy;++y) { - for(int y=0;y<sy;++y) + ty = y + minBorder[1]; + tz = z + minBorder[2]; + + switch(borderType) { - ty = y + minBorder[1]; - tz = z + minBorder[2]; - tt = t + minBorder[3]; - - - switch(borderType) + case TORUS: + if(sizeY>0) { - - case TORUS: - if(sizeY>0) - { - while(ty<0) - ty += sizeY; - ty %= sizeY; - } + while(ty<0) + ty += sizeY; + ty %= sizeY; + } - if(sizeZ>0) - { - while(tz<0) - tz += sizeZ; - tz %= sizeZ; - } + if(sizeZ>0) + { + while(tz<0) + tz += sizeZ; + tz %= sizeZ; + } - if(sizeT!=0) - { - while(tt<0) - tt += sizeZ; - tt %= sizeT; - } + offset = (y * tempDataSize[0]) + (z * tempDataSize[0] * tempDataSize[1] * dataSize); - offset = (y * tempDataSize[0]) + (z * tempDataSize[0] * tempDataSize[1] * dataSize) + (t * tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * dataSize); - - for(int x=0;x<-minBorder[0];++x) - { - memcpy(tempData + (offset + x) * dataSize, getAddressAt(sizeX - x - 1, ty, tz, tt), dataSize); - } - - for(int x=0;x<maxBorder[0];++x) - { - memcpy(tempData + (offset + sizeX + x - minBorder[0]) * dataSize, getAddressAt((sizeX + x) % sizeX, ty, tz, tt), dataSize); - } - - break; + for(int x=0;x<-minBorder[0];++x) + { + memcpy(tempData + (offset + x) * dataSize, getAddressAt(sizeX - x - 1, ty, tz), dataSize); } - - memcpy(tempData + (offset - minBorder[0]) * dataSize, getAddressAt(0, ty, tz, tt), sizeX * dataSize); + + for(int x=0;x<maxBorder[0];++x) + { + memcpy(tempData + (offset + sizeX + x - minBorder[0]) * dataSize, getAddressAt((sizeX + x) % sizeX, ty, tz), dataSize); + } + + break; } + + memcpy(tempData + (offset - minBorder[0]) * dataSize, getAddressAt(0, ty, tz), sizeX * dataSize); } } - emit calculationEnd(); } @@ -239,73 +216,55 @@ { int counter = storedCounter; char temp[8] = {0,0,0,0,0,0,0,0}; - int sx = sizeX, sy = sizeY, sz = sizeZ, st = sizeT; + int sx = sizeX, sy = sizeY, sz = sizeZ; QVector<int> coordinates(dimension, 0); emit calculationBegin(); - - if(sy==0) - sy=1; - - if(sz==0) - sz=1; - - if(st==0) - st=1; - copyData(); - for(int t=0;t<st;t++) + for(int z=0;z<sz;z++) { - if (dimension == 4) + if (dimension >= 3) { - coordinates[3] = t; + coordinates[2] = z; } - for(int z=0;z<sz;z++) + for(int y=0;y<sy;y++) { - if (dimension >= 3) + if (dimension >= 2) { - coordinates[2] = z; + coordinates[1] = y; } - for(int y=0;y<sy;y++) + for(int x=0;x<sx;x++) { - if (dimension >= 2) + coordinates[0] = x; + neighbourhood->resolveValues(tempData + ((x - minBorder[0]) + (y - minBorder[1]) * tempDataSize[0] + (z - minBorder[2]) * tempDataSize[0] * tempDataSize[1]) * dataSize); + switch(dataType) { - coordinates[1] = y; + case baseDataTypes::BOOL: + case baseDataTypes::CHAR: + case baseDataTypes::SHORT: + case baseDataTypes::INT: + *((int *)temp) = localfunction->resolve(neighbourhood->valuesToVector_i()); + break; + case baseDataTypes::FLOAT: + *((float *)temp) = (float)localfunction->resolve(neighbourhood->valuesToVector_d()); + break; + case baseDataTypes::DOUBLE: + *((double *)temp) = localfunction->resolve(neighbourhood->valuesToVector_d()); + break; } - for(int x=0;x<sx;x++) + if(*((int *)temp)<0) { - coordinates[0] = x; - neighbourhood->resolveValues(tempData + (x - minBorder[0]) + ((y - minBorder[1]) * tempDataSize[0]) + (z - minBorder[2]) * (tempDataSize[0] * tempDataSize[1]) + (t - minBorder[3]) * (tempDataSize[0] * tempDataSize[1] * tempDataSize[2]) * dataSize); - switch(dataType) - { - case baseDataTypes::BOOL: - case baseDataTypes::CHAR: - case baseDataTypes::SHORT: - case baseDataTypes::INT: - *((int *)temp) = localfunction->resolve(neighbourhood->valuesToVector_i()); - break; - case baseDataTypes::FLOAT: - *((float *)temp) = (float)localfunction->resolve(neighbourhood->valuesToVector_d()); - break; - case baseDataTypes::DOUBLE: - *((double *)temp) = localfunction->resolve(neighbourhood->valuesToVector_d()); - break; - } - if(*((int *)temp)<0) - { - /// @todo k\xD3Zka - startX = x; - startY = y; - startZ = z; - startT = t; - functionIndex = localfunction->lastUnknownValueIndex(); - return 0; - } - emit calculated(coordinates, neighbourhood->valuesToVector_i(), (int)*temp); - //memcpy(data + counter, temp, dataSize); - memcpy(calcBuffer + counter, temp, dataSize); - counter += dataSize; + /// @todo k\xD3Zka + startX = x; + startY = y; + startZ = z; + functionIndex = localfunction->lastUnknownValueIndex(); + return 0; } + emit calculated(coordinates, neighbourhood->valuesToVector_i(), (int)*temp); + //memcpy(data + counter, temp, dataSize); + memcpy(calcBuffer + counter, temp, dataSize); + counter += dataSize; } } } @@ -321,7 +280,7 @@ QVector<int> Calculator::freezedCoords(void) { QVector<int> out; - out<<startX<<startY<<startZ<<startT; + out<<startX<<startY<<startZ; return out; } @@ -332,7 +291,7 @@ Calculator & Calculator::operator = (CalculationData &cData) { - if(cData.getDimension()!=getDimension() || cData.getSizeX() != getSizeX() || cData.getSizeY() != getSizeY() || cData.getSizeZ() != getSizeZ() || cData.getSizeT() != getSizeT()) + if(cData.getDimension()!=getDimension() || cData.getSizeX() != getSizeX() || cData.getSizeY() != getSizeY() || cData.getSizeZ() != getSizeZ()) { clearData(); setDataType(cData.getDataType()); @@ -348,9 +307,6 @@ case 3: resizeData(cData.getSizeX(), cData.getSizeY(), cData.getSizeZ()); break; - case 4: - resizeData(cData.getSizeX(), cData.getSizeY(), cData.getSizeZ(), cData.getSizeT()); - break; } } fillData(cData.getDataPointer()); @@ -364,7 +320,7 @@ { minBorder = neighbourhood->getMinNeighbourhoodValues(); maxBorder = neighbourhood->getMaxNeighbourhoodValues(); - for(int i=0;i<4;++i) + for(int i=0;i<3;++i) { if(minBorder[i]>0) minBorder[i] = 0; @@ -376,9 +332,8 @@ tempDataSize[0] = -minBorder[0] + maxBorder[0] + sizeX; tempDataSize[1] = -minBorder[1] + maxBorder[1] + sizeY; tempDataSize[2] = -minBorder[2] + maxBorder[2] + sizeZ; - tempDataSize[3] = -minBorder[3] + maxBorder[3] + sizeT; resizeTempDataBuffer(); - neighbourhood->calculateOffsets(tempDataSize[0], tempDataSize[1], tempDataSize[2], tempDataSize[3], getDataType()); + neighbourhood->calculateOffsets(tempDataSize[0], tempDataSize[1], tempDataSize[2], getDataType()); } // 2nd buffer Modified: trunk/qcell/basesources/Neighbourhood.cpp =================================================================== --- trunk/qcell/basesources/Neighbourhood.cpp 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/basesources/Neighbourhood.cpp 2007-02-11 18:42:06 UTC (rev 302) @@ -14,8 +14,8 @@ Neighbourhood::Neighbourhood() { dimension = 666; - minValues.resize(4); - maxValues.resize(4); + minValues.resize(3); + maxValues.resize(3); } Neighbourhood::~Neighbourhood() @@ -29,7 +29,6 @@ temp.x = x; temp.y = 0; temp.z = 0; - temp.t = 0; neighbourVector << temp; dimension = 1; @@ -43,9 +42,6 @@ maxValues[1] = 0; minValues[2] = 0; maxValues[2] = 0; - minValues[3] = 0; - maxValues[3] = 0; - } void Neighbourhood::addNeighbour(int x, int y) @@ -54,7 +50,6 @@ temp.x = x; temp.y = y; temp.z = 0; - temp.t = 0; neighbourVector << temp; if(dimension>2) dimension = 2; @@ -73,8 +68,6 @@ minValues[2] = 0; maxValues[2] = 0; - minValues[3] = 0; - maxValues[3] = 0; } void Neighbourhood::addNeighbour(int x, int y, int z) @@ -83,7 +76,6 @@ temp.x = x; temp.y = y; temp.z = z; - temp.t = 0; neighbourVector << temp; if(dimension>3) dimension = 3; @@ -105,49 +97,10 @@ if(maxValues[2]<z) maxValues[2]=z; - - minValues[3] = 0; - maxValues[3] = 0; } -void Neighbourhood::addNeighbour(int x, int y, int z, int t) -{ - NContainer temp; - temp.x = x; - temp.y = y; - temp.z = z; - temp.t = t; - neighbourVector << temp; - if(dimension>4) - dimension = 4; - - if(minValues[0]>x) - minValues[0]=x; - - if(maxValues[0]<x) - maxValues[0]=x; - - if(minValues[1]>y) - minValues[1]=y; - - if(maxValues[1]<y) - maxValues[1]=y; - - if(minValues[2]>z) - minValues[2]=z; - - if(maxValues[2]<z) - maxValues[2]=z; - - if(minValues[3]>t) - minValues[3]=t; - - if(maxValues[3]<t) - maxValues[3]=t; -} - void Neighbourhood::addNeighbour(QVector<int> v) { switch(v.size()) @@ -166,14 +119,9 @@ if(dimension>3) dimension = 3; break; - case 4: - addNeighbour(v[0], v[1], v[2], v[3]); - if(dimension>4) - dimension = 4; - break; default: - if(v.size()>4) - addNeighbour(v[0], v[1], v[2], v[3]); + if(v.size()>3) + addNeighbour(v[0], v[1], v[2]); } } @@ -202,16 +150,6 @@ } } -void Neighbourhood::setNeighbourAt(int index, int x, int y, int z, int t) -{ - if(neighbourVector.size()>index) - { - neighbourVector[index].x = x; - neighbourVector[index].y = y; - neighbourVector[index].z = z; - neighbourVector[index].t = t; - } -} void Neighbourhood::setNeighbourAt(int index, QVector<int> v) { switch(v.size()) @@ -225,12 +163,9 @@ case 3: setNeighbourAt(index, v[0], v[1], v[2]); break; - case 4: - setNeighbourAt(index, v[0], v[1], v[2], v[3]); - break; default: - if(v.size()>4) - setNeighbourAt(index, v[0], v[1], v[2], v[3]); + if(v.size()>3) + setNeighbourAt(index, v[0], v[1], v[2]); } } @@ -240,8 +175,8 @@ neighbourVector.clear(); if(dimension!=minValues.size()) { - minValues[3] = minValues[2] = minValues[1] = minValues[0]=9999; - maxValues[3] = maxValues[2] = maxValues[1] = maxValues[0]=-9999; + minValues[2] = minValues[1] = minValues[0]=9999; + maxValues[2] = maxValues[1] = maxValues[0]=-9999; } } @@ -263,7 +198,6 @@ { QDomNode node; QDomElement element; -// NContainer container; clearNeighbourhood(); if(xmlElement->tagName()=="Neighbourhood") { @@ -276,40 +210,30 @@ element = node.toElement(); if(element.tagName()=="Neighbour") { - if(element.hasAttribute("t")) + if(element.hasAttribute("z")) { - addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt(), element.attribute("z").toInt(), element.attribute("t").toInt()); - if(dimension>4) - dimension = 4; + addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt(), element.attribute("z").toInt()); + if(dimension>3) + dimension = 3; } else { - if(element.hasAttribute("z")) + if(element.hasAttribute("y")) { - addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt(), element.attribute("z").toInt()); - if(dimension>3) - dimension = 3; + addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt()); + if(dimension>2) + dimension = 2; + } else { - if(element.hasAttribute("y")) + if(element.hasAttribute("x")) { - addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt()); - if(dimension>2) - dimension = 2; - + addNeighbour(element.attribute("x").toInt()); + dimension = 1; } - else - { - if(element.hasAttribute("x")) - { - addNeighbour(element.attribute("x").toInt()); - dimension = 1; - } - } } } - //neighbourVector<<container; } node = node.nextSibling(); } @@ -343,12 +267,6 @@ element.setAttribute("y", temp.y); element.setAttribute("z", temp.z); break; - case 4: - element.setAttribute("x", temp.x); - element.setAttribute("y", temp.y); - element.setAttribute("z", temp.z); - element.setAttribute("t", temp.t); - break; } root.appendChild(element); } @@ -380,7 +298,7 @@ return neighbourVector[index].value.dValue; } -void Neighbourhood::calculateOffsets(int sizeX, int sizeY, int sizeZ, int sizeT, baseDataTypes::DATA_TYPES type) +void Neighbourhood::calculateOffsets(int sizeX, int sizeY, int sizeZ, baseDataTypes::DATA_TYPES type) { int dataSize=0; dType = type; @@ -407,7 +325,7 @@ } for(int i=0;i<neighbourVector.size();i++) - neighbourVector[i].offset = dataSize * (neighbourVector[i].x + neighbourVector[i].y * sizeX + neighbourVector[i].z * sizeX * sizeY + neighbourVector[i].t * sizeX * sizeY * sizeZ); + neighbourVector[i].offset = dataSize * (neighbourVector[i].x + neighbourVector[i].y * sizeX + neighbourVector[i].z * sizeX * sizeY); } void Neighbourhood::resolveValues(const char *address) @@ -513,12 +431,9 @@ maxv[2]=0; int sx = maxv[0] - minv[0], sy = maxv[1] - minv[1], sz = maxv[2] - minv[2]; - //if(minv[0]<0) - sx++; - //if(minv[1]<0) - sy++; - //if(minv[2]<0) - sz++; + sx++; + sy++; + sz++; switch(getDimension()) { Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-02-11 17:58:55 UTC (rev 301) +++ trunk/qcell/basesources/Renderer.cpp 2007-02-11 18:42:06 UTC (rev 302) @@ -47,10 +47,25 @@ return list; } -void Renderer::generateGreed(void) +GLuint Renderer::generateQuad(void) { + GLuint list = glGenLists(1); + glNewList(list, GL_COMPILE); + glBegin(GL_QUADS); + + glNormal3f( 0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 0.0f); + glVertex3f( 1.0f, -1.0f, 0.0f); + glVertex3f( 1.0f, 1.0f, 0.0f); - float mov; + glEnd(); + glEndList(); + return list; +} + +void Renderer::generateGreed(void) +{ if(greed>0) glDeleteLists(greed, 1); if(getStorage()->getSizeX()==0 || getStorage()->getSizeY()==0 || getStorage()->getSizeZ()==0) @@ -62,95 +77,59 @@ glBegin(GL_LINES); glColor3f(1.0f, 1.0f, 1.0f); - //float mx = (float)getStorage()->getSizeX() / 2.0f, my = (float)getStorage()->getSizeY() / 2.0f, mz = (float)getStorage()->getSizeZ() / 2.0f; + float bias = 1.0f; + float mx = -storage.getSizeX(), my = -storage.getSizeY(), mz = -storage.getSizeZ(); - float mx = 0.01f; - float my = 0.01f; - float mz = 0.01f; + if(storage.getDimension()<3 || force2D) + mz = bias; - mov = (float)getStorage()->getSizeY(); - for(int y=0;y<getStorage()->getSizeY() + 1;++y) + for(int i=0;i<storage.getSizeX() + 1;++i) { - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(y * 2) - mov + 1.0f, -(float)(getStorage()->getSizeZ()) - mz -1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(y * 2) - mov + 1.0f, -(float)(getStorage()->getSizeZ()) - mz -1.0f); + glVertex3f((float)(i * 2) + mx - bias, my - bias, mz - bias); + glVertex3f((float)(i * 2) + mx - bias, -my - bias, mz - bias); } - mov = (float)getStorage()->getSizeX(); - for(int x=0;x<getStorage()->getSizeX() + 1; ++x) + for(int i=0;i<storage.getSizeY() + 1;++i) { - glVertex3f((float)(x * 2) - mov -1.0f, -(float)getStorage()->getSizeY() + 1.0f, -(float)(getStorage()->getSizeZ()) - mz -1.0f); - glVertex3f((float)(x * 2) - mov -1.0f, (float)getStorage()->getSizeY() + 1.0f, -(float)(getStorage()->getSizeZ()) - mz -1.0f); + glVertex3f( mx - bias, (float)(i * 2) + my - bias, mz - bias); + glVertex3f(-mx - bias, (float)(i * 2) + my - bias, mz - bias); } - - mov = (float)getStorage()->getSizeZ(); - for(int z=0;z<getStorage()->getSizeZ() + 1;++z) + if(storage.getDimension()==3 && !force2D) { - glVertex3f(-(float)getStorage()->getSizeX() -1.0f, (float)(getStorage()->getSizeY()) + my + 1.0f, (float)(z * 2) - mov -1.0f); - glVertex3f( (float)getStorage()->getSizeX() -1.0f, (float)(getStorage()->getSizeY()) + my + 1.0f, (float)(z * 2) - mov -1.0f); - } + for(int i=0;i<storage.getSizeX() + 1;++i) + { + glVertex3f((float)(i * 2) + mx - bias, -my - bias, mz - bias); + glVertex3f((float)(i * 2) + mx - bias, -my - bias, -mz - bias); + } - mov = (float)getStorage()->getSizeX(); - for(int x=0;x<getStorage()->getSizeX() + 1; ++x) - { - glVertex3f((float)(x * 2) - mov -1.0f, (float)(getStorage()->getSizeY()) + my + 1.0f, -(float)getStorage()->getSizeZ() -1.0f); - glVertex3f((float)(x * 2) - mov -1.0f, (float)(getStorage()->getSizeY()) + my + 1.0f, (float)getStorage()->getSizeZ() -1.0f); - } + for(int i=0;i<storage.getSizeZ() + 1;++i) + { + glVertex3f( mx - bias, -my - bias, (float)(i * 2) + mz - bias); + glVertex3f(-mx - bias, -my - bias, (float)(i * 2) + mz - bias); + } + for(int i=0;i<storage.getSizeZ() + 1;++i) + { + glVertex3f(mx - bias, my - bias, (float)(i * 2) + mz - bias); + glVertex3f(mx - bias, -my - bias, (float)(i * 2) + mz - bias); + } - mov = (float)getStorage()->getSizeY(); - for(int y=0;y<getStorage()->getSizeY() + 1;++y) - { - glVertex3f(-(float)getStorage()->getSizeX() - mx -1.0f, (float)(y * 2) - mov + 1.0f, -(float)(getStorage()->getSizeZ()) -1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - mx -1.0f, (float)(y * 2) - mov + 1.0f, (float)(getStorage()->getSizeZ()) -1.0f); - } + for(int i=0;i<storage.getSizeY() + 1;++i) + { + glVertex3f(mx - bias, (float)(i * 2) + my - bias, mz - bias); + glVertex3f(mx - bias, (float)(i * 2) + my - bias, -mz - bias); + } - mov = (float)getStorage()->getSizeZ(); - for(int z=0;z<getStorage()->getSizeZ() + 1;++z) - { - glVertex3f(-(float)getStorage()->getSizeX() - mx -1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)(z * 2) - mov -1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - mx -1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)(z * 2) - mov -1.0f); - } + glVertex3f(mx - bias, my - bias, -mz - bias); + glVertex3f(-mx - bias, my - bias, -mz - bias); + glVertex3f(-mx - bias, my - bias, -mz - bias); + glVertex3f(-mx - bias, -my - bias, -mz - bias); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - - - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, (float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f( (float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, (float)getStorage()->getSizeZ()-1.0f); - glVertex3f(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); - + glVertex3f(-mx - bias, my - bias, mz - bias); + glVertex3f(-mx - bias, my - bias, -mz - bias); + } glEnd(); glEndList(); } @@ -186,58 +165,6 @@ glDisable(GL_TEXTURE_2D); } -QImage Renderer::render1D(void) -{ - if(OGLpBuffer) - painter.begin(OGLpBuffer); - else - painter.begin(imageBuffer); - for(int x=0;x<storage.getSizeX();++x) - { - painter.setPen(symbolsMap[storage.getValueAt_i(x)].color); - painter.drawPoint(x, 0); - } - painter.end(); - if(OGLpBuffer) - return OGLpBuffer->toImage(); - - return *imageBuffer; -} - -QImage Renderer::render2D(int zval) -{ - if(OGLpBuffer) - painter.begin(OGLpBuffer); - else - painter.begin(imageBuffer); - for(int y=0;y<storage.getSizeY();++y) - { - for(int x=0;x<storage.getSizeX();++x) - { - painter.setPen(symbolsMap[storage.getValueAt_i(x, y, zval)].color); - painter.drawPoint(x, y); - } - } - painter.end(); - if(OGLpBuffer) - return OGLpBuffer->toImage(); - - return *imageBuffer; -} - -QImage Renderer::render3D(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glLoadIdentity(); - - glTranslated(translation[0], translation[1], translation[2]); - glRotatef(rotation[0], 1.0f, 0.0f, 0.0f); - glRotatef(rotation[1], 0.0f, 1.0f, 0.0f); - glRotatef(rotation[2], 0.0f, 0.0f, 1.0f); - render(); - return grabFrameBuffer(); -} - void Renderer::initializeGL() { qglClearColor(QColor(0,0,0)); @@ -245,9 +172,6 @@ glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); - //glEnable(GL_COLOR_MATERIAL); - - //glEnable(GL_NORMALIZE); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); @@ -262,6 +186,7 @@ glLightfv(GL_LIGHT0, GL_POSITION, position); primitives<<generateBox(); + quad = generateQuad(); generateObserver(); renderText(0.0f , 0.0f, 0.0f, "init"); } @@ -274,12 +199,28 @@ glLoadIdentity(); glTranslated(translation[0], translation[1], translation[2]); - glRotatef(rotation[0], 1.0f, 0.0f, 0.0f); - glRotatef(rotation[1], 0.0f, 1.0f, 0.0f); - glRotatef(rotation[2], 0.0f, 0.0f, 1.0f); - - render(); + if(storage.getDimension()==3 && !force2D) + { + glRotatef(rotation[0], 1.0f, 0.0f, 0.0f); + glRotatef(rotation[1], 0.0f, 1.0f, 0.0f); + glRotatef(rotation[2], 0.0f, 0.0f, 1.0f); + render3D(); + renderGreed(); + } + else + { + glDisable(GL_DEPTH_TEST); + render2D(); + renderGreed(); + glEnable(GL_DEPTH_TEST); + } + if(showValues) + renderValues(); + + if(showLocalObserver) + renderObserver(); + if(showSelectRect) drawRect(selectRect[0], selectRect[1], selectRect[2], selectRect[3]); @@ -301,6 +242,8 @@ mouseButtons = event->buttons(); cursor_x = event->x(); cursor_y = event->y(); + selectRect[0] = cursor_x; + selectRect[1] = cursor_y; } void Renderer::mouseReleaseEvent(QMouseEvent * event) @@ -334,28 +277,25 @@ { rotateX((float)(event->y() - cursor_y)/2.0f); rotateY((float)(event->x() - cursor_x)/2.0f); - cursor_x = event->x(); - cursor_y = event->y(); + } else if(event->buttons()==Qt::RightButton) { translateX((float)(event->x() - cursor_x)/10.0f); translateY((float)(cursor_y - event->y())/10.0f); - cursor_x = event->x(); - cursor_y = event->y(); } else if(event->buttons()==Qt::LeftButton) { - selectRect[0] = cursor_x; - selectRect[1] = cursor_y; selectRect[2] = event->x(); selectRect[3] = event->y(); showSelectRect = 1; } - updateGL(); + cursor_x = event->x(); + cursor_y = event->y(); + repaint(); } void Renderer::wheelEvent(QWheelEvent * event) @@ -385,7 +325,10 @@ else setOrtoPerspective(); glMatrixMode(GL_MODELVIEW); - render(0); + if(storage.getDimension()==3) + render3D(1); + else + render2D(1); numberOfSelectetObject = glRenderMode(GL_RENDER); @@ -424,8 +367,6 @@ Renderer::Renderer(QWidget *parent) : QGLWidget(parent) { discretValues = 1; - OGLpBuffer = NULL; - imageBuffer = NULL; SYMBOL baseSymbols; baseSymbols.hide = 1; @@ -444,6 +385,7 @@ rotation.resize(3); greed = 0; + quad = 0; corectPerspective = 1; connect(&storage, SIGNAL(dataResized()), SLOT(resizeDataEvent())); @@ -460,6 +402,7 @@ maskValue.resize(3); maskValue[0] = maskValue[1] = maskValue[2] = -1; showValues = 0; + force2D = 0; } Renderer::~Renderer() @@ -474,17 +417,8 @@ if(observer>0) glDeleteLists(observer, 1); - // if(painter) - // delete painter; - // painter = NULL; - - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = NULL; - - if(imageBuffer) - delete imageBuffer; - imageBuffer = NULL; + if(quad>0) + glDeleteLists(quad, 1); } bool Renderer::selectOne(int x, int y) @@ -546,14 +480,6 @@ glVertex2i(x1, y1); glEnd(); - /* - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if(corectPerspective) - setRealPerspective(); - else - setOrtoPerspective(); - */ glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glPopMatrix(); @@ -561,145 +487,14 @@ glPopMatrix(); glMatrixMode(GL_MODELVIEW); } - -/* -void Renderer::setDataType(baseDataTypes::DATA_TYPES type) +void Renderer::render3D(bool selectMode) { - switch(type) - { - case baseDataTypes::BOOL: - case baseDataTypes::CHAR: - case baseDataTypes::INT: - case baseDataTypes::SHORT: - discretValues = 1; - break; - - case baseDataTypes::FLOAT: - case baseDataTypes::DOUBLE: - discretValues = 0; - break; - } - - CalculationData::setDataType(type); -} - -bool Renderer::resizeData(int x, char *dataPointer, bool foreignDataPointer) -{ - - if(CalculationData::resizeData(x, dataPointer, foreignDataPointer)) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = new QGLPixelBuffer(sizeX, 1, format(), this); - if(!OGLpBuffer->hasOpenGLPbuffers()) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = NULL; - - if(imageBuffer) - delete imageBuffer; - imageBuffer = new QImage(sizeX, 1, QImage::Format_RGB32); - } - return 1; - } - return 0; -} - -bool Renderer::resizeData(int x, int y, char *dataPointer, bool foreignDataPointer) -{ - if(CalculationData::resizeData(x, y, dataPointer, foreignDataPointer)) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = new QGLPixelBuffer(sizeX, sizeY, format(), this); - - if(!OGLpBuffer->hasOpenGLPbuffers()) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = NULL; - - if(imageBuffer) - delete imageBuffer; - imageBuffer = new QImage(sizeX, sizeY, QImage::Format_RGB32); - } - return 1; - } - return 0; -} - -bool Renderer::resizeData(int x, int y, int z, char *dataPointer, bool foreignDataPointer) -{ - - if(CalculationData::resizeData(x, y, z, dataPointer, foreignDataPointer)) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = new QGLPixelBuffer(sizeX, sizeY, format(), this); - - if(!OGLpBuffer->hasOpenGLPbuffers()) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = NULL; - - if(imageBuffer) - delete imageBuffer; - imageBuffer = new QImage(sizeX, sizeY, QImage::Format_RGB32); - } - return 1; - } - return 0; -} - -bool Renderer::resizeData(int x, int y, int z, int t, char *dataPointer, bool foreignDataPointer) -{ - return CalculationData::resizeData(x, y, z, t, dataPointer, foreignDataPointer); -} - -bool Renderer::resizeData(QVector<int> newSize, char *dataPointer, bool foreignDataPointer) -{ - if(CalculationData::resizeData(newSize, dataPointer, foreignDataPointer)) - { - if(OGLpBuffer) - delete OGLpBuffer; - OGLpBuffer = NULL; - switch(newSize.size()) - { - case 1: - OGLpBuffer = new QGLPixelBuffer(sizeX, 1, format(), this); - break; - case 2: - OGLpBuffer = new QGLPixelBuffer(sizeX, sizeY, format(), this); - break; - } - - } - return 0; -} -*/ -void Renderer::render(bool renderGreed) -{ int counter = 0, index; bool selectTest; float mx = -(float)storage.getSizeX(), my = -(float)storage.ge... [truncated message content] |
From: <dhu...@us...> - 2007-02-12 09:17:39
|
Revision: 306 http://svn.sourceforge.net/qcell/?rev=306&view=rev Author: dhubleizh Date: 2007-02-12 01:17:38 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - function saving is back and seems to work, even with LIF files Modified Paths: -------------- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.ui Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-11 21:54:12 UTC (rev 305) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-12 09:17:38 UTC (rev 306) @@ -313,42 +313,81 @@ // Generic type to parse XML request LocalFunction lf; + lf.fromXmlString(&content); // Check if we can use the generic type from the XML string - if(!lf.fromXmlString(&content)); - { - qDebug(tr("Unable to parse out internal data!").toAscii()); +// if(!lf.fromXmlString(&content)); +// { +// qDebug(tr("Unable to parse out internal data!").toAscii()); +// +// return QByteArray(); +// } - return QByteArray(); - } - // Header - result.append("FQT"); - result.append('\n'); + result.append("FQT\n"); // Second line // Num of args - result.append(lf.getNumberOfArgs()); + result.append(QString::number(lf.getNumberOfArgs()).toAscii()); result.append(' '); // Num of arg values - result.append(lf.getAlphabetSize()); + result.append(QString::number(lf.getAlphabetSize()).toAscii()); result.append(' '); // Num of return values - result.append(lf.getMaxReturnValues()); - result.append(' '); + result.append(QString::number(lf.getAlphabetSize()).toAscii()); result.append('\n'); // Third line - summed args foreach(int arg, lf.getSummedArguments()) { - result.append(QString::number(arg)[0].toAscii()); + result.append(QString::number(arg+1).toAscii()); result.append(','); } // Get rid of the penging `,' result.chop(1); - result.append('\n'); +// result.append('\n'); - /// @todo Main function writing + /// @todo Get it right next time - this is ugly! + QMap<QString, QString> fqt; + QDomDocument doc; + doc.setContent(content); + QDomElement root = doc.firstChild().toElement(); + root.removeChild(root.firstChild()); + QDomElement values = root.firstChild().toElement(); + int free_args = lf.getNumberOfArgs() - lf.getSummedArguments().count(); + int num_combinations = pow(lf.getAlphabetSize(), free_args); + QChar fill_value = values.attribute("FillValue")[0]; + int index = 0; + QString values_txt = values.text(); + values_txt.chop(1); + foreach(QString sum_line, values_txt.split(";\n")) + { + QStringList tokens = sum_line.split('='); + QStringList sum_and_free = tokens[0].split('+'); + QString sum = sum_and_free.takeFirst(); + + if (!fqt.contains(sum)) + { + fqt[sum] = QString(num_combinations, fill_value); + } + + index = num_combinations-1; + for (int i = 0; i < sum_and_free.size(); i++) + { + index -= sum_and_free[i].toInt() * (pow(lf.getAlphabetSize(), (free_args - i)) - 1); + } + fqt[sum][index] = tokens[1][0]; + } + + foreach(QString key, fqt.keys()) + { + result.append(QString("%1: %2\n") + .arg(key) + .arg(fqt[key]) + .toAscii() + ); + } + return result; } Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-11 21:54:12 UTC (rev 305) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-12 09:17:38 UTC (rev 306) @@ -1026,7 +1026,50 @@ void MainWindow::on_action_Function_save_activated() { + if(function_parsers.count() == 0) + { + QMessageBox::warning( + /*parent*/ this, + /*title*/ tr("Plugins warning"), + /*message*/ tr("There are no plugins loaded to handle LocalFunction saving.") + ); + return; + + } + + QFileDialog fd( + /*parent*/ this, + /*cation*/ tr("Save Local Function"), + /*dir*/ "." + ); + + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setFileMode(QFileDialog::AnyFile); + + QStringList filters; + QString filter; + // Add filter in format %{name} files (*.%{name}) + foreach(QString key, function_parsers.keys()) + { + // Don't shorten this, as it is made for translations + // purposes + filter = key + " " + tr("files") + " (*." + key + ")"; + filters << filter; + } + fd.setFilters(filters); + fd.setDefaultSuffix("FQT"); + + if(fd.exec()) + { + if(!fd.selectedFiles().isEmpty()) + { + callSaver(fd.selectedFiles().first(), "LocalFunction"); + + } + + } + } void MainWindow::on_action_Save_experiment_activated() @@ -1391,7 +1434,27 @@ NewWorldWizard nww; if (nww.exec()) { - /// @todo emit some signal here + data.clear(); + CalculationData *tmp = new CalculationData(); + + if (nww.spinBox3D->isEnabled()) + { + tmp->resizeData(nww.spinBox1D->value(), nww.spinBox2D->value(), nww.spinBox3D->value()); + } + else if (nww.spinBox2D->isEnabled()) + { + tmp->resizeData(nww.spinBox1D->value(), nww.spinBox2D->value()); + } + else if (nww.spinBox1D->isEnabled()) + { + tmp->resizeData(nww.spinBox1D->value()); + } + + tmp->fillData(0); + data.append(tmp); + + setupWorld(); + unlockExperiment(); } } @@ -1400,7 +1463,9 @@ NewNeighbourhoodWizard nnw; if (nnw.exec()) { - /// @todo emit some signal here + /// @todo Wait for Neighbourhood to be initializable +// neighbourhood = new Neighbourhood N(); + } } Modified: trunk/qcell/visgui/MainWindow.ui =================================================================== --- trunk/qcell/visgui/MainWindow.ui 2007-02-11 21:54:12 UTC (rev 305) +++ trunk/qcell/visgui/MainWindow.ui 2007-02-12 09:17:38 UTC (rev 306) @@ -67,17 +67,6 @@ <property name="title" > <string>&File</string> </property> - <widget class="QMenu" name="menu_Save" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="title" > - <string>&Save</string> - </property> - <addaction name="action_World_save" /> - <addaction name="action_Neighbourhood_save" /> - <addaction name="action_Function_save" /> - </widget> <widget class="QMenu" name="menu_Open" > <property name="statusTip" > <string>Opens experiment data.</string> @@ -97,6 +86,17 @@ <addaction name="action_New_Neighbourhood" /> <addaction name="action_New_Function" /> </widget> + <widget class="QMenu" name="menu_Save" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="title" > + <string>&Save</string> + </property> + <addaction name="action_World_save" /> + <addaction name="action_Neighbourhood_save" /> + <addaction name="action_Function_save" /> + </widget> <addaction name="menu_New" /> <addaction name="menu_Open" /> <addaction name="action_Open_experiment" /> @@ -289,6 +289,9 @@ <property name="text" > <string>&Function</string> </property> + <property name="visible" > + <bool>true</bool> + </property> </action> <action name="action_Save_experiment" > <property name="enabled" > @@ -318,11 +321,17 @@ <property name="text" > <string>&Neighbourhood</string> </property> + <property name="visible" > + <bool>false</bool> + </property> </action> <action name="action_New_Function" > <property name="text" > <string>&Function</string> </property> + <property name="visible" > + <bool>false</bool> + </property> </action> <action name="action_Import" > <property name="enabled" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-12 10:07:35
|
Revision: 308 http://svn.sourceforge.net/qcell/?rev=308&view=rev Author: dhubleizh Date: 2007-02-12 02:07:30 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - locking and unlocking stuff accordingly Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.ui Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-02-12 09:50:21 UTC (rev 307) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-12 10:07:30 UTC (rev 308) @@ -47,7 +47,6 @@ void setNToolsVisible(bool visible); private: - Ui::simulationWindowClass ui; protected: // only for test @@ -124,6 +123,8 @@ CalculationData *getStorage(); Renderer *getNeighbourhoodEditor(void); + Ui::simulationWindowClass ui; + protected slots: void zPlaneChange(int i); void dataUpdateRequest(void); Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-12 09:50:21 UTC (rev 307) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-12 10:07:30 UTC (rev 308) @@ -722,7 +722,9 @@ ui.tabWidget->setTabEnabled(1, 0); ui.tabWidget->setTabEnabled(2, 0); ui.tabWidget->setTabEnabled(3, 0); + ui.tabWidget->setTabEnabled(4, 0); ui.tabWidget->setTabEnabled(5, 0); + ui.tabWidget->setTabEnabled(6, 0); // for test only ui.functionTab->setLayout(new QVBoxLayout(ui.functionTab)); @@ -1474,8 +1476,10 @@ void simulationWindow::unlockGUI() { // basetools->unlockGUI(); - ui.tabWidget->setTabEnabled(5, true); - ui.functionTab->setEnabled(true); +// ui.tabWidget->setTabEnabled(4, 1); +// ui.tabWidget->setTabEnabled(5, 1); +// ui.tabWidget->setTabEnabled(6, 1); +// ui.functionTab->setEnabled(true); ft->unlockGUI(); } @@ -1590,4 +1594,4 @@ { 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-02-12 09:50:21 UTC (rev 307) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-12 10:07:30 UTC (rev 308) @@ -1,4 +1,4 @@ -/**@file MainWindow.c +/**@file MainWindow.cpp * @author czarny * @version 0.1 * @date @@ -141,12 +141,12 @@ // add Neigborhood Tools - dockNtools = new BetterDockWidget(this); - dockNtools->hide(); - //dockNtools->setDisabled(true); + dockNtools = new BetterDockWidget(this); + dockNtools->hide(); + dockNtools->setDisabled(true); NeigborhoodTools * neigborhoodTools = new NeigborhoodTools(this); - dockNtools->setWindowTitle(tr("Neigborhood Tools")); - dockNtools->setWidget(neigborhoodTools); + dockNtools->setWindowTitle(tr("Neigborhood Tools")); + dockNtools->setWidget(neigborhoodTools); ((QVBoxLayout*)dockNtools->layout())->addStretch(); dockNtools->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); @@ -202,14 +202,14 @@ statusBar()->addPermanentWidget(tmp_label); statusBar()->addPermanentWidget(iterationLCD); - // Model elements loaded indicator - world_check = new QCheckBox(tr("World"), this); -// world_check->setBackgroundColor(QColor(Qt::red)); - neighbourhood_check = new QCheckBox(tr("Neighbourhood"), this); - local_function_check = new QCheckBox(tr("Local Function"), this); - statusBar()->addPermanentWidget(world_check); - statusBar()->addPermanentWidget(neighbourhood_check); - statusBar()->addPermanentWidget(local_function_check); +// // Model elements loaded indicator +// world_check = new QCheckBox(tr("World"), this); +//// world_check->setBackgroundColor(QColor(Qt::red)); +// neighbourhood_check = new QCheckBox(tr("Neighbourhood"), this); +// local_function_check = new QCheckBox(tr("Local Function"), this); +// statusBar()->addPermanentWidget(world_check); +// statusBar()->addPermanentWidget(neighbourhood_check); +// statusBar()->addPermanentWidget(local_function_check); // Plugin parsing /// @todo get that code out of here! @@ -737,11 +737,7 @@ // Menus menu_View->setEnabled(true); - // Docks unlocking - baseDock->setEnabled(true); - dock3D->setEnabled(true); - dock2D->setEnabled(true); - dock1D->setEnabled(true); +// dockNtools->setEnabled(true); emit unlockGUI(); } @@ -1500,6 +1496,13 @@ emit neigborhoodSet(sw->getNeighbourhoodEditor()->getStorage()->getSizeX(), sw->getNeighbourhoodEditor()->getStorage()->getSizeY(), sw->getNeighbourhoodEditor()->getStorage()->getSizeZ()); emit neigborCount(neighbourhood->getNeighbourNumber()); //*************************************************** + + // Unlock stuff + sw->ui.tabWidget->setTabEnabled(6, 1); + dockNtools->setEnabled(true); + + // Switch to N + sw->ui.tabWidget->setCurrentIndex(6); } void MainWindow::setupLocalFunction() @@ -1514,6 +1517,13 @@ // for test only ********************************* sw->getFunctionTable()->setFunctionPointer(local_function); //************************************************ + + // Unlock stuff + sw->ui.tabWidget->setTabEnabled(5, 1); + sw->ui.functionTab->setEnabled(true); + + // Switch to function table + sw->ui.tabWidget->setCurrentIndex(5); } void MainWindow::setupWorld() @@ -1553,9 +1563,9 @@ ); // Pass rules selection from GUI to engine - connect(((ElementalRulesWidget*)elemental_dock->widget()), SIGNAL(rulesSelected(QVector<int>)), - elemental_rules, SLOT(rulesSelected(QVector<int>)) - ); +// connect(((ElementalRulesWidget*)elemental_dock->widget()), SIGNAL(rulesSelected(QVector<int>)), +// elemental_rules, SLOT(rulesSelected(QVector<int>)) +// ); // We should only work when the rules list is visible, as it slows // the calculation considerably @@ -1572,6 +1582,31 @@ menu_Save->setEnabled(true); action_World_save->setEnabled(true); + // Unlock stuff + baseDock->setEnabled(true); + + // Switch to proper tab + switch (sw->getStorage()->getDimension()) + { + case 3: + { + sw->ui.tabWidget->setCurrentIndex(0); + dock3D->setEnabled(true); + break; + } + case 2: + { + sw->ui.tabWidget->setCurrentIndex(2); + dock2D->setEnabled(true); + break; + } + case 1: + { + sw->ui.tabWidget->setCurrentIndex(3); + dock1D->setEnabled(true); + break; + } + } } void MainWindow::on_action_Export_activated() Modified: trunk/qcell/visgui/MainWindow.ui =================================================================== --- trunk/qcell/visgui/MainWindow.ui 2007-02-12 09:50:21 UTC (rev 307) +++ trunk/qcell/visgui/MainWindow.ui 2007-02-12 10:07:30 UTC (rev 308) @@ -34,19 +34,13 @@ <height>30</height> </rect> </property> - <widget class="QMenu" name="menu_Experiment" > + <widget class="QMenu" name="menu_View" > <property name="enabled" > <bool>false</bool> </property> <property name="title" > - <string>&Experiment</string> + <string>&View</string> </property> - <addaction name="action_Start" /> - <addaction name="action_Stop" /> - <addaction name="action_Restart" /> - <addaction name="separator" /> - <addaction name="action_Forward" /> - <addaction name="action_Back" /> </widget> <widget class="QMenu" name="menu_Help" > <property name="title" > @@ -55,13 +49,19 @@ <addaction name="separator" /> <addaction name="action_About" /> </widget> - <widget class="QMenu" name="menu_View" > + <widget class="QMenu" name="menu_Experiment" > <property name="enabled" > <bool>false</bool> </property> <property name="title" > - <string>&View</string> + <string>&Experiment</string> </property> + <addaction name="action_Start" /> + <addaction name="action_Stop" /> + <addaction name="action_Restart" /> + <addaction name="separator" /> + <addaction name="action_Forward" /> + <addaction name="action_Back" /> </widget> <widget class="QMenu" name="menu_File" > <property name="title" > @@ -78,14 +78,6 @@ <addaction name="action_Neighbourhood" /> <addaction name="action_Function" /> </widget> - <widget class="QMenu" name="menu_New" > - <property name="title" > - <string>&New</string> - </property> - <addaction name="action_New_World" /> - <addaction name="action_New_Neighbourhood" /> - <addaction name="action_New_Function" /> - </widget> <widget class="QMenu" name="menu_Save" > <property name="enabled" > <bool>false</bool> @@ -97,6 +89,14 @@ <addaction name="action_Neighbourhood_save" /> <addaction name="action_Function_save" /> </widget> + <widget class="QMenu" name="menu_New" > + <property name="title" > + <string>&New</string> + </property> + <addaction name="action_New_World" /> + <addaction name="action_New_Neighbourhood" /> + <addaction name="action_New_Function" /> + </widget> <addaction name="menu_New" /> <addaction name="menu_Open" /> <addaction name="action_Open_experiment" /> @@ -173,6 +173,9 @@ <property name="statusTip" > <string>Opens a predefined experiment.</string> </property> + <property name="visible" > + <bool>false</bool> + </property> </action> <action name="action_Continue_experiment" > <property name="text" > @@ -316,6 +319,9 @@ <property name="text" > <string>&World</string> </property> + <property name="statusTip" > + <string>Creates a new world of given size.</string> + </property> </action> <action name="action_New_Neighbourhood" > <property name="text" > @@ -348,6 +354,9 @@ <property name="text" > <string>&Export</string> </property> + <property name="statusTip" > + <string>Exports experiments to formats readable by other simulators.</string> + </property> </action> </widget> <resources/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-13 15:26:20
|
Revision: 311 http://svn.sourceforge.net/qcell/?rev=311&view=rev Author: dhubleizh Date: 2007-02-13 07:26:13 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - implemented and slightly tested REAK and ZIFW inparsing - seems to work - added the libs to main - visualisation every n-iterations mode Modified Paths: -------------- trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/parsers/LTFL/LTFLParserPlugin.cpp trunk/qcell/parsers/REAK/REAKParserPlugin.cpp trunk/qcell/parsers/ZIFW/ZIFWParserPlugin.cpp trunk/qcell/visgui/ExperimentSetup.ui trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h trunk/qcell/visgui/main.cpp trunk/qcell/visgui/visgui.pro Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -233,9 +233,16 @@ { sumVector.clear(); elements = list[i].split(',', QString::SkipEmptyParts); - for(int j=0;j<elements.size();++j) + if (elements.size() == 1 && elements[0].toInt() == 0) { + setSumArguments(QVector<int>()); + } + else + { + for(int j=0;j<elements.size();++j) + { sumVector.append((elements[j]).toInt()); + } } if(!sumVector.isEmpty()) { @@ -281,8 +288,15 @@ if(mainSplit.size()==2) { argumentsSplit = mainSplit[0].split(',', QString::SkipEmptyParts); - for(int i=0;i<argumentsSplit.size();++i) + if (argumentsSplit.first().toInt() == 0 && sumArguments.isEmpty()) + { + setSumArguments(QVector<int>()); + } + else + { + for(int i=0;i<argumentsSplit.size();++i) sums.append((argumentsSplit[i]).toInt()); + } argumentsSplit = mainSplit[1].split(',', QString::SkipEmptyParts); for(int i=0;i<argumentsSplit.size();++i) @@ -572,14 +586,22 @@ int index; if(sumArguments.size()==0 || freeArguments.size()==0) return 0; - if(valueTable.empty()) + if(valueTable.isEmpty()) resizeValueTable(); switch(functionMode) { case LocalFunction::SUM_AND_SWITCH: - index = calculateSumsIndex(sums) + calculateSwitchIndex(freeArgs); - valueTable[index] = value; - break; + { + index = calculateSumsIndex(sums) + calculateSwitchIndex(freeArgs); + valueTable[index] = value; + break; + } + case LocalFunction::SWITCH: + { + index = calculateSwitchIndex(freeArgs); + valueTable[index] = value; + break; + } default: return 0; } @@ -647,18 +669,26 @@ root = doc.createElement("LocalFunction"); root.setAttribute("ArgumentsNumber", getNumberOfArgs()); root.setAttribute("InputAlphabet", getAlphabetSize()); - if(sumArguments.size()>0) + if(sumArguments.size() > 0) { element = doc.createElement("Sums"); temp.clear(); for(int i=0;i<sumArguments.size();++i) { + if (sumArguments[i].isEmpty()) + { + temp += QString("\n%1").arg(0); + } + else + { temp += QString("\n%1").arg((sumArguments[i])[0]); - for(int j=1;j<sumArguments[i].size();++j) - { - temp += QString(",%1").arg((sumArguments[i])[j]); - } - temp += ";\n"; + } + + for(int j=1;j<sumArguments[i].size();++j) + { + temp += QString(",%1").arg((sumArguments[i])[j]); + } + temp += ";\n"; } text = doc.createTextNode(temp); element.appendChild(text); @@ -713,8 +743,7 @@ { element = node.toElement(); if(element.tagName()=="Sums") - setSumsFromString(element.text()); - + setSumsFromString(element.text()); if(element.tagName()=="Values") { if(element.hasAttribute("FillValue")) Modified: trunk/qcell/parsers/LTFL/LTFLParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/LTFL/LTFLParserPlugin.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/parsers/LTFL/LTFLParserPlugin.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -6,6 +6,7 @@ * Last Update: wto 28 lis 2006 11:23:55 CET */ #include "LTFLParserPlugin.h" +#include <QDebug> LTFLParserPlugin::LTFLParserPlugin() { @@ -50,20 +51,20 @@ result[0] = result[0].trimmed(); if(format.exactMatch(result[0])) { - splitted = result[0].section("FL",1); - dimensions = splitted.toInt(); +// splitted = result[0].section("FL",1); +// dimensions = splitted.toInt(); +// +// // dimensions sanity check +// if ((dimensions < 1) || (dimensions > 3)) +// { +// qDebug(tr("You should specify dimensions number from 1-3 in line %1") +// .arg(line_nr) +// .toAscii() +// ); +// +// return QString(); +// } - // dimensions sanity check - if ((dimensions < 1) || (dimensions > 3)) - { - qDebug(tr("You should specify dimensions number from 1-3 in line %1") - .arg(line_nr) - .toAscii() - ); - - return QString(); - } - result.removeFirst(); line_nr++; } @@ -79,11 +80,12 @@ // Dimensions sizes and number of neighbours result[0] = result[0].trimmed(); format = QRegExp("^(\\d)+ (\\d)+$"); + qDebug(result[0].toAscii()); if(format.exactMatch(result[0])) { splitted_list = result[0].split(' '); - alphabet_size = splitted_list.first().toInt(); - arguments = splitted_list.last().toInt(); + arguments = splitted_list.first().toInt(); + alphabet_size = splitted_list.last().toInt(); // alphabet_size sanity check. int max_alphabet_size = (int)'z'-(int)'A'+10; @@ -112,7 +114,7 @@ // The real function parsing result[0] = result[0].trimmed(); - format.setPattern("^([\\-0-9A-z]){" + QString::number(alphabet_size) + "} [0-9A-z]$"); + format.setPattern("^([\\-0-9A-z]){" + QString::number(arguments) + "} [0-9A-z]$"); int tmp_result, tmp_argument; QVector<int> tmp_arguments; foreach(QString line, result) @@ -209,10 +211,24 @@ line_nr++; } - /// @todo input the retrieved data into LF + // setting the number of arguments the function will take + // and the alphabet size + lf.init(arguments, alphabet_size, alphabet_size); + // setting the type of function +// lf.setFunctonType(LocalFunction::SWITCH); + lf.setSwitchFunction(); + lf.setSumArguments(QVector<int>()); -// return lf.toXmlString(); - return QString(); + QMapIterator<QVector<int>, int> iter(function); + while (iter.hasNext()) + { + iter.next(); + lf.setFunctionValue(iter.value(), iter.key()); + qDebug() << iter.value() << " : " << iter.key(); + } + + qDebug(lf.toXmlString().toAscii()); + return lf.toXmlString(); } QByteArray LTFLParserPlugin::parseOut(QString content, const QString type, const QString subtype) Modified: trunk/qcell/parsers/REAK/REAKParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -227,8 +227,8 @@ /// @todo input the retrieved data into LF // Init the function lf.init(arguments, alphabet_size, alphabet_size); - lf.setFunctonType(LocalFunction::SWITCH); -// lf.setSumArguments(QVector<int>(1,0)); +// lf.setFunctonType(LocalFunction::SWITCH); + lf.setSumArguments(QVector<int>()); // Finally pass the function to the engine QHashIterator<int, QVector<int> > i(function); @@ -236,10 +236,10 @@ { i.next(); lf.setFunctionValue(i.key(), i.value()); - qDebug() << i.key() << " : " << i.value(); +// qDebug() << i.key() << " : " << i.value(); } - qDebug(lf.toXmlString().toAscii()); +// qDebug(lf.toXmlString().toAscii()); return lf.toXmlString(); } Modified: trunk/qcell/parsers/ZIFW/ZIFWParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/ZIFW/ZIFWParserPlugin.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/parsers/ZIFW/ZIFWParserPlugin.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -46,7 +46,7 @@ } // Function type - format = QRegExp("^ZIFWP[1-3]?$"); + format = QRegExp("^ZIFW[1-3]?$"); lines[0] = lines[0].trimmed(); if(format.exactMatch(lines[0])) { @@ -115,7 +115,7 @@ // Main function parsing lines[0] = lines[0].trimmed(); - format = QRegExp("^[0-9A-z]: \\{([\\-0-9A-z]{" + QString::number(arguments_nr) + "})*,([\\-0-9A-z]{" + QString::number(arguments_nr) + ")?\\}$"); + format = QRegExp("^[0-9A-z]: \\{(([\\-0-9A-z]){" + QString::number(arguments_nr) + "},)*(([\\-0-9A-z]){" + QString::number(arguments_nr) + "})?\\}$"); int tmp_result, tmp_sign, argument_index, set_nr; QVector<QVector <int> > tmp_arguments; foreach(QString line, lines) @@ -152,14 +152,16 @@ // First clearing tmp values tmp_arguments.clear(); set_nr = 0; - // Remove space after separator ':' - splitted[1].remove(0, 1); + // Remove space and '{' after separator ':' + splitted[1].remove(0, 2); + // Remove '}' + splitted[1].chop(1); foreach(QString set, splitted[1].split(',')) { // Keep track of the set set_nr++; // Reset argument index counter - argument_index = 0; + argument_index = -1; if (set.isEmpty()) { @@ -183,7 +185,6 @@ if(tmp_sign >= (int)'A') { tmp_sign = tmp_sign - (int)'A' + 10; - } else { @@ -192,11 +193,12 @@ if(tmp_sign >= output_alphabet_size) { - qDebug(tr("The value number %1 in set %2 in line %3 is larger then the input alphabet size declared in the header (%4).") + qDebug(tr("The value number %1(%2) in set %3 in line %4 is larger then the input alphabet size declared in the header (%5).") .arg(argument_index) + .arg(tmp_sign) .arg(set) .arg(line_nr) - .arg(input_alphabet_size) + .arg(output_alphabet_size) .toAscii() ); @@ -204,7 +206,11 @@ } // Finally add the argument - tmp_arguments.append(QVector<int>(1, tmp_sign)); + if (value.toAscii() != '-') + { + tmp_arguments.last()[argument_index] = tmp_sign; + } +// tmp_arguments.append(QVector<int>(1, tmp_sign)); } } @@ -232,10 +238,22 @@ // and the alphabet size lf.init(arguments_nr, input_alphabet_size, output_alphabet_size); // setting the type of function - lf.setFunctonType(LocalFunction::SWITCH); +// lf.setFunctonType(LocalFunction::SWITCH); + lf.setSwitchFunction(); + lf.setSumArguments(QVector<int>()); - /// @todo How the fuck set ZIFW function parameters eh? + QMapIterator<int, QVector<QVector< int> > > iter(function); + while (iter.hasNext()) + { + iter.next(); + for (int i = 0; i < iter.value().size(); i++) + { + lf.setFunctionValue(iter.key(), iter.value()[i]); +// qDebug() << iter.key() << " : " << iter.value()[i]; + } + } +// qDebug(lf.toXmlString().toAscii()); return lf.toXmlString(); } Modified: trunk/qcell/visgui/ExperimentSetup.ui =================================================================== --- trunk/qcell/visgui/ExperimentSetup.ui 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/visgui/ExperimentSetup.ui 2007-02-13 15:26:13 UTC (rev 311) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>400</width> - <height>231</height> + <height>289</height> </rect> </property> <property name="windowTitle" > @@ -68,6 +68,54 @@ </widget> </item> <item> + <widget class="QGroupBox" name="stepBox" > + <property name="title" > + <string>Visualization step</string> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="stepLabel" > + <property name="text" > + <string>Step</string> + </property> + <property name="buddy" > + <cstring>stepSpinBox</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="stepSpinBox" > + <property name="maximum" > + <number>99999</number> + </property> + <property name="minimum" > + <number>1</number> + </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> + </widget> + </item> + <item> <widget class="QGroupBox" name="speedBox" > <property name="title" > <string>Delay between iterations</string> Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -77,8 +77,8 @@ dock3D, SLOT(setVisible(bool)) ); - connect(view3DTools, SIGNAL(newPositionZ(float)), sw->getRenderer(), SLOT(setZValue(float))); - connect( sw->getRenderer(), SIGNAL(newPositionSet(float, float, float)), view3DTools, SLOT(PositionChange(float, float, float))); + connect(view3DTools, SIGNAL(newPositionZ(float)), sw->getRenderer(), SLOT(setZValue(float))); + connect( sw->getRenderer(), SIGNAL(newPositionSet(float, float, float)), view3DTools, SLOT(PositionChange(float, float, float))); // View 2D Tools dock2D = new BetterDockWidget(this); @@ -139,7 +139,6 @@ dock1D, SLOT(setVisible(bool)) ); - // add Neigborhood Tools dockNtools = new BetterDockWidget(this); dockNtools->hide(); @@ -156,16 +155,16 @@ vnt_action->setText(tr("&Neigborhood Tools")); menu_View->addAction(vnt_action); - connect(sw, SIGNAL(setNToolsVisible(bool)), - dockNtools, SLOT(setVisible(bool)) - ); + 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))); + 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))); - connect(neigborhoodTools, SIGNAL(setSelectedPress(int)), sw->getNeighbourhoodEditor(), SLOT(fillSelected(int))); + connect(neigborhoodTools, SIGNAL(setSelectedPress(int)), sw->getNeighbourhoodEditor(), SLOT(fillSelected(int))); // Adding delay setup // An interlinked pair of QDoubleSpinBox and a QSlider // delaySlider = new QSlider(Qt::Horizontal); @@ -757,6 +756,7 @@ working = false; iteration = 0; msec_delay = 0; + step = 1; // Set all data pointers to NULL, as unlockExperiment depends on it! neighbourhood = NULL; @@ -832,10 +832,15 @@ void MainWindow::update() { + static int counter = 0; // *sw->getStorage() = *data[iteration]; // sw->getStorage()->resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1); //calc.resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1); + if (++counter == step) + { + counter = 0; sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); + } iterationLCD->display(iteration); } @@ -895,6 +900,7 @@ if(es.exec() == QDialog::Accepted) { working = true; + step = es.stepSpinBox->value(); // msec_delay = (uint)(es.delaySpinBox->value() * 100.00); // delaySpinBox->setValue(es.delaySpinBox->value()); if(es.continiuosCheckBox->isChecked()) Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/visgui/MainWindow.h 2007-02-13 15:26:13 UTC (rev 311) @@ -111,6 +111,7 @@ bool working; int iteration; uint msec_delay; + int step; Calculator calc; ElementalRules* elemental_rules; @@ -118,7 +119,7 @@ BetterDockWidget* dock3D; BetterDockWidget* dock2D; BetterDockWidget* dock1D; - BetterDockWidget* dockNtools; + BetterDockWidget* dockNtools; BetterDockWidget* baseDock; QList<CalculationData*> data; LocalFunction* local_function; Modified: trunk/qcell/visgui/main.cpp =================================================================== --- trunk/qcell/visgui/main.cpp 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/visgui/main.cpp 2007-02-13 15:26:13 UTC (rev 311) @@ -12,9 +12,9 @@ Q_IMPORT_PLUGIN(NFileParser); Q_IMPORT_PLUGIN(FQTFileParser); Q_IMPORT_PLUGIN(KIFileParser); -//Q_IMPORT_PLUGIN(REAKFileParser); +Q_IMPORT_PLUGIN(REAKFileParser); //Q_IMPORT_PLUGIN(LTFLFileParser); -//Q_IMPORT_PLUGIN(ZIFWFileParser); +Q_IMPORT_PLUGIN(ZIFWFileParser); //Q_IMPORT_PLUGIN(ZIFWPFileParser); Q_IMPORT_PLUGIN(Life105FileParser); Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-02-12 10:45:28 UTC (rev 310) +++ trunk/qcell/visgui/visgui.pro 2007-02-13 15:26:13 UTC (rev 311) @@ -67,7 +67,7 @@ ../basesources/functiontable.cpp \ ../basesources/neigborhoodtools.cpp -LIBS = -L../libs -lN -lFQT -lKI -lLife105 +LIBS = -L../libs -lN -lFQT -lKI -lLife105 -lREAK -lZIFW TRANSLATIONS = visgui_pl.ts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-13 16:27:02
|
Revision: 316 http://svn.sourceforge.net/qcell/?rev=316&view=rev Author: dhubleizh Date: 2007-02-13 08:26:59 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - fixed 2DView crash Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-02-13 16:11:34 UTC (rev 315) +++ trunk/qcell/baseheaders/Renderer.h 2007-02-13 16:26:59 UTC (rev 316) @@ -69,7 +69,7 @@ QVector<int> maskValue; bool showValues; - const char **texture; + const char** texture; bool force2D; Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-02-13 16:11:34 UTC (rev 315) +++ trunk/qcell/basesources/Renderer.cpp 2007-02-13 16:26:59 UTC (rev 316) @@ -137,7 +137,7 @@ void Renderer::generateObserver(void) { glEnable(GL_TEXTURE_2D); - observerTexture = bindTexture(QPixmap(texture), GL_TEXTURE_2D); + observerTexture = bindTexture(texture, GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); @@ -865,7 +865,8 @@ void Renderer::setTexture(const char *xpm[]) { - texture = xpm; +// texture = QPixmap(xpm); + texture = xpm; } void Renderer::setOrtoPerspective(bool noClear) Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-13 16:11:34 UTC (rev 315) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-13 16:26:59 UTC (rev 316) @@ -620,6 +620,7 @@ ui.view2DGraph->setLayout(new QVBoxLayout(ui.view2DGraph)); graphicsView2D = new Renderer(ui.view2DGraph); + graphicsView2D->setTexture((const char**)observer_xpm); ui.view2DGraph->layout()->addWidget(graphicsView2D); graphicsView2D->force2DView(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-13 16:11:41
|
Revision: 315 http://svn.sourceforge.net/qcell/?rev=315&view=rev Author: dhubleizh Date: 2007-02-13 08:11:34 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - use xpm instead of png files Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/visgui.pro Added Paths: ----------- trunk/qcell/images/ trunk/qcell/images/observer.xpm trunk/qcell/images/zeropoint.xpm Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-02-13 16:07:51 UTC (rev 314) +++ trunk/qcell/baseheaders/Renderer.h 2007-02-13 16:11:34 UTC (rev 315) @@ -2,6 +2,8 @@ #define _RENDERER_H #include "CalculationData.h" +#include "observer.xpm" +#include "zeropoint.xpm" #include <QVector> #include <QColor> #include <QGLPixelBuffer> @@ -67,7 +69,7 @@ QVector<int> maskValue; bool showValues; - QString textureName; + const char **texture; bool force2D; @@ -152,7 +154,7 @@ void showCellValues(bool show = 1); public: - void setTextureName(QString name); + void setTexture(const char *xpm[]); protected slots: void resizeDataEvent(void); Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-02-13 16:07:51 UTC (rev 314) +++ trunk/qcell/basesources/Renderer.cpp 2007-02-13 16:11:34 UTC (rev 315) @@ -137,7 +137,7 @@ void Renderer::generateObserver(void) { glEnable(GL_TEXTURE_2D); - observerTexture = bindTexture(QPixmap(textureName), GL_TEXTURE_2D); + observerTexture = bindTexture(QPixmap(texture), GL_TEXTURE_2D); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); @@ -863,9 +863,9 @@ showValues = show; } -void Renderer::setTextureName(QString name) +void Renderer::setTexture(const char *xpm[]) { - textureName = name; + texture = xpm; } void Renderer::setOrtoPerspective(bool noClear) Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-13 16:07:51 UTC (rev 314) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-13 16:11:34 UTC (rev 315) @@ -613,7 +613,7 @@ ui.view3D->setLayout(new QVBoxLayout(ui.view3D)); renderer = new Renderer(ui.view3D); - renderer->setTextureName("./observer.png"); + renderer->setTexture((const char**)observer_xpm); ui.view3D->layout()->addWidget(renderer); // Not needed anymore // renderer->resize(ui.view3D->width(), ui.view3D->height()); @@ -733,7 +733,7 @@ ui.NeighbourhoodTab->setLayout(new QVBoxLayout(ui.NeighbourhoodTab)); nRrenderer = new Renderer(ui.NeighbourhoodTab); - nRrenderer->setTextureName("./zeropoint.png"); + nRrenderer->setTexture((const char**)zeropoint_xpm); ui.NeighbourhoodTab->layout()->addWidget(nRrenderer); nRrenderer->showCellValues(); nRrenderer->showSymbol(0); Added: trunk/qcell/images/observer.xpm =================================================================== --- trunk/qcell/images/observer.xpm (rev 0) +++ trunk/qcell/images/observer.xpm 2007-02-13 16:11:34 UTC (rev 315) @@ -0,0 +1,269 @@ +/* XPM */ +static char * observer_xpm[] = { +"256 256 10 1", +" c #000000", +". c #FFFFFF", +"+ c #B3FFFF", +"@ c #00FFFF", +"# c #8080FF", +"$ c #0000FF", +"% c #09AFFF", +"& c #804000", +"* c #351B00", +"= c #8000FF", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ............. ", +" ....................................... ", +" ................................................. ", +" ......................................................... ", +" ................................................................... ", +" ........................................................................... ", +" ................................................................................... ", +" ....................................................................................... ", +" ............................................................................................. ", +" ................................................................................................. ", +" ..................................................................................................... ", +" ........................................................................................................... ", +" ............................................................................................................... ", +" ................................................................................................................... ", +" ......................................................................................................................... ", +" ........................................................................................................................... ", +" ............................................................................................................................... ", +" ................................................................................................................................. ", +" ............................................................++++++++++............................................................... ", +" ....................................................++++++++++++++++++++++++++++....................................................... ", +" ..................................................++++++++++++++++++++++++++++++++++++..................................................... ", +" ................................................++++++++++++++++++++++++++++++++++++++++++................................................... ", +" ..............................................++++++++++++++++++++++++++++++++++++++++++++++++++................................................. ", +" ............................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++............................................... ", +" .............................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++................................................ ", +" ............................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++............................................... ", +" ...........................................++++++++++++++++++++++++++++@@@@@@@@@@@+++++++++++++++++++++++++++.............................................. ", +" ..........................................++++++++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@#@@+++++++++++++++++++++............................................. ", +" .........................................+++++++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@++++++++++++++++++++............................................ ", +" ........................................+++++++++++++++++++@@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@#@@@@@@@@@++++++++++++++++++........................................... ", +" ........................................+++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@#@@@@@@@@@@@@++++++++++++++++........................................... ", +" ........................................++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@##@@@@@@@@@@@#@@@@@@@@@@@@@@+++++++++++++++........................................... ", +" .......................................++++++++++++++++@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++++++.......................................... ", +" ........................................+++++++++++++++@@@@@@@@@@@@@@@@@@#@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@++++++++++++++........................................... ", +" ........................................++++++++++++++@@@@@@@@@@@@@@@@@@@@#@@$@@@@@@@@@@@@@@@@@@$$@@@@@@@@@@@@@@@@@@@+++++++++++++........................................... ", +" .......................................++++++++++++++@@@@@@@@@@@@@@@@@@#@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@@+++++++++++++.......................................... ", +" .......................................+++++++++++++@@@@@@@@@@@@@@@@@@@@#@@@@@@@$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++.......................................... ", +" .......................................+++++++++++++@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@$@@@@@$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++.......................................... ", +" ......................................+++++++++++++@@@@@@@@@%@@@@@@@@@@@@#@@@@@@%@@@@@@@@$@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++......................................... ", +" ......................................+++++++++++++@@@@@@@@@@%@@@@@@@@@@@@#@@@@@@@@@$@@$@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++......................................... ", +" ......................................++++++++++++@@@@@@@@@@@@@%%@@@@@@$@$$#@@@@@@@@@$@@$@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++......................................... ", +" .....................................++++++++++++@##@@@@@@@@@@@@%@@@@@@$@@##@@@@@@@@$$@@$@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++........................................ ", +" ......................................+++++++++++@@@@##@@@@@@@@@@@%@@@@@@@@@@@@%@@@@$@@@@$$@@@@@%@@@@@@$@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@++++++++++......................................... ", +" ......................................+++++++++++@@@@@@@#@@@@$@@@@@%@@@@@$@@@@@@%@@@@$@@@@@$@@@@@@@@@@@@$@@@@$@@@@@@@@@@@##@@@@@@@@@@@@@++++++++++......................................... ", +" ......................................+++++++++++@@@@@@@@#@@@@$@@@@@%@@$$$$$$@@@@@@@@@$@@$$@@@@@@@@@@@@@@$@@@@$@@@@@@@@@@@@#@@@@@@@@@@@@@@++++++++++......................................... ", +" .....................................+++++++++++@@@@@@@@@@@@@@$$@@@@%.@@@$$@@@@@@@@@@$@@$@@$@@@@@@@@@@@@@$@@@@$@$$$$@@@@@@@@#@@@@@@@@@@@@@@++++++++++........................................ ", +" .....................................+++++++++++@@@@@@@@@@@@@@@@$@..........@@@@@@@@@@@@$@@@$$@@@@@@@@@@@@@@$$$$%$@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++........................................ ", +" .....................................+++++++++++@@@@@@@@@@@@@@@@@..............@@@@@@@@@$$@@@@@$@@@@@@@@@@@@@@@@$%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++........................................ ", +" .....................................++++++++++@@@@$$$@@@@@@@@@@................@@@@@@@$@@@@@@@@$@@@@@@@@@@@@@@@$%@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@+++++++++........................................ ", +" .....................................++++++++++@@@@@@@@$@@@@@@@@..................@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@$$%@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@+++++++++........................................ ", +" ......................................+++++++++@@@@@@@##$$$@@@@@....................@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@%@@@@@@@@$@@@$@@@@@@@@@@@@@@@@@@@++++++++......................................... ", +" .....................................+++++++++@@@@@@@@@@#@@$@@@@....................@@$@@@@@@@@@@@@@@@@@@@@@@@@@$@@%@@@@@@@@$@@@$@@@@@@@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++++@@@@@@@@@@###@$$@......................@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@$$@@$@@@@@@@@@@@@@@@@@@@@+++++++++........................................ ", +" .....................................+++++++++@@@@@@@@@@@@@@#$@@......................$@@@@@@&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@%%$@@@@@@@@$$@@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++++@@@@@@@@@@@@@@#@@@......................@@@&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@$$@%@@@@@@@@#$@@@@@@@@@@@@+++++++++........................................ ", +" .....................................+++++++++@@@@@@@@@@@@@@@@##@......................&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@$$$$@$@%@@@@@@@@#@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++++@@@@@@@@@@@@@@@@@#@......................&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@$@@@@@@@@@@#@@@@@@@@@@@@@@+++++++++........................................ ", +" .....................................+++++++++@@@@@@@@@@@@@@@@@@$@......................&&&&&&&&&&&&*&&&&&&&&&&&&&&@@@@@@@@@@@@@$@@@@@@@@@@#@@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................+++++++++@@@@@@@@@@@@@@@@@@@$$......................&&&&&&&***********&&&&&&&&&&@@@@@@@@@@@@$@@@@@$@@@@@@@@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................+++++++++@@@$$@@@@@@@@@@@@@@@$......................&&*********************&&&&&&&@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@++++++++........................................ ", +" ......................................++++++++@@@@@@$@@@@@@@@@@@@@@@$.....................&***********************&&&&&&&&@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@+++++++......................................... ", +" .....................................+++++++++@@@@@@$$@@@@@@@@@@@@@@@....................***************************&&&&&&&@@@@@@@@@@@@$@@@@@@@@@@@@#@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++@@@@@@@@$@@$@@$@@@@@@@@@@...................****************************&&&&&&&@@@@@@@@@@$@@@@@$$$$$@@@#@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@$@@$@@$@%%@@@@@@@@.................*******************************&&&&&&@@@@@@@@@$@$%$$@@@@@@@@#@@@@@@@@@@@+++++++........................................ ", +" .....................................+++++++++@@@@@@@@@@@$@@$@@@%@@@@@@@@...............*********************************&&&&&&@@@@@@@@@@%$@@@@@@@@@@#@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@$@@@$@@%%@@@@@@@@.............***********************************&&&&&@@@@@@@@@@%@$@$$@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@$@@$@@@@%%@@@@@@@@.........**************************************&&&&&@@@@@@@@%%@@$@$@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................+++++++++@@@@@#####@@@$@@$@@@@@%@@@@@@@@@&&&&&&&***************************************&&&&&&@@@@@@@@@@@@$$@@@@@@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++@@@@@@@$$$@@@@@$@$@@@@@@@@@@@@@@@&&&&&&*****************************************&&&&&@@@@@@@@@@@@@$$@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@@$@$$$@@@@@@@@@@@@&&&&&&*******************************************&&&&&@@@@@@@@@@@@$@$@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" ....................................+++++++++@@@@@@@@@@@@@@@$@@@@$$@@@@@@@@@@&&&&&&*******************************************&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++....................................... ", +" .....................................++++++++@@@@@@@@@@@@@@@@$@$@@@@@@@@@@@@@&&&&&&*********************************************&&&&&@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@$@@%%%%%$@@@@@@@@@@@@@@&&&&&***********************************************&&&&@@@@@@@@@@@@@$$@@@@@@@@##@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@$@@@@@$$@%@@@@@@@@@@@&&&&&&***********************************************&&&&&@@@@@@@@@@@$$@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@$$@@$$@@@$@@@%%@@@@@@@@@@&&&&&&***********************************************&&&&&@@@@@@%@@@@@$@@@#####@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@####@@$$$$@@@@@%%%%%%@@@@&&&&&*************************************************&&&&@@@@@@@%@@@@$@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@$#@@@@@@@@@@@@@@@@%@@@@&&&&&*************************************************&&&&@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" ......................................++++++++@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@@%%%@@@@@@@@@@@@@@@@@@@@+++++++......................................... ", +" .....................................+++++++++@@@@@@@@@@@$$$$$@@@@@@@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@$$$@@@@@@@@@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@&&&&&**************************************************&&&&&@@@@@@@@@@$$@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@%%%@@@@@@@@@@@@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@%%%@$@@@@@@%@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@$@@@@@@@@@@@$$$$@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@$$$$$@@@@@@$@@$@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@$@@@$$$@@@@$@@@$@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@$$$@@@@@%@@@@@@@@&&&&&&*************************************************&&&&&@@@@@@@$$@@@@@@$$$@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@@@$@@@@%@@@@@@@@@@&&&&&*************************************************&&&&@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@+++++++........................................ ", +" ......................................++++++++@@@@@@@@@@@@@@@@$$@%@@@@@@@@@@@&&&&&&***********************************************&&&&&@@@%@@@@@@@@@@@$@@@@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@@@@@@@@%%@@@@@@@@@@@&&&&&&***********************************************&&&&&@@@@%@@@@@@@@$$@@@@@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@$@%%%@@@@@@@@@@@@@@@&&&&&&***********************************************&&&&&@@@@%@@@@@@@@@$@@@@@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@#@@%%%%%@@@@%@@@@@@@@@@@@@&&&&&&*********************************************&&&&&@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++......................................... ", +" .....................................++++++++@@@@@@####@@$$@@@@%@@@@@@@@@@@@@&&&&&&&*******************************************&&&&&&@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@#@@@$##$$%@@@@@@@@@@@@@@&&&&&&*******************************************&&&&&@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@@#$@@%@@@@@@@@@@@@@@&&&&&&&*****************************************&&&&&&@@@@@@@@@%$$$@@@$@@@@@@@@@@@@@@@@@+++++++........................................ ", +" .....................................++++++++@@@@@@@@@@@@@#@$@@%@@@$$@@@@@@@@@@&&&&&&&***************************************&&&&&&@@@@@@@$@@@%@@@@@$@@@@@@@@@@@@@@@@@+++++++........................................ ", +" ......................................++++++++@@@@@@@@@@##@@@@@%%%@$@@@@@@@@@@@&&&&&&&***************************************&&&&&&@@@@@@@$@@@%%@@@@@@@$@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@#@@@@@%@@%$$@@@@@@@@@@@@&&&&&&&*************************************&&&&&&@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@+++++++......................................... ", +" .....................................++++++++@@@@@@@@@@@@@@@%@@%%$@@%%@@@@@@@@@@&&&&&&&***********************************&&&&&&@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@+++++++........................................ ", +" ......................................++++++++@@@@@@@@@@@@$@%@%@@@%%@@@@@@@@@@@@&&&&&&&&*********************************&&&&&&&@@@@@@@@@@@@@@$@@@@%@$@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@@@@%%%@@%@@@@@@@@@@@@@@@&&&&&&&&&*****************************&&&&&&&&@@@@@@@@@@@@$$$@@@@@@%%@@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@@@@%%@%%@@@@@@@@@@@@@@@@@&&&&&&&&&***************************&&&&&&&&@@@@@@@@@@@@@@$@@@@@@@@@%@@@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@$%%%%@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&***********************&&&&&&&&&@@@@@@@@@@$$@@@@$$@@@@==@%%@@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@$@@@@@@@@%%%@@@@@@@@@@@@@@&&&&&&&&&&*********************&&&&&&&&&@@@@@@@@@@@@@$$@@@$@@@@@=@@@%@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@@@@@@@@@##@%%@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&***********&&&&&&&&&&&&@@@@@@@@@@@@@@@@@$@@$@@@@@=@@@%@@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@@@@@@#######@%%@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@$$@@@@@@@@=@@%@@@@@@@@+++++++......................................... ", +" ......................................++++++++@@%@@@@@@@@%%%%@$@$$$$@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@$@@@@@@$$@@$===@@@@@@@@@@@@@@@@+++++++......................................... ", +" ......................................+++++++++@@%%%%%%%%@@@@$@@%%%%%%@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@$@@@@@@@@$@@$@===@@@@@@@@@@@@@++++++++......................................... ", +" .......................................++++++++@@@@@@@@@@@$$$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@$@@@@@@@$@@$@@@@@@@@@@@@@@@@@+++++++.......................................... ", +" ......................................+++++++++@@@@@@@@@@@@@@@@@$$$$@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@%@@@$@@@@@@@@@@=@@@@@@@@@@@++++++++......................................... ", +" .......................................+++++++++@@@@@@@@@$$$$$$$$$@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@%$@@@@@@@@@@@@@=@@@@@@@@@@++++++++.......................................... ", +" ......................................+++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%$$@@@@@@@@@@@@=@@@@@@@@@@++++++++......................................... ", +" .......................................+++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%@$@@@@@@@@@@@@=@@@@@@@@@++++++++.......................................... ", +" ......................................+++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@%@=@@@@@@@@@@@@=@@@@@@@@@++++++++......................................... ", +" .......................................+++++++++@@@@@@@@@@@@@$$$$$$$$@$$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@$$%@=@@@@@@@@@@@@=@@@@@@@@++++++++.......................................... ", +" .......................................++++++++@@@@@@@@@@@$$@@@@@@@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@%@@@@@@@$$%@$@@@@@@@@@@@@=@@@@@@@@+++++++.......................................... ", +" .......................................+++++++++@@@@@@@@@@@@#@@@@@@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$@@@@%@@@@$$@@@%@$@@@@@@@@@@@@@@@@@@@@++++++++.......................................... ", +" .......................................+++++++++@@@@@@@@@@@#@@@@$$@@@@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@$@@@@@%$@@@@$@@$$$$@@@@@@@@@@@@@@@@@@@++++++++.......................................... ", +" .......................................++++++++++@@@@@@@@@@@@@@@@@@@@$@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$$$@@@@@@%@$$@@$$@@@@$@@@@@@@@@@@@@@@@@@+++++++++.......................................... ", +" .......................................++++++++++@@@@@@@@@@@@@@@###@$$$@$@@$@@@@@@@@@$@@@@@@@@@@@@@@@@@@@$$@@@@@$@%@@@$@@@$@@@@$$@@@$$@@@@@@@@@@+++++++++.......................................... ", +" .......................................++++++++++@@@@@@@@@@@@@#@@@@$$@@$@#$@@@@@@@@$$@@@@@@@@@@$@@@@@@@@@@$@@@@$$%@@@@$$$$@@@@@@@$$@@@@@@@@@@@+++++++++.......................................... ", +" ........................................++++++++++@@@@@@@@#@@##@@@@@@$@@#$@@@@%@@@$$$$@@@@@@@@@$@@@@@@@@@@$@@@@@@%@@@@@@$$$$$$$$$@@@@@@@@@@@@+++++++++........................................... ", +" ........................................++++++++++@@@@@@@#@#@@@@@@@@$@@#$@@@@%@##$@%@$@@@@@@@@@$$@@@@@@@@@$@@@@@%$$@$@@@@$@@@@$@@@@@@@@@@@@+++++++++........................................... ", +" ........................................++++++++++@@@@@@@##@@@@@@@$@@@#%@@@@%#$$@@%@@$@@@@%@@@@$$@@@@@@@@@@@@@@%@$$@$@@@@@@@@@@@@@@@@@@@@+++++++++........................................... ", +" ........................................+++++++++++@@@@@@@@@@@@@@$@@@@%$@@@%@#$@@%@@@$@@@%@@@@@$$@@@@@@@@@@@@@%$@@$@@$$@@@@@@@@@@@@@@@@@++++++++++........................................... ", +" ........................................+++++++++++@@@@@@@@@@@@$@@@@%%@@@@%@#@@%@@@@@@@%@@@@@$%$@@@@@@$@@@@@@%$@@@@@@@@@@@@@@@@@@@@@@@++++++++++........................................... ", +" ........................................+++++++++++@@@@@@@@@@$$@@@@@$@@@@%$@@%@@@@@@@%@@@@@$%@$@@@@@$$@@@@@@%@@@@@@$@@@@@@@@@@@@@@@@++++++++++........................................... ", +" ........................................++++++++++++@@@@@@@@$@@@@@@@@@@%%@@@%@@@@@$%%@@@@@@%@$@@@@@$$$@@@@@%@@@@@@@@@@@@@@@@@@@@@@++++++++++........................................... ", +" .........................................++++++++++++@@@@@$$@@@@@@@@@@@%@@@%@@@@@@$%@@@@@@%@@$@@@@@@@$@@$@@%@@@@@@@@@@@@@@@@@@@@+++++++++++............................................ ", +" .........................................++++++++++++@@@@@@@@@@@@@@$$@%@@%@@@@@@$$@@@@@@@%@@$@@@@@@@$@@@@@%@@@@@@@@@@@@@@@@@@@+++++++++++............................................ ", +" .........................................++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@%@@@@@@@@@@$@@@@@%@@@@@@@@@@@@@@@@@@+++++++++++............................................ ", +" ...........................................++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@$$@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++.............................................. ", +" ...........................................+++++++++++++@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++.............................................. ", +" ...........................................++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++++.............................................. ", +" ............................................++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++++............................................... ", +" ............................................+++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++++............................................... ", +" ...........................................++++++++++++++++@@@@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@@@@+++++++++++++++.............................................. ", +" ............................................+++++++++++++++++@@@@@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@@@@@++++++++++++++++............................................... ", +" .............................................+++++++++++++++++++@@@@@@@@@@@@@@%@@@@@@@@@@@@@@@@@@++++++++++++++++++................................................ ", +" ..............................................++++++++++++++++++++@@@@@@@@@@@%@@@@@@@@@@@@@@@+++++++++++++++++++................................................. ", +" ...............................................++++++++++++++++++++++++++@@@@@@@@@@@+++++++++++++++++++++++++.................................................. ", +" ................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++++................................................... ", +" ................................................++++++++++++++++++++++++++++++++++++++++++++++++++++++++................................................... ", +" ..................................................++++++++++++++++++++++++++++++++++++++++++++++++++..................................................... ", +" .....................................................++++++++++++++++++++++++++++++++++++++++++........................................................ ", +" ......................................................++++++++++++++++++++++++++++++++++++......................................................... ", +" .........................................................++++++++++++++++++++++++++++............................................................ ", +" ................................................................++++++++++................................................................... ", +" ........................................................................................................................................... ", +" ....................................................................................................................................... ", +" ..................................................................................................................................... ", +" ................................................................................................................................. ", +" ............................................................................................................................... ", +" ........................................................................................................................... ", +" ......................................................................................................................... ", +" ................................................................................................................... ", +" ............................................................................................................... ", +" ........................................................................................................... ", +" ..................................................................................................... ", +" ................................................................................................. ", +" ............................................................................................. ", +" ....................................................................................... ", +" ................................................................................... ", +" ........................................................................... ", +" ................................................................... ", +" ......................................................... ", +" ................................................. ", +" ....................................... ", +" ............. ", +" ", +" ", +" ", +" ", +" ", +" ", +" ... [truncated message content] |
From: <dhu...@us...> - 2007-02-13 19:36:36
|
Revision: 318 http://svn.sourceforge.net/qcell/?rev=318&view=rev Author: dhubleizh Date: 2007-02-13 11:36:33 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - some totally basic view interpretation Modified Paths: -------------- trunk/qcell/baseheaders/ElementalRules.h trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/ElementalRules.cpp trunk/qcell/visgui/ElementalRulesWidget.cpp trunk/qcell/visgui/ElementalRulesWidget.h trunk/qcell/visgui/ElementalRulesWidget.ui trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h Modified: trunk/qcell/baseheaders/ElementalRules.h =================================================================== --- trunk/qcell/baseheaders/ElementalRules.h 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/baseheaders/ElementalRules.h 2007-02-13 19:36:33 UTC (rev 318) @@ -14,6 +14,8 @@ #include <QMultiHash> #include <QPair> +#include "CalculationData.h" + class ElementalRules : public QObject { Q_OBJECT @@ -29,6 +31,7 @@ int neighbours_count; int index; bool should_work; + CalculationData cd; QVector<int> return_values; QVector<QVector<int> > neighbours; @@ -45,6 +48,8 @@ void setNeighoursCount(const int neighbours); inline int getNeighbourCount(); + void setCDSize(int x, int y, int z); + CalculationData* getCalculationData(); }; Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/basesources/CalculationData.cpp 2007-02-13 19:36:33 UTC (rev 318) @@ -225,6 +225,24 @@ } } +void CalculationData::setValueAt(int val, QVector<int> pos) +{ + if (pos.size() == 3) + { + setValueAt(val, pos[0], pos[1], pos[2]); + } + else + { + if (pos.size() == 2) + { + setValueAt(val, pos[0], pos[1]); + } + else + { + setValueAt(val, pos[0]); + } + } +} double CalculationData::getValueAt_d(int x) { @@ -744,4 +762,4 @@ resizeData(cData.getSize()); fillData(cData.getDataPointer()); return *this; -} \ No newline at end of file +} Modified: trunk/qcell/basesources/ElementalRules.cpp =================================================================== --- trunk/qcell/basesources/ElementalRules.cpp 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/basesources/ElementalRules.cpp 2007-02-13 19:36:33 UTC (rev 318) @@ -6,6 +6,7 @@ */ #include "ElementalRules.h" +#include <QDebug> ElementalRules::ElementalRules() : QObject() @@ -77,6 +78,8 @@ // At the end we note the coordinates rules_mask.insert(rule_index, coordinates); + // Write to the internal interpreted World + cd.setValueAt(rule_index, coordinates); } void ElementalRules::resetList() @@ -105,3 +108,27 @@ should_work = flag; } +void ElementalRules::setCDSize(int x, int y, int z) +{ + if (z > 1) + { + cd.resizeData(x, y, z); + } + else + { + if (y > 1) + { + cd.resizeData(x, y); + } + else + { + cd.resizeData(x); + } + } +} + +CalculationData* ElementalRules::getCalculationData() +{ + return &cd; +} + Modified: trunk/qcell/visgui/ElementalRulesWidget.cpp =================================================================== --- trunk/qcell/visgui/ElementalRulesWidget.cpp 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/visgui/ElementalRulesWidget.cpp 2007-02-13 19:36:33 UTC (rev 318) @@ -22,6 +22,9 @@ connect(rulesTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(ruleDoubleClicked(QTreeWidgetItem*, int)) ); + connect(interpretedCheckBox, SIGNAL(toggled(bool)), + this, SLOT(interpretedView_toggled(bool)) + ); } void ElementalRulesWidget::addRule(int id, QVector<int> neighbrous, int result, QVector<int> coordinates) @@ -156,3 +159,8 @@ // //} +void ElementalRulesWidget::interpretedView_toggled(bool toggled) +{ + emit interpret(toggled); +} + Modified: trunk/qcell/visgui/ElementalRulesWidget.h =================================================================== --- trunk/qcell/visgui/ElementalRulesWidget.h 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/visgui/ElementalRulesWidget.h 2007-02-13 19:36:33 UTC (rev 318) @@ -24,6 +24,7 @@ Q_OBJECT signals: void visible(bool visible); + void interpret(bool interpretedView); // void rulesSelected(QHash<int, QList<QVector<int> > > rules); public slots: void setVisible(bool visible); @@ -35,6 +36,8 @@ void addOccurance(int id, QVector<int> coordinates); void selectionChanged(); void ruleDoubleClicked(QTreeWidgetItem* item, int column); +protected slots: + void interpretedView_toggled(bool); protected: QString parseCoordinates(QVector<int> coordinates); public: Modified: trunk/qcell/visgui/ElementalRulesWidget.ui =================================================================== --- trunk/qcell/visgui/ElementalRulesWidget.ui 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/visgui/ElementalRulesWidget.ui 2007-02-13 19:36:33 UTC (rev 318) @@ -20,6 +20,36 @@ <number>6</number> </property> <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>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QCheckBox" name="interpretedCheckBox" > + <property name="text" > + <string>Interpreted view</string> + </property> + </widget> + </item> + </layout> + </item> + <item> <widget class="QTreeWidget" name="rulesTree" > <property name="sizePolicy" > <sizepolicy> Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-13 19:36:33 UTC (rev 318) @@ -228,6 +228,10 @@ QAction* elemental_action = elemental_dock->toggleViewAction(); elemental_action->setText("&" + elemental_dock->windowTitle()); menu_View->addAction(elemental_action); + // Interpretation view on/off + connect((ElementalRulesWidget*)elemental_dock->widget(), SIGNAL(interpret(bool)), + this, SLOT(interpretationChanged(bool)) + ); foreach(QObject* plugin, QPluginLoader::staticInstances()) { @@ -754,6 +758,7 @@ void MainWindow::setupEngine() { working = false; + interpretedView = false; iteration = 0; msec_delay = 0; step = 1; @@ -839,7 +844,17 @@ if (++counter == step) { counter = 0; - sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); + if (interpretedView) + { + sw->getStorage()->resizeData(elemental_rules->getCalculationData()->getSize(), + elemental_rules->getCalculationData()->getDataPointer(), + 1 + ); + } + else + { + sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); + } } iterationLCD->display(iteration); } @@ -1540,6 +1555,11 @@ // Creating elemental rules according to DATA_TYPE elemental_rules = new ElementalRules; + elemental_rules->setCDSize( + data.last()->getSizeX(), + data.last()->getSizeY(), + data.last()->getSizeZ() + ); // Pass the calculation result to rules selection connect(&calc, SIGNAL(calculated(QVector<int>, QVector<int>, int)), @@ -1580,6 +1600,7 @@ elemental_rules, SLOT(work(bool)) ); + iteration=data.count()-1; // visualization update @@ -1663,3 +1684,12 @@ } } +void MainWindow::interpretationChanged(bool interpret) +{ + interpretedView = interpret; + sw->getStorage()->resizeData(elemental_rules->getCalculationData()->getSize(), + elemental_rules->getCalculationData()->getDataPointer(), + 1 + ); +} + Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-02-13 17:24:47 UTC (rev 317) +++ trunk/qcell/visgui/MainWindow.h 2007-02-13 19:36:33 UTC (rev 318) @@ -50,6 +50,8 @@ public: MainWindow(QWidget* parent = 0); +public slots: + void interpretationChanged(bool interpret); private slots: void on_action_About_activated(); void on_action_Quit_activated(); @@ -110,6 +112,7 @@ bool working; int iteration; + bool interpretedView; uint msec_delay; int step; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-02-14 11:19:22
|
Revision: 319 http://svn.sourceforge.net/qcell/?rev=319&view=rev Author: lessm Date: 2007-02-14 03:19:15 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - LF changes Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/doc/licenciate_thesis/chap2/chap2.tex trunk/qcell/doc/licenciate_thesis/chap3/chap3.tex trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/baseheaders/Renderer.h 2007-02-14 11:19:15 UTC (rev 319) @@ -2,8 +2,8 @@ #define _RENDERER_H #include "CalculationData.h" -#include "observer.xpm" -#include "zeropoint.xpm" +#include "../images/observer.xpm" +#include "../images/zeropoint.xpm" #include <QVector> #include <QColor> #include <QGLPixelBuffer> Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-02-14 11:19:15 UTC (rev 319) @@ -233,17 +233,17 @@ { sumVector.clear(); elements = list[i].split(',', QString::SkipEmptyParts); - if (elements.size() == 1 && elements[0].toInt() == 0) - { - setSumArguments(QVector<int>()); - } - else - { +// if (elements.size() == 1 && elements[0].toInt() == 0) +// { +// setSumArguments(QVector<int>()); +// } +// else +// { for(int j=0;j<elements.size();++j) { sumVector.append((elements[j]).toInt()); } - } +// } if(!sumVector.isEmpty()) { if(i==0) @@ -770,7 +770,9 @@ if(sumArguments.size()==0) return 0; for(int i=0;i<sumArguments.size();++i) + { out *= sumArguments[i].size() * (maxArgVal - 1) + 1; + } return out; } Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 11:19:15 UTC (rev 319) @@ -254,6 +254,21 @@ int simulationWindow::calculateDistans(int x, int y, int z, bool box) { + + float d1 = sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); + + + x += getStorage()->getSizeX()- 1 - localObserverPosition[0]; + y += getStorage()->getSizeY()- 1 - localObserverPosition[1]; + z += getStorage()->getSizeZ()- 1 - localObserverPosition[2]; + + if(x>=getStorage()->getSizeX()) + x -= getStorage()->getSizeX()-1; + if(y>=getStorage()->getSizeY()) + y -= getStorage()->getSizeY()-1; + if(z>=getStorage()->getSizeZ()) + z -= getStorage()->getSizeZ()-1; +/* if(box) { int mx = abs(localObserverPosition[0] - x), my = abs(localObserverPosition[1] - y), mz = abs(localObserverPosition[2] - z); @@ -261,7 +276,12 @@ return tmp > mz ? tmp : mz; } else - return sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); +*/ +// return sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); + + float d2 = sqrt((float)((x - (getStorage()->getSizeX()-1)) * (x - (getStorage()->getSizeX()-1))) * (float)((y - (getStorage()->getSizeY()-1)) * (y - (getStorage()->getSizeY()-1))) * (float)((z - (getStorage()->getSizeZ()-1)) * (z - (getStorage()->getSizeZ()-1)))); + + return d1<d2?d1:d2; } void simulationWindow::update2DTable(bool forceUpdate) @@ -403,6 +423,7 @@ bool needUpdate=0; int index; QString tmpString; + QStringList columnHeaders; SYMBOL symbol; QTableWidgetItem *item; table1D->blockSignals(1); @@ -418,7 +439,13 @@ table1DMem->setRowHeight(0, 30); for(int x=0;x<renderer->getStorage()->getSizeX();++x) + columnHeaders.append(tmpString.setNum(x)); + + table1D->setHorizontalHeaderLabels(columnHeaders); + table1DMem->setHorizontalHeaderLabels(columnHeaders); + for(int x=0;x<renderer->getStorage()->getSizeX();++x) { + index = renderer->getStorage()->getValueAt_i(x); if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; Modified: trunk/qcell/doc/licenciate_thesis/chap2/chap2.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/chap2/chap2.tex 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/doc/licenciate_thesis/chap2/chap2.tex 2007-02-14 11:19:15 UTC (rev 319) @@ -268,7 +268,7 @@ \begin{figure}[!hpt] \centering \includegraphics[width=10cm]{chap2/ddlab} -\caption{DDLab} +\caption{DDLab - obraz dynamiki globalnej} \label{fig:} \end{figure} @@ -283,7 +283,7 @@ \label{fig:} \end{figure} -Life32 jest symulatorem ukierunkowanym na regu\xB3y "Game of Life". Do g\xB3\xF3wnych zalet tej aplikacji nale\xBF\xB9 maksymalny rozmiar przetwarzanej konfiguracji kt\xF3ry ograniczony jest do planszy o rozmiarach 1000000 x 1000000, oraz du\xBFa pr\xEAdko\x9C\xE6 przetwarzania. Ograniczeniem pakietu jest to \xBFe umo\xBFliwia przetwarzanie konfiguracji binarnych. Symulator posiada mo\xBFliwo\x9C\xE6 wczytywania konfiguracji innych popularnych pakiet\xF3w. Przebieg symulacji obrazowany jest za pomoc\xB9 dwu wymiarowych plansz KB. Pakiet pozwala na konfiguracje kolor\xF3w kom\xF3rek. +Life32 jest symulatorem ukierunkowanym na regu\xB3y "Game of Life". Do g\xB3\xF3wnych zalet tej aplikacji nale\xBF\xB9 maksymalny rozmiar przetwarzanej konfiguracji kt\xF3ry ograniczony jest do planszy o rozmiarach 1000000 x 1000000, oraz du\xBFa pr\xEAdko\x9C\xE6 przetwarzania. Ograniczeniem pakietu jest to \xBFe umo\xBFliwia przetwarzanie jedynie konfiguracji binarnych. Symulator posiada mo\xBFliwo\x9C\xE6 wczytywania plik\xF3w innych popularnych pakiet\xF3w. Przebieg symulacji obrazowany jest za pomoc\xB9 dwu wymiarowych plansz KB. Pakiet pozwala na konfiguracje kolor\xF3w kom\xF3rek. \subsection{CelLab} \begin{figure}[!hpt] @@ -293,7 +293,7 @@ \label{fig:} \end{figure} -Pakiet CelLab wyr\xF3\xBFnia spo\x9Cr\xF3d innych symulator\xF3w mo\xBFliwo\x9C\xE6 definiowania w\xB3asnych funkcji lokalnych poprzez stworzenie kr\xF3tkiego programu w j\xEAzykach: Java, C, BASIC lub Pascal. Program jest ograniczony jedynie do w\xB3asnego formatu opisu konfiguracji modelu oblicze\xF1. Sk\xB3adowanie KB mo\xBFliwe jest do plik\xF3w jcp lub bitmapy. Inn\xB9 funkcj\xB9 niespotykan\xB9 w innych pakietach jest mo\xBFliwo\x9C\xE6 tworzenia plik\xF3w avi z zapisem przebiegu eksperymentu. Post\xEAp symulacji obrazowany jest w trybie graficznym z mo\xBFliwo\x9Cci\xB9 dostosowania kolorystyki symboli. +Pakiet CelLab wyr\xF3\xBFnia spo\x9Cr\xF3d innych symulator\xF3w mo\xBFliwo\x9C\xE6 definiowania w\xB3asnych funkcji lokalnych poprzez stworzenie kr\xF3tkiego programu w j\xEAzykach: Java, C, BASIC lub Pascal. Domy\x9Clnie program jest ograniczony jedynie do w\xB3asnego formatu opisu konfiguracji modelu oblicze\xF1. Sk\xB3adowanie KB mo\xBFliwe jest do plik\xF3w jcp lub bitmapy. Inn\xB9 funkcj\xB9 niespotykan\xB9 w innych pakietach jest mo\xBFliwo\x9C\xE6 tworzenia plik\xF3w avi z zapisem przebiegu eksperymentu. Post\xEAp symulacji obrazowany jest w trybie graficznym z mo\xBFliwo\x9Cci\xB9 dostosowania kolorystyki symboli. \subsection{WinLife} \begin{figure}[!hpt] @@ -307,7 +307,7 @@ \subsection {Por\xF3wnanie dost\xEApnych AK} -Przeprowadzona analiza funkcji szeroko znanych symulator\xF3w AK pokazuje i\xBF wi\xEAkszo\x9C\xE6 symulator\xF3w koncentruje si\xEA na obrazowaniu regu\xB3 z rodziny "Game of Life". Zakres wizualizacji ogranicza si\xEA do jedno i dwu wymiarowych AK w trybie graficznym z mo\xBFliwo\x9Cci\xB9 zmiany interpretacji symboli. W trakcie analizy dost\xEApnych symulator\xF3w AK nie stwierdzono wyposa\xBFenia symulator\xF3w w funkcje dynamicznego doboru modelu przetwarzania oraz mo\xBFliwo\x9Cci dowolnego definiowania s\xB9siedztwa. +Przeprowadzona analiza funkcji szeroko znanych symulator\xF3w AK pokazuje i\xBF wi\xEAkszo\x9C\xE6 symulator\xF3w koncentruje si\xEA na wizualizacji specyficznych . Zakres wizualizacji ogranicza si\xEA do jedno i dwu wymiarowych AK w trybie graficznym z mo\xBFliwo\x9Cci\xB9 zmiany interpretacji symboli. W trakcie analizy dost\xEApnych symulator\xF3w AK nie stwierdzono wyposa\xBFenia symulator\xF3w w funkcje dynamicznego doboru modelu przetwarzania oraz mo\xBFliwo\x9Cci dowolnego definiowania s\xB9siedztwa. Powszechnie stosuje si\xEA dwa rodzaje s\xB9siedztwa von Neumanna oraz Moora z mo\xBFliwo\x9Cci\xB9 modyfikacji s\xB9siad\xF3w. \begin{landscape} \begin{table}[!p] Modified: trunk/qcell/doc/licenciate_thesis/chap3/chap3.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/chap3/chap3.tex 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/doc/licenciate_thesis/chap3/chap3.tex 2007-02-14 11:19:15 UTC (rev 319) @@ -22,7 +22,7 @@ \end{itemize} \subsubsection {Wizualizacja symulacji} -Program pozwala wizualizowa\xE6 symulatory LAK(tryb tekstowy), DAK(tryb testowy, tryb graficzny), TAK(tryb graficzny z dwoma typami perspektywy). +Program pozwala wizualizowa\xE6 symulatory LAK(tryb tekstowy), DAK(tryb testowy, tryb graficzny), TAK(tryb graficzny z dwoma trybami perspektywy). \subsection {Rozszerzone funkcje programu} \label{subsec:rfp} @@ -30,13 +30,12 @@ \subsubsection{Dynamiczne dobieranie modelu symulacji} \label{subsubsec:ddm} Program umo\xBFliwia dynamiczne dobieranie funkcji lokalnej podczas pracy symulatora. -uwzgl\xEAdnieniem lokalno\x9Cci obserwatora. \subsubsection{Edycja KI} Pakiet daje mo\xBFliwo\x9C\xE6 edycji konfiguracji bie\xBF\xB9cej oraz posiada zestaw narz\xEAdzi wspomagaj\xB9cych(wype\xB3nianie obszar\xF3w, kopiowanie/wklejanie obszar\xF3w). \subsubsection{Wymiana danych ze popularnymi pakietami} -Aplikacja umo\xBFliwia zapis/odczyt plik\xF3w w formacie lif. +Aplikacja umo\xBFliwia zapis/odczyt plik\xF3w w formacie "lif" i "life". \subsubsection {Tryby obserwatora} Aplikacja posiada funkcj\xEA prze\xB3\xB9czania trybu obserwatora. Dost\xEApne s\xB9 tryby lokalny i globalny. @@ -52,7 +51,7 @@ \item funkcja lokalna \begin{itemize} -\item FQT - Jest formatem pliku tekstowego, zawieraj\xB9cego w kolejnych wierszach: +\item FQT - Jest formatem pliku tekstowego s\xB3u\xBF\xB9cego do opisu funkcji lokalnej, zawieraj\xB9cego w kolejnych wierszach: \begin{itemize} \item identyfikator literowy typu funkcji \item trzy liczby (separowane spacj\xB9): liczba argument\xF3w, liczba warto\x9Cci argumentu i liczba warto\x9Cci funkcji Modified: trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-13 19:36:33 UTC (rev 318) +++ trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-14 11:19:15 UTC (rev 319) @@ -2,35 +2,37 @@ \label{chap:iop} \section{Interfejs programu} -W niniejszy rozdziale przedstawiony zosta\xB3 interfejs programu, instrukcja obs\xB3ugi oraz przyk\xB3adowy przebieg eksperymentu. +W niniejszy rozdziale przedstawiony zosta\xB3 interfejs programu, instrukcja obs\xB3ugi oraz przyk\xB3adowy przebieg wybranych eksperyment\xF3w obrazuj\xB9cych mo\xBFliwo\x9Cci funkcyjne pakietu. \begin{figure}[h] \centering \includegraphics[width=14cm]{chap6/mainwindow} -\caption{Widok g\xB3\xF3wny} +\caption{Obraz symulatora gotowego do pracy} \end{figure} \begin{enumerate} - \item Menu g\xB3\xF3wne - \item Zak\xB3adki funkcji - \item Pasek narz\xEAdzi - \item Widok zak\xB3adki + \item Menu g\xB3\xF3wne - zawiera podstawowe funkcje umo\xBFliwiaj\xB9ce operowanie na plikach opisu modelu oraz KI. + \item Zak\xB3adki funkcji - umo\xBFliwia nawigacji po trybach wizualizacji eksperymentu. + \item Pasek boczny - jest obszarem zarezerwowanym dla okien narz\xEAdzi + \item Widok zak\xB3adki - przedstawia obszar zarezerwowany dla wizualizacji wybranej funkcji pakietu. \end{enumerate} \subsection{Menu g\xB3\xF3wne} Obszar zawieraj\xB9cy menu pliku umo\xBFliwiaj\xB9ce wczytanie konfiguracji modelu AK z pliku, oraz przyciski wyboru trybu pracy symulatora. \subsubsection{File} +Menu File posiada nast\xEApuj\xB9ce pola: \begin{itemize} \item New - menu kreator\xF3w element\xF3w modelu AK -\item Open - menu wczytywania element\xF3w modelu AK +\item Open - menu wczytywania plik\xF3w opisu modelu AK \item Continue Experiment - wczytuje wcze\x9Cniej zapisany eksperyment -\item Save - zapis element\xF3w modelu AK -\item Save Experiment - zapis eksperymentu do pliku(N, FL, KI, kroki eksperymentu) +\item Save - zapis plik\xF3w opisu modelu AK +\item Save Experiment - zapis eksperymentu do pliku (N, FL, KI, kroki eksperymentu) \item Quit - wyj\x9Ccie z programu \end{itemize} \subsubsection{View} -Menu umo\xBFliwia ukrywanie/uaktywnianie narz\xEAdzi specjalizowanych dla poszczeg\xF3lnych funkcji +Menu umo\xBFliwia ukrywanie/uaktywnianie narz\xEAdzi specjalizowanych dla poszczeg\xF3lnych funkcji. + \subsubsection{Experiment} \begin{itemize} \item Start - uruchamia prace symulatora w trybie pracy ci\xB9g\xB3ej lub sekwencji krok\xF3w @@ -41,6 +43,7 @@ \item About - informacje o pakiecie \end{itemize} \subsubsection{Help} +Menu "Help" posiada jedynie pozycje "About wy\x9Cwietlaj\xB9c\xB9 informacje o pakiecie. \subsection{Zak\xB3adki funkcji} Zak\xB3adki funkcji umo\xBFliwiaj\xB9 nawigacj\xEA pomi\xEAdzy poszczeg\xF3lnymi trybami wizualizacji, a tak\xBFe pomi\xEAdzy narz\xEAdziami funkcji lokalnej, s\xB9siedztwa oraz symboli. @@ -231,38 +234,49 @@ \caption {Wczytywanie konfiguracji z plik\xF3w} \end{figure} -Do sterowania post\xEApem symulacji s\xB3u\xBFy pasek narz\xEAdzi symulacji zaznaczony na rysunku 6.10. +Aby wykona\xE6 kolejne kroi 6.10. \begin{figure}[!h] \centering \includegraphics[width=14cm]{chap6/step} -\caption {Iterowanie krok\xF3w} +\caption {Narz\xEAdzia iterowanie krok\xF3w} \end{figure} -Kolejne kroki symulacji przedstawiaj\xB9 rysunki 6.11 - 6.14 +\subsection{Podstawowy eksperyment 3D} +Poni\xBFsza +Rysunki 6.11 - 6.14 przedstawiaj\xB9 kolejne kroki symulacji. Po analizie por\xF3wnawczej zauwa\xBFy\xE6 mo\xBFna i\xBF widoczne obiekty zaklasyfikowa\xE6 mo\xBFna jako \xB3aziki. \begin{figure}[!h] \centering -\includegraphics[width=8cm]{chap6/iter1} +\includegraphics[width=4cm]{chap6/iter1} \caption {Krok 1} \end{figure} \begin{figure}[!h] \centering -\includegraphics[width=8cm]{chap6/iter2} +\includegraphics[width=4cm]{chap6/iter2} \caption {Krok 2} \end{figure} \begin{figure}[!h] \centering -\includegraphics[width=8cm]{chap6/iter3} +\includegraphics[width=4cm]{chap6/iter3} \caption {Krok 3} \end{figure} \begin{figure}[!h] \centering -\includegraphics[width=8cm]{chap6/iter4} +\includegraphics[width=4cm]{chap6/iter4} \caption {Krok 4} \end{figure} + +\subsection{Dynamiczne dobieranie modelu} +Poni\xBFszy przyk\xB3ad obrazuje spos\xF3b dynamicznego doboru modelu obliczeniowego. +Zadaniem docelowym jest okre\x9Cleni modelu umo\xBFliwiaj\xB9cego obrazowanie kolizji sygna\xB3\xF3w w przestrzeni 1D. Zak\xB3adamy \xBFe sygna\xB3y poruszaj\xB9 si\xEA z pr\xEAdko\x9Cci\xB9 V=1 w przeciwnych kierunkach oraz po kolizj\xB9 pr\xEAdko\x9C\xE6 i kierunek sygna\xB3\xF3w ma pozosta\xE6 bez zmian. Do przedstawienia kolizji niezb\xEAdny jest alfabetu o czterech symbolach oraz s\xB9siedztwo tr\xF3jelementowe. + +Rysunek {} przedstawia tablice funkcji nieokre\x9Clonej. Widzimy na i\xBF wszystkie pola tabeli oznaczone s\xB9 znakiem "?" oznaczaj\xB9cym symbol nieokre\x9Clony. + +Rysunek {} uwidacznia tablice funkcji lokalnej zawieraj\xB9cej minimaln\xB9 liczb\xEA okre\x9Clonych warto\x9Cci + % vim:fencs=cp1250:fenc=cp1250 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-14 14:45:54
|
Revision: 320 http://svn.sourceforge.net/qcell/?rev=320&view=rev Author: dhubleizh Date: 2007-02-14 06:45:46 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - ui names corrections - proper rows tagging Modified Paths: -------------- trunk/qcell/baseheaders/view1dtexttools.ui trunk/qcell/baseheaders/view2dtexttools.ui trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.ui Modified: trunk/qcell/baseheaders/view1dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.ui 2007-02-14 11:19:15 UTC (rev 319) +++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-02-14 14:45:46 UTC (rev 320) @@ -78,7 +78,7 @@ </size> </property> <property name="text" > - <string>Values</string> + <string>Symbols</string> </property> <property name="checkable" > <bool>true</bool> @@ -105,7 +105,7 @@ </size> </property> <property name="text" > - <string>Symbols</string> + <string>Chars</string> </property> <property name="checkable" > <bool>true</bool> Modified: trunk/qcell/baseheaders/view2dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.ui 2007-02-14 11:19:15 UTC (rev 319) +++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-02-14 14:45:46 UTC (rev 320) @@ -84,7 +84,7 @@ </size> </property> <property name="text" > - <string>Values</string> + <string>Symbols</string> </property> <property name="checkable" > <bool>true</bool> @@ -111,7 +111,7 @@ </size> </property> <property name="text" > - <string>Symbols</string> + <string>Chars</string> </property> <property name="checkable" > <bool>true</bool> Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 11:19:15 UTC (rev 319) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 14:45:46 UTC (rev 320) @@ -526,19 +526,24 @@ void simulationWindow::update1DTableMem(void) { QTableWidgetItem *item, *memItem; - table1DMem->blockSignals(1); - table1DMem->insertRow(0); - for(int x=0;x<renderer->getStorage()->getSizeX();++x) +// table1DMem->blockSignals(1); + table1DMem->insertRow(table1DMem->rowCount()); + QStringList labels; + for(int x=0; x < renderer->getStorage()->getSizeX(); x++) { - item = table1D->item(0, x); - memItem = new QTableWidgetItem(*item); - table1DMem->setItem(0, x, memItem); +// item = table1D->item(0, x); +// memItem = new QTableWidgetItem(*item); + memItem = new QTableWidgetItem(*table1D->item(0,x)); + table1DMem->setItem(table1DMem->rowCount()-1, x, memItem); + labels << QString::number(x); } - table1DMem->blockSignals(0); - if(table1DMem->rowCount()>30) - { - table1DMem->removeRow(table1DMem->rowCount()-1); - } + table1DMem->setVerticalHeaderLabels(labels); + table1DMem->scrollToBottom(); +// table1DMem->blockSignals(0); +// if(table1DMem->rowCount()>30) +// { +// table1DMem->removeRow(table1DMem->rowCount()-1); +// } } void simulationWindow::updateSymbolTable(void) Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-14 11:19:15 UTC (rev 319) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-14 14:45:46 UTC (rev 320) @@ -815,7 +815,7 @@ iteration--; calc = *(data[iteration]); - data.removeLast(); +// data.removeLast(); } } @@ -901,7 +901,7 @@ void MainWindow::on_action_Back_activated() { - oneStep( Back); + oneStep(Back); } void MainWindow::on_action_Start_activated() @@ -944,6 +944,20 @@ CalculationData* backup = data.first(); data.clear(); data.append(backup); + + // Pass data to Calculator + *(CalculationData*)&calc = *data.last(); + + // Creating elemental rules according to DATA_TYPE + elemental_rules->resetList(); + elemental_rules->setCDSize( + data.last()->getSizeX(), + data.last()->getSizeY(), + data.last()->getSizeZ() + ); + + // visualization update + update(); } void MainWindow::on_action_World_save_activated() Modified: trunk/qcell/visgui/MainWindow.ui =================================================================== --- trunk/qcell/visgui/MainWindow.ui 2007-02-14 11:19:15 UTC (rev 319) +++ trunk/qcell/visgui/MainWindow.ui 2007-02-14 14:45:46 UTC (rev 320) @@ -42,13 +42,6 @@ <string>&View</string> </property> </widget> - <widget class="QMenu" name="menu_Help" > - <property name="title" > - <string>&Help</string> - </property> - <addaction name="separator" /> - <addaction name="action_About" /> - </widget> <widget class="QMenu" name="menu_Experiment" > <property name="enabled" > <bool>false</bool> @@ -111,7 +104,6 @@ <addaction name="menu_File" /> <addaction name="menu_View" /> <addaction name="menu_Experiment" /> - <addaction name="menu_Help" /> </widget> <widget class="QStatusBar" name="statusbar" /> <widget class="QToolBar" name="toolBar" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-14 17:13:56
|
Revision: 321 http://svn.sourceforge.net/qcell/?rev=321&view=rev Author: dhubleizh Date: 2007-02-14 09:13:48 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - local observers coords displayed - lot of small changes Modified Paths: -------------- trunk/qcell/baseheaders/basetools.h trunk/qcell/baseheaders/basetools.ui trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/basesources/basetools.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/MainWindow.h Modified: trunk/qcell/baseheaders/basetools.h =================================================================== --- trunk/qcell/baseheaders/basetools.h 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/baseheaders/basetools.h 2007-02-14 17:13:48 UTC (rev 321) @@ -23,6 +23,7 @@ void unlockGUI(); void setRowCount(int count); void setItem(int row, int column, QTableWidgetItem* item); + void setObserverCoords(QVector<int> coords); protected slots: void modeChangeSelect(void); Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/baseheaders/basetools.ui 2007-02-14 17:13:48 UTC (rev 321) @@ -8,8 +8,8 @@ <rect> <x>0</x> <y>0</y> - <width>154</width> - <height>421</height> + <width>166</width> + <height>494</height> </rect> </property> <property name="windowTitle" > @@ -26,8 +26,8 @@ <widget class="QGroupBox" name="ViewModeGroup" > <property name="sizePolicy" > <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>1</vsizetype> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -35,7 +35,7 @@ <property name="maximumSize" > <size> <width>16777215</width> - <height>75</height> + <height>16777215</height> </size> </property> <property name="title" > @@ -99,6 +99,59 @@ </property> </widget> </item> + <item> + <widget class="QLabel" name="localObserversLabel" > + <property name="text" > + <string>Observers position:</string> + </property> + </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>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="observersPosition" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>(X,Y,Z)</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> </layout> </widget> </item> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 17:13:48 UTC (rev 321) @@ -46,6 +46,7 @@ void set1DTextToolsVisible(bool visible); void setNToolsVisible(bool visible); + void observerChanged(QVector<int> coords); private: protected: Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-02-14 17:13:48 UTC (rev 321) @@ -806,7 +806,7 @@ temp.clear(); calcVector = indexToSums(i); foreach(tmp, calcVector) - temp.append(tr("%1;").arg(tmp)); + temp.append(tr("%1").arg(tmp)); out<<temp; } @@ -826,7 +826,7 @@ temp.clear(); calcVector = indexToFreeArgs(i); foreach(tmp, calcVector) - temp.append(tr("%1;").arg(tmp)); + temp.append(tr("%1").arg(tmp)); out<<temp; } Modified: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/basesources/basetools.cpp 2007-02-14 17:13:48 UTC (rev 321) @@ -131,3 +131,22 @@ ui.valueTable->setItem(row, column, item); } +void BaseTools::setObserverCoords(QVector<int> coords) +{ + QString label("("); + for (int i = 0; i < coords.size(); i++) + { + if (coords[i] > 0) + { + label.append(QString("%1,") + .arg(QString::number(coords[i])) + ); + } + } + label.chop(1); + label.append(')'); + + ui.observersPosition->setText(label); + ui.observersPosition->setEnabled(true); +} + Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 17:13:48 UTC (rev 321) @@ -294,9 +294,10 @@ QTableWidgetItem *item; QProgressDialog progresDialog; table2D->blockSignals(1); + QStringList hLabels, vLabels; if(forceUpdate) { - progresDialog.setLabelText("Generating view pleas wait..."); + progresDialog.setLabelText("Generating view, pleas wait..."); progresDialog.setMaximum(renderer->getStorage()->getSizeY()); progresDialog.show(); showProgres = 1; @@ -308,11 +309,20 @@ table2D->setColumnCount(renderer->getStorage()->getSizeX()); table2D->setRowCount(renderer->getStorage()->getSizeY()); for(int i=0;i<renderer->getStorage()->getSizeY();++i) - table2D->setRowHeight(i, 30); + { + table2D->setRowHeight(i, 30); + vLabels << QString::number(i); + } for(int i=0;i<renderer->getStorage()->getSizeX();++i) - table2D->setColumnWidth(i, 30); + { + table2D->setColumnWidth(i, 30); + hLabels << QString::number(i); + } + table2D->setHorizontalHeaderLabels(hLabels); + table2D->setVerticalHeaderLabels(vLabels); + for(int y=0;y<renderer->getStorage()->getSizeY();++y) { for(int x=0;x<renderer->getStorage()->getSizeX();++x) @@ -520,6 +530,7 @@ } } } + table1D->setVerticalHeaderLabels(QStringList ("KB")); table1D->blockSignals(0); } @@ -667,6 +678,7 @@ table1D->setItem(0, 0, &height_determiner); table1D->setMaximumHeight((2*table1D->rowHeight(0))+ 20); table1D->clear(); + table1D->setVerticalHeaderLabels(QStringList ("KB")); table1DMem = new QTableWidget(ui.view1D); ui.view1D->layout()->addWidget(table1DMem); @@ -678,6 +690,7 @@ symbolTable->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Char"))); symbolTable->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Color"))); symbolTable->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Model"))); + symbolTable->setColumnHidden(3, true); symbolTable->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Hide Flag"))); updateSymbolTable(); @@ -1123,6 +1136,7 @@ renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); + emit observerChanged(localObserverPosition); localViewReinterprete(); update2DTable(); graph2DUpdateRequest = 1; @@ -1181,6 +1195,7 @@ localObserverPosition[1] = row; localObserverPosition[2] = 0; renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); + emit observerChanged(localObserverPosition); localViewReinterprete(); update1DTable(); graph2DUpdateRequest = 1; @@ -1305,6 +1320,7 @@ localObserverPosition[1] = y; localObserverPosition[2] = z; renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); + emit observerChanged(localObserverPosition); localViewReinterprete(); table2DUpdateRequest = 1; graph2DUpdateRequest = 1; Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-14 17:13:48 UTC (rev 321) @@ -49,6 +49,9 @@ connect(sw, SIGNAL(setItem(int, int, QTableWidgetItem*)), basetools, SLOT(setItem(int, int, QTableWidgetItem*)) ); + connect(sw, SIGNAL(observerChanged(QVector<int>)), + basetools, SLOT(setObserverCoords(QVector<int>)) + ); // View 3D Tools dock3D = new BetterDockWidget(this); @@ -285,15 +288,15 @@ setupEngine(); } -void MainWindow::on_action_About_activated() -{ - // Construct and display AboutDialog - QDialog* dialog = new QDialog(this); - Ui::AboutDialog* ad = new Ui::AboutDialog(); - ad->setupUi(dialog); - // Display it modally (block MaindWindow), but discard the result - dialog->exec(); -} +//void MainWindow::on_action_About_activated() +//{ +// // Construct and display AboutDialog +// QDialog* dialog = new QDialog(this); +// Ui::AboutDialog* ad = new Ui::AboutDialog(); +// ad->setupUi(dialog); +// // Display it modally (block MaindWindow), but discard the result +// dialog->exec(); +//} void MainWindow::on_action_Quit_activated() { Modified: trunk/qcell/visgui/MainWindow.h =================================================================== --- trunk/qcell/visgui/MainWindow.h 2007-02-14 14:45:46 UTC (rev 320) +++ trunk/qcell/visgui/MainWindow.h 2007-02-14 17:13:48 UTC (rev 321) @@ -53,7 +53,7 @@ public slots: void interpretationChanged(bool interpret); private slots: - void on_action_About_activated(); +// void on_action_About_activated(); void on_action_Quit_activated(); void on_action_Neighbourhood_activated(); void on_action_Function_activated(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-14 18:41:49
|
Revision: 323 http://svn.sourceforge.net/qcell/?rev=323&view=rev Author: dhubleizh Date: 2007-02-14 10:41:39 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - 1D Table clearing on new KI load Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 17:43:57 UTC (rev 322) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 18:41:39 UTC (rev 323) @@ -168,6 +168,7 @@ void setSelectedCell(QVector<int> coord); void setSelectedFunctionRule(int index); + void clearView(); public slots: void NViewModeChange(int mode); Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 17:43:57 UTC (rev 322) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 18:41:39 UTC (rev 323) @@ -1644,3 +1644,18 @@ nRrenderer->maskSet(maskx, masky, maskz); nRrenderer->repaint(); } + +void simulationWindow::clearView() +{ + int i, row_count; + row_count = table1DMem->rowCount(); + for (i = 0; i < row_count; i++) + { + table1DMem->removeRow(0); + } +// for (i = 0; i < row_count; i++) +// { +// table2D->removeRow(0); +// } +} + Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-14 17:43:57 UTC (rev 322) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-14 18:41:39 UTC (rev 323) @@ -948,6 +948,7 @@ data.clear(); data.append(backup); + sw->clearView(); // Pass data to Calculator *(CalculationData*)&calc = *data.last(); @@ -1568,6 +1569,7 @@ void MainWindow::setupWorld() { // Pass data to Calculator + sw->clearView(); *(CalculationData*)&calc = *data.last(); // Creating elemental rules according to DATA_TYPE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-14 22:01:12
|
Revision: 325 http://svn.sourceforge.net/qcell/?rev=325&view=rev Author: dhubleizh Date: 2007-02-14 14:01:07 -0800 (Wed, 14 Feb 2007) Log Message: ----------- - I can't even remember all the things changed Modified Paths: -------------- trunk/qcell/baseheaders/basetools.ui trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/basesources/basetools.cpp trunk/qcell/basesources/functiontable.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/baseheaders/basetools.ui 2007-02-14 22:01:07 UTC (rev 325) @@ -8,7 +8,7 @@ <rect> <x>0</x> <y>0</y> - <width>166</width> + <width>171</width> <height>494</height> </rect> </property> @@ -26,8 +26,8 @@ <widget class="QGroupBox" name="ViewModeGroup" > <property name="sizePolicy" > <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>5</vsizetype> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -35,7 +35,7 @@ <property name="maximumSize" > <size> <width>16777215</width> - <height>16777215</height> + <height>115</height> </size> </property> <property name="title" > @@ -101,6 +101,9 @@ </item> <item> <widget class="QLabel" name="localObserversLabel" > + <property name="statusTip" > + <string>Shows local observers position (X,Y,Z)</string> + </property> <property name="text" > <string>Observers position:</string> </property> @@ -132,6 +135,15 @@ <property name="enabled" > <bool>false</bool> </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>15</height> + </size> + </property> + <property name="statusTip" > + <string>Shows local observers position (X,Y,Z)</string> + </property> <property name="text" > <string>(X,Y,Z)</string> </property> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-02-14 22:01:07 UTC (rev 325) @@ -125,6 +125,7 @@ Renderer *getNeighbourhoodEditor(void); Ui::simulationWindowClass ui; + void back1DTable(); protected slots: void zPlaneChange(int i); Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-02-14 22:01:07 UTC (rev 325) @@ -36,7 +36,7 @@ <enum>QTabWidget::Rounded</enum> </property> <property name="currentIndex" > - <number>4</number> + <number>5</number> </property> <widget class="QWidget" name="view3D" > <attribute name="title" > @@ -115,6 +115,14 @@ <attribute name="title" > <string>Function</string> </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + </layout> </widget> <widget class="QWidget" name="NeighbourhoodTab" > <attribute name="title" > Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -24,7 +24,7 @@ } valueTable.resize(numElements); - valueTable.fill(0); + valueTable.fill(-1); } int LocalFunction::mostPopularValue(void) Modified: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/basesources/basetools.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -136,12 +136,12 @@ QString label("("); for (int i = 0; i < coords.size(); i++) { - if (coords[i] > 0) - { +// if (coords[i] > 0) +// { label.append(QString("%1,") .arg(QString::number(coords[i])) ); - } +// } } label.chop(1); label.append(')'); Modified: trunk/qcell/basesources/functiontable.cpp =================================================================== --- trunk/qcell/basesources/functiontable.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/basesources/functiontable.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -28,6 +28,7 @@ ++counter; } } + headers = function->rowsHeaders(); ui.functionTable->setVerticalHeaderLabels(headers); headers = function->columnHeaders(); @@ -56,20 +57,24 @@ void FunctionTable::selectCell(int index) { - int counter = 0; - QTableWidgetItem *item; - for(int i=0;i<ui.functionTable->rowCount();++i) - { - for(int j=0;j<ui.functionTable->columnCount();++j) - { - item = ui.functionTable->item(i, j); - if(counter==index) - item->setSelected(1); - else - item->setSelected(0); - counter++; - } - } + // The item we will be editing + QTableWidgetItem *item; + + // As dividing by 0 is bad + if (index > 0) + { + item = ui.functionTable->item( + index / ui.functionTable->columnCount(), + index % ui.functionTable->columnCount() % index + ); + } + else + { + item = ui.functionTable->item(0, 0); + } + + // Edit proper cell + ui.functionTable->editItem(item); } void FunctionTable::functionEdit(int row, int column) Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -773,7 +773,7 @@ ui.tabWidget->setTabEnabled(6, 0); // for test only - ui.functionTab->setLayout(new QVBoxLayout(ui.functionTab)); +// ui.functionTab->setLayout(new QVBoxLayout(ui.functionTab)); ft = new FunctionTable(ui.functionTab); ui.functionTab->layout()->addWidget(ft); @@ -1659,3 +1659,9 @@ // } } +void simulationWindow::back1DTable() +{ + table1DMem->removeRow(table1DMem->rowCount()-1); + table1DMem->removeRow(table1DMem->rowCount()-1); +} + Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -178,7 +178,7 @@ // Main function parsing lines[0] = lines[0].trimmed(); - format = QRegExp("^(\\d)+: [0-9A-z]{" + QString::number(free_args_columns-1) + "}[0-9A-z]$"); + format = QRegExp("^(\\d)+: [\\-0-9A-z]{" + QString::number(free_args_columns-1) + "}[\\-0-9A-z]$"); QStringList tmp; int tmp_sum,value_index; QVector<int> tmp_values; @@ -234,8 +234,12 @@ // Collecting this lines values tmp_sign = (int)value.toAscii(); - if(tmp_sign >= (int)'A') + if (tmp_sign == (int)'-') { + tmp_values.append(-1); + } + else if(tmp_sign >= (int)'A') + { tmp_values.append(tmp_sign - (int)'A' + 10); } @@ -293,7 +297,7 @@ switch(lf.getFunctonType()) { case LocalFunction::SUM_AND_SWITCH: - lf.setDefaultValue(0); + lf.setDefaultValue(-1); foreach(int sum, results.keys()) { for(int i=0; i < results[sum].size(); ++i) Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-02-14 19:10:56 UTC (rev 324) +++ trunk/qcell/visgui/MainWindow.cpp 2007-02-14 22:01:07 UTC (rev 325) @@ -818,7 +818,9 @@ iteration--; calc = *(data[iteration]); -// data.removeLast(); + data.removeLast(); + sw->back1DTable(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-02-15 09:12:10
|
Revision: 327 http://svn.sourceforge.net/qcell/?rev=327&view=rev Author: dhubleizh Date: 2007-02-15 01:12:09 -0800 (Thu, 15 Feb 2007) Log Message: ----------- - KI parsed out ok - function parsing in (REAK, ZIFW, FQT), out (FQT) - function table edditing made clear Modified Paths: -------------- trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/basesources/functiontable.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/parsers/KI/KIParserPlugin.cpp trunk/qcell/parsers/REAK/REAKParserPlugin.cpp Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-02-15 00:21:48 UTC (rev 326) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-02-15 09:12:09 UTC (rev 327) @@ -669,7 +669,7 @@ root = doc.createElement("LocalFunction"); root.setAttribute("ArgumentsNumber", getNumberOfArgs()); root.setAttribute("InputAlphabet", getAlphabetSize()); - if(sumArguments.size() > 0) + if(sumArguments.size() > 0 && sumArguments[0].size() > 0) { element = doc.createElement("Sums"); temp.clear(); @@ -677,7 +677,7 @@ { if (sumArguments[i].isEmpty()) { - temp += QString("\n%1").arg(0); + temp += QString("\n%1").arg(-1); } else { @@ -696,7 +696,8 @@ } element = doc.createElement("Values"); - mpv = mostPopularValue(); +// mpv = mostPopularValue(); + mpv = -1; element.setAttribute("FillValue", mpv); temp = "\n"; for(int i=0;i<valueTable.size();++i) @@ -739,21 +740,36 @@ { init(xmlElement->attribute("ArgumentsNumber").toInt(), xmlElement->attribute("InputAlphabet").toInt(), 666); node = xmlElement->firstChild(); - while(!node.isNull()) + element = node.toElement(); + if(element.tagName()=="Sums") { - element = node.toElement(); - if(element.tagName()=="Sums") - setSumsFromString(element.text()); - if(element.tagName()=="Values") - { - if(element.hasAttribute("FillValue")) - { - setDefaultValue(element.attribute("FillValue").toInt()); - setValuesFromString(element.text()); - } - } - node = node.nextSibling(); + setSumsFromString(element.text()); + node = node.nextSibling(); + element = node.toElement(); } + else + { + setSumArguments(QVector<int>()); + } + if(element.hasAttribute("FillValue")) + { + setDefaultValue(element.attribute("FillValue").toInt()); + setValuesFromString(element.text()); + } + +// while(!node.isNull()) +// { +// element = node.toElement(); +// if(element.tagName()=="Values") +// { +// if(element.hasAttribute("FillValue")) +// { +// setDefaultValue(element.attribute("FillValue").toInt()); +// setValuesFromString(element.text()); +// } +// } +// node = node.nextSibling(); +// } return 1; } return 0; Modified: trunk/qcell/basesources/functiontable.cpp =================================================================== --- trunk/qcell/basesources/functiontable.cpp 2007-02-15 00:21:48 UTC (rev 326) +++ trunk/qcell/basesources/functiontable.cpp 2007-02-15 09:12:09 UTC (rev 327) @@ -1,4 +1,5 @@ #include "../baseheaders/functiontable.h" +#include <QDebug> void FunctionTable::init(void) { @@ -65,7 +66,7 @@ { item = ui.functionTable->item( index / ui.functionTable->columnCount(), - index % ui.functionTable->columnCount() % index + index % ui.functionTable->columnCount() ); } else @@ -92,11 +93,22 @@ function->setValueAt(-1, row * ui.functionTable->columnCount() + column); item->setText("?"); } - else + else if(temp.toInt() <= function->getAlphabetSize()) { item->setText(temp); function->setValueAt(temp.toInt(), row * ui.functionTable->columnCount() + column); } + else + { + // Reset original value + item->setText(QString::number(function->getValueAt( + row * ui.functionTable->columnCount() + column)) + ); + qDebug(tr("The inputed return value is greater than the one declared in function header(%1)") + .arg(function->getAlphabetSize()) + .toAscii() + ); + } } } Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-15 00:21:48 UTC (rev 326) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-02-15 09:12:09 UTC (rev 327) @@ -6,6 +6,7 @@ * Last Update: czw lis 30 14:19:22 CET 2006 */ #include "FQTParserPlugin.h" +#include <QDebug> FQTParserPlugin::FQTParserPlugin() { @@ -348,7 +349,7 @@ } // Get rid of the penging `,' result.chop(1); -// result.append('\n'); + result.append('\n'); /// @todo Get it right next time - this is ugly! QMap<QString, QString> fqt; @@ -364,11 +365,13 @@ int index = 0; QString values_txt = values.text(); values_txt.chop(1); + values_txt.remove(0, 1); foreach(QString sum_line, values_txt.split(";\n")) { QStringList tokens = sum_line.split('='); QStringList sum_and_free = tokens[0].split('+'); QString sum = sum_and_free.takeFirst(); + QStringList free = sum_and_free.first().split(','); if (!fqt.contains(sum)) { @@ -376,9 +379,12 @@ } index = num_combinations-1; - for (int i = 0; i < sum_and_free.size(); i++) + for (int i = 0; i < free.count(); i++) { - index -= sum_and_free[i].toInt() * (pow(lf.getAlphabetSize(), (free_args - i)) - 1); + int farg = free[i].toInt(); + int alphs = lf.getAlphabetSize(); + int wynik = pow(lf.getAlphabetSize(), free_args-i-1); + index -= free[i].toInt() * (pow(lf.getAlphabetSize(), (free_args - i - 1))); } fqt[sum][index] = tokens[1][0]; } Modified: trunk/qcell/parsers/KI/KIParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/KI/KIParserPlugin.cpp 2007-02-15 00:21:48 UTC (rev 326) +++ trunk/qcell/parsers/KI/KIParserPlugin.cpp 2007-02-15 09:12:09 UTC (rev 327) @@ -31,7 +31,7 @@ // dimensions and how large it is, so we need to track counts QVector<QVector<QVector <int> > > world; // Generic type for outputing XML strings - CalculationData* cd = new CalculationData(); + CalculationData cd; // Maximum dimensions values int max_x, max_y, max_z; max_x = max_y = max_z = 0; @@ -95,7 +95,7 @@ } // Char is the maximum value we can get from this file type - cd->setDataType(baseDataTypes::CHAR); + cd.setDataType(baseDataTypes::CHAR); // no Z dimenzion if ( world.count() == 1 ) @@ -103,10 +103,10 @@ // no Y dimension if (world.first().count() == 1 ) { - cd->resizeData(world.first().first().count()); + cd.resizeData(world.first().first().count()); for (int i = 0; i < world.first().first().count(); i++) { - cd->setValueAt(world.first().first()[i], i); + cd.setValueAt(world.first().first()[i], i); } } @@ -114,7 +114,7 @@ else { max_y = world.first().count(); - cd->resizeData(max_x, max_y); + cd.resizeData(max_x, max_y); for ( int i = 0; i < world.first().count(); i++ ) { for ( int j = 0; j < world.first().first().count(); j++ ) @@ -122,9 +122,9 @@ if (world.first()[i].count() > max_x) { max_x = world.first()[i].count(); - cd->resizeData(max_x, max_y); + cd.resizeData(max_x, max_y); } - cd->setValueAt(world.first()[i][j], j, i); + cd.setValueAt(world.first()[i][j], j, i); } } @@ -136,13 +136,13 @@ else { max_z = world.count(); - cd->resizeData(max_x, max_y, max_z); + cd.resizeData(max_x, max_y, max_z); for ( int i = 0; i < world.count(); i++ ) { if (world[i].count() > max_y) { max_y = world[i].count(); - cd->resizeData(max_x, max_y, max_z); + cd.resizeData(max_x, max_y, max_z); } for ( int j = 0; j < world[i].count(); j++ ) @@ -152,10 +152,10 @@ if (world[i][j].count() > max_x) { max_x = world[i][j].count(); - cd->resizeData(max_x, max_y, max_z); + cd.resizeData(max_x, max_y, max_z); } - cd->setValueAt(world[i][j][k], k, j, i); + cd.setValueAt(world[i][j][k], k, j, i); } } @@ -164,7 +164,7 @@ } - return cd->toXmlString(); + return cd.toXmlString(); } QByteArray KIParserPlugin::parseOut(QString content, const QString type, const QString subtype) @@ -172,23 +172,22 @@ // The resulting array to write to file by the backend QByteArray result; // Generic type to parse XML request - CalculationData* cd = (CalculationData*)content.toInt(); + CalculationData cd; // Check if we can use the generic type from the XML string /// @todo Unhack this! -// if(!cd.setFromXmlString(&content)) - if(cd == NULL) + if(!cd.setFromXmlString(&content)) { qDebug(tr("Unable to parse out internal data!").toAscii()); } - switch (cd->getDimension()) + switch (cd.getDimension()) { case 1: { - for (int x = 0; x < cd->getSizeX(); x++) + for (int x = 0; x < cd.getSizeX(); x++) { - result.append((char)('0' + cd->getValueAt_i(x))); + result.append((char)('0' + cd.getValueAt_i(x))); } result.append('\n'); @@ -196,11 +195,11 @@ } case 2: { - for(int y = 0; y < cd->getSizeY(); y++) + for(int y = 0; y < cd.getSizeY(); y++) { - for (int x = 0; x < cd->getSizeX(); x++) + for (int x = 0; x < cd.getSizeX(); x++) { - result.append((char)('0' + cd->getValueAt_i(x,y))); + result.append((char)('0' + cd.getValueAt_i(x,y))); } result.append('\n'); @@ -210,13 +209,13 @@ } case 3: { - for(int z = 0; z < cd->getSizeZ(); z++) + for(int z = 0; z < cd.getSizeZ(); z++) { - for (int y = 0; y < cd->getSizeY(); y++) + for (int y = 0; y < cd.getSizeY(); y++) { - for (int x = 0; x < cd->getSizeX(); x++) + for (int x = 0; x < cd.getSizeX(); x++) { - result.append((char)('0' + cd->getValueAt_d(x, y, z))); + result.append((char)('0' + cd.getValueAt_d(x, y, z))); } result.append('\n'); Modified: trunk/qcell/parsers/REAK/REAKParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-02-15 00:21:48 UTC (rev 326) +++ trunk/qcell/parsers/REAK/REAKParserPlugin.cpp 2007-02-15 09:12:09 UTC (rev 327) @@ -236,10 +236,10 @@ { i.next(); lf.setFunctionValue(i.key(), i.value()); -// qDebug() << i.key() << " : " << i.value(); + qDebug() << i.key() << " : " << i.value(); } -// qDebug(lf.toXmlString().toAscii()); + qDebug(lf.toXmlString().toAscii()); return lf.toXmlString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-02-15 09:27:20
|
Revision: 329 http://svn.sourceforge.net/qcell/?rev=329&view=rev Author: lessm Date: 2007-02-15 01:27:18 -0800 (Thu, 15 Feb 2007) Log Message: ----------- - local observer bug resolved Modified Paths: -------------- trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-02-15 09:21:49 UTC (rev 328) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-15 09:27:18 UTC (rev 329) @@ -254,34 +254,38 @@ int simulationWindow::calculateDistans(int x, int y, int z, bool box) { + int ox=getStorage()->getSizeX() / 2, oy=getStorage()->getSizeY() / 2, oz=getStorage()->getSizeZ() / 2; - float d1 = sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); + x += ox - localObserverPosition[0]; + y += oy - localObserverPosition[1]; + z += oz - localObserverPosition[2]; + if(x<0) + x+= getStorage()->getSizeX() - 1; - x += getStorage()->getSizeX()- 1 - localObserverPosition[0]; - y += getStorage()->getSizeY()- 1 - localObserverPosition[1]; - z += getStorage()->getSizeZ()- 1 - localObserverPosition[2]; + if(y<0) + y+= getStorage()->getSizeY() - 1; + if(z<0) + z+= getStorage()->getSizeZ() - 1; + if(x>=getStorage()->getSizeX()) - x -= getStorage()->getSizeX()-1; + x-= getStorage()->getSizeX() - 1; + if(y>=getStorage()->getSizeY()) - y -= getStorage()->getSizeY()-1; + y-= getStorage()->getSizeY() - 1; + if(z>=getStorage()->getSizeZ()) - z -= getStorage()->getSizeZ()-1; -/* + z-= getStorage()->getSizeZ() - 1; + if(box) { - int mx = abs(localObserverPosition[0] - x), my = abs(localObserverPosition[1] - y), mz = abs(localObserverPosition[2] - z); + int mx = abs(ox - x), my = abs(oy - y), mz = abs(oz - z); int tmp = mx>my ? mx : my; return tmp > mz ? tmp : mz; } else -*/ -// return sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); - - float d2 = sqrt((float)((x - (getStorage()->getSizeX()-1)) * (x - (getStorage()->getSizeX()-1))) * (float)((y - (getStorage()->getSizeY()-1)) * (y - (getStorage()->getSizeY()-1))) * (float)((z - (getStorage()->getSizeZ()-1)) * (z - (getStorage()->getSizeZ()-1)))); - - return d1<d2?d1:d2; + return (int)sqrt((float)((x - ox) * (x - ox)) + (float)((y - oy) * (y - oy)) + (float)((z - oz) * (z - oz))); } void simulationWindow::update2DTable(bool forceUpdate) Modified: trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-15 09:21:49 UTC (rev 328) +++ trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-15 09:27:18 UTC (rev 329) @@ -108,8 +108,8 @@ Zestaw narz\xEAdzi dla symulatora DAK. Zawiera nast\xEApuj\xB9ce opcje: \begin{itemize} \item Colors - interpretowanie za pomoc\xB9 kolor\xF3w -\item Values - interpretowanie za pomoc\xB9 warto\x9Cci symboli -\item Symbols - interpretacja za pomoc\xB9 symboli tekstowych +\item Symbols - interpretowanie za pomoc\xB9 warto\x9Cci symboli +\item Char - interpretacja za pomoc\xB9 znak\xF3w tekstowych \item Z Plane - przesuni\xEAcie w p\xB3aszczy\x9Fnie przekroju XY (widocznie jedynie dla KI 3D) \end{itemize} @@ -122,8 +122,8 @@ Zestaw narz\xEAdzi dla symulatora LAK: \begin{itemize} \item Colors - interpretowanie za pomoc\xB9 kolor\xF3w -\item Values - interpretowanie za pomoc\xB9 warto\x9Cci symboli -\item Symbols - interpretacja za pomoc\xB9 symboli tekstowych +\item Symbols - interpretowanie za pomoc\xB9 warto\x9Cci symboli +\item Char - interpretacja za pomoc\xB9 znak\xF3w tekstowych \item Clear - usuni\xEAcie z tabeli poprzednich krok\xF3w symulacji \end{itemize} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |