From: <le...@us...> - 2007-01-08 23:20:46
|
Revision: 130 http://svn.sourceforge.net/qcell/?rev=130&view=rev Author: lessm Date: 2007-01-08 15:20:43 -0800 (Mon, 08 Jan 2007) Log Message: ----------- - format described in LocalFunction.h - some changes in CalculationData Renderer simulationWindow classes Modified Paths: -------------- trunk/qcell/baseheaders/LocalFunction.h trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/Renderer.cpp Modified: trunk/qcell/baseheaders/LocalFunction.h =================================================================== --- trunk/qcell/baseheaders/LocalFunction.h 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/baseheaders/LocalFunction.h 2007-01-08 23:20:43 UTC (rev 130) @@ -12,6 +12,44 @@ //#include <Python.h> +/** + +xml Function format + +<LocalFunction ArgumentsNumber="number of arguments" InputAlphabet="number of symbols in alphabet"> + +<Sums> +e1,e2,...,en; +f1,f2,...,fn; +... +h1,h2,...,hn; +<\Sums> + +<Values FillValue="default value in value table"> + +s1,s2,...,sn+f1,f2,...,fn=value; + +<\Values> + +<\LocalFunction> + +game of life example + +<LocalFunction ArgumentsNumber="9" InputAlphabet="2" > + <Sums> +0,1,2,3,4,5,6,7; +</Sums> + <Values FillValue="0" > +2+1=1; +3+0=1; +3+1=1; +</Values> +</LocalFunction> + + + +*/ + class LocalFunction { Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-08 23:20:43 UTC (rev 130) @@ -15,6 +15,8 @@ #include "ui_simulationwindow.h" #include "../baseheaders/Renderer.h" +#include <QToolBox> + // this is widget make visualization of world data class simulationWindow : public QWidget @@ -34,6 +36,8 @@ QTableWidget *table1DMem; QTableWidget *symbolTable; + QToolBox *tools; + bool table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; QGraphicsView *graphicsView2D; Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-08 23:20:43 UTC (rev 130) @@ -1,14 +1,6 @@ <ui version="4.0" > <class>simulationWindowClass</class> <widget class="QWidget" name="simulationWindowClass" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>100</width> - <height>30</height> - </rect> - </property> <property name="sizePolicy" > <sizepolicy> <hsizetype>7</hsizetype> Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-08 23:20:43 UTC (rev 130) @@ -31,7 +31,8 @@ { data = dataPointer; haveForeignDataPointer = 1; - emit dataUpdated(); + //emit dataUpdated(); + emit dataResized(); } return 1; } @@ -39,14 +40,14 @@ void * CalculationData::getAddressAt(int x, int y, int z, int t) { int dSize; - if(dataType==baseDataTypes::NONE) + if(dataType==baseDataTypes::DATA_TYPES::NONE) return NULL; return data + dataSize * (x + y * sizeX + z * sizeX * sizeY + t * sizeX * sizeY * sizeZ); } CalculationData::CalculationData() { - dataType = baseDataTypes::CHAR; + dataType = baseDataTypes::DATA_TYPES::CHAR; sizeX = sizeY = sizeZ = sizeT = 0; dimension = -1; dataSize = sizeof(char); @@ -56,7 +57,7 @@ CalculationData::~CalculationData() { - dataType = baseDataTypes::NONE; + dataType = baseDataTypes::DATA_TYPES::NONE; sizeX = sizeY = sizeZ = sizeT = 0; dimension = -1; dataSize = 0; @@ -67,7 +68,7 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; case baseDataTypes::CHAR: @@ -92,16 +93,16 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return *((char *)getAddressAt(x, y, 0, 0)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return *((int *)(getAddressAt(x, y, 0, 0))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return *((short *)(getAddressAt(x, y, 0, 0))); case baseDataTypes::FLOAT: return (int)(*((float *)(getAddressAt(x, y, 0, 0)))); @@ -116,16 +117,16 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return *((char *)getAddressAt(x, y, z, 0)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return *((int *)(getAddressAt(x, y, z, 0))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return *((short *)(getAddressAt(x, y, z, 0))); case baseDataTypes::FLOAT: @@ -141,16 +142,16 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return *((char *)getAddressAt(x, y, z, t)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return *((int *)(getAddressAt(x, y, z, t))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return *((short *)(getAddressAt(x, y, z, t))); case baseDataTypes::FLOAT: @@ -183,18 +184,18 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: *((char *)getAddressAt(x, 0, 0, 0)) = (char)val; break; - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: *((int *)(getAddressAt(x, 0, 0, 0))) = val; break; - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: *((short *)(getAddressAt(x, 0, 0, 0))) = (short)val; break; } @@ -204,18 +205,18 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: *((char *)getAddressAt(x, y, 0, 0)) = (char)val; break; - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: *((int *)(getAddressAt(x, y, 0, 0))) = val; break; - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: *((short *)(getAddressAt(x, y, 0, 0))) = (short)val; break; } @@ -225,18 +226,18 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: *((char *)getAddressAt(x, y, z, 0)) = (char)val; break; - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: *((int *)(getAddressAt(x, y, z, 0))) = val; break; - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: *((short *)(getAddressAt(x, y, z, 0))) = (short)val; break; } @@ -246,18 +247,18 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: *((char *)getAddressAt(x, y, z, t)) = (char)val; break; - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: *((int *)(getAddressAt(x, y, z, t))) = val; break; - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: *((short *)(getAddressAt(x, y, z, t))) = (short)val; break; } @@ -267,22 +268,22 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return (double)*((char *)getAddressAt(x, 0, 0, 0)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return (double)*((int *)(getAddressAt(x, 0, 0, 0))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return (double)*((short *)(getAddressAt(x, 0, 0, 0))); - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: return *((double *)(getAddressAt(x, 0, 0, 0))); - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: return *((float *)(getAddressAt(x, 0, 0, 0))); } return 0.0; @@ -292,22 +293,22 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return (double)*((char *)getAddressAt(x, y, 0, 0)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return (double)*((int *)(getAddressAt(x, y, 0, 0))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return (double)*((short *)(getAddressAt(x, y, 0, 0))); - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: return *((double *)(getAddressAt(x, y, 0, 0))); - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: return *((float *)(getAddressAt(x, y, 0, 0))); } return 0.0; @@ -317,22 +318,22 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return (double)*((char *)getAddressAt(x, y, z, 0)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return (double)*((int *)(getAddressAt(x, y, z, 0))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return (double)*((short *)(getAddressAt(x, y, z, 0))); - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: return *((double *)(getAddressAt(x, y, z, 0))); - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: return *((float *)(getAddressAt(x, y, z, 0))); } return 0.0; @@ -342,22 +343,22 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: break; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: return (double)*((char *)getAddressAt(x, y, z, t)); - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: return (double)*((int *)(getAddressAt(x, y, z, t))); - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: return (double)*((short *)(getAddressAt(x, y, z, t))); - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: return *((double *)(getAddressAt(x, y, z, t))); - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: return *((float *)(getAddressAt(x, y, z, t))); } return 0.0; @@ -383,11 +384,11 @@ { switch(dataType) { - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: *((double *)(getAddressAt(x, 0, 0, 0))) = val; break; - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: *((float *)(getAddressAt(x, 0, 0, 0))) = (float)val; break; } @@ -397,11 +398,11 @@ { switch(dataType) { - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: *((double *)(getAddressAt(x, y, 0, 0))) = val; break; - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: *((float *)(getAddressAt(x, y, 0, 0))) = (float)val; break; } @@ -411,11 +412,11 @@ { switch(dataType) { - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: *((double *)(getAddressAt(x, y, z, 0))) = val; break; - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: *((float *)(getAddressAt(x, y, z, 0))) = (float)val; break; } @@ -425,11 +426,11 @@ { switch(dataType) { - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: *((double *)(getAddressAt(x, y, z, t))) = val; break; - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: *((float *)(getAddressAt(x, y, z, t))) = (float)val; break; } @@ -576,10 +577,10 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: return (sizeX * sizeY * sizeZ * sizeT)/8 + 1; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: switch(dimension) { case 1: @@ -592,7 +593,7 @@ return sizeX * sizeY * sizeZ * sizeT * sizeof(char); } - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: switch(dimension) { case 1: @@ -605,7 +606,7 @@ return sizeX * sizeY * sizeZ * sizeT * sizeof(double); } - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: switch(dimension) { case 1: @@ -618,7 +619,7 @@ return sizeX * sizeY * sizeZ * sizeT * sizeof(float); } - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: switch(dimension) { case 1: @@ -631,7 +632,7 @@ return sizeX * sizeY * sizeZ * sizeT * sizeof(int); } - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: switch(dimension) { case 1: @@ -677,7 +678,7 @@ QString CalculationData::createXmlHeader(void) { - return QString::number((int)this); + return QString(); } bool CalculationData::setFromXmlString(QString *xmlString) @@ -713,4 +714,4 @@ fillData(cData.getDataPointer()); return *this; -} +} \ No newline at end of file Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-08 23:20:43 UTC (rev 130) @@ -106,10 +106,10 @@ { switch(dataType) { - case baseDataTypes::BOOL: + case baseDataTypes::DATA_TYPES::BOOL: return (outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3])/8 + 1; - case baseDataTypes::CHAR: + case baseDataTypes::DATA_TYPES::CHAR: switch(dimension) { case 1: @@ -122,7 +122,7 @@ return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(char); } - case baseDataTypes::DOUBLE: + case baseDataTypes::DATA_TYPES::DOUBLE: switch(dimension) { case 1: @@ -135,7 +135,7 @@ return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(double); } - case baseDataTypes::FLOAT: + case baseDataTypes::DATA_TYPES::FLOAT: switch(dimension) { case 1: @@ -148,7 +148,7 @@ return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(float); } - case baseDataTypes::INT: + case baseDataTypes::DATA_TYPES::INT: switch(dimension) { case 1: @@ -161,7 +161,7 @@ return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(int); } - case baseDataTypes::SHORT: + case baseDataTypes::DATA_TYPES::SHORT: switch(dimension) { case 1: Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-08 22:33:11 UTC (rev 129) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-08 23:20:43 UTC (rev 130) @@ -53,6 +53,9 @@ float mov; if(greed>0) glDeleteLists(greed, 1); + if(getStorage()->getSizeX()==0 || getStorage()->getSizeY()==0 || getStorage()->getSizeZ()==0) + return; + greed = glGenLists(1); glNewList(greed, GL_COMPILE); @@ -105,6 +108,45 @@ glVertex3f(-(float)getStorage()->getSizeX() - mx -1.0f, (float)(getStorage()->getSizeY()) + 1.0f, (float)(z * 2) - mov -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(-(float)getStorage()->getSizeX() - 1.0f, -(float)(getStorage()->getSizeY()) + 1.0f, -(float)getStorage()->getSizeZ()-1.0f); + glEnd(); glEndList(); } @@ -174,9 +216,9 @@ glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - float ambient[] = {0.6f, 0.6f, 0.6f, 1.0f}; - float diffuse[] = {0.9f, 0.9f, 0.9f, 1.0f}; - float spectacular[] = {1.0f, 1.0f, 1.0f, 1.0f}; + float ambient[] = {0.2f, 0.2f, 0.2f, 1.0f}; + float diffuse[] = {0.6f, 0.6f, 0.6f, 1.0f}; + float spectacular[] = {0.8f, 0.8f, 0.8f, 1.0f}; float position[] = { 10.0f, 10.0f, 10.0f, 1.0f}; glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-09 08:59:59
|
Revision: 133 http://svn.sourceforge.net/qcell/?rev=133&view=rev Author: dhubleizh Date: 2007-01-09 00:59:57 -0800 (Tue, 09 Jan 2007) Log Message: ----------- - "Function" to "LocalFunction" in FQTParserPlugin.cpp and MainWindow.cpp - debugged and tested parsing of FQTParsingPlugin - removed some major bugs in thath plugin - seems to work now Modified Paths: -------------- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-09 08:57:53 UTC (rev 132) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-09 08:59:57 UTC (rev 133) @@ -10,7 +10,7 @@ FQTParserPlugin::FQTParserPlugin() { - supported_parser_types << "Function"; + supported_parser_types << "LocalFunction"; supported_file_types << "FQT"; } @@ -38,6 +38,12 @@ // Basic sanity check lines = QString(content).split('\n'); + // Check if there is pending '\n' to chop + if(lines.last().count() == 0) + { + lines.removeLast(); + } + if(lines.count() < 4) { qDebug(tr("The input file is to short!").toAscii()); @@ -66,19 +72,19 @@ // Number of arguments, possible values number and possible return values number lines[0] = lines[0].trimmed(); - format = QRegExp("^([0-9a-Z] ){2}[0-9a-Z]$"); + format = QRegExp("^((\\d)+ ){2}(\\d)+$"); if(format.exactMatch(lines[0])) { QStringList tmp_split = lines[0].split(' '); - arguments_nr = tmp_split[0].toLong(); - values_nr = tmp_split[1].toLong(); - return_values_nr = tmp_split[2].toLong(); + arguments_nr = tmp_split[0].toInt(); + values_nr = tmp_split[1].toInt(); + return_values_nr = tmp_split[2].toInt(); - if((arguments_nr == 0) || (values_nr == 0) || (return_values_nr == 0)) + if((arguments_nr < 2) || (values_nr < 2) || (return_values_nr < 2)) { - qDebug(tr("In line %1 each value (arguments number, arguments values number and return values number) needs to be more then 0 for the function to be usuable") + qDebug(tr("In line %1 each value (arguments number, arguments values number and return values number) needs to be more then 2 for the function to be usuable") .arg(line_nr) .toAscii() ); @@ -110,16 +116,28 @@ ); } - // Index of arguments gettins summed up + // Index of arguments getting summed up lines[0] = lines[0].trimmed(); - format = QRegExp("^((\\d)+,){1-" + QString::number(arguments_nr-2) + "}(\\d)+$"); + switch (arguments_nr) + { + case 2: + { + format = QRegExp("^(\\d)$"); + break; + } + default: + { + format = QRegExp("^((\\d)+,){1-" + QString::number(arguments_nr-2) + "}(\\d)+$"); + } + } if(format.exactMatch(lines[0])) { int arg_index, arg_nr; - arg_nr = 1; + arg_nr = 0; foreach(QString argument, lines[0].split(',')) { + arg_nr++; arg_index = argument.toLong(); // Sanity check @@ -136,12 +154,10 @@ } arguments.append(arg_index); - - arg_nr++; } // Now we can calculate the maximal sum value max_sum = arg_nr * (values_nr - 1); - free_args_columns = values_nr^arg_nr; + free_args_columns = pow(values_nr, (arguments_nr - arg_nr)); lines.removeFirst(); line_nr++; @@ -159,7 +175,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; @@ -188,13 +204,28 @@ return QString(); } + // Double adding sanity check + else if(results.contains(tmp_sum)) + { + qDebug(tr("The sum %1 in line %2 already added.") + .arg(tmp_sum) + .arg(line_nr) + .toAscii() + ); + return QString(); + } + // Now parsing the rest of values // First clearing tmp values tmp_values.clear(); - value_index = 1; + value_index = 0; + // Remove space after seperator ':' + tmp[1].remove(0, 1); foreach(QChar value, tmp[1]) { + // Keep track of current parsed value + value_index++; // Sanity check for value if(value.toAscii() >= ('0'+values_nr)) { @@ -210,22 +241,9 @@ // Collecting this lines values tmp_values.append(value.toAscii() - '0'); - // Keep track of current parsed value - value_index++; } - // Double adding sanity check - if(results.contains(tmp_sum)) - { - qDebug(tr("The sum %1 in line %2 already added.") - .arg(tmp_sum) - .arg(line_nr) - .toAscii() - ); - return QString(); - } - // Finally adding the parsed values results[tmp_sum] == QVector<int>(tmp_values); Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-09 08:57:53 UTC (rev 132) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-09 08:59:57 UTC (rev 133) @@ -46,9 +46,9 @@ } } - if(type == "Function") + if(type == "LocalFunction") { - file_types = iParser->fileTypes("Function"); + file_types = iParser->fileTypes("LocalFunction"); foreach(QString extension, file_types) { function_parsers[extension] = iParser; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-09 09:50:40
|
Revision: 134 http://svn.sourceforge.net/qcell/?rev=134&view=rev Author: dhubleizh Date: 2007-01-09 01:50:35 -0800 (Tue, 09 Jan 2007) Log Message: ----------- - embede all of UI in simulationWindow into Layouts thus making it more flexible - tranlsated simulationWindow into polish Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/visgui_pl.qm trunk/qcell/visgui/visgui_pl.ts Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-09 08:59:57 UTC (rev 133) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-09 09:50:35 UTC (rev 134) @@ -1,6 +1,14 @@ <ui version="4.0" > <class>simulationWindowClass</class> <widget class="QWidget" name="simulationWindowClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>536</width> + <height>182</height> + </rect> + </property> <property name="sizePolicy" > <sizepolicy> <hsizetype>7</hsizetype> @@ -12,231 +20,281 @@ <property name="windowTitle" > <string>simulationWindow</string> </property> - <widget class="QTabWidget" name="tabWidget" > - <property name="geometry" > - <rect> - <x>10</x> - <y>10</y> - <width>620</width> - <height>460</height> - </rect> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> </property> - <property name="tabPosition" > - <enum>QTabWidget::North</enum> + <property name="spacing" > + <number>6</number> </property> - <property name="tabShape" > - <enum>QTabWidget::Rounded</enum> - </property> - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="view3D" > - <attribute name="title" > - <string>3D View</string> - </attribute> - <widget class="QRadioButton" name="perspectiveView" > - <property name="geometry" > - <rect> - <x>20</x> - <y>10</y> - <width>83</width> - <height>18</height> - </rect> + <item> + <widget class="QTabWidget" name="tabWidget" > + <property name="tabPosition" > + <enum>QTabWidget::North</enum> </property> - <property name="text" > - <string>Perspective</string> + <property name="tabShape" > + <enum>QTabWidget::Rounded</enum> </property> - <property name="checked" > - <bool>true</bool> + <property name="currentIndex" > + <number>0</number> </property> + <widget class="QWidget" name="view3D" > + <attribute name="title" > + <string>3D View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QRadioButton" name="perspectiveView" > + <property name="text" > + <string>Perspective</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="ortho2DView" > + <property name="text" > + <string>Ortho2D</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> + <widget class="QWidget" name="view2D" > + <attribute name="title" > + <string>2D Text View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QCheckBox" name="Grig2DColors" > + <property name="text" > + <string>Enable Colors</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid2DValues" > + <property name="text" > + <string>Values</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid2DSybmols" > + <property name="text" > + <string>Symbols</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label" > + <property name="lineWidth" > + <number>3</number> + </property> + <property name="text" > + <string>Z Plane</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + <property name="buddy" > + <cstring>Grid2DZplane</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="Grid2DZplane" /> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="view2DGraph" > + <attribute name="title" > + <string>2D Graphics View</string> + </attribute> + </widget> + <widget class="QWidget" name="view1D" > + <attribute name="title" > + <string>1D Text View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QCheckBox" name="Grig1DColors" > + <property name="text" > + <string>Enable Colors</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid1DValues" > + <property name="text" > + <string>Values</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid1DSybmols" > + <property name="text" > + <string>Symbols</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="memClr" > + <property name="text" > + <string>Clear Memory</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> + <widget class="QWidget" name="symbolConfig" > + <attribute name="title" > + <string>Symbols Configuration</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QPushButton" name="addSymbol" > + <property name="text" > + <string>Add Symbol</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="removeSymbol" > + <property name="text" > + <string>Remove Symbol</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> </widget> - <widget class="QRadioButton" name="ortho2DView" > - <property name="geometry" > - <rect> - <x>120</x> - <y>10</y> - <width>83</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Ortho2D</string> - </property> - </widget> - </widget> - <widget class="QWidget" name="view2D" > - <attribute name="title" > - <string>2D Text View</string> - </attribute> - <widget class="QSpinBox" name="Grid2DZplane" > - <property name="geometry" > - <rect> - <x>500</x> - <y>10</y> - <width>91</width> - <height>22</height> - </rect> - </property> - </widget> - <widget class="QLabel" name="label" > - <property name="geometry" > - <rect> - <x>440</x> - <y>10</y> - <width>35</width> - <height>14</height> - </rect> - </property> - <property name="lineWidth" > - <number>3</number> - </property> - <property name="text" > - <string>Z Plane</string> - </property> - <property name="textFormat" > - <enum>Qt::AutoText</enum> - </property> - </widget> - <widget class="QRadioButton" name="Grid2DValues" > - <property name="geometry" > - <rect> - <x>140</x> - <y>10</y> - <width>83</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - <widget class="QRadioButton" name="Grid2DSybmols" > - <property name="geometry" > - <rect> - <x>240</x> - <y>10</y> - <width>83</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Symbols</string> - </property> - </widget> - <widget class="QCheckBox" name="Grig2DColors" > - <property name="geometry" > - <rect> - <x>10</x> - <y>10</y> - <width>91</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - </widget> - <widget class="QWidget" name="view2DGraph" > - <attribute name="title" > - <string>2D Graphics View</string> - </attribute> - </widget> - <widget class="QWidget" name="view1D" > - <attribute name="title" > - <string>1D Text View</string> - </attribute> - <widget class="QRadioButton" name="Grid1DSybmols" > - <property name="geometry" > - <rect> - <x>240</x> - <y>10</y> - <width>83</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Symbols</string> - </property> - </widget> - <widget class="QRadioButton" name="Grid1DValues" > - <property name="geometry" > - <rect> - <x>140</x> - <y>10</y> - <width>83</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - <widget class="QCheckBox" name="Grig1DColors" > - <property name="geometry" > - <rect> - <x>10</x> - <y>10</y> - <width>91</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - <widget class="QPushButton" name="memClr" > - <property name="geometry" > - <rect> - <x>350</x> - <y>10</y> - <width>75</width> - <height>23</height> - </rect> - </property> - <property name="text" > - <string>Clear Memory</string> - </property> - </widget> - </widget> - <widget class="QWidget" name="symbolConfig" > - <attribute name="title" > - <string>Symbols Configuration</string> - </attribute> - <widget class="QPushButton" name="removeSymbol" > - <property name="geometry" > - <rect> - <x>110</x> - <y>10</y> - <width>90</width> - <height>23</height> - </rect> - </property> - <property name="text" > - <string>Remove Symbol</string> - </property> - </widget> - <widget class="QPushButton" name="addSymbol" > - <property name="geometry" > - <rect> - <x>10</x> - <y>10</y> - <width>90</width> - <height>23</height> - </rect> - </property> - <property name="text" > - <string>Add Symbol</string> - </property> - </widget> - </widget> - </widget> + </item> + </layout> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-09 08:59:57 UTC (rev 133) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-09 09:50:35 UTC (rev 134) @@ -415,9 +415,12 @@ ui.setupUi(this); renderer = new Renderer(ui.view3D); + ui.view3D->layout()->addWidget(renderer); renderer->resize(ui.view3D->width(), ui.view3D->height()); graphicsView2D = new QGraphicsView(ui.view2DGraph); + ui.view2DGraph->setLayout(new QVBoxLayout()); + ui.view2DGraph->layout()->addWidget(graphicsView2D); graphicsScene2D = new QGraphicsScene; pixmap = new QPixmap(0, 0); @@ -428,11 +431,14 @@ table1D = new QTableWidget(ui.view1D); + ui.view1D->layout()->addWidget(table1D); table1D->setRowCount(1); table1DMem = new QTableWidget(ui.view1D); + ui.view1D->layout()->addWidget(table1DMem); symbolTable = new QTableWidget(ui.symbolConfig); + ui.symbolConfig->layout()->addWidget(symbolTable); symbolTable->setColumnCount(5); symbolTable->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value"))); symbolTable->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Symbol"))); @@ -441,6 +447,8 @@ symbolTable->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Hide Flag"))); table2D = new QTableWidget(ui.view2D); + ui.view2D->layout()->addWidget(table2D); + connect(ui.Grid2DZplane, SIGNAL(valueChanged(int)), SLOT(zPlaneChange(int))); connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest())); @@ -636,4 +644,4 @@ { renderer->setOrtoPerspective(); renderer->repaint(); -} \ No newline at end of file +} Modified: trunk/qcell/visgui/visgui_pl.qm =================================================================== (Binary files differ) Modified: trunk/qcell/visgui/visgui_pl.ts =================================================================== --- trunk/qcell/visgui/visgui_pl.ts 2007-01-09 08:59:57 UTC (rev 133) +++ trunk/qcell/visgui/visgui_pl.ts 2007-01-09 09:50:35 UTC (rev 134) @@ -71,6 +71,11 @@ <source>Here I am!</source> <translation type="obsolete">Tutaj jestem!</translation> </message> + <message> + <location filename="../basesources/GenericParserPlugin.cpp" line="115"/> + <source>This plugin doesn't support saving type %1. It supports %2.</source> + <translation>Ta wtyczka nie obsługuje zapisywania typu %1. Obsługuje typ %2.</translation> + </message> </context> <context> <name>MainWindow</name> @@ -80,22 +85,22 @@ <translation>QCell</translation> </message> <message> - <location filename="MainWindow.ui" line="39"/> + <location filename="MainWindow.ui" line="95"/> <source>&Help</source> <translation>P&omoc</translation> </message> <message> - <location filename="MainWindow.ui" line="51"/> + <location filename="MainWindow.ui" line="102"/> <source>&File</source> <translation>&Plik</translation> </message> <message> - <location filename="MainWindow.ui" line="55"/> + <location filename="MainWindow.ui" line="106"/> <source>Opens experiment data.</source> <translation>Otwiera dane eksperymentu.</translation> </message> <message> - <location filename="MainWindow.ui" line="58"/> + <location filename="MainWindow.ui" line="109"/> <source>&Open</source> <translation>&Otwórz</translation> </message> @@ -105,83 +110,83 @@ <translation type="obsolete">To menu pozwala przeszukiwać tematy pomocy i poczytać o aplikacji.</translation> </message> <message> - <location filename="MainWindow.ui" line="103"/> + <location filename="MainWindow.ui" line="152"/> <source>&Quit</source> <translation>&Wyjście</translation> </message> <message> - <location filename="MainWindow.ui" line="106"/> + <location filename="MainWindow.ui" line="155"/> <source>This menu item quits the application.</source> <comment>Quits the application</comment> <translation>Ten przycisk menu powoduje wyjście z aplikacji.</translation> </message> <message> - <location filename="MainWindow.ui" line="109"/> + <location filename="MainWindow.ui" line="158"/> <source>Quits the application.</source> <translation>Wychodzi z aplikacji.</translation> </message> <message> - <location filename="MainWindow.ui" line="114"/> + <location filename="MainWindow.ui" line="271"/> <source>&Neighbourhood</source> <translation>&Sąsiedztwo</translation> </message> <message> - <location filename="MainWindow.ui" line="117"/> + <location filename="MainWindow.ui" line="166"/> <source>Opens neighbourhood.</source> <translation>Otwiera plik sąsiedztwa.</translation> </message> <message> - <location filename="MainWindow.ui" line="122"/> + <location filename="MainWindow.ui" line="276"/> <source>&Function</source> <translation>&Funkcja</translation> </message> <message> - <location filename="MainWindow.ui" line="125"/> + <location filename="MainWindow.ui" line="174"/> <source>Opens function.</source> <translation>Otwiera plik funkcji.</translation> </message> <message> - <location filename="MainWindow.ui" line="130"/> + <location filename="MainWindow.ui" line="266"/> <source>&World</source> <translation>Ś&wiat</translation> </message> <message> - <location filename="MainWindow.ui" line="133"/> + <location filename="MainWindow.ui" line="182"/> <source>Opens world configuration.</source> <translation>Otwiera konfigurację świata.</translation> </message> <message> - <location filename="MainWindow.ui" line="138"/> + <location filename="MainWindow.ui" line="187"/> <source>Open &experiment</source> <translation>Otwórz &eksperyment</translation> </message> <message> - <location filename="MainWindow.ui" line="141"/> + <location filename="MainWindow.ui" line="190"/> <source>Opens a predefined experiment.</source> <translation>Otwiera zdefiniowany wcześniej eksperyment.</translation> </message> <message> - <location filename="MainWindow.ui" line="146"/> + <location filename="MainWindow.ui" line="195"/> <source>&Continiue experiment</source> <translation>&Kontynuuj eksperyment</translation> </message> <message> - <location filename="MainWindow.ui" line="149"/> + <location filename="MainWindow.ui" line="198"/> <source>Loads an earlier saved experiment.</source> <translation>Ładuje wcześniej zachowany eksperyment.</translation> </message> <message> - <location filename="MainWindow.ui" line="154"/> + <location filename="MainWindow.ui" line="203"/> <source>&About</source> <translation>&O programie</translation> </message> <message> - <location filename="MainWindow.ui" line="157"/> + <location filename="MainWindow.ui" line="206"/> <source>Shows info about the program.</source> <translation>Pokazuje informacje o programie.</translation> </message> <message> - <location filename="MainWindow.cpp" line="102"/> + <location filename="MainWindow.cpp" line="104"/> <source>Open Neighbourhood</source> <translation>Otwórz Sąsiedztwo</translation> </message> @@ -191,97 +196,97 @@ <translation type="obsolete"> pliki</translation> </message> <message> - <location filename="MainWindow.cpp" line="201"/> + <location filename="MainWindow.cpp" line="566"/> <source>files</source> <translation>pliki</translation> </message> <message> - <location filename="MainWindow.cpp" line="178"/> + <location filename="MainWindow.cpp" line="542"/> <source>Plugins warning</source> <translation>Ostrzeżenie wtyczek</translation> </message> <message> - <location filename="MainWindow.cpp" line="94"/> + <location filename="MainWindow.cpp" line="96"/> <source>There are no plugins loaded to handle Neighbourhood parsing.</source> <translation>Nie ma załadowanej żadnej wtyczki do obsługi parsowania plików Sąsiedztwa.</translation> </message> <message> - <location filename="MainWindow.cpp" line="137"/> + <location filename="MainWindow.cpp" line="139"/> <source>There are no plugins loaded to handle Function parsing.</source> <translation>Nie ma załadowanej żadnej wtyczki do obsługi parsowania Funkcji.</translation> </message> <message> - <location filename="MainWindow.cpp" line="145"/> + <location filename="MainWindow.cpp" line="147"/> <source>Open Function</source> <translation>Otwórz Funkcję</translation> </message> <message> - <location filename="MainWindow.cpp" line="180"/> + <location filename="MainWindow.cpp" line="183"/> <source>There are no plugins loaded to handle World parsing.</source> <translation>Nie ma załadowanej żadnej wtyczki do parsowania Świata.</translation> </message> <message> - <location filename="MainWindow.cpp" line="188"/> + <location filename="MainWindow.cpp" line="191"/> <source>Open World</source> <translation>Otwórz Świat</translation> </message> <message> - <location filename="MainWindow.cpp" line="224"/> + <location filename="MainWindow.cpp" line="230"/> <source>Error opening file %1.</source> <translation>Błąd podczas otwierania pliku %1.</translation> </message> <message> - <location filename="MainWindow.cpp" line="261"/> + <location filename="MainWindow.cpp" line="346"/> <source>The file extensions %1 isn't supported.</source> <translation>Rozszerzenie pliku %1 nie jest wspierane.</translation> </message> <message> - <location filename="MainWindow.cpp" line="271"/> + <location filename="MainWindow.cpp" line="357"/> <source>Unsupported file type to parse.</source> <translation>Niewspierany typ pliku do przeczytania.</translation> </message> <message> - <location filename="MainWindow.ui" line="46"/> + <location filename="MainWindow.ui" line="79"/> <source>&Edit</source> <translation>&Edycja</translation> </message> <message> - <location filename="MainWindow.ui" line="72"/> + <location filename="MainWindow.ui" line="84"/> <source>&Experiment</source> <translation>&Eksperyment</translation> </message> <message> - <location filename="MainWindow.ui" line="162"/> + <location filename="MainWindow.ui" line="211"/> <source>&Start</source> <translation>&Start</translation> </message> <message> - <location filename="MainWindow.ui" line="168"/> + <location filename="MainWindow.ui" line="217"/> <source>Starts the experiment.</source> <translation>Startuje eksperyment.</translation> </message> <message> - <location filename="MainWindow.ui" line="173"/> + <location filename="MainWindow.ui" line="222"/> <source>S&top</source> <translation>S&top</translation> </message> <message> - <location filename="MainWindow.ui" line="179"/> + <location filename="MainWindow.ui" line="228"/> <source>Stops the experiment.</source> <translation>Zatrzymuje eksperyment.</translation> </message> <message> - <location filename="MainWindow.ui" line="184"/> + <location filename="MainWindow.ui" line="233"/> <source>&Restart</source> <translation>Ponowne u&ruchominie</translation> </message> <message> - <location filename="MainWindow.ui" line="190"/> + <location filename="MainWindow.ui" line="239"/> <source>Restarts the experiment.</source> <translation>Uruchamia eksperyment od nowa.</translation> </message> <message> - <location filename="MainWindow.ui" line="195"/> + <location filename="MainWindow.ui" line="244"/> <source>&Forward</source> <translation>Do &przodu</translation> </message> @@ -291,20 +296,60 @@ <translation type="obsolete">Iteruje jeden krok.</translation> </message> <message> - <location filename="MainWindow.ui" line="201"/> + <location filename="MainWindow.ui" line="250"/> <source>Iterates one setp forward.</source> <translation>Iteruje jeden krok do przodu.</translation> </message> <message> - <location filename="MainWindow.ui" line="206"/> + <location filename="MainWindow.ui" line="255"/> <source>&Back</source> <translation>Do &tyłu</translation> </message> <message> - <location filename="MainWindow.ui" line="212"/> + <location filename="MainWindow.ui" line="261"/> <source>Iterates one setp back.</source> <translation>Iteruje jeden krok wstecz.</translation> </message> + <message> + <location filename="MainWindow.ui" line="50"/> + <source>Iteration</source> + <translation>Iteracja</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="394"/> + <source>You cannot step back beyond the beginning of the experiment!</source> + <translation>Nie możesz cofnąc się poza początek eksperymentu!</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="307"/> + <source>Error opnening file %1.</source> + <translation>Błąd podczas próby otwarcia pliku %1.</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="496"/> + <source>There are no plugins loaded to handle World saving.</source> + <translation>Nie ma załadowanej żadnej wtyczki do obsługi zapisywania plików świata.</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="504"/> + <source>Save World</source> + <translation>Zapisz Świat</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="544"/> + <source>There are no plugins loaded to handle Neighbourhood saving.</source> + <translation>Nie ma załadowanych żadnych wtyczek do obsługi zapisywania Sąsiedztwa.</translation> + </message> + <message> + <location filename="MainWindow.cpp" line="552"/> + <source>Save Neighbourhood</source> + <translation>Zapisz Sąsiedztwo</translation> + </message> + <message> + <location filename="MainWindow.ui" line="117"/> + <source>&Save experiment</source> + <translation>&Zapisz eksperyment</translation> + </message> </context> <context> <name>QApplication</name> @@ -329,4 +374,115 @@ <translation>Śmiertelny</translation> </message> </context> +<context> + <name>simulationWindow</name> + <message> + <location filename="../basesources/simulationwindow.cpp" line="399"/> + <source>%1</source> + <translation>%1</translation> + </message> + <message> + <location filename="../basesources/simulationwindow.cpp" line="437"/> + <source>Value</source> + <translation>Wartość</translation> + </message> + <message> + <location filename="../basesources/simulationwindow.cpp" line="438"/> + <source>Symbol</source> + <translation>Symbol</translation> + </message> + <message> + <location filename="../basesources/simulationwindow.cpp" line="439"/> + <source>Color</source> + <translation>Kolor</translation> + </message> + <message> + <location filename="../basesources/simulationwindow.cpp" line="440"/> + <source>Model</source> + <translation>Model</translation> + </message> + <message> + <location filename="../basesources/simulationwindow.cpp" line="441"/> + <source>Hide Flag</source> + <translation>Flaga Ukrycia</translation> + </message> +</context> +<context> + <name>simulationWindowClass</name> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="13"/> + <source>simulationWindow</source> + <translation>oknoSymulacji</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="35"/> + <source>3D View</source> + <translation>Widok 3D</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="47"/> + <source>Perspective</source> + <translation>Perspektywa</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="63"/> + <source>Ortho2D</source> + <translation>Orto2D</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="69"/> + <source>2D Text View</source> + <translation>Widok Tekstowy 2D</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="94"/> + <source>Z Plane</source> + <translation>Płaszczyzna Z</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="175"/> + <source>Values</source> + <translation>Wartości</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="162"/> + <source>Symbols</source> + <translation>Symbole</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="191"/> + <source>Enable Colors</source> + <translation>Uruchom Kolory</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="145"/> + <source>2D Graphics View</source> + <translation>Graficzny Widok 2D</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="150"/> + <source>1D Text View</source> + <translation>Widok Tekstowy 1D</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="204"/> + <source>Clear Memory</source> + <translation>Wyczyśc Pamięć</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="210"/> + <source>Symbols Configuration</source> + <translation>Konfiguracja Symboli</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="222"/> + <source>Remove Symbol</source> + <translation>Usuń Symbol</translation> + </message> + <message> + <location filename="../baseheaders/simulationwindow.ui" line="235"/> + <source>Add Symbol</source> + <translation>Dodaj Symbol</translation> + </message> +</context> </TS> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-09 19:30:25
|
Revision: 135 http://svn.sourceforge.net/qcell/?rev=135&view=rev Author: dhubleizh Date: 2007-01-09 11:30:22 -0800 (Tue, 09 Jan 2007) Log Message: ----------- - found bug in FQTParserPlugin - some minor changes in MainWindow in search of proper use of CalculationData and derriviates Modified Paths: -------------- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-09 09:50:35 UTC (rev 134) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-09 19:30:22 UTC (rev 135) @@ -7,7 +7,6 @@ */ #include "FQTParserPlugin.h" - FQTParserPlugin::FQTParserPlugin() { supported_parser_types << "LocalFunction"; @@ -245,7 +244,7 @@ // Finally adding the parsed values - results[tmp_sum] == QVector<int>(tmp_values); + results[tmp_sum] = QVector<int>(tmp_values); // To keep count of current line nr line_nr++; @@ -271,7 +270,7 @@ foreach(int sum, results.keys()) { for(int i=0;i<results.value(sum).size();++i) - lf.setFunctionValue((results.value(sum))[i], sum, i); + lf.setFunctionValue((results.value(sum))[i], sum, i); } } return lf.toXmlString(); Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-09 09:50:35 UTC (rev 134) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-09 19:30:22 UTC (rev 135) @@ -279,7 +279,12 @@ /// @todo Fix that! data.clear(); data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt()); - *sw->getStorage() = *data.last(); + CalculationData* cd = new CalculationData(); + cd->setDataType(data.last()->getDataType()); + cd->fillData(data.last()->getDataPointer()); + qDebug() << "D\xB3ugo\xB6c :" << cd->getDimension(); + *sw->getStorage() = *cd; + calc.setForeignDataPointer((char*)data.first()->getDataPointer()); QVector<int> end_coord; end_coord << data.last()->getSizeX() << data.last()->getSizeY() @@ -371,11 +376,8 @@ { case Forward: { - if(iteration >= data.count()) + if((iteration + 1) >= data.count()) { - CalculationData* cd = new CalculationData(); - *cd = *data[iteration]; - calc.setForeignDataPointer((char*)cd->getDataPointer()); calc.calculate(); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-10 12:33:36
|
Revision: 136 http://svn.sourceforge.net/qcell/?rev=136&view=rev Author: dhubleizh Date: 2007-01-10 04:33:32 -0800 (Wed, 10 Jan 2007) Log Message: ----------- - CalculationData typo - tweaked a little AboutDialog - no tab switching, modal displaying, more 'aboutish' view - no more experimenting how to display CalculatoinData; back to only displaying - removed pending todos - and in the same time added some more todos; waiting for Leszek Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/visgui/AboutDialog.ui trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-01-09 19:30:22 UTC (rev 135) +++ trunk/qcell/baseheaders/CalculationData.h 2007-01-10 12:33:32 UTC (rev 136) @@ -65,7 +65,7 @@ bool resizeData(QVector<int> newSize, char *dataPointer=NULL, bool foreignDataPointer=0); int getSizeX(void); - int getSizeY(void); + int getSizeY(void); int getSizeZ(void); int getSizeT(void); int getSizeInByte(void); Modified: trunk/qcell/visgui/AboutDialog.ui =================================================================== --- trunk/qcell/visgui/AboutDialog.ui 2007-01-09 19:30:22 UTC (rev 135) +++ trunk/qcell/visgui/AboutDialog.ui 2007-01-10 12:33:32 UTC (rev 136) @@ -1,6 +1,9 @@ <ui version="4.0" > <class>AboutDialog</class> <widget class="QDialog" name="AboutDialog" > + <property name="enabled" > + <bool>true</bool> + </property> <property name="geometry" > <rect> <x>0</x> @@ -24,10 +27,25 @@ <property name="enabled" > <bool>true</bool> </property> + <property name="focusPolicy" > + <enum>Qt::NoFocus</enum> + </property> + <property name="contextMenuPolicy" > + <enum>Qt::NoContextMenu</enum> + </property> <property name="acceptDrops" > <bool>false</bool> </property> <property name="autoFillBackground" > + <bool>true</bool> + </property> + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="interactive" > <bool>false</bool> </property> </widget> @@ -77,6 +95,27 @@ </item> </layout> </widget> + <tabstops> + <tabstop>OKButton</tabstop> + <tabstop>graphicsView</tabstop> + </tabstops> <resources/> - <connections/> + <connections> + <connection> + <sender>OKButton</sender> + <signal>clicked()</signal> + <receiver>AboutDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>373</x> + <y>271</y> + </hint> + <hint type="destinationlabel" > + <x>334</x> + <y>196</y> + </hint> + </hints> + </connection> + </connections> </ui> Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-09 19:30:22 UTC (rev 135) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-10 12:33:32 UTC (rev 136) @@ -72,11 +72,12 @@ void MainWindow::on_action_About_activated() { + // Construct and display AboutDialog QDialog* dialog = new QDialog(this); Ui::AboutDialog* ad = new Ui::AboutDialog(); ad->setupUi(dialog); - connect(ad->OKButton, SIGNAL(clicked()), dialog, SLOT(accept())); - dialog->show(); + // Display it modally (block MaindWindow), but discard the result + dialog->exec(); } void MainWindow::on_action_Quit_activated() @@ -279,11 +280,7 @@ /// @todo Fix that! data.clear(); data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt()); - CalculationData* cd = new CalculationData(); - cd->setDataType(data.last()->getDataType()); - cd->fillData(data.last()->getDataPointer()); - qDebug() << "D\xB3ugo\xB6c :" << cd->getDimension(); - *sw->getStorage() = *cd; + *sw->getStorage() = *data.last(); calc.setForeignDataPointer((char*)data.first()->getDataPointer()); QVector<int> end_coord; end_coord << data.last()->getSizeX() @@ -378,6 +375,8 @@ { if((iteration + 1) >= data.count()) { + /// @todo Use the updated API of Calculator + /// @todo Pass the calculated CalculationData to the data list calc.calculate(); } else @@ -401,6 +400,7 @@ } } + /// @todo This will probabelly need change after the Calculator API change *sw->getStorage() = *data[iteration]; iterationLCD->display(iteration); } @@ -478,7 +478,6 @@ void MainWindow::on_action_Restart_activated() { - /// @todo Handle restarting the experiment iteration = 0; this->iterationLCD->display(iteration); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-10 19:50:22
|
Revision: 140 http://svn.sourceforge.net/qcell/?rev=140&view=rev Author: lessm Date: 2007-01-10 11:50:10 -0800 (Wed, 10 Jan 2007) Log Message: ----------- - Calculator class updated Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/baseheaders/Calculator.h trunk/qcell/baseheaders/Neighbourhood.h trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/GenericParserPlugin.cpp trunk/qcell/basesources/Neighbourhood.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/baseheaders/CalculationData.h 2007-01-10 19:50:10 UTC (rev 140) @@ -65,13 +65,13 @@ bool resizeData(QVector<int> newSize, char *dataPointer=NULL, bool foreignDataPointer=0); int getSizeX(void); - int getSizeY(void); + int getSizeY(void); int getSizeZ(void); int getSizeT(void); int getSizeInByte(void); int getDimension(void); - const char *getDataPointer(void); + /*const*/ char *getDataPointer(void); void fillData(const char *dataPointer); void setForeignDataPointer(char *dataPointer); Modified: trunk/qcell/baseheaders/Calculator.h =================================================================== --- trunk/qcell/baseheaders/Calculator.h 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/baseheaders/Calculator.h 2007-01-10 19:50:10 UTC (rev 140) @@ -11,31 +11,49 @@ class Calculator : public CalculationData { Q_OBJECT + +public: + enum BORDER + { + TORUS = 0, + MIRROR = 1, + VALUE = 2 + }; + private: protected: - char *outData; +public: + char *tempData; bool haveForeignOutputDataPointer; - QVector<int> outDataSize, calculationSpaceStart, calculationSpaceEnd; + QVector<int> tempDataSize, calculationSpaceStart, calculationSpaceEnd; Neighbourhood *neighbourhood; LocalFunction *localfunction; + QVector<int> minBorder; + QVector<int> maxBorder; + + BORDER borderType; + protected: - void clearOutputData(void); + void clearTempData(void); void copyData(void); - bool resizeOutputDataBuffer(bool dataCopy=0, char *dataPointer=NULL); + bool resizeTempDataBuffer(bool dataCopy=0, char *dataPointer=NULL); + void updateBorder(void); public: + Calculator(); ~Calculator(); void setNeighbourhood(Neighbourhood *n); void setLocalFunction(LocalFunction *f); - bool setCalculationSpace(QVector<int> start, QVector<int> end, bool dataCopy=0, char *foreignDataPointer=NULL); - int getOutputDataSizeInByte(void); - /*const*/ char *getOutputDataPointer(void); + int getTempDataSizeInByte(void); void calculate(void); + +protected slots: + void setupSpace(void); }; #endif Modified: trunk/qcell/baseheaders/Neighbourhood.h =================================================================== --- trunk/qcell/baseheaders/Neighbourhood.h 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/baseheaders/Neighbourhood.h 2007-01-10 19:50:10 UTC (rev 140) @@ -27,6 +27,9 @@ QVector<NContainer> neighbourVector; DATA_TYPES dType; + QVector<int> minValues; + QVector<int> maxValues; + protected: public: Neighbourhood(); @@ -61,6 +64,9 @@ QVector<int> valuesToVector_i(void); QVector<double> valuesToVector_d(void); + + QVector<int> getMaxNeighbourhoodValues(void); + QVector<int> getMinNeighbourhoodValues(void); }; #endif Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -653,7 +653,7 @@ return dimension; } -const char *CalculationData::getDataPointer(void) +/*const*/ char *CalculationData::getDataPointer(void) { return data; } Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -1,44 +1,102 @@ #include "../baseheaders/Calculator.h" -void Calculator::clearOutputData(void) +void Calculator::clearTempData(void) { - if(!haveForeignOutputDataPointer && outData) - delete outData; + if(!haveForeignOutputDataPointer && tempData) + delete tempData; - outData = NULL; + tempData = NULL; } void Calculator::copyData(void) { - int counter = 0; - for(int t=calculationSpaceStart[3];t<=calculationSpaceEnd[3];++t) + int offset; + int sy = tempDataSize[1], sz = tempDataSize[2], st = tempDataSize[3]; + int ty, tz, tt; + + 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=calculationSpaceStart[2];z<=calculationSpaceEnd[2];++z) + for(int z=0;z<sz;++z) { - for(int y=calculationSpaceStart[1];y<=calculationSpaceEnd[1];++y) + for(int y=0;y<sy;++y) { - memcpy(outData + counter, getAddressAt(calculationSpaceStart[0], y, z, t), outDataSize[0]); - counter += outDataSize[0]; + ty = y + minBorder[1]; + tz = z + minBorder[2]; + tt = t + minBorder[3]; + + + + switch(borderType) + { + + case TORUS: + if(sizeY>0) + { + while(ty<0) + ty += sizeY; + ty %= sizeY; + } + + 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) + (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; + } + + memcpy(tempData + (offset - minBorder[0]) * dataSize, getAddressAt(0, ty, tz, tt), sizeX * dataSize); } } } } -bool Calculator::resizeOutputDataBuffer(bool dataCopy, char *dataPointer) +bool Calculator::resizeTempDataBuffer(bool dataCopy, char *dataPointer) { - clearOutputData(); + int tmp; + clearTempData(); if(dataPointer==NULL) { - haveForeignOutputDataPointer = 1; - outData = new char[getOutputDataSizeInByte()]; - if(!outData) + haveForeignOutputDataPointer = 0; + tempData = new char[ tmp= getTempDataSizeInByte()]; + if(!tempData) return 0; } else { - haveForeignOutputDataPointer = 0; - outData = dataPointer; + haveForeignOutputDataPointer = 1; + tempData = dataPointer; } if(dataCopy) copyData(); @@ -46,20 +104,28 @@ return 1; } +void Calculator::updateBorder(void) +{ + +} + Calculator::Calculator() { - outData = NULL; + tempData = NULL; haveForeignOutputDataPointer = 0; - outDataSize.resize(4); + tempDataSize.resize(4); calculationSpaceStart.resize(4); calculationSpaceEnd.resize(4); neighbourhood = NULL; localfunction = NULL; + borderType = Calculator::TORUS; + + connect(this, SIGNAL(dataResized()), SLOT(setupSpace())); } Calculator::~Calculator() { - clearOutputData(); + clearTempData(); haveForeignOutputDataPointer = 0; neighbourhood = NULL; localfunction = NULL; @@ -68,7 +134,9 @@ void Calculator::setNeighbourhood(Neighbourhood *n) { neighbourhood = n; - neighbourhood->calculateOffsets(sizeX, sizeY, sizeZ, sizeT, getDataType()); + //setupSpace(); + //resizeTempDataBuffer(); + //neighbourhood->calculateOffsets(tempDataSize[0], tempDataSize[1], tempDataSize[2], tempDataSize[3], getDataType()); } void Calculator::setLocalFunction(LocalFunction *f) @@ -76,125 +144,107 @@ localfunction = f; } -bool Calculator::setCalculationSpace(QVector<int> start, QVector<int> end, bool dataCopy, char *foreignDataPointer) +int Calculator::getTempDataSizeInByte(void) { - if( start.size() == end.size() && start.size()==dimension) - { - for(int i=0;i<4;++i) - { - if(i<dimension) - { - calculationSpaceStart[i] = start[i]; - calculationSpaceEnd[i] = end[i]; - outDataSize[i] = calculationSpaceEnd[i] - calculationSpaceStart[i] + 1; - } - else - { - calculationSpaceStart[i] = 0; - calculationSpaceEnd[i] = 0; - outDataSize[i] = 0; - } - } - - return resizeOutputDataBuffer(dataCopy, foreignDataPointer); - } - return 0; -} - - -int Calculator::getOutputDataSizeInByte(void) -{ switch(dataType) { case baseDataTypes::BOOL: - return (outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3])/8 + 1; + return (tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3])/8 + 1; case baseDataTypes::CHAR: switch(dimension) { case 1: - return outDataSize[0] * sizeof(char); + return tempDataSize[0] * sizeof(char); case 2: - return outDataSize[0] * outDataSize[1] * sizeof(char); + return tempDataSize[0] * tempDataSize[1] * sizeof(char); case 3: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * sizeof(char); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * sizeof(char); case 4: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(char); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3] * sizeof(char); } case baseDataTypes::DOUBLE: switch(dimension) { case 1: - return outDataSize[0] * sizeof(double); + return tempDataSize[0] * sizeof(double); case 2: - return outDataSize[0] * outDataSize[1] * sizeof(double); + return tempDataSize[0] * tempDataSize[1] * sizeof(double); case 3: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * sizeof(double); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * sizeof(double); case 4: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(double); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3] * sizeof(double); } case baseDataTypes::FLOAT: switch(dimension) { case 1: - return outDataSize[0] * sizeof(float); + return tempDataSize[0] * sizeof(float); case 2: - return outDataSize[0] * outDataSize[1] * sizeof(float); + return tempDataSize[0] * tempDataSize[1] * sizeof(float); case 3: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * sizeof(float); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * sizeof(float); case 4: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(float); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3] * sizeof(float); } case baseDataTypes::INT: switch(dimension) { case 1: - return outDataSize[0] * sizeof(int); + return tempDataSize[0] * sizeof(int); case 2: - return outDataSize[0] * outDataSize[1] * sizeof(int); + return tempDataSize[0] * tempDataSize[1] * sizeof(int); case 3: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * sizeof(int); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * sizeof(int); case 4: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(int); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3] * sizeof(int); } case baseDataTypes::SHORT: switch(dimension) { case 1: - return outDataSize[0] * sizeof(short); + return tempDataSize[0] * sizeof(short); case 2: - return outDataSize[0] * outDataSize[1] * sizeof(short); + return tempDataSize[0] * tempDataSize[1] * sizeof(short); case 3: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * sizeof(short); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * sizeof(short); case 4: - return outDataSize[0] * outDataSize[1] * outDataSize[2] * outDataSize[3] * sizeof(short); + return tempDataSize[0] * tempDataSize[1] * tempDataSize[2] * tempDataSize[3] * sizeof(short); } } return 0; } -/*const*/ char *Calculator::getOutputDataPointer(void) -{ - return outData; -} - void Calculator::calculate(void) { int counter = 0; char temp[8]; - for(int t=calculationSpaceStart[3];t<=calculationSpaceEnd[3];++t) + int sx = tempDataSize[0] - maxBorder[0] , sy = tempDataSize[1] - maxBorder[1], sz = tempDataSize[2] - maxBorder[2], st = tempDataSize[3] - maxBorder[3]; + + if(sy==0) + sy=1; + + if(sz==0) + sz=1; + + if(st==0) + st=1; + + copyData(); + + for(int t=-minBorder[3];t<st;++t) { - for(int z=calculationSpaceStart[2];z<=calculationSpaceEnd[2];++z) + for(int z=-minBorder[2];z<sz;++z) { - for(int y=calculationSpaceStart[1];y<=calculationSpaceEnd[1];++y) + for(int y=-minBorder[1];y<sy;++y) { - for(int x=calculationSpaceStart[0];x<=calculationSpaceEnd[0];++x) + for(int x=-minBorder[0];x<sx;++x) { - neighbourhood->resolveValues((const char *)getAddressAt(x, y, z, t)); + neighbourhood->resolveValues(tempData + x + (y * tempDataSize[0]) + z * (tempDataSize[0] * tempDataSize[1]) + t * (tempDataSize[0] * tempDataSize[1] * tempDataSize[2]) * dataSize); switch(dataType) { case baseDataTypes::BOOL: @@ -210,10 +260,27 @@ *((double *)temp) = localfunction->resolve(neighbourhood->valuesToVector_d()); break; } - memcpy(outData + counter, temp, dataSize); + memcpy(data + counter, temp, dataSize); counter += dataSize; } } } } + } + +void Calculator::setupSpace(void) +{ + if(neighbourhood) + { + minBorder = neighbourhood->getMinNeighbourhoodValues(); + maxBorder = neighbourhood->getMaxNeighbourhoodValues(); + 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()); + + } +} \ No newline at end of file Modified: trunk/qcell/basesources/GenericParserPlugin.cpp =================================================================== --- trunk/qcell/basesources/GenericParserPlugin.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/basesources/GenericParserPlugin.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -73,8 +73,10 @@ } - return realParser(content, type, subtype); + QString s = realParser(content, type, subtype); + return s; + } QByteArray GenericParserPlugin::parseOut(const QString content, const QString type, const QString subtype) Modified: trunk/qcell/basesources/Neighbourhood.cpp =================================================================== --- trunk/qcell/basesources/Neighbourhood.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/basesources/Neighbourhood.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -3,6 +3,8 @@ Neighbourhood::Neighbourhood() { dimension = 666; + minValues.resize(4); + maxValues.resize(4); } Neighbourhood::~Neighbourhood() @@ -19,6 +21,12 @@ temp.t = 0; neighbourVector << temp; dimension = 1; + + if(minValues[0]>x) + minValues[0]=x; + + if(maxValues[0]<x) + maxValues[0]=x; } void Neighbourhood::addNeighbour(int x, int y) @@ -31,6 +39,19 @@ neighbourVector << temp; if(dimension>2) dimension = 2; + + 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; + } void Neighbourhood::addNeighbour(int x, int y, int z) { @@ -42,6 +63,24 @@ neighbourVector << temp; if(dimension>3) dimension = 3; + + 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; } void Neighbourhood::addNeighbour(int x, int y, int z, int t) @@ -54,6 +93,32 @@ 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) @@ -146,6 +211,11 @@ { dimension = 666; neighbourVector.clear(); + if(dimension!=minValues.size()) + { + minValues[3] = minValues[2] = minValues[1] = minValues[0]=9999; + maxValues[3] = maxValues[2] = maxValues[1] = maxValues[0]=-9999; + } } int Neighbourhood::getDimension(void) @@ -380,3 +450,14 @@ out<<c.value.dValue; return out; } + + +QVector<int> Neighbourhood::getMaxNeighbourhoodValues(void) +{ + return maxValues; +} + +QVector<int> Neighbourhood::getMinNeighbourhoodValues(void) +{ + return minValues; +} Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -479,9 +479,9 @@ simulationWindow::~simulationWindow() { - if(renderer) - delete renderer; - renderer = NULL; +// if(renderer) +// delete renderer; +// renderer = NULL; if(pixmap) delete pixmap; Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -264,14 +264,21 @@ /// @todo How the fuck set FQT function parameters eh? + //looknij to + + int test; + switch(lf.getFunctonType()) { case LocalFunction::SUM_AND_SWITCH: + lf.setDefaultValue(0); foreach(int sum, results.keys()) { + test = results.value(sum).size(); for(int i=0;i<results.value(sum).size();++i) lf.setFunctionValue((results.value(sum))[i], sum, i); } + break; } return lf.toXmlString(); } Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-10 16:48:27 UTC (rev 139) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-10 19:50:10 UTC (rev 140) @@ -223,7 +223,6 @@ if(!fd.selectedFiles().isEmpty()) { callParser(fd.selectedFiles().first(), "World"); - } } @@ -335,7 +334,7 @@ end_coord << data.last()->getSizeX() << data.last()->getSizeY() << data.last()->getSizeZ(); - calc.setCalculationSpace(*new QVector<int>(3, 0), end_coord); + //calc.setCalculationSpace(*new QVector<int>(3, 0), end_coord); // Enable saving menu for World menu_Save->setEnabled(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-10 20:14:38
|
Revision: 142 http://svn.sourceforge.net/qcell/?rev=142&view=rev Author: dhubleizh Date: 2007-01-10 12:14:34 -0800 (Wed, 10 Jan 2007) Log Message: ----------- - removed test stuff from GenericParserPlugin.cpp - deleted code moved to GenericParserPlugin from FQTParserPlugin Modified Paths: -------------- trunk/qcell/basesources/GenericParserPlugin.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp Modified: trunk/qcell/basesources/GenericParserPlugin.cpp =================================================================== --- trunk/qcell/basesources/GenericParserPlugin.cpp 2007-01-10 19:57:11 UTC (rev 141) +++ trunk/qcell/basesources/GenericParserPlugin.cpp 2007-01-10 20:14:34 UTC (rev 142) @@ -8,27 +8,6 @@ #include "../baseheaders/GenericParserPlugin.h" -//QStringList GenericParserPlugin::parserTypes() -//{ -// return supported_parser_types; -//} -// -//QStringList GenericParserPlugin::fileTypes(const QString type) -//{ -// if(supported_parser_types.contains(type)) -// { -// return supported_file_types; -// } -// else { -// qDebug(tr("The plugin type %1 is not supported by this plugin.") -// .arg(type) -// .toAscii() -// ); -// -// return QStringList(); -// } -//} - QString GenericParserPlugin::parse(const QByteArray content, const QString type, const QString subtype) { if(!supported_parser_types.contains(type)) @@ -73,10 +52,7 @@ } - QString s = realParser(content, type, subtype); - - return s; - + return realParser(content, type, subtype); } QByteArray GenericParserPlugin::parseOut(const QString content, const QString type, const QString subtype) Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-10 19:57:11 UTC (rev 141) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-10 20:14:34 UTC (rev 142) @@ -264,22 +264,18 @@ /// @todo How the fuck set FQT function parameters eh? - //looknij to - - int test; - - switch(lf.getFunctonType()) - { + switch(lf.getFunctonType()) + { case LocalFunction::SUM_AND_SWITCH: - lf.setDefaultValue(0); - foreach(int sum, results.keys()) - { - test = results.value(sum).size(); - for(int i=0;i<results.value(sum).size();++i) - lf.setFunctionValue((results.value(sum))[i], sum, i); - } - break; - } + lf.setDefaultValue(0); + foreach(int sum, results.keys()) + { + for(int i=0;i<results.value(sum).size();++i) + lf.setFunctionValue((results.value(sum))[i], sum, i); + } + break; + } + 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-01-11 09:00:24
|
Revision: 146 http://svn.sourceforge.net/qcell/?rev=146&view=rev Author: lessm Date: 2007-01-11 01:00:21 -0800 (Thu, 11 Jan 2007) Log Message: ----------- - Calculator class updated Modified Paths: -------------- trunk/qcell/baseheaders/Calculator.h trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/basesources/Neighbourhood.cpp Modified: trunk/qcell/baseheaders/Calculator.h =================================================================== --- trunk/qcell/baseheaders/Calculator.h 2007-01-10 21:13:26 UTC (rev 145) +++ trunk/qcell/baseheaders/Calculator.h 2007-01-11 09:00:21 UTC (rev 146) @@ -22,7 +22,6 @@ private: protected: -public: char *tempData; bool haveForeignOutputDataPointer; QVector<int> tempDataSize, calculationSpaceStart, calculationSpaceEnd; @@ -52,6 +51,8 @@ void calculate(void); + Calculator & operator = (CalculationData &cData); + protected slots: void setupSpace(void); }; Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-10 21:13:26 UTC (rev 145) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-11 09:00:21 UTC (rev 146) @@ -88,7 +88,8 @@ if(dataPointer==NULL) { haveForeignOutputDataPointer = 0; - tempData = new char[ tmp= getTempDataSizeInByte()]; + tmp = getTempDataSizeInByte(); + tempData = new char[getTempDataSizeInByte()]; if(!tempData) return 0; @@ -134,9 +135,8 @@ void Calculator::setNeighbourhood(Neighbourhood *n) { neighbourhood = n; - //setupSpace(); - //resizeTempDataBuffer(); - //neighbourhood->calculateOffsets(tempDataSize[0], tempDataSize[1], tempDataSize[2], tempDataSize[3], getDataType()); + if(data!=NULL) + setupSpace(); } void Calculator::setLocalFunction(LocalFunction *f) @@ -222,8 +222,8 @@ void Calculator::calculate(void) { int counter = 0; - char temp[8]; - int sx = tempDataSize[0] - maxBorder[0] , sy = tempDataSize[1] - maxBorder[1], sz = tempDataSize[2] - maxBorder[2], st = tempDataSize[3] - maxBorder[3]; + char temp[8] = {0,0,0,0,0,0,0,0}; + int sx = sizeX, sy = sizeY, sz = sizeZ, st = sizeT; if(sy==0) sy=1; @@ -236,15 +236,15 @@ copyData(); - for(int t=-minBorder[3];t<st;++t) + for(int t=0;t<st;++t) { - for(int z=-minBorder[2];z<sz;++z) + for(int z=0;z<sz;++z) { - for(int y=-minBorder[1];y<sy;++y) + for(int y=0;y<sy;++y) { - for(int x=-minBorder[0];x<sx;++x) + for(int x=0;x<sx;++x) { - neighbourhood->resolveValues(tempData + x + (y * tempDataSize[0]) + z * (tempDataSize[0] * tempDataSize[1]) + t * (tempDataSize[0] * tempDataSize[1] * tempDataSize[2]) * dataSize); + 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: @@ -260,6 +260,7 @@ *((double *)temp) = localfunction->resolve(neighbourhood->valuesToVector_d()); break; } + memcpy(data + counter, temp, dataSize); counter += dataSize; } @@ -269,12 +270,48 @@ } +Calculator & Calculator::operator = (CalculationData &cData) +{ + if(cData.getDimension()!=getDimension() || cData.getSizeX() != getSizeX() || cData.getSizeY() != getSizeY() || cData.getSizeZ() != getSizeZ() || cData.getSizeT() != getSizeT()) + { + clearData(); + 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; + } + fillData(cData.getDataPointer()); + } + return *this; +} + void Calculator::setupSpace(void) { if(neighbourhood) { minBorder = neighbourhood->getMinNeighbourhoodValues(); maxBorder = neighbourhood->getMaxNeighbourhoodValues(); + for(int i=0;i<4;++i) + { + if(minBorder[i]>0) + minBorder[i] = 0; + + if(maxBorder[i]<0) + maxBorder[i] = 0; + } + tempDataSize[0] = -minBorder[0] + maxBorder[0] + sizeX; tempDataSize[1] = -minBorder[1] + maxBorder[1] + sizeY; tempDataSize[2] = -minBorder[2] + maxBorder[2] + sizeZ; Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-01-10 21:13:26 UTC (rev 145) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-01-11 09:00:21 UTC (rev 146) @@ -63,24 +63,34 @@ QVector<int> LocalFunction::calculateSums(QVector<int> &args) { - int i, j; + int i, j, tmp; QVector<int> out; out.resize(sumArguments.size()); for(i=0;i<sumArguments.size();++i) { out[i] = 0; foreach(j, sumArguments[i]) - out[i] += args[j]; + { + tmp = args[j]; + if(tmp>=getAlphabetSize()) + tmp = getAlphabetSize()-1; + out[i] += tmp; + } } return out; } QVector<int> LocalFunction::calculateSwitchArguments(QVector<int> &args) { - int index; + int index,tmp; QVector<int> out; foreach(index, freeArguments) - out<<args[index]; + { + tmp = args[index]; + if(tmp>=getAlphabetSize()) + tmp = getAlphabetSize()-1; + out<<tmp; + } return out; } Modified: trunk/qcell/basesources/Neighbourhood.cpp =================================================================== --- trunk/qcell/basesources/Neighbourhood.cpp 2007-01-10 21:13:26 UTC (rev 145) +++ trunk/qcell/basesources/Neighbourhood.cpp 2007-01-11 09:00:21 UTC (rev 146) @@ -27,6 +27,14 @@ if(maxValues[0]<x) maxValues[0]=x; + + minValues[1] = 0; + maxValues[1] = 0; + minValues[2] = 0; + maxValues[2] = 0; + minValues[3] = 0; + maxValues[3] = 0; + } void Neighbourhood::addNeighbour(int x, int y) @@ -52,6 +60,11 @@ if(maxValues[1]<y) maxValues[1]=y; + minValues[2] = 0; + maxValues[2] = 0; + minValues[3] = 0; + maxValues[3] = 0; + } void Neighbourhood::addNeighbour(int x, int y, int z) { @@ -81,6 +94,9 @@ if(maxValues[2]<z) maxValues[2]=z; + + minValues[3] = 0; + maxValues[3] = 0; } void Neighbourhood::addNeighbour(int x, int y, int z, int t) @@ -236,7 +252,8 @@ { QDomNode node; QDomElement element; - NContainer container; +// NContainer container; + clearNeighbourhood(); if(xmlElement->tagName()=="Neighbourhood") { node = xmlElement->firstChild(); @@ -250,10 +267,7 @@ { if(element.hasAttribute("t")) { - container.x = element.attribute("x").toInt(); - container.y = element.attribute("y").toInt(); - container.z = element.attribute("z").toInt(); - container.t = element.attribute("t").toInt(); + addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt(), element.attribute("z").toInt(), element.attribute("t").toInt()); if(dimension>4) dimension = 4; } @@ -261,9 +275,7 @@ { if(element.hasAttribute("z")) { - container.x = element.attribute("x").toInt(); - container.y = element.attribute("y").toInt(); - container.z = element.attribute("z").toInt(); + addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt(), element.attribute("z").toInt()); if(dimension>3) dimension = 3; } @@ -271,8 +283,7 @@ { if(element.hasAttribute("y")) { - container.x = element.attribute("x").toInt(); - container.y = element.attribute("y").toInt(); + addNeighbour(element.attribute("x").toInt(), element.attribute("y").toInt()); if(dimension>2) dimension = 2; @@ -281,13 +292,13 @@ { if(element.hasAttribute("x")) { - container.x = element.attribute("x").toInt(); + addNeighbour(element.attribute("x").toInt()); dimension = 1; } } } } - neighbourVector<<container; + //neighbourVector<<container; } node = node.nextSibling(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-11 10:28:21
|
Revision: 147 http://svn.sourceforge.net/qcell/?rev=147&view=rev Author: lessm Date: 2007-01-11 02:28:19 -0800 (Thu, 11 Jan 2007) Log Message: ----------- - some problems with Calculator and CalculationData classes resolve Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/basesources/CalculationData.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-01-11 09:00:21 UTC (rev 146) +++ trunk/qcell/baseheaders/CalculationData.h 2007-01-11 10:28:19 UTC (rev 147) @@ -72,7 +72,7 @@ int getDimension(void); /*const*/ char *getDataPointer(void); - void fillData(const char *dataPointer); + void fillData(char *dataPointer); void setForeignDataPointer(char *dataPointer); QString createXmlHeader(void); Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-11 09:00:21 UTC (rev 146) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-11 10:28:19 UTC (rev 147) @@ -658,11 +658,15 @@ return data; } -void CalculationData::fillData(const char *dataPointer) +void CalculationData::fillData(char *dataPointer) { if(!haveForeignDataPointer) { - if(data!=NULL) + if(data==NULL) + { + resizeData(0, dataPointer); + } + else memcpy(data, dataPointer, getSizeInByte()); emit dataUpdated(); } @@ -693,7 +697,6 @@ CalculationData & CalculationData::operator = (CalculationData &cData) { - clearData(); setDataType(cData.getDataType()); switch(cData.getDimension()) Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-11 09:00:21 UTC (rev 146) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-11 10:28:19 UTC (rev 147) @@ -491,6 +491,9 @@ /// @todo Use the updated API of Calculator /// @todo Pass the calculated CalculationData to the data list calc.calculate(); + CalculationData *temp = new CalculationData; + *temp = calc; + data<<temp; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-11 17:06:30
|
Revision: 148 http://svn.sourceforge.net/qcell/?rev=148&view=rev Author: dhubleizh Date: 2007-01-11 09:06:23 -0800 (Thu, 11 Jan 2007) Log Message: ----------- - error indicator in Calculator.cpp - some minotr timer tweaks in MainWindow.cpp - debug stuff in FQTParser Modified Paths: -------------- trunk/qcell/basesources/Calculator.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-11 10:28:19 UTC (rev 147) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-11 17:06:23 UTC (rev 148) @@ -222,6 +222,7 @@ void Calculator::calculate(void) { int counter = 0; + int index; char temp[8] = {0,0,0,0,0,0,0,0}; int sx = sizeX, sy = sizeY, sz = sizeZ, st = sizeT; @@ -244,12 +245,14 @@ { for(int x=0;x<sx;++x) { + index = (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; 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: + /// @todo BUUUUMMM babol case baseDataTypes::INT: *((int *)temp) = localfunction->resolve(neighbourhood->valuesToVector_i()); break; @@ -320,4 +323,4 @@ neighbourhood->calculateOffsets(tempDataSize[0], tempDataSize[1], tempDataSize[2], tempDataSize[3], getDataType()); } -} \ No newline at end of file +} Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-11 10:28:19 UTC (rev 147) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-11 17:06:23 UTC (rev 148) @@ -6,6 +6,7 @@ * Last Update: czw lis 30 14:19:22 CET 2006 */ #include "FQTParserPlugin.h" +#include <QDebug> FQTParserPlugin::FQTParserPlugin() { @@ -54,7 +55,7 @@ lines[0] = lines[0].trimmed(); if(format.exactMatch(lines[0])) { - // TODO: There has to be something to do here - right ? + /// @todo There has to be something to do here - right ? lines.removeFirst(); line_nr++; @@ -126,10 +127,11 @@ } default: { - format = QRegExp("^((\\d)+,){1-" + QString::number(arguments_nr-2) + "}(\\d)+$"); + format = QRegExp("^((\\d)+,){1," + QString::number(arguments_nr-2) + "}(\\d)+$"); } } if(format.exactMatch(lines[0])) + /// @todo Absolutely change that!!!! { int arg_index, arg_nr; arg_nr = 0; @@ -152,7 +154,7 @@ return QString(); } - arguments.append(arg_index); + arguments.append(arg_index-1); } // Now we can calculate the maximal sum value max_sum = arg_nr * (values_nr - 1); @@ -168,6 +170,8 @@ .arg(format.pattern()) .toAscii() ); + + return QString(); } /// @todo Is there a way of determining the number of lines left for sanity check? Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-11 10:28:19 UTC (rev 147) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-11 17:06:23 UTC (rev 148) @@ -468,7 +468,7 @@ { working = false; iteration = 0; - msec_delay = 0.0; + msec_delay = 0; // Set all data pointers to NULL, as unlockExperiment depends on it! neighbourhood = NULL; @@ -585,19 +585,24 @@ void MainWindow::on_action_Start_activated() { + // No need to put it into MainWindow, as it isn't used there + static int iterations = 10; ExperimentSetup es; + es.delaySpinBox->setValue((long)msec_delay/100.00); + es.iterationsSpinBox->setValue(iterations); if(es.exec() == QDialog::Accepted) { working = true; - msec_delay = (int)(es.delaySpinBox->value() * 100.00); + msec_delay = (uint)(es.delaySpinBox->value() * 100.00); if(es.continiuosCheckBox->isChecked()) { continousSteps(); } else { - stepForward(es.iterationsSpinBox->value()); + iterations = es.iterationsSpinBox->value(); + stepForward(iterations); } } @@ -885,6 +890,8 @@ ((delaySpinBox->maximum() - delaySpinBox->minimum()) / 100) * value ); + // Setting the global value + msec_delay = (uint)(delaySpinBox->value() * 100); // release lock delaySpinBox->blockSignals(false); } @@ -893,8 +900,7 @@ { // Anti spinBox->slider value change lock delaySlider->blockSignals(true); - // Setting it here is easier - // When the value is set by slider, this function will be called anywayz + // Setting global value msec_delay = value * 100.00; // Set the slider proportional to spinBox range delaySlider->setValue( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-12 16:12:09
|
Revision: 150 http://svn.sourceforge.net/qcell/?rev=150&view=rev Author: lessm Date: 2007-01-12 08:12:03 -0800 (Fri, 12 Jan 2007) Log Message: ----------- - Simulation in 2D text mode work properly(performance tweak) Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-01-11 22:13:54 UTC (rev 149) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-12 16:12:03 UTC (rev 150) @@ -18,6 +18,7 @@ { bool hide; QColor color; + QColor textColor; float floatColorDiffuse[4], floatColorSpectacular[4]; int primitiveID; QChar textSybmol; Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-11 22:13:54 UTC (rev 149) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-12 16:12:03 UTC (rev 150) @@ -38,7 +38,7 @@ QToolBox *tools; - bool table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; + char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; QGraphicsView *graphicsView2D; QGraphicsScene *graphicsScene2D; @@ -54,7 +54,7 @@ protected: - void update2DTable(void); + void update2DTable(bool forceUpdate=0); void update2DGraph(void); void update1DTable(void); void update1DTableMem(void); Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-11 22:13:54 UTC (rev 149) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-12 16:12:03 UTC (rev 150) @@ -687,6 +687,7 @@ bool CalculationData::setFromXmlString(QString *xmlString) { + return 1; } Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-11 22:13:54 UTC (rev 149) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-12 16:12:03 UTC (rev 150) @@ -62,8 +62,12 @@ 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 mx = (float)getStorage()->getSizeX() / 2.0f, my = (float)getStorage()->getSizeY() / 2.0f, mz = (float)getStorage()->getSizeZ() / 2.0f; + float mx = 0.01f; + float my = 0.01f; + float mz = 0.01f; + mov = (float)getStorage()->getSizeY(); for(int y=0;y<getStorage()->getSizeY() + 1;++y) { @@ -499,14 +503,18 @@ if(index<symbolsMap.size()) { symbolsMap[index].color = color; + symbolsMap[index].textColor.setRed(255 - color.red()); + symbolsMap[index].textColor.setGreen(255 - color.green()); + symbolsMap[index].textColor.setBlue(255 - color.blue()); + symbolsMap[index].floatColorSpectacular[0] = symbolsMap[index].floatColorDiffuse[0] = (float)color.red() / 255.0f; symbolsMap[index].floatColorSpectacular[1] = symbolsMap[index].floatColorDiffuse[1] = (float)color.green() / 255.0f; symbolsMap[index].floatColorSpectacular[2] = symbolsMap[index].floatColorDiffuse[2] = (float)color.blue() / 255.0f; symbolsMap[index].floatColorSpectacular[3] = symbolsMap[index].floatColorDiffuse[3] = 1.0f; - symbolsMap[index].floatColorSpectacular[0] += symbolsMap[index].floatColorDiffuse[0] * 0.1f; - symbolsMap[index].floatColorSpectacular[1] += symbolsMap[index].floatColorDiffuse[1] * 0.1f; - symbolsMap[index].floatColorSpectacular[2] += symbolsMap[index].floatColorDiffuse[2] * 0.1f; + symbolsMap[index].floatColorSpectacular[0] += symbolsMap[index].floatColorDiffuse[0] * 0.02f; + symbolsMap[index].floatColorSpectacular[1] += symbolsMap[index].floatColorDiffuse[1] * 0.02f; + symbolsMap[index].floatColorSpectacular[2] += symbolsMap[index].floatColorDiffuse[2] * 0.02f; return 1; } return 0; Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-11 22:13:54 UTC (rev 149) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-12 16:12:03 UTC (rev 150) @@ -109,9 +109,12 @@ void simulationWindow::paintEvent(QPaintEvent * event) { - if(ui.view2D->isVisible() && table2DUpdateRequest) + if(ui.view2D->isVisible() && table2DUpdateRequest>0) { - update2DTable(); + if(table2DUpdateRequest==1) + update2DTable(); + else + update2DTable(1); table2DUpdateRequest = 0; } if(ui.view2DGraph->isVisible() && graph2DUpdateRequest) @@ -132,17 +135,23 @@ } } -void simulationWindow::update2DTable(void) +void simulationWindow::update2DTable(bool forceUpdate) { + bool showProgres=0; + bool needUpdate=0; int index; + QString tmpString; + SYMBOL symbol; QTableWidgetItem *item; QProgressDialog progresDialog; + if(forceUpdate) + { + progresDialog.setLabelText("Generating view pleas wait..."); + progresDialog.setMaximum(renderer->getStorage()->getSizeY()); + progresDialog.show(); + showProgres = 1; + } - progresDialog.setLabelText("Generating view pleas wait..."); - progresDialog.setMaximum(renderer->getStorage()->getSizeY()); - - progresDialog.show(); - if(table2D->columnCount()!= renderer->getStorage()->getSizeX() || table2D->rowCount()!= renderer->getStorage()->getSizeY()) { ui.Grid2DZplane->setRange(0, renderer->getStorage()->getSizeZ()-1); @@ -162,29 +171,28 @@ index = renderer->getStorage()->getValueAt_i(x, y, z_plane); if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; + symbol = renderer->getSymbol(index); if(ui.Grid2DValues->isChecked()) item = new QTableWidgetItem(tr("%1").arg(index)); else - item = new QTableWidgetItem(tr("%1").arg(renderer->getSymbol(index).textSybmol)); + item = new QTableWidgetItem(symbol.textSybmol); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setTextAlignment(Qt::AlignCenter); - item->setTextColor(Qt::black); + if(ui.Grig2DColors->isChecked()) { - item->setBackgroundColor(renderer->getSymbol(index).color); - if(item->textColor() == item->backgroundColor()) - { - if(item->backgroundColor()==Qt::black) - item->setTextColor(Qt::white); - else - item->setTextColor(Qt::black); - } + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); } else + { + item->setTextColor(Qt::black); item->setBackgroundColor(Qt::white); + } table2D->setItem(y, x, item); } - progresDialog.setValue(y); + if(forceUpdate) + progresDialog.setValue(y); } } else @@ -193,31 +201,46 @@ { for(int x=0;x<renderer->getStorage()->getSizeX();++x) { + needUpdate = forceUpdate; index = renderer->getStorage()->getValueAt_i(x, y, z_plane); if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; + symbol = renderer->getSymbol(index); item = table2D->item(y, x); if(ui.Grid2DValues->isChecked()) - item->setText(tr("%1").arg(index)); + { + tmpString.setNum(index); + if(item->text()!=tmpString) + { + item->setText(tmpString); + needUpdate = 1; + } + } else - item->setText(tr("%1").arg(renderer->getSymbol(index).textSybmol)); - - item->setTextColor(Qt::black); - if(ui.Grig2DColors->isChecked()) { - item->setBackgroundColor(renderer->getSymbol(index).color); - if(item->textColor() == item->backgroundColor()) + if(symbol.textSybmol!=(item->text())[0]) { - if(item->backgroundColor()==Qt::black) - item->setTextColor(Qt::white); - else - item->setTextColor(Qt::black); + item->setText(symbol.textSybmol); + needUpdate = 1; } } - else - item->setBackgroundColor(Qt::white); + if(needUpdate) + { + item->setTextColor(Qt::black); + if(ui.Grig2DColors->isChecked()) + { + item->setBackgroundColor(renderer->getSymbol(index).color); + item->setTextColor(renderer->getSymbol(index).textColor); + } + else + { + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + } + } } - progresDialog.setValue(y); + if(forceUpdate) + progresDialog.setValue(y); } } } @@ -520,7 +543,10 @@ if(ui.view2D->isVisible()) update2DTable(); else - table2DUpdateRequest = 1; + { + if(table2DUpdateRequest<2) + table2DUpdateRequest = 1; + } if(ui.view2DGraph->isVisible()) update2DGraph(); @@ -546,6 +572,7 @@ ui.tabWidget->setTabEnabled(1, 1); ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); + table2DUpdateRequest = 2; break; case 3: @@ -553,13 +580,14 @@ ui.tabWidget->setTabEnabled(1, 1); ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); + table2DUpdateRequest = 2; break; } } void simulationWindow::GridView2DRepaint() { - update2DTable(); + update2DTable(1); } void simulationWindow::GridView1DRepaint() @@ -585,7 +613,8 @@ temp = (item->text())[0]; renderer->setSymbol(row, temp); item->setText(temp); - table2DUpdateRequest = table1DUpdateRequest = 1; + table2DUpdateRequest = 2; + table1DUpdateRequest = 1; } else if(column==4) @@ -617,7 +646,7 @@ table1DUpdateRequest = 1; if(ui.Grig2DColors->isChecked()) - table2DUpdateRequest = 1; + table2DUpdateRequest = 2; graph2DUpdateRequest = 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-12 18:32:50
|
Revision: 156 http://svn.sourceforge.net/qcell/?rev=156&view=rev Author: lessm Date: 2007-01-12 10:32:47 -0800 (Fri, 12 Jan 2007) Log Message: ----------- - LocalFunction have some changes Modified Paths: -------------- trunk/qcell/basesources/LocalFunction.cpp trunk/qcell/parsers/FQT/FQTParserPlugin.cpp Modified: trunk/qcell/basesources/LocalFunction.cpp =================================================================== --- trunk/qcell/basesources/LocalFunction.cpp 2007-01-12 18:08:16 UTC (rev 155) +++ trunk/qcell/basesources/LocalFunction.cpp 2007-01-12 18:32:47 UTC (rev 156) @@ -86,6 +86,8 @@ QVector<int> out; foreach(index, freeArguments) { + if(index>=args.size()) + index = args.size() -1; tmp = args[index]; if(tmp>=getAlphabetSize()) tmp = getAlphabetSize()-1; @@ -511,7 +513,7 @@ int LocalFunction::resolve(QVector<int> args) { - int i, index = 0, temp; + int index = 0; if(valueTable.empty()) resizeValueTable(); if(functionMode==LocalFunction::SCRIPT) Modified: trunk/qcell/parsers/FQT/FQTParserPlugin.cpp =================================================================== --- trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-12 18:08:16 UTC (rev 155) +++ trunk/qcell/parsers/FQT/FQTParserPlugin.cpp 2007-01-12 18:32:47 UTC (rev 156) @@ -275,7 +275,7 @@ foreach(int sum, results.keys()) { for(int i=0;i<results.value(sum).size();++i) - lf.setFunctionValue((results.value(sum))[i], sum, i); + lf.setFunctionValue((results.value(sum))[results.value(sum).size() - i - 1], sum, i); } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-13 18:04:45
|
Revision: 160 http://svn.sourceforge.net/qcell/?rev=160&view=rev Author: lessm Date: 2007-01-13 10:04:39 -0800 (Sat, 13 Jan 2007) Log Message: ----------- - world data is editable now i 2D view Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/MainWindow.cpp trunk/qcell/visgui/visgui.pro Added Paths: ----------- trunk/qcell/baseheaders/basetools.h trunk/qcell/baseheaders/basetools.ui trunk/qcell/basesources/basetools.cpp Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/baseheaders/CalculationData.h 2007-01-13 18:04:39 UTC (rev 160) @@ -70,6 +70,7 @@ int getSizeT(void); int getSizeInByte(void); int getDimension(void); + QVector<int> getSize(void); /*const*/ char *getDataPointer(void); void fillData(char *dataPointer); Added: trunk/qcell/baseheaders/basetools.h =================================================================== --- trunk/qcell/baseheaders/basetools.h (rev 0) +++ trunk/qcell/baseheaders/basetools.h 2007-01-13 18:04:39 UTC (rev 160) @@ -0,0 +1,36 @@ +#ifndef BASETOOLS_H +#define BASETOOLS_H + +#include <QWidget> +#include <QTableWidget> +#include "ui_basetools.h" + +class BaseTools : public QWidget +{ + Q_OBJECT + +public: + BaseTools(QWidget *parent = 0); + ~BaseTools(); + + QTableWidget * getValueTablePointer(void); + +private: + Ui::BaseToolsClass ui; + int editMode; + +protected slots: + void modeChangeSelect(void); + void modeChangeEdit(void); + void commandCopy(void); + void commandPaste(void); + void commandFill(void); + void updateSelectedSymbol(int row, int column); + +signals: + void toolsModeUpdate(int mode); + void command(int cmd); + void sumbolSelected(int index); +}; + +#endif // BASETOOLS_H Added: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui (rev 0) +++ trunk/qcell/baseheaders/basetools.ui 2007-01-13 18:04:39 UTC (rev 160) @@ -0,0 +1,142 @@ +<ui version="4.0" > + <class>BaseToolsClass</class> + <widget class="QWidget" name="BaseToolsClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>102</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle" > + <string>BaseTools</string> + </property> + <widget class="QGroupBox" name="groupBox" > + <property name="geometry" > + <rect> + <x>1</x> + <y>0</y> + <width>100</width> + <height>71</height> + </rect> + </property> + <property name="title" > + <string>Edit Mode</string> + </property> + <widget class="QToolButton" name="ModeEditButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Edit</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="ModeSelectButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Select</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>1</x> + <y>70</y> + <width>100</width> + <height>91</height> + </rect> + </property> + <property name="title" > + <string>Edit Tools</string> + </property> + <widget class="QToolButton" name="FillButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>60</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Fill</string> + </property> + </widget> + <widget class="QToolButton" name="PasteButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Paste</string> + </property> + </widget> + <widget class="QToolButton" name="CopyButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Copy</string> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox_3" > + <property name="geometry" > + <rect> + <x>1</x> + <y>160</y> + <width>100</width> + <height>131</height> + </rect> + </property> + <property name="title" > + <string>Values</string> + </property> + <widget class="QTableWidget" name="valueTable" > + <property name="geometry" > + <rect> + <x>5</x> + <y>20</y> + <width>90</width> + <height>101</height> + </rect> + </property> + </widget> + </widget> + </widget> + <layoutdefault spacing="6" margin="11" /> + <resources/> + <connections/> +</ui> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-13 18:04:39 UTC (rev 160) @@ -14,6 +14,7 @@ #include <QColorDialog> #include "ui_simulationwindow.h" #include "../baseheaders/Renderer.h" +#include "../baseheaders/basetools.h" #include <QToolBox> @@ -38,6 +39,8 @@ QToolBox *tools; + BaseTools *basetools; + char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; QGraphicsView *graphicsView2D; @@ -45,6 +48,8 @@ QGraphicsPixmapItem *graphicsScene2DPixmap; QPixmap *pixmap; + int selectedSymbol, workMode; + virtual void mouseMoveEvent(QMouseEvent * event); virtual void mousePressEvent(QMouseEvent * event); virtual void wheelEvent(QWheelEvent * event); @@ -59,6 +64,7 @@ void update1DTable(void); void update1DTableMem(void); void updateSymbolTable(void); + void changeSymbol(int x, int y, int z); public: simulationWindow(QWidget *parent = 0); @@ -84,6 +90,11 @@ void corectPerspectve(void); void orthoPerspective(void); + void GridView2DEdit(int row, int column); + + void workModeChange(int mode); + void selectSymbol(int index); + signals: void progressUpdate(int val); Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-13 18:04:39 UTC (rev 160) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>536</width> - <height>182</height> + <width>508</width> + <height>301</height> </rect> </property> <property name="sizePolicy" > @@ -20,281 +20,279 @@ <property name="windowTitle" > <string>simulationWindow</string> </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>9</number> + <widget class="QTabWidget" name="tabWidget" > + <property name="geometry" > + <rect> + <x>10</x> + <y>10</y> + <width>490</width> + <height>283</height> + </rect> </property> - <property name="spacing" > - <number>6</number> + <property name="tabPosition" > + <enum>QTabWidget::North</enum> </property> - <item> - <widget class="QTabWidget" name="tabWidget" > - <property name="tabPosition" > - <enum>QTabWidget::North</enum> + <property name="tabShape" > + <enum>QTabWidget::Rounded</enum> + </property> + <property name="currentIndex" > + <number>4</number> + </property> + <widget class="QWidget" name="view3D" > + <attribute name="title" > + <string>3D View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> </property> - <property name="tabShape" > - <enum>QTabWidget::Rounded</enum> + <property name="spacing" > + <number>6</number> </property> - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="view3D" > - <attribute name="title" > - <string>3D View</string> - </attribute> - <layout class="QVBoxLayout" > + <item> + <layout class="QHBoxLayout" > <property name="margin" > - <number>9</number> + <number>0</number> </property> <property name="spacing" > <number>6</number> </property> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> + <widget class="QRadioButton" name="perspectiveView" > + <property name="text" > + <string>Perspective</string> </property> - <property name="spacing" > - <number>6</number> + <property name="checked" > + <bool>true</bool> </property> - <item> - <widget class="QRadioButton" name="perspectiveView" > - <property name="text" > - <string>Perspective</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="ortho2DView" > - <property name="text" > - <string>Ortho2D</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> + </widget> </item> + <item> + <widget class="QRadioButton" name="ortho2DView" > + <property name="text" > + <string>Ortho2D</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> - </widget> - <widget class="QWidget" name="view2D" > - <attribute name="title" > - <string>2D Text View</string> - </attribute> - <layout class="QVBoxLayout" > + </item> + </layout> + </widget> + <widget class="QWidget" name="view2D" > + <attribute name="title" > + <string>2D Text View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > <property name="margin" > - <number>9</number> + <number>0</number> </property> <property name="spacing" > <number>6</number> </property> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> + <widget class="QCheckBox" name="Grig2DColors" > + <property name="text" > + <string>Enable Colors</string> </property> - <property name="spacing" > - <number>6</number> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid2DValues" > + <property name="text" > + <string>Values</string> </property> - <item> - <widget class="QCheckBox" name="Grig2DColors" > - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid2DValues" > - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid2DSybmols" > - <property name="text" > - <string>Symbols</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label" > - <property name="lineWidth" > - <number>3</number> - </property> - <property name="text" > - <string>Z Plane</string> - </property> - <property name="textFormat" > - <enum>Qt::AutoText</enum> - </property> - <property name="buddy" > - <cstring>Grid2DZplane</cstring> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="Grid2DZplane" /> - </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> + <property name="checked" > + <bool>true</bool> + </property> + </widget> </item> + <item> + <widget class="QRadioButton" name="Grid2DSybmols" > + <property name="text" > + <string>Symbols</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label" > + <property name="lineWidth" > + <number>3</number> + </property> + <property name="text" > + <string>Z Plane</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + <property name="buddy" > + <cstring>Grid2DZplane</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="Grid2DZplane" /> + </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> - <widget class="QWidget" name="view2DGraph" > - <attribute name="title" > - <string>2D Graphics View</string> - </attribute> - </widget> - <widget class="QWidget" name="view1D" > - <attribute name="title" > - <string>1D Text View</string> - </attribute> - <layout class="QVBoxLayout" > + </item> + </layout> + </widget> + <widget class="QWidget" name="view2DGraph" > + <attribute name="title" > + <string>2D Graphics View</string> + </attribute> + </widget> + <widget class="QWidget" name="view1D" > + <attribute name="title" > + <string>1D Text View</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > <property name="margin" > - <number>9</number> + <number>0</number> </property> <property name="spacing" > <number>6</number> </property> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> + <widget class="QCheckBox" name="Grig1DColors" > + <property name="text" > + <string>Enable Colors</string> </property> - <property name="spacing" > - <number>6</number> + </widget> + </item> + <item> + <widget class="QRadioButton" name="Grid1DValues" > + <property name="text" > + <string>Values</string> </property> - <item> - <widget class="QCheckBox" name="Grig1DColors" > - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid1DValues" > - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid1DSybmols" > - <property name="text" > - <string>Symbols</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="memClr" > - <property name="text" > - <string>Clear Memory</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> + <property name="checked" > + <bool>true</bool> + </property> + </widget> </item> + <item> + <widget class="QRadioButton" name="Grid1DSybmols" > + <property name="text" > + <string>Symbols</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="memClr" > + <property name="text" > + <string>Clear Memory</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> - </widget> - <widget class="QWidget" name="symbolConfig" > - <attribute name="title" > - <string>Symbols Configuration</string> - </attribute> - <layout class="QVBoxLayout" > + </item> + </layout> + </widget> + <widget class="QWidget" name="symbolConfig" > + <attribute name="title" > + <string>Symbols Configuration</string> + </attribute> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QHBoxLayout" > <property name="margin" > - <number>9</number> + <number>0</number> </property> <property name="spacing" > <number>6</number> </property> <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> + <widget class="QPushButton" name="addSymbol" > + <property name="text" > + <string>Add Symbol</string> </property> - <property name="spacing" > - <number>6</number> + </widget> + </item> + <item> + <widget class="QPushButton" name="removeSymbol" > + <property name="text" > + <string>Remove Symbol</string> </property> - <item> - <widget class="QPushButton" name="addSymbol" > - <property name="text" > - <string>Add Symbol</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="removeSymbol" > - <property name="text" > - <string>Remove Symbol</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> + </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> - </widget> - </item> - </layout> + </item> + </layout> + </widget> + </widget> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-13 18:04:39 UTC (rev 160) @@ -39,7 +39,6 @@ void * CalculationData::getAddressAt(int x, int y, int z, int t) { - int dSize; if(dataType==baseDataTypes::NONE) return NULL; return data + dataSize * (x + y * sizeX + z * sizeX * sizeY + t * sizeX * sizeY * sizeZ); @@ -468,7 +467,8 @@ dataSize = sizeof(short); break; } - resizeData(); + if(type!=dataType && sizeX>0) + resizeData(); } } @@ -492,6 +492,11 @@ dimension = 1; return resizeData(foreignDataPointer, dataPointer); } + else + { + if(dataPointer && foreignDataPointer) + setForeignDataPointer(dataPointer); + } return 1; } @@ -506,6 +511,11 @@ dimension = 2; return resizeData(foreignDataPointer, dataPointer); } + else + { + if(dataPointer && foreignDataPointer) + setForeignDataPointer(dataPointer); + } return 1; } @@ -520,6 +530,11 @@ dimension = 3; return resizeData(foreignDataPointer, dataPointer); } + else + { + if(dataPointer && foreignDataPointer) + setForeignDataPointer(dataPointer); + } return 1; } @@ -534,6 +549,11 @@ dimension = 4; return resizeData(foreignDataPointer, dataPointer); } + else + { + if(dataPointer && foreignDataPointer) + setForeignDataPointer(dataPointer); + } return 1; } @@ -544,11 +564,11 @@ case 1: return resizeData(newSize[0], dataPointer, foreignDataPointer); case 2: - return resizeData(newSize[1], newSize[2], dataPointer, foreignDataPointer); + return resizeData(newSize[0], newSize[1], dataPointer, foreignDataPointer); case 3: - return resizeData(newSize[1], newSize[2], newSize[3], dataPointer, foreignDataPointer); + return resizeData(newSize[0], newSize[1], newSize[2], dataPointer, foreignDataPointer); case 4: - return resizeData(newSize[1], newSize[2], newSize[3], newSize[4], dataPointer, foreignDataPointer); + return resizeData(newSize[0], newSize[1], newSize[2], newSize[3], dataPointer, foreignDataPointer); } return 0; } @@ -653,6 +673,27 @@ return dimension; } +QVector<int> CalculationData::getSize(void) +{ + QVector<int> out; + switch(getDimension()) + { + case 1: + out<<sizeX; + break; + case 2: + out<<sizeX<<sizeY; + break; + case 3: + out<<sizeX<<sizeY<<sizeZ; + break; + case 4: + out<<sizeX<<sizeY<<sizeZ<<sizeT; + break; + } + return out; +} + /*const*/ char *CalculationData::getDataPointer(void) { return data; Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-13 18:04:39 UTC (rev 160) @@ -222,7 +222,6 @@ void Calculator::calculate(void) { int counter = 0; - int index; char temp[8] = {0,0,0,0,0,0,0,0}; int sx = sizeX, sy = sizeY, sz = sizeZ, st = sizeT; Added: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp (rev 0) +++ trunk/qcell/basesources/basetools.cpp 2007-01-13 18:04:39 UTC (rev 160) @@ -0,0 +1,69 @@ +#include "../baseheaders/basetools.h" + +BaseTools::BaseTools(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + editMode = 0; + connect(ui.CopyButton, SIGNAL(clicked(bool)), SLOT(commandCopy())); + connect(ui.PasteButton, SIGNAL(clicked(bool)), SLOT(commandPaste())); + connect(ui.PasteButton, SIGNAL(clicked(bool)), SLOT(commandFill())); + + connect(ui.ModeSelectButton, SIGNAL(clicked(bool)), SLOT(modeChangeSelect())); + connect(ui.ModeEditButton, SIGNAL(clicked(bool)), SLOT(modeChangeEdit())); + + connect(ui.valueTable, SIGNAL(cellClicked(int, int)), SLOT(updateSelectedSymbol(int, int))); +} + +BaseTools::~BaseTools() +{ + +} + +QTableWidget * BaseTools::getValueTablePointer(void) +{ + return ui.valueTable; +} + +void BaseTools::modeChangeSelect(void) +{ + + ui.ModeSelectButton->setChecked(1); + ui.ModeEditButton->setChecked(0); + if(editMode!=0) + { + editMode=0; + emit toolsModeUpdate(0); + } +} + +void BaseTools::modeChangeEdit(void) +{ + ui.ModeEditButton->setChecked(1); + ui.ModeSelectButton->setChecked(0); + if(editMode!=1) + { + editMode=1; + emit toolsModeUpdate(1); + } +} + +void BaseTools::commandCopy(void) +{ + emit command(0); +} + +void BaseTools::commandPaste(void) +{ + emit command(1); +} + +void BaseTools::commandFill(void) +{ + emit command(2); +} + +void BaseTools::updateSelectedSymbol(int row, int column) +{ + emit sumbolSelected(row); +} \ No newline at end of file Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-13 18:04:39 UTC (rev 160) @@ -83,7 +83,7 @@ void simulationWindow::resizeEvent(QResizeEvent * event) { - ui.tabWidget->resize(width() - 20, height() - 60); + ui.tabWidget->resize(width() - 140, height() - 10); ui.view1D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); ui.view2D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); ui.view3D->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); @@ -105,6 +105,8 @@ symbolTable->move(0, 35); symbolTable->resize(ui.symbolConfig->width() - 7, ui.symbolConfig->height() -42); + + basetools->move(width() - 101, 0); } void simulationWindow::paintEvent(QPaintEvent * event) @@ -229,8 +231,8 @@ item->setTextColor(Qt::black); if(ui.Grig2DColors->isChecked()) { - item->setBackgroundColor(renderer->getSymbol(index).color); - item->setTextColor(renderer->getSymbol(index).textColor); + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); } else { @@ -368,6 +370,10 @@ if(symbolTable->rowCount() != renderer->getSymbolCount()) { symbolTable->setRowCount(renderer->getSymbolCount()); + + basetools->getValueTablePointer()->setRowCount(renderer->getSymbolCount()); + basetools->getValueTablePointer()->setColumnWidth(0, 53); + for(int i=0;i<symbolTable->rowCount();++i) { temp = renderer->getSymbol(i); @@ -377,6 +383,10 @@ item->setText(tr("%1").arg(i)); symbolTable->setItem(i, 0, item); + item = new QTableWidgetItem(*item); + item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + basetools->getValueTablePointer()->setItem(i, 0, item); + item = new QTableWidgetItem; item->setTextAlignment(Qt::AlignCenter); item->setText(tr("%1").arg(temp.textSybmol)); @@ -408,6 +418,7 @@ { for(int i=0;i<renderer->getSymbolCount();++i) { + temp = renderer->getSymbol(i); item = symbolTable->item(i, 0); item->setText(tr("%1").arg(i)); @@ -430,6 +441,12 @@ } } +void simulationWindow::changeSymbol(int x, int y, int z) +{ + if(workMode==1) + getStorage()->setValueAt(selectedSymbol, x, y, z); +} + simulationWindow::simulationWindow(QWidget *parent) : QWidget(parent) { @@ -498,6 +515,18 @@ table2DUpdateRequest = 0; table1DUpdateRequest = 0; + + basetools = new BaseTools(this); + basetools->getValueTablePointer()->setColumnCount(1); + basetools->getValueTablePointer()->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value"))); + + selectedSymbol = 0; + workMode = 0; + + connect(table2D, SIGNAL(cellClicked(int, int)), SLOT(GridView2DEdit(int, int))); + + connect(basetools, SIGNAL(toolsModeUpdate(int)), SLOT(workModeChange(int))); + connect(basetools, SIGNAL(sumbolSelected(int)), SLOT(selectSymbol(int))); } simulationWindow::~simulationWindow() @@ -681,3 +710,59 @@ renderer->setOrtoPerspective(); renderer->repaint(); } + +void simulationWindow::GridView2DEdit(int row, int column) +{ + QTableWidgetItem *item; + bool needUpdate = 0; + SYMBOL symbol; + QString tmpString; + if(workMode==1) + { + changeSymbol(column, row, z_plane); + item = table2D->item(row, column); + symbol = renderer->getSymbol(selectedSymbol); + if(ui.Grid2DValues->isChecked()) + { + tmpString.setNum(selectedSymbol); + if(item->text()!=tmpString) + { + item->setText(tmpString); + needUpdate = 1; + } + } + else + { + if(symbol.textSybmol!=(item->text())[0]) + { + item->setText(symbol.textSybmol); + needUpdate = 1; + } + } + if(needUpdate) + { + item->setTextColor(Qt::black); + if(ui.Grig2DColors->isChecked()) + { + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); + } + else + { + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + } + } + } +} + +void simulationWindow::workModeChange(int mode) +{ + workMode = mode; +} + +void simulationWindow::selectSymbol(int index) +{ + selectedSymbol = index; +} + Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-13 18:04:39 UTC (rev 160) @@ -351,8 +351,10 @@ } data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt()); - *sw->getStorage() = *data.last(); + //*sw->getStorage() = *data.last(); + *(CalculationData*)&calc = *data.last(); + sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); // Enable saving menu for World menu_Save->setEnabled(true); @@ -528,8 +530,11 @@ void MainWindow::update() { - *sw->getStorage() = *data[iteration]; - iterationLCD->display(iteration); + calc.getSize(); + //*sw->getStorage() = *data[iteration]; + //sw->getStorage()->resizeData(data[iteration-1]->getSize(), data[iteration-1]->getDataPointer(), 1); + sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); + iterationLCD->display(iteration); } void MainWindow::stepForward(int step) Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-01-12 20:35:43 UTC (rev 159) +++ trunk/qcell/visgui/visgui.pro 2007-01-13 18:04:39 UTC (rev 160) @@ -8,7 +8,8 @@ FORMS = MainWindow.ui \ AboutDialog.ui \ ExperimentSetup.ui \ - ../baseheaders/simulationwindow.ui + ../baseheaders/simulationwindow.ui \ + ../baseheaders/basetools.ui HEADERS = MainWindow.h \ ExperimentSetup.h \ ../baseheaders/Client.h \ @@ -21,7 +22,8 @@ ../baseheaders/LocalFunction.h \ ../baseheaders/simulationwindow.h \ ../baseheaders/Renderer.h \ - ../baseheaders/Calculator.h + ../baseheaders/Calculator.h\ + ../baseheaders/basetools.h SOURCES = ../basesources/GenericParserPlugin.cpp \ main.cpp \ @@ -34,7 +36,8 @@ ../basesources/LocalFunction.cpp \ ../basesources/simulationwindow.cpp \ ../basesources/Renderer.cpp \ - ../basesources/Calculator.cpp + ../basesources/Calculator.cpp \ + ../basesources/basetools.cpp LIBS = -L../libs -lN -lFQT -lKI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-14 00:48:24
|
Revision: 162 http://svn.sourceforge.net/qcell/?rev=162&view=rev Author: lessm Date: 2007-01-13 16:48:22 -0800 (Sat, 13 Jan 2007) Log Message: ----------- - Some Bugs removed - 1D edit panel add Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/baseheaders/view2dtexttools.h trunk/qcell/baseheaders/view2dtexttools.ui trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/basesources/view2dtexttools.cpp trunk/qcell/visgui/visgui.pro Added Paths: ----------- trunk/qcell/baseheaders/view1dtexttools.h trunk/qcell/baseheaders/view1dtexttools.ui trunk/qcell/basesources/view1dtexttools.cpp Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-14 00:48:22 UTC (rev 162) @@ -17,6 +17,7 @@ #include "basetools.h" #include "view3dtools.h" #include "view2dtexttools.h" +#include "view1dtexttools.h" #include <QToolBox> @@ -48,6 +49,11 @@ bool view2DTextColorFlag; int view2DTextInterpretationMode; + View1DTextTools *view1DTextTools; + + bool view1DTextColorFlag; + int view1DTextInterpretationMode; + char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; QGraphicsView *graphicsView2D; @@ -87,7 +93,9 @@ void GridView2DColor(bool flag); void GrigView2DInterpretationMode(int mode); - void GridView1DRepaint(void); + void GridView1DColor(bool flag); + void GrigView1DInterpretationMode(int mode); + void GridView1DMemClear(void); void symbolTableChange(int row, int column); Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-14 00:48:22 UTC (rev 162) @@ -57,61 +57,6 @@ <attribute name="title" > <string>1D Text View</string> </attribute> - <widget class="QCheckBox" name="Grig1DColors" > - <property name="geometry" > - <rect> - <x>0</x> - <y>10</y> - <width>89</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - <widget class="QRadioButton" name="Grid1DValues" > - <property name="geometry" > - <rect> - <x>110</x> - <y>10</y> - <width>54</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - <widget class="QPushButton" name="memClr" > - <property name="geometry" > - <rect> - <x>280</x> - <y>10</y> - <width>75</width> - <height>23</height> - </rect> - </property> - <property name="text" > - <string>Clear Memory</string> - </property> - </widget> - <widget class="QRadioButton" name="Grid1DSybmols" > - <property name="geometry" > - <rect> - <x>200</x> - <y>10</y> - <width>63</width> - <height>18</height> - </rect> - </property> - <property name="text" > - <string>Symbols</string> - </property> - </widget> </widget> <widget class="QWidget" name="symbolConfig" > <attribute name="title" > Added: trunk/qcell/baseheaders/view1dtexttools.h =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.h (rev 0) +++ trunk/qcell/baseheaders/view1dtexttools.h 2007-01-14 00:48:22 UTC (rev 162) @@ -0,0 +1,32 @@ +#ifndef VIEW1DTEXTTOOLS_H +#define VIEW1DTEXTTOOLS_H + +#include <QWidget> +#include "ui_view1dtexttools.h" + +class View1DTextTools : public QWidget +{ + Q_OBJECT + +public: + View1DTextTools(QWidget *parent = 0); + ~View1DTextTools(); + +private: + Ui::View1DTextToolsClass ui; + bool colorFlag; + int textMode; + +protected slots: + void ColorsClick(void); + void ValuesClick(void); + void SymbolsClicks(void); + void memoryClearButtonClick(void); + +signals: + void colorsEnabled(bool flag); + void viewModeChenged(int mode); + void memoryClear(void); +}; + +#endif // VIEW1DTEXTTOOLS_H Added: trunk/qcell/baseheaders/view1dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.ui (rev 0) +++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-14 00:48:22 UTC (rev 162) @@ -0,0 +1,109 @@ +<ui version="4.0" > + <class>View1DTextToolsClass</class> + <widget class="QWidget" name="View1DTextToolsClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>102</width> + <height>145</height> + </rect> + </property> + <property name="windowTitle" > + <string>View1DTextTools</string> + </property> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>1</x> + <y>90</y> + <width>100</width> + <height>51</height> + </rect> + </property> + <property name="title" > + <string>Memory</string> + </property> + <widget class="QToolButton" name="MemoryClearButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Clear</string> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox" > + <property name="geometry" > + <rect> + <x>1</x> + <y>1</y> + <width>100</width> + <height>91</height> + </rect> + </property> + <property name="title" > + <string>View 1D Text</string> + </property> + <widget class="QToolButton" name="ColorsButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Colors</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="ValuesButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Values</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="SymbolsButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>60</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Symbols</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + </widget> + </widget> + <layoutdefault spacing="6" margin="11" /> + <resources/> + <connections/> +</ui> Modified: trunk/qcell/baseheaders/view2dtexttools.h =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.h 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/baseheaders/view2dtexttools.h 2007-01-14 00:48:22 UTC (rev 162) @@ -13,6 +13,7 @@ ~View2DTextTools(); void Pure2DMode(bool flag=0); void setZPlaneMax(int max); + void showZplaneOnly(bool flag=0); private: Ui::View2DTextToolsClass ui; Modified: trunk/qcell/baseheaders/view2dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-14 00:48:22 UTC (rev 162) @@ -12,10 +12,33 @@ <property name="windowTitle" > <string>View2DTextTools</string> </property> - <widget class="QGroupBox" name="groupBox" > + <widget class="QGroupBox" name="ZPlaneGroup" > <property name="geometry" > <rect> <x>1</x> + <y>100</y> + <width>100</width> + <height>51</height> + </rect> + </property> + <property name="title" > + <string>Z Plane</string> + </property> + <widget class="QSpinBox" name="Zplane" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>71</width> + <height>22</height> + </rect> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="View2DGroup" > + <property name="geometry" > + <rect> + <x>1</x> <y>1</y> <width>100</width> <height>91</height> @@ -76,29 +99,6 @@ </property> </widget> </widget> - <widget class="QGroupBox" name="ZPlaneGroup" > - <property name="geometry" > - <rect> - <x>1</x> - <y>100</y> - <width>100</width> - <height>51</height> - </rect> - </property> - <property name="title" > - <string>Z Plane</string> - </property> - <widget class="QSpinBox" name="Zplane" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>71</width> - <height>22</height> - </rect> - </property> - </widget> - </widget> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 00:48:22 UTC (rev 162) @@ -97,8 +97,8 @@ table2D->resize(ui.view2D->width() - 10 , ui.view2D->height() - 10); graphicsView2D->resize(ui.view2DGraph->width() - 7, ui.view2DGraph->height() - 7); - table1D->move(0, 35); - table1D->resize(ui.view1D->width() - 7, 45); + table1D->move(1, 1); + table1D->resize(ui.view1D->width() - 10, 75); table1DMem->move(0, 100); table1DMem->resize(ui.view1D->width() - 7, ui.view1D->height() - 157); @@ -109,6 +109,7 @@ basetools->move(width() - 101, 0); view3DTools->move(width() - 101, basetools->height() + 1); view2DTextTools->move(width() - 101, basetools->height() + 1); + view1DTextTools->move(width() - 101, basetools->height() + 1); } @@ -124,6 +125,7 @@ if(ui.view2D->isVisible()) { view2DTextTools->show(); + view2DTextTools->showZplaneOnly(0); if(table2DUpdateRequest>0) { if(table2DUpdateRequest==1) @@ -134,19 +136,30 @@ } } else - view2DTextTools->hide(); + { + if(!ui.view2DGraph->isVisible()) + view2DTextTools->hide(); + } if(ui.view2DGraph->isVisible()) { + view2DTextTools->show(); + view2DTextTools->showZplaneOnly(1); if(graph2DUpdateRequest) { update2DGraph(); graph2DUpdateRequest = 0; } } + else + { + if(!ui.view2D->isVisible()) + view2DTextTools->hide(); + } if(ui.view1D->isVisible()) { + view1DTextTools->show(); if(table1DUpdateRequest) { if(table1DUpdateRequest==1) @@ -156,6 +169,8 @@ table1DUpdateRequest = 0; } } + else + view1DTextTools->hide(); if(ui.symbolConfig->isVisible()) { @@ -312,15 +327,15 @@ symbol = renderer->getSymbol(index); table1D->setColumnWidth(x, 30); table1DMem->setColumnWidth(x, 30); - if(ui.Grid1DSybmols->isChecked()) + if(view1DTextInterpretationMode==0) + item = new QTableWidgetItem(tr("%1").arg(index)); + else item = new QTableWidgetItem(tr("%1").arg(symbol.textSybmol)); - else - item = new QTableWidgetItem(tr("%1").arg(index)); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setTextAlignment(Qt::AlignCenter); - if(ui.Grig1DColors->isChecked()) + if(view1DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -343,7 +358,7 @@ index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); item = table1D->item(0, x); - if(ui.Grid1DValues->isChecked()) + if(view1DTextInterpretationMode==0) { tmpString.setNum(index); if(item->text()!=tmpString) @@ -363,7 +378,7 @@ if(needUpdate) { item->setTextColor(Qt::black); - if(ui.Grig1DColors->isChecked()) + if(view1DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -514,13 +529,9 @@ connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest())); - connect(ui.Grid1DSybmols, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); - connect(ui.Grid1DValues, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); - connect(ui.Grig1DColors, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); - connect(renderer->getStorage(), SIGNAL(dataResized()), SLOT(dataResizeRequest())); - connect(ui.memClr, SIGNAL(clicked(bool)), SLOT(GridView1DMemClear())); + connect(symbolTable, SIGNAL(cellChanged(int, int)), SLOT(symbolTableChange(int, int))); connect(symbolTable, SIGNAL(cellDoubleClicked(int, int)), SLOT(symbolTableColorChange(int, int))); @@ -547,13 +558,21 @@ view3DTools = new View3DTools(this); connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int))); - view2DTextTools = new View2DTextTools(this); view2DTextColorFlag = 0; view2DTextInterpretationMode = 0; + view2DTextTools = new View2DTextTools(this); + connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int))); connect(view2DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView2DColor(bool))); connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int))); + view1DTextColorFlag = 0; + view1DTextInterpretationMode = 0; + view1DTextTools = new View1DTextTools(this); + + connect(view1DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView1DColor(bool))); + connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int))); + connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear())); } simulationWindow::~simulationWindow() @@ -580,8 +599,16 @@ { z_plane = i; if(ui.view2D->isVisible()) + { update2DTable(); - graph2DUpdateRequest = 1; + graph2DUpdateRequest = 1; + } + else + { + table2DUpdateRequest = 1; + if(ui.view2DGraph->isVisible()) + update2DGraph(); + } } void simulationWindow::dataUpdateRequest(void) @@ -621,6 +648,7 @@ ui.tabWidget->setTabEnabled(1, 0); ui.tabWidget->setTabEnabled(2, 0); ui.tabWidget->setTabEnabled(3, 1); + table1DUpdateRequest = 2; break; case 2: @@ -629,6 +657,7 @@ ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); table2DUpdateRequest = 2; + graph2DUpdateRequest = 1; view2DTextTools->setZPlaneMax(0); view2DTextTools->Pure2DMode(1); @@ -640,10 +669,12 @@ ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); table2DUpdateRequest = 2; + graph2DUpdateRequest = 1; view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1); view2DTextTools->Pure2DMode(0); break; } + repaint(); } void simulationWindow::GridView2DColor(bool flag) @@ -658,11 +689,18 @@ update2DTable(1); } -void simulationWindow::GridView1DRepaint() +void simulationWindow::GridView1DColor(bool flag) { + view1DTextColorFlag = flag; update1DTable(1); } +void simulationWindow::GrigView1DInterpretationMode(int mode) +{ + view1DTextInterpretationMode = mode; + update1DTable(1); +} + void simulationWindow::GridView1DMemClear(void) { while(table1DMem->rowCount()>0) @@ -710,7 +748,7 @@ renderer->setSymbolColor(row, color); renderer->repaint(); - if(ui.Grig1DColors->isChecked()) + if(view1DTextColorFlag) table1DUpdateRequest = 2; if(view2DTextColorFlag) @@ -795,6 +833,7 @@ item->setBackgroundColor(Qt::white); } } + graph2DUpdateRequest = 1; } } @@ -809,7 +848,7 @@ changeSymbol(column, 0, 0); item = table1D->item(0, column); symbol = renderer->getSymbol(selectedSymbol); - if(ui.Grid1DValues->isChecked()) + if(view1DTextInterpretationMode==0) { tmpString.setNum(selectedSymbol); if(item->text()!=tmpString) @@ -829,7 +868,7 @@ if(needUpdate) { item->setTextColor(Qt::black); - if(ui.Grig1DColors->isChecked()) + if(view1DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); Added: trunk/qcell/basesources/view1dtexttools.cpp =================================================================== --- trunk/qcell/basesources/view1dtexttools.cpp (rev 0) +++ trunk/qcell/basesources/view1dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162) @@ -0,0 +1,55 @@ +#include "view1dtexttools.h" + +View1DTextTools::View1DTextTools(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + + colorFlag = 0; + textMode = 0; + + connect(ui.ColorsButton, SIGNAL(clicked(bool)), SLOT(ColorsClick())); + connect(ui.SymbolsButton, SIGNAL(clicked(bool)), SLOT(SymbolsClicks())); + connect(ui.ValuesButton, SIGNAL(clicked(bool)), SLOT(ValuesClick())); + connect(ui.MemoryClearButton, SIGNAL(clicked(bool)), SLOT(memoryClearButtonClick())); +} + +View1DTextTools::~View1DTextTools() +{ + +} + +void View1DTextTools::ColorsClick(void) +{ + if(ui.ColorsButton->isChecked()) + emit colorsEnabled(1); + else + emit colorsEnabled(0); +} + +void View1DTextTools::ValuesClick(void) +{ + ui.ValuesButton->setChecked(1); + ui.SymbolsButton->setChecked(0); + if(textMode!=0) + { + textMode = 0; + emit viewModeChenged(0); + } +} + +void View1DTextTools::SymbolsClicks(void) +{ + ui.ValuesButton->setChecked(0); + ui.SymbolsButton->setChecked(1); + if(textMode!=1) + { + textMode = 1; + emit viewModeChenged(1); + } +} + +void View1DTextTools::memoryClearButtonClick(void) +{ + emit memoryClear(); +} Modified: trunk/qcell/basesources/view2dtexttools.cpp =================================================================== --- trunk/qcell/basesources/view2dtexttools.cpp 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/basesources/view2dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162) @@ -31,6 +31,14 @@ ui.Zplane->setRange(0, max); } +void View2DTextTools::showZplaneOnly(bool flag) +{ + if(!flag) + ui.View2DGroup->show(); + else + ui.View2DGroup->hide(); +} + void View2DTextTools::ColorsClick(void) { if(ui.ColorsButton->isChecked()) Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-01-13 23:01:23 UTC (rev 161) +++ trunk/qcell/visgui/visgui.pro 2007-01-14 00:48:22 UTC (rev 162) @@ -11,7 +11,8 @@ ../baseheaders/simulationwindow.ui \ ../baseheaders/basetools.ui \ ../baseheaders/view3dtools.ui \ - ../baseheaders/view2dtexttools.ui + ../baseheaders/view2dtexttools.ui \ + ../baseheaders/view1dtexttools.ui HEADERS = MainWindow.h \ ExperimentSetup.h \ ../baseheaders/Client.h \ @@ -27,7 +28,8 @@ ../baseheaders/Calculator.h\ ../baseheaders/basetools.h \ ../baseheaders/view3dtools.h \ - ../baseheaders/view2dtexttools.h + ../baseheaders/view2dtexttools.h \ + ../baseheaders/view1dtexttools.h SOURCES = ../basesources/GenericParserPlugin.cpp \ main.cpp \ @@ -43,7 +45,8 @@ ../basesources/Calculator.cpp \ ../basesources/basetools.cpp \ ../basesources/view3dtools.cpp \ - ../basesources/view2dtexttools.cpp + ../basesources/view2dtexttools.cpp \ + ../basesources/view1dtexttools.cpp LIBS = -L../libs -lN -lFQT -lKI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-14 01:47:05
|
Revision: 161 http://svn.sourceforge.net/qcell/?rev=161&view=rev Author: lessm Date: 2007-01-13 15:01:23 -0800 (Sat, 13 Jan 2007) Log Message: ----------- - 1D view editable - in 2D and 3D view interface changed all controls on right side Modified Paths: -------------- trunk/qcell/baseheaders/basetools.h trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/basetools.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/visgui/visgui.pro Added Paths: ----------- trunk/qcell/baseheaders/view2dtexttools.h trunk/qcell/baseheaders/view2dtexttools.ui trunk/qcell/baseheaders/view3dtools.h trunk/qcell/baseheaders/view3dtools.ui trunk/qcell/basesources/view2dtexttools.cpp trunk/qcell/basesources/view3dtools.cpp Modified: trunk/qcell/baseheaders/basetools.h =================================================================== --- trunk/qcell/baseheaders/basetools.h 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/baseheaders/basetools.h 2007-01-13 23:01:23 UTC (rev 161) @@ -30,7 +30,7 @@ signals: void toolsModeUpdate(int mode); void command(int cmd); - void sumbolSelected(int index); + void symbolSelected(int index); }; #endif // BASETOOLS_H Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-13 23:01:23 UTC (rev 161) @@ -13,8 +13,10 @@ #include <QProgressDialog> #include <QColorDialog> #include "ui_simulationwindow.h" -#include "../baseheaders/Renderer.h" -#include "../baseheaders/basetools.h" +#include "Renderer.h" +#include "basetools.h" +#include "view3dtools.h" +#include "view2dtexttools.h" #include <QToolBox> @@ -40,7 +42,12 @@ QToolBox *tools; BaseTools *basetools; + View3DTools *view3DTools; + View2DTextTools *view2DTextTools; + bool view2DTextColorFlag; + int view2DTextInterpretationMode; + char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; QGraphicsView *graphicsView2D; @@ -61,7 +68,7 @@ protected: void update2DTable(bool forceUpdate=0); void update2DGraph(void); - void update1DTable(void); + void update1DTable(bool forceUpdate=0); void update1DTableMem(void); void updateSymbolTable(void); void changeSymbol(int x, int y, int z); @@ -77,7 +84,9 @@ void zPlaneChange(int i); void dataUpdateRequest(void); void dataResizeRequest(void); - void GridView2DRepaint(void); + void GridView2DColor(bool flag); + void GrigView2DInterpretationMode(int mode); + void GridView1DRepaint(void); void GridView1DMemClear(void); @@ -87,10 +96,10 @@ void addSymbol(void); void removeSymbol(void); - void corectPerspectve(void); - void orthoPerspective(void); + void perspectiveUpdate(int mode); void GridView2DEdit(int row, int column); + void GridView1DEdit(int row, int column); void workModeChange(int mode); void selectSymbol(int index); Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-13 23:01:23 UTC (rev 161) @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>508</width> + <width>513</width> <height>301</height> </rect> </property> @@ -42,133 +42,11 @@ <attribute name="title" > <string>3D View</string> </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QRadioButton" name="perspectiveView" > - <property name="text" > - <string>Perspective</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="ortho2DView" > - <property name="text" > - <string>Ortho2D</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> <widget class="QWidget" name="view2D" > <attribute name="title" > <string>2D Text View</string> </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QCheckBox" name="Grig2DColors" > - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid2DValues" > - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid2DSybmols" > - <property name="text" > - <string>Symbols</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label" > - <property name="lineWidth" > - <number>3</number> - </property> - <property name="text" > - <string>Z Plane</string> - </property> - <property name="textFormat" > - <enum>Qt::AutoText</enum> - </property> - <property name="buddy" > - <cstring>Grid2DZplane</cstring> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="Grid2DZplane" /> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> </widget> <widget class="QWidget" name="view2DGraph" > <attribute name="title" > @@ -179,118 +57,92 @@ <attribute name="title" > <string>1D Text View</string> </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>9</number> + <widget class="QCheckBox" name="Grig1DColors" > + <property name="geometry" > + <rect> + <x>0</x> + <y>10</y> + <width>89</width> + <height>18</height> + </rect> </property> - <property name="spacing" > - <number>6</number> + <property name="text" > + <string>Enable Colors</string> </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QCheckBox" name="Grig1DColors" > - <property name="text" > - <string>Enable Colors</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid1DValues" > - <property name="text" > - <string>Values</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="Grid1DSybmols" > - <property name="text" > - <string>Symbols</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="memClr" > - <property name="text" > - <string>Clear Memory</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> + <widget class="QRadioButton" name="Grid1DValues" > + <property name="geometry" > + <rect> + <x>110</x> + <y>10</y> + <width>54</width> + <height>18</height> + </rect> + </property> + <property name="text" > + <string>Values</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" name="memClr" > + <property name="geometry" > + <rect> + <x>280</x> + <y>10</y> + <width>75</width> + <height>23</height> + </rect> + </property> + <property name="text" > + <string>Clear Memory</string> + </property> + </widget> + <widget class="QRadioButton" name="Grid1DSybmols" > + <property name="geometry" > + <rect> + <x>200</x> + <y>10</y> + <width>63</width> + <height>18</height> + </rect> + </property> + <property name="text" > + <string>Symbols</string> + </property> + </widget> </widget> <widget class="QWidget" name="symbolConfig" > <attribute name="title" > <string>Symbols Configuration</string> </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>9</number> + <widget class="QPushButton" name="addSymbol" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>75</width> + <height>23</height> + </rect> </property> - <property name="spacing" > - <number>6</number> + <property name="text" > + <string>Add Symbol</string> </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="addSymbol" > - <property name="text" > - <string>Add Symbol</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="removeSymbol" > - <property name="text" > - <string>Remove Symbol</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> + </widget> + <widget class="QPushButton" name="removeSymbol" > + <property name="geometry" > + <rect> + <x>80</x> + <y>0</y> + <width>84</width> + <height>23</height> + </rect> + </property> + <property name="text" > + <string>Remove Symbol</string> + </property> + </widget> </widget> </widget> </widget> Added: trunk/qcell/baseheaders/view2dtexttools.h =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.h (rev 0) +++ trunk/qcell/baseheaders/view2dtexttools.h 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,34 @@ +#ifndef VIEW2DTEXTTOOLS_H +#define VIEW2DTEXTTOOLS_H + +#include <QWidget> +#include "ui_view2dtexttools.h" + +class View2DTextTools : public QWidget +{ + Q_OBJECT + +public: + View2DTextTools(QWidget *parent = 0); + ~View2DTextTools(); + void Pure2DMode(bool flag=0); + void setZPlaneMax(int max); + +private: + Ui::View2DTextToolsClass ui; + bool colorFlag; + int textMode; + +protected slots: + void ColorsClick(void); + void ValuesClick(void); + void SymbolsClicks(void); + void ZPlaneSet(int zplane); + +signals: + void colorsEnabled(bool flag); + void viewModeChenged(int mode); + void newZPlaneSet(int zplane); +}; + +#endif // VIEW2DTEXTTOOLS_H Added: trunk/qcell/baseheaders/view2dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.ui (rev 0) +++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,106 @@ +<ui version="4.0" > + <class>View2DTextToolsClass</class> + <widget class="QWidget" name="View2DTextToolsClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>102</width> + <height>157</height> + </rect> + </property> + <property name="windowTitle" > + <string>View2DTextTools</string> + </property> + <widget class="QGroupBox" name="groupBox" > + <property name="geometry" > + <rect> + <x>1</x> + <y>1</y> + <width>100</width> + <height>91</height> + </rect> + </property> + <property name="title" > + <string>View 2D Text</string> + </property> + <widget class="QToolButton" name="ValuesButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Values</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="ColorsButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Colors</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="SymbolsButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>60</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Symbols</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="ZPlaneGroup" > + <property name="geometry" > + <rect> + <x>1</x> + <y>100</y> + <width>100</width> + <height>51</height> + </rect> + </property> + <property name="title" > + <string>Z Plane</string> + </property> + <widget class="QSpinBox" name="Zplane" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>71</width> + <height>22</height> + </rect> + </property> + </widget> + </widget> + </widget> + <layoutdefault spacing="6" margin="11" /> + <resources/> + <connections/> +</ui> Added: trunk/qcell/baseheaders/view3dtools.h =================================================================== --- trunk/qcell/baseheaders/view3dtools.h (rev 0) +++ trunk/qcell/baseheaders/view3dtools.h 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,27 @@ +#ifndef VIEW3DTOOLS_H +#define VIEW3DTOOLS_H + +#include <QWidget> +#include "ui_view3dtools.h" + +class View3DTools : public QWidget +{ + Q_OBJECT + +public: + View3DTools(QWidget *parent = 0); + ~View3DTools(); + +private: + Ui::View3DToolsClass ui; + int viewMode; + +protected slots: + void ViewChangePerspective(void); + void ViewChangeOrtho(void); + +signals: + void ViewModeUpdated(int mode); +}; + +#endif // VIEW3DTOOLS_H Added: trunk/qcell/baseheaders/view3dtools.ui =================================================================== --- trunk/qcell/baseheaders/view3dtools.ui (rev 0) +++ trunk/qcell/baseheaders/view3dtools.ui 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,67 @@ +<ui version="4.0" > + <class>View3DToolsClass</class> + <widget class="QWidget" name="View3DToolsClass" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>102</width> + <height>80</height> + </rect> + </property> + <property name="windowTitle" > + <string>View3DTools</string> + </property> + <widget class="QGroupBox" name="ViewsTools" > + <property name="geometry" > + <rect> + <x>1</x> + <y>1</y> + <width>100</width> + <height>71</height> + </rect> + </property> + <property name="title" > + <string>View 3D</string> + </property> + <widget class="QToolButton" name="PerspectiveButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Perspective</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="OrthoButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Ortho</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + </widget> + </widget> + <layoutdefault spacing="6" margin="11" /> + <resources/> + <connections/> +</ui> Modified: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/basesources/basetools.cpp 2007-01-13 23:01:23 UTC (rev 161) @@ -17,7 +17,6 @@ BaseTools::~BaseTools() { - } QTableWidget * BaseTools::getValueTablePointer(void) @@ -65,5 +64,5 @@ void BaseTools::updateSelectedSymbol(int row, int column) { - emit sumbolSelected(row); + emit symbolSelected(row); } \ No newline at end of file Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-13 23:01:23 UTC (rev 161) @@ -90,47 +90,73 @@ ui.view2DGraph->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); ui.symbolConfig->resize(ui.tabWidget->width(), ui.tabWidget->height() - 20); - renderer->move(0, 35); - renderer->resize(ui.view3D->width() - 7, ui.view3D->height() - 42); + renderer->move(1, 1); + renderer->resize(ui.view3D->width() - 1, ui.view3D->height() - 1); - table2D->move(0, 35); - table2D->resize(ui.view2D->width() - 7 , ui.view2D->height() - 42); + table2D->move(1, 1); + table2D->resize(ui.view2D->width() - 10 , ui.view2D->height() - 10); graphicsView2D->resize(ui.view2DGraph->width() - 7, ui.view2DGraph->height() - 7); table1D->move(0, 35); - table1D->resize(ui.view1D->width() - 7, 75); + table1D->resize(ui.view1D->width() - 7, 45); - table1DMem->move(0, 150); + table1DMem->move(0, 100); table1DMem->resize(ui.view1D->width() - 7, ui.view1D->height() - 157); symbolTable->move(0, 35); symbolTable->resize(ui.symbolConfig->width() - 7, ui.symbolConfig->height() -42); basetools->move(width() - 101, 0); + view3DTools->move(width() - 101, basetools->height() + 1); + view2DTextTools->move(width() - 101, basetools->height() + 1); + } void simulationWindow::paintEvent(QPaintEvent * event) { - if(ui.view2D->isVisible() && table2DUpdateRequest>0) + if(ui.view3D->isVisible()) { - if(table2DUpdateRequest==1) - update2DTable(); - else - update2DTable(1); - table2DUpdateRequest = 0; + view3DTools->show(); } - if(ui.view2DGraph->isVisible() && graph2DUpdateRequest) + else + view3DTools->hide(); + + if(ui.view2D->isVisible()) { - update2DGraph(); - graph2DUpdateRequest = 0; + view2DTextTools->show(); + if(table2DUpdateRequest>0) + { + if(table2DUpdateRequest==1) + update2DTable(); + else + update2DTable(1); + table2DUpdateRequest = 0; + } } + else + view2DTextTools->hide(); - if(ui.view1D->isVisible() && table1DUpdateRequest) + if(ui.view2DGraph->isVisible()) { - update1DTable(); - table1DUpdateRequest = 0; + if(graph2DUpdateRequest) + { + update2DGraph(); + graph2DUpdateRequest = 0; + } } + if(ui.view1D->isVisible()) + { + if(table1DUpdateRequest) + { + if(table1DUpdateRequest==1) + update1DTable(); + else + update1DTable(1); + table1DUpdateRequest = 0; + } + } + if(ui.symbolConfig->isVisible()) { updateSymbolTable(); @@ -156,7 +182,6 @@ if(table2D->columnCount()!= renderer->getStorage()->getSizeX() || table2D->rowCount()!= renderer->getStorage()->getSizeY()) { - ui.Grid2DZplane->setRange(0, renderer->getStorage()->getSizeZ()-1); table2D->clear(); table2D->setColumnCount(renderer->getStorage()->getSizeX()); table2D->setRowCount(renderer->getStorage()->getSizeY()); @@ -174,14 +199,14 @@ if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); - if(ui.Grid2DValues->isChecked()) + if(view2DTextInterpretationMode==0) item = new QTableWidgetItem(tr("%1").arg(index)); else item = new QTableWidgetItem(symbol.textSybmol); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setTextAlignment(Qt::AlignCenter); - if(ui.Grig2DColors->isChecked()) + if(view2DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -209,7 +234,7 @@ index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); item = table2D->item(y, x); - if(ui.Grid2DValues->isChecked()) + if(view2DTextInterpretationMode==0) { tmpString.setNum(index); if(item->text()!=tmpString) @@ -229,7 +254,7 @@ if(needUpdate) { item->setTextColor(Qt::black); - if(ui.Grig2DColors->isChecked()) + if(view2DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -261,10 +286,13 @@ } } -void simulationWindow::update1DTable(void) +void simulationWindow::update1DTable(bool forceUpdate) { + bool needUpdate=0; int index; - QTableWidgetItem *item;//, *memItem; + QString tmpString; + SYMBOL symbol; + QTableWidgetItem *item; if(table1D->columnCount()!= renderer->getStorage()->getSizeX()) { @@ -273,7 +301,6 @@ table1D->setRowHeight(0, 30); table1DMem->clear(); - //table1DMem->setRowCount(1); table1DMem->setColumnCount(renderer->getStorage()->getSizeX()); table1DMem->setRowHeight(0, 30); @@ -282,69 +309,71 @@ index = renderer->getStorage()->getValueAt_i(x); if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; + symbol = renderer->getSymbol(index); table1D->setColumnWidth(x, 30); table1DMem->setColumnWidth(x, 30); if(ui.Grid1DSybmols->isChecked()) - { - item = new QTableWidgetItem(tr("%1").arg(renderer->getSymbol(index).textSybmol)); - } + item = new QTableWidgetItem(tr("%1").arg(symbol.textSybmol)); else - { item = new QTableWidgetItem(tr("%1").arg(index)); - } item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setTextAlignment(Qt::AlignCenter); - item->setTextColor(Qt::black); + if(ui.Grig1DColors->isChecked()) { - item->setBackgroundColor(renderer->getSymbol(index).color); - if(item->textColor() == item->backgroundColor()) - { - if(item->backgroundColor()==Qt::black) - item->setTextColor(Qt::white); - else - item->setTextColor(Qt::black); - } + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); } else + { item->setBackgroundColor(Qt::white); - + item->setTextColor(Qt::black); + } table1D->setItem(0, x, item); - - /* - memItem = new QTableWidgetItem(*item); - table1DMem->setItem(0, x, memItem); - */ } } else { for(int x=0;x<renderer->getStorage()->getSizeX();++x) { + needUpdate = forceUpdate; index = renderer->getStorage()->getValueAt_i(x); if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; + symbol = renderer->getSymbol(index); item = table1D->item(0, x); - if(ui.Grid1DSybmols->isChecked()) - item->setText(tr("%1").arg(renderer->getSymbol(index).textSybmol)); + if(ui.Grid1DValues->isChecked()) + { + tmpString.setNum(index); + if(item->text()!=tmpString) + { + item->setText(tmpString); + needUpdate = 1; + } + } else - item->setText(tr("%1").arg(index)); - - item->setTextColor(Qt::black); - if(ui.Grig1DColors->isChecked()) { - item->setBackgroundColor(renderer->getSymbol(index).color); - if(item->textColor() == item->backgroundColor()) + if(symbol.textSybmol!=(item->text())[0]) { - if(item->backgroundColor()==Qt::black) - item->setTextColor(Qt::white); - else - item->setTextColor(Qt::black); + item->setText(symbol.textSybmol); + needUpdate = 1; } } - else - item->setBackgroundColor(Qt::white); + if(needUpdate) + { + item->setTextColor(Qt::black); + if(ui.Grig1DColors->isChecked()) + { + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); + } + else + { + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + } + } } } } @@ -455,12 +484,9 @@ ui.setupUi(this); renderer = new Renderer(ui.view3D); - ui.view3D->layout()->addWidget(renderer); renderer->resize(ui.view3D->width(), ui.view3D->height()); graphicsView2D = new QGraphicsView(ui.view2DGraph); - ui.view2DGraph->setLayout(new QVBoxLayout()); - ui.view2DGraph->layout()->addWidget(graphicsView2D); graphicsScene2D = new QGraphicsScene; pixmap = new QPixmap(0, 0); @@ -471,14 +497,11 @@ table1D = new QTableWidget(ui.view1D); - ui.view1D->layout()->addWidget(table1D); table1D->setRowCount(1); table1DMem = new QTableWidget(ui.view1D); - ui.view1D->layout()->addWidget(table1DMem); symbolTable = new QTableWidget(ui.symbolConfig); - ui.symbolConfig->layout()->addWidget(symbolTable); symbolTable->setColumnCount(5); symbolTable->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value"))); symbolTable->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Symbol"))); @@ -487,15 +510,10 @@ symbolTable->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Hide Flag"))); table2D = new QTableWidget(ui.view2D); - ui.view2D->layout()->addWidget(table2D); - connect(ui.Grid2DZplane, SIGNAL(valueChanged(int)), SLOT(zPlaneChange(int))); + connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest())); - connect(ui.Grid2DSybmols, SIGNAL(clicked(bool)), SLOT(GridView2DRepaint())); - connect(ui.Grid2DValues, SIGNAL(clicked(bool)), SLOT(GridView2DRepaint())); - connect(ui.Grig2DColors, SIGNAL(clicked(bool)), SLOT(GridView2DRepaint())); - connect(ui.Grid1DSybmols, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); connect(ui.Grid1DValues, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); connect(ui.Grig1DColors, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint())); @@ -510,9 +528,6 @@ connect(ui.addSymbol, SIGNAL(clicked(bool)), SLOT(addSymbol())); connect(ui.removeSymbol, SIGNAL(clicked(bool)), SLOT(removeSymbol())); - connect(ui.perspectiveView, SIGNAL(clicked(bool)), SLOT(corectPerspectve())); - connect(ui.ortho2DView, SIGNAL(clicked(bool)), SLOT(orthoPerspective())); - table2DUpdateRequest = 0; table1DUpdateRequest = 0; @@ -520,13 +535,25 @@ basetools->getValueTablePointer()->setColumnCount(1); basetools->getValueTablePointer()->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value"))); - selectedSymbol = 0; - workMode = 0; + selectedSymbol = 0; + workMode = 0; - connect(table2D, SIGNAL(cellClicked(int, int)), SLOT(GridView2DEdit(int, int))); + connect(table2D, SIGNAL(cellClicked(int, int)), SLOT(GridView2DEdit(int, int))); + connect(table1D, SIGNAL(cellClicked(int, int)), SLOT(GridView1DEdit(int, int))); - connect(basetools, SIGNAL(toolsModeUpdate(int)), SLOT(workModeChange(int))); - connect(basetools, SIGNAL(sumbolSelected(int)), SLOT(selectSymbol(int))); + connect(basetools, SIGNAL(toolsModeUpdate(int)), SLOT(workModeChange(int))); + connect(basetools, SIGNAL(symbolSelected(int)), SLOT(selectSymbol(int))); + + view3DTools = new View3DTools(this); + connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int))); + + view2DTextTools = new View2DTextTools(this); + view2DTextColorFlag = 0; + view2DTextInterpretationMode = 0; + connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int))); + connect(view2DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView2DColor(bool))); + connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int))); + } simulationWindow::~simulationWindow() @@ -602,6 +629,9 @@ ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); table2DUpdateRequest = 2; + view2DTextTools->setZPlaneMax(0); + view2DTextTools->Pure2DMode(1); + break; case 3: @@ -610,18 +640,27 @@ ui.tabWidget->setTabEnabled(2, 1); ui.tabWidget->setTabEnabled(3, 0); table2DUpdateRequest = 2; + view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1); + view2DTextTools->Pure2DMode(0); break; } } -void simulationWindow::GridView2DRepaint() +void simulationWindow::GridView2DColor(bool flag) { + view2DTextColorFlag = flag; update2DTable(1); } +void simulationWindow::GrigView2DInterpretationMode(int mode) +{ + view2DTextInterpretationMode = mode; + update2DTable(1); +} + void simulationWindow::GridView1DRepaint() { - update1DTable(); + update1DTable(1); } void simulationWindow::GridView1DMemClear(void) @@ -643,7 +682,7 @@ renderer->setSymbol(row, temp); item->setText(temp); table2DUpdateRequest = 2; - table1DUpdateRequest = 1; + table1DUpdateRequest = 2; } else if(column==4) @@ -672,9 +711,9 @@ renderer->repaint(); if(ui.Grig1DColors->isChecked()) - table1DUpdateRequest = 1; + table1DUpdateRequest = 2; - if(ui.Grig2DColors->isChecked()) + if(view2DTextColorFlag) table2DUpdateRequest = 2; graph2DUpdateRequest = 1; @@ -699,18 +738,21 @@ updateSymbolTable(); } -void simulationWindow::corectPerspectve(void) +void simulationWindow::perspectiveUpdate(int mode) { - renderer->setRealPerspective(); - renderer->repaint(); + switch(mode) + { + case 0: + renderer->setRealPerspective(); + renderer->repaint(); + break; + case 1: + renderer->setOrtoPerspective(); + renderer->repaint(); + break; + } } -void simulationWindow::orthoPerspective(void) -{ - renderer->setOrtoPerspective(); - renderer->repaint(); -} - void simulationWindow::GridView2DEdit(int row, int column) { QTableWidgetItem *item; @@ -722,7 +764,7 @@ changeSymbol(column, row, z_plane); item = table2D->item(row, column); symbol = renderer->getSymbol(selectedSymbol); - if(ui.Grid2DValues->isChecked()) + if(view2DTextInterpretationMode==0) { tmpString.setNum(selectedSymbol); if(item->text()!=tmpString) @@ -742,7 +784,7 @@ if(needUpdate) { item->setTextColor(Qt::black); - if(ui.Grig2DColors->isChecked()) + if(view2DTextColorFlag) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -756,6 +798,51 @@ } } +void simulationWindow::GridView1DEdit(int row, int column) +{ + QTableWidgetItem *item; + bool needUpdate = 0; + SYMBOL symbol; + QString tmpString; + if(workMode==1) + { + changeSymbol(column, 0, 0); + item = table1D->item(0, column); + symbol = renderer->getSymbol(selectedSymbol); + if(ui.Grid1DValues->isChecked()) + { + tmpString.setNum(selectedSymbol); + if(item->text()!=tmpString) + { + item->setText(tmpString); + needUpdate = 1; + } + } + else + { + if(symbol.textSybmol!=(item->text())[0]) + { + item->setText(symbol.textSybmol); + needUpdate = 1; + } + } + if(needUpdate) + { + item->setTextColor(Qt::black); + if(ui.Grig1DColors->isChecked()) + { + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); + } + else + { + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + } + } + } +} + void simulationWindow::workModeChange(int mode) { workMode = mode; Added: trunk/qcell/basesources/view2dtexttools.cpp =================================================================== --- trunk/qcell/basesources/view2dtexttools.cpp (rev 0) +++ trunk/qcell/basesources/view2dtexttools.cpp 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,67 @@ +#include "view2dtexttools.h" + +View2DTextTools::View2DTextTools(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + colorFlag = 0; + textMode = 0; + + connect(ui.ColorsButton, SIGNAL(clicked(bool)), SLOT(ColorsClick())); + connect(ui.SymbolsButton, SIGNAL(clicked(bool)), SLOT(SymbolsClicks())); + connect(ui.ValuesButton, SIGNAL(clicked(bool)), SLOT(ValuesClick())); + connect(ui.Zplane, SIGNAL(valueChanged(int)), SLOT(ZPlaneSet(int))); + ui.Zplane->setRange(0, 0); +} + +View2DTextTools::~View2DTextTools() +{ +} + +void View2DTextTools::Pure2DMode(bool flag) +{ + if(!flag) + ui.ZPlaneGroup->show(); + else + ui.ZPlaneGroup->hide(); +} + +void View2DTextTools::setZPlaneMax(int max) +{ + ui.Zplane->setRange(0, max); +} + +void View2DTextTools::ColorsClick(void) +{ + if(ui.ColorsButton->isChecked()) + emit colorsEnabled(1); + else + emit colorsEnabled(0); +} + +void View2DTextTools::ValuesClick(void) +{ + ui.ValuesButton->setChecked(1); + ui.SymbolsButton->setChecked(0); + if(textMode!=0) + { + textMode = 0; + emit viewModeChenged(0); + } +} + +void View2DTextTools::SymbolsClicks(void) +{ + ui.ValuesButton->setChecked(0); + ui.SymbolsButton->setChecked(1); + if(textMode!=1) + { + textMode = 1; + emit viewModeChenged(1); + } +} + +void View2DTextTools::ZPlaneSet(int zplane) +{ + emit newZPlaneSet(zplane); +} Added: trunk/qcell/basesources/view3dtools.cpp =================================================================== --- trunk/qcell/basesources/view3dtools.cpp (rev 0) +++ trunk/qcell/basesources/view3dtools.cpp 2007-01-13 23:01:23 UTC (rev 161) @@ -0,0 +1,37 @@ +#include "view3dtools.h" + +View3DTools::View3DTools(QWidget *parent) + : QWidget(parent) +{ + ui.setupUi(this); + viewMode = 0; + + connect(ui.PerspectiveButton, SIGNAL(clicked(bool)), SLOT(ViewChangePerspective())); + connect(ui.OrthoButton, SIGNAL(clicked(bool)), SLOT(ViewChangeOrtho())); +} + +View3DTools::~View3DTools() +{ +} + +void View3DTools::ViewChangePerspective(void) +{ + ui.PerspectiveButton->setChecked(1); + ui.OrthoButton->setChecked(0); + if(viewMode!=0) + { + viewMode = 0; + emit ViewModeUpdated(0); + } +} + +void View3DTools::ViewChangeOrtho(void) +{ + ui.PerspectiveButton->setChecked(0); + ui.OrthoButton->setChecked(1); + if(viewMode!=1) + { + viewMode = 1; + emit ViewModeUpdated(1); + } +} \ No newline at end of file Modified: trunk/qcell/visgui/visgui.pro =================================================================== --- trunk/qcell/visgui/visgui.pro 2007-01-13 18:04:39 UTC (rev 160) +++ trunk/qcell/visgui/visgui.pro 2007-01-13 23:01:23 UTC (rev 161) @@ -9,7 +9,9 @@ AboutDialog.ui \ ExperimentSetup.ui \ ../baseheaders/simulationwindow.ui \ - ../baseheaders/basetools.ui + ../baseheaders/basetools.ui \ + ../baseheaders/view3dtools.ui \ + ../baseheaders/view2dtexttools.ui HEADERS = MainWindow.h \ ExperimentSetup.h \ ../baseheaders/Client.h \ @@ -23,7 +25,9 @@ ../baseheaders/simulationwindow.h \ ../baseheaders/Renderer.h \ ../baseheaders/Calculator.h\ - ../baseheaders/basetools.h + ../baseheaders/basetools.h \ + ../baseheaders/view3dtools.h \ + ../baseheaders/view2dtexttools.h SOURCES = ../basesources/GenericParserPlugin.cpp \ main.cpp \ @@ -37,7 +41,9 @@ ../basesources/simulationwindow.cpp \ ../basesources/Renderer.cpp \ ../basesources/Calculator.cpp \ - ../basesources/basetools.cpp + ../basesources/basetools.cpp \ + ../basesources/view3dtools.cpp \ + ../basesources/view2dtexttools.cpp LIBS = -L../libs -lN -lFQT -lKI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-14 10:28:11
|
Revision: 163 http://svn.sourceforge.net/qcell/?rev=163&view=rev Author: lessm Date: 2007-01-14 02:28:05 -0800 (Sun, 14 Jan 2007) Log Message: ----------- - Text view 1D and 2D have color mode only showing symbols id Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/view1dtexttools.h trunk/qcell/baseheaders/view2dtexttools.h trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/basesources/view1dtexttools.cpp trunk/qcell/basesources/view2dtexttools.cpp Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-14 10:28:05 UTC (rev 163) @@ -46,12 +46,10 @@ View3DTools *view3DTools; View2DTextTools *view2DTextTools; - bool view2DTextColorFlag; int view2DTextInterpretationMode; View1DTextTools *view1DTextTools; - bool view1DTextColorFlag; int view1DTextInterpretationMode; char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest; @@ -90,10 +88,8 @@ void zPlaneChange(int i); void dataUpdateRequest(void); void dataResizeRequest(void); - void GridView2DColor(bool flag); void GrigView2DInterpretationMode(int mode); - void GridView1DColor(bool flag); void GrigView1DInterpretationMode(int mode); void GridView1DMemClear(void); Modified: trunk/qcell/baseheaders/view1dtexttools.h =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.h 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/baseheaders/view1dtexttools.h 2007-01-14 10:28:05 UTC (rev 163) @@ -24,7 +24,6 @@ void memoryClearButtonClick(void); signals: - void colorsEnabled(bool flag); void viewModeChenged(int mode); void memoryClear(void); }; Modified: trunk/qcell/baseheaders/view2dtexttools.h =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.h 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/baseheaders/view2dtexttools.h 2007-01-14 10:28:05 UTC (rev 163) @@ -27,7 +27,7 @@ void ZPlaneSet(int zplane); signals: - void colorsEnabled(bool flag); + void viewModeChenged(int mode); void newZPlaneSet(int zplane); }; Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 10:28:05 UTC (rev 163) @@ -214,23 +214,28 @@ if(index>=renderer->getSymbolCount()) index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); - if(view2DTextInterpretationMode==0) + switch(view2DTextInterpretationMode) + { + case 0: item = new QTableWidgetItem(tr("%1").arg(index)); - else + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + break; + case 1: item = new QTableWidgetItem(symbol.textSybmol); - item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - item->setTextAlignment(Qt::AlignCenter); - - if(view2DTextColorFlag) - { + item->setTextColor(Qt::black); + item->setBackgroundColor(Qt::white); + break; + + case 3: + item = new QTableWidgetItem(tr("%1").arg(index)); item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); + break; } - else - { - item->setTextColor(Qt::black); - item->setBackgroundColor(Qt::white); - } + + item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + item->setTextAlignment(Qt::AlignCenter); table2D->setItem(y, x, item); } if(forceUpdate) @@ -249,27 +254,30 @@ index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); item = table2D->item(y, x); - if(view2DTextInterpretationMode==0) + + switch(view2DTextInterpretationMode) { + case 2: + case 0: tmpString.setNum(index); if(item->text()!=tmpString) { item->setText(tmpString); needUpdate = 1; } - } - else - { + break; + case 1: if(symbol.textSybmol!=(item->text())[0]) { item->setText(symbol.textSybmol); needUpdate = 1; } + break; } + if(needUpdate) { - item->setTextColor(Qt::black); - if(view2DTextColorFlag) + if(view2DTextInterpretationMode==2) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -327,24 +335,26 @@ symbol = renderer->getSymbol(index); table1D->setColumnWidth(x, 30); table1DMem->setColumnWidth(x, 30); - if(view1DTextInterpretationMode==0) + switch(view1DTextInterpretationMode) + { + case 0: item = new QTableWidgetItem(tr("%1").arg(index)); - else + item->setBackgroundColor(Qt::white); + item->setTextColor(Qt::black); + break; + case 1: item = new QTableWidgetItem(tr("%1").arg(symbol.textSybmol)); + item->setBackgroundColor(Qt::white); + item->setTextColor(Qt::black); + break; + case 2: + item = new QTableWidgetItem(tr("%1").arg(index)); + item->setBackgroundColor(symbol.color); + item->setTextColor(symbol.textColor); + break; + } item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setTextAlignment(Qt::AlignCenter); - - - if(view1DTextColorFlag) - { - item->setBackgroundColor(symbol.color); - item->setTextColor(symbol.textColor); - } - else - { - item->setBackgroundColor(Qt::white); - item->setTextColor(Qt::black); - } table1D->setItem(0, x, item); } } @@ -358,27 +368,29 @@ index = renderer->getSymbolCount() - 1; symbol = renderer->getSymbol(index); item = table1D->item(0, x); - if(view1DTextInterpretationMode==0) + switch(view1DTextInterpretationMode) { + case 2: + case 0: tmpString.setNum(index); if(item->text()!=tmpString) { item->setText(tmpString); needUpdate = 1; } - } - else - { + break; + + case 1: if(symbol.textSybmol!=(item->text())[0]) { item->setText(symbol.textSybmol); needUpdate = 1; } + break; } if(needUpdate) { - item->setTextColor(Qt::black); - if(view1DTextColorFlag) + if(view1DTextInterpretationMode==2) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -558,19 +570,15 @@ view3DTools = new View3DTools(this); connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int))); - view2DTextColorFlag = 0; view2DTextInterpretationMode = 0; view2DTextTools = new View2DTextTools(this); connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int))); - connect(view2DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView2DColor(bool))); connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int))); - view1DTextColorFlag = 0; view1DTextInterpretationMode = 0; view1DTextTools = new View1DTextTools(this); - connect(view1DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView1DColor(bool))); connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int))); connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear())); } @@ -677,24 +685,12 @@ repaint(); } -void simulationWindow::GridView2DColor(bool flag) -{ - view2DTextColorFlag = flag; - update2DTable(1); -} - void simulationWindow::GrigView2DInterpretationMode(int mode) { view2DTextInterpretationMode = mode; update2DTable(1); } -void simulationWindow::GridView1DColor(bool flag) -{ - view1DTextColorFlag = flag; - update1DTable(1); -} - void simulationWindow::GrigView1DInterpretationMode(int mode) { view1DTextInterpretationMode = mode; @@ -748,10 +744,10 @@ renderer->setSymbolColor(row, color); renderer->repaint(); - if(view1DTextColorFlag) + if(view1DTextInterpretationMode==2) table1DUpdateRequest = 2; - if(view2DTextColorFlag) + if(view2DTextInterpretationMode==2) table2DUpdateRequest = 2; graph2DUpdateRequest = 1; @@ -802,27 +798,28 @@ changeSymbol(column, row, z_plane); item = table2D->item(row, column); symbol = renderer->getSymbol(selectedSymbol); - if(view2DTextInterpretationMode==0) + switch(view2DTextInterpretationMode) { + case 2: + case 0: tmpString.setNum(selectedSymbol); if(item->text()!=tmpString) { item->setText(tmpString); needUpdate = 1; } - } - else - { + break; + case 1: if(symbol.textSybmol!=(item->text())[0]) { item->setText(symbol.textSybmol); needUpdate = 1; } + break; } if(needUpdate) { - item->setTextColor(Qt::black); - if(view2DTextColorFlag) + if(view2DTextInterpretationMode==2) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); @@ -848,27 +845,30 @@ changeSymbol(column, 0, 0); item = table1D->item(0, column); symbol = renderer->getSymbol(selectedSymbol); - if(view1DTextInterpretationMode==0) + + switch(view1DTextInterpretationMode) { + case 2: + case 0: tmpString.setNum(selectedSymbol); if(item->text()!=tmpString) { item->setText(tmpString); needUpdate = 1; } - } - else - { + break; + case 1: if(symbol.textSybmol!=(item->text())[0]) { item->setText(symbol.textSybmol); needUpdate = 1; } + break; } + if(needUpdate) { - item->setTextColor(Qt::black); - if(view1DTextColorFlag) + if(view1DTextInterpretationMode==2) { item->setBackgroundColor(symbol.color); item->setTextColor(symbol.textColor); Modified: trunk/qcell/basesources/view1dtexttools.cpp =================================================================== --- trunk/qcell/basesources/view1dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/basesources/view1dtexttools.cpp 2007-01-14 10:28:05 UTC (rev 163) @@ -21,16 +21,21 @@ void View1DTextTools::ColorsClick(void) { - if(ui.ColorsButton->isChecked()) - emit colorsEnabled(1); - else - emit colorsEnabled(0); + ui.ValuesButton->setChecked(0); + ui.SymbolsButton->setChecked(0); + ui.ColorsButton->setChecked(1); + if(textMode!=2) + { + textMode = 2; + emit viewModeChenged(2); + } } void View1DTextTools::ValuesClick(void) { ui.ValuesButton->setChecked(1); ui.SymbolsButton->setChecked(0); + ui.ColorsButton->setChecked(0); if(textMode!=0) { textMode = 0; @@ -42,6 +47,7 @@ { ui.ValuesButton->setChecked(0); ui.SymbolsButton->setChecked(1); + ui.ColorsButton->setChecked(0); if(textMode!=1) { textMode = 1; Modified: trunk/qcell/basesources/view2dtexttools.cpp =================================================================== --- trunk/qcell/basesources/view2dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162) +++ trunk/qcell/basesources/view2dtexttools.cpp 2007-01-14 10:28:05 UTC (rev 163) @@ -41,16 +41,21 @@ void View2DTextTools::ColorsClick(void) { - if(ui.ColorsButton->isChecked()) - emit colorsEnabled(1); - else - emit colorsEnabled(0); + ui.ValuesButton->setChecked(0); + ui.SymbolsButton->setChecked(0); + ui.ColorsButton->setChecked(1); + if(textMode!=2) + { + textMode = 2; + emit viewModeChenged(2); + } } void View2DTextTools::ValuesClick(void) { ui.ValuesButton->setChecked(1); ui.SymbolsButton->setChecked(0); + ui.ColorsButton->setChecked(0); if(textMode!=0) { textMode = 0; @@ -62,6 +67,7 @@ { ui.ValuesButton->setChecked(0); ui.SymbolsButton->setChecked(1); + ui.ColorsButton->setChecked(0); if(textMode!=1) { textMode = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-14 16:11:20
|
Revision: 168 http://svn.sourceforge.net/qcell/?rev=168&view=rev Author: lessm Date: 2007-01-14 08:11:11 -0800 (Sun, 14 Jan 2007) Log Message: ----------- - 3D view have select mode - 3D view have multiselect mode 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-01-14 14:47:03 UTC (rev 167) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-14 16:11:11 UTC (rev 168) @@ -14,6 +14,8 @@ #include <QPixmap> #include <QChar> +#define SELECT_BUFFER_SIZE 64000 + struct SYMBOL { bool hide; @@ -43,21 +45,42 @@ GLuint generateBox(void); void generateGreed(void); + int cursor_x, cursor_y; + QImage render1D(void); QImage render2D(int zval=0); QImage render3D(void); CalculationData storage; + Qt::MouseButtons mouseButtons; + bool selectionMode; + GLuint numberOfSelectetObject; + GLuint selectBuffer[SELECT_BUFFER_SIZE]; + QVector<int> selectetObjects; + + int selectRect[4]; + bool showSelectRect; + protected: void initializeGL(); void paintGL(); void resizeGL(int width, int height); + virtual void mousePressEvent(QMouseEvent * event); + virtual void mouseReleaseEvent(QMouseEvent * event); + virtual void mouseMoveEvent(QMouseEvent * event); + virtual void wheelEvent(QWheelEvent * event); + void executeSelect(int x, int y, int width=1, int height=1); + public: Renderer(QWidget *parent); ~Renderer(); + + void 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); @@ -67,7 +90,7 @@ 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(void); + void render(bool renderGreed=1); QImage renderToQImage(int zplane=-1); void renderToPixmap(QPixmap *pixmap, int zval); bool setSymbolColor(int index, QColor color); @@ -92,8 +115,8 @@ CalculationData * getStorage(void); - void setOrtoPerspective(void); - void setRealPerspective(void); + void setOrtoPerspective(bool noClear=1); + void setRealPerspective(bool noClear=1); protected slots: void resizeDataEvent(void); Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-14 14:47:03 UTC (rev 167) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-14 16:11:11 UTC (rev 168) @@ -246,20 +246,116 @@ glRotatef(rotation[2], 0.0f, 0.0f, 1.0f); render(); + if(showSelectRect) + drawRect(selectRect[0], selectRect[1], selectRect[2], selectRect[3]); } - void Renderer::resizeGL(int width, int height) - { +void Renderer::resizeGL(int width, int height) +{ glViewport(0, 0, width, height); - + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); if(corectPerspective) setRealPerspective(); else - setOrtoPerspective(); + setOrtoPerspective(); +} - - } +void Renderer::mousePressEvent(QMouseEvent * event) +{ + mouseButtons = event->buttons(); + cursor_x = event->x(); + cursor_y = event->y(); +} +void Renderer::mouseReleaseEvent(QMouseEvent * event) +{ + if(showSelectRect) + { + multiSelect(abs((selectRect[0] + selectRect[2])/2), abs((selectRect[1] + selectRect[3])/2), abs(selectRect[0] - selectRect[2]), abs(selectRect[1] - selectRect[3])); + } + else + if(mouseButtons==Qt::LeftButton) + { + selectOne(event->x(), event->y()); + } + showSelectRect = 0; + repaint(); +} + +void Renderer::mouseMoveEvent(QMouseEvent * event) +{ + showSelectRect = 0; + if(event->buttons()==(Qt::LeftButton | Qt::RightButton)) + { + 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(); +} + +void Renderer::wheelEvent(QWheelEvent * event) +{ + translateZ((float)event->delta()/100.0f); + updateGL(); +} + + void Renderer::executeSelect(int x, int y, int width, int height) +{ + GLint viewport[4]; + glSelectBuffer(SELECT_BUFFER_SIZE, selectBuffer); + glRenderMode(GL_SELECT); + glInitNames(); + glPushName(0); + selectionMode = 1; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + glGetIntegerv(GL_VIEWPORT, viewport); + + gluPickMatrix((GLdouble)x, (GLdouble)(viewport[3]-y), width, height, viewport); + + if(corectPerspective) + setRealPerspective(); + else + setOrtoPerspective(); + glMatrixMode(GL_MODELVIEW); + render(0); + + numberOfSelectetObject = glRenderMode(GL_RENDER); + + selectionMode = 0; + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if(corectPerspective) + setRealPerspective(); + else + setOrtoPerspective(); +} + + + Renderer::Renderer(QWidget *parent) : QGLWidget(parent) { discretValues = 1; @@ -284,7 +380,13 @@ greed = 0; corectPerspective = 1; + connect(&storage, SIGNAL(dataResized()), SLOT(resizeDataEvent())); + + selectionMode = 0; + numberOfSelectetObject = 0; + selectetObjects.clear(); + showSelectRect = 0; } Renderer::~Renderer() @@ -307,6 +409,81 @@ delete imageBuffer; imageBuffer = NULL; } + +void Renderer::selectOne(int x, int y) +{ + unsigned int minVal = 0xffffffff; + int minValIndex = -1; + executeSelect(x, y, 1, 1); + selectetObjects.clear(); + for(unsigned int i=0;i<numberOfSelectetObject * 4; i+=4) + { + if(minVal>selectBuffer[i + 1]) + { + minVal = selectBuffer[i + 1]; + minValIndex = selectBuffer[i + 3]; + } + } + if(minValIndex!=1) + { + selectetObjects<<minValIndex; + updateGL(); + } +} + +void Renderer::multiSelect(int x, int y, int width, int height) +{ + executeSelect(x, y, width, height); + selectetObjects.clear(); + for(unsigned int i=0;i<numberOfSelectetObject * 4; i+=4) + selectetObjects<<selectBuffer[i + 3]; + + if(numberOfSelectetObject>0) + updateGL(); +} +void Renderer::drawRect(int x1, int y1, int x2, int y2) +{ + GLint viewport[4]; + glDisable(GL_LIGHTING); + glDisable(GL_DEPTH_TEST); + glGetIntegerv(GL_VIEWPORT, viewport); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + + gluOrtho2D(0, viewport[2], viewport[3], 0); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glColor3f(0.0f, 1.0f, 0.0f); + + glBegin(GL_LINE_LOOP); + glVertex2i(x1, y1); + glVertex2i(x2, y1); + glVertex2i(x2, y2); + glVertex2i(x1, y2); + glVertex2i(x1, y1); + glEnd(); + + /* + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if(corectPerspective) + setRealPerspective(); + else + setOrtoPerspective(); + */ + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + /* void Renderer::setDataType(baseDataTypes::DATA_TYPES type) { @@ -424,13 +601,18 @@ return 0; } */ -void Renderer::render(void) +void Renderer::render(bool renderGreed) { int counter = 0, index; + bool selectTest; float mx = -(float)storage.getSizeX(), my = -(float)storage.getSizeY(), mz = -(float)storage.getSizeZ(); - glDisable(GL_LIGHTING); - glCallList(greed); - glEnable(GL_LIGHTING); + if(renderGreed) + { + glDisable(GL_LIGHTING); + glCallList(greed); + glEnable(GL_LIGHTING); + } + SYMBOL symbol; for(int z=0;z<storage.getSizeZ();++z) { for(int y=storage.getSizeY();y>0;--y) @@ -438,18 +620,69 @@ for(int x=0;x<storage.getSizeX();++x) { - index = storage.getValueAt_i(counter++); + index = storage.getValueAt_i(counter); if(index>=symbolsMap.size()) index = symbolsMap.size() - 1; + + symbol = symbolsMap[index]; + if(!(symbolsMap[index].hide)) { + if(selectionMode) + glLoadName(counter); + glPushMatrix(); glTranslatef(mx + (float)x * 2.0f , my + (float)y * 2.0f, mz + (float)z * 2.0f); - glMaterialfv(GL_FRONT, GL_DIFFUSE, symbolsMap[index].floatColorDiffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, symbolsMap[index].floatColorSpectacular); - glCallList(primitives[symbolsMap[index].primitiveID]); + + glMaterialfv(GL_FRONT, GL_DIFFUSE, symbol.floatColorDiffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, symbol.floatColorSpectacular); + + selectTest = 0; + /* + if(!selectionMode) + { + if(selectetObjects.contains(counter)) + { + glEnable(GL_NORMALIZE); + glPushMatrix(); + glScalef(0.8f, 0.8f, 0.8f); + glEnable(GL_COLOR_MATERIAL); + glDisable(GL_LIGHTING); + glPolygonMode(GL_FRONT, GL_LINE); + glColor3b((char)symbol.textColor.red(), (char)symbol.textColor.green(), (char)symbol.textColor.blue()); + glCallList(primitives[symbol.primitiveID]); + glPolygonMode(GL_FRONT, GL_FILL); + glEnable(GL_LIGHTING); + glDisable(GL_COLOR_MATERIAL); + glPopMatrix(); + glDisable(GL_NORMALIZE); + selectTest = 1; + } + }*/ + + if(!selectionMode) + { + if(selectetObjects.contains(counter)) + { + glPolygonMode(GL_FRONT, GL_LINE); + glCallList(primitives[symbol.primitiveID]); + glPolygonMode(GL_FRONT, GL_FILL); + glEnable(GL_NORMALIZE); + glPushMatrix(); + glScalef(0.8f, 0.8f, 0.8f); + glCallList(primitives[symbol.primitiveID]); + glPopMatrix(); + glDisable(GL_NORMALIZE); + } + else + glCallList(primitives[symbol.primitiveID]); + } + else + glCallList(primitives[symbol.primitiveID]); + glPopMatrix(); } + ++counter; } } } @@ -635,20 +868,22 @@ setOrtoPerspective(); } -void Renderer::setOrtoPerspective(void) +void Renderer::setOrtoPerspective(bool noClear) { float aspect = (float)width()/(float)height(); glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + if(!noClear) + glLoadIdentity(); glOrtho((-(double)storage.getSizeX() - 20.0) * aspect, ((double)storage.getSizeX() + 20.0) * aspect, -(double)storage.getSizeY() - 20.0 , (double)storage.getSizeY() + 20.0, 0.0, 500.0); glMatrixMode(GL_MODELVIEW); corectPerspective = 0; } -void Renderer::setRealPerspective(void) +void Renderer::setRealPerspective(bool noClear) { glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + if(!noClear) + glLoadIdentity(); gluPerspective(75.0f, (GLdouble)width() / (GLdouble)height(), 0.1f, 500.0f); glMatrixMode(GL_MODELVIEW); corectPerspective = 1; Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 14:47:03 UTC (rev 167) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 16:11:11 UTC (rev 168) @@ -2,6 +2,7 @@ void simulationWindow::mouseMoveEvent(QMouseEvent * event) { + /* if(ui.view3D->isVisible()) { if(event->buttons()==(Qt::LeftButton | Qt::RightButton)) @@ -21,16 +22,11 @@ cursor_y = event->y(); renderer->updateGL(); } + */ } void simulationWindow::wheelEvent(QWheelEvent * event) { - if(ui.view3D->isVisible()) - { - renderer->translateZ((float)event->delta()/100.0f); - renderer->updateGL(); - } - if(ui.view2DGraph->isVisible()) { //if(ui.view2DGraph->isVisible()) @@ -73,11 +69,8 @@ void simulationWindow::mousePressEvent(QMouseEvent * event) { - //if(ui.view3D->isVisible()) - //{ - cursor_x = event->x(); - cursor_y = event->y(); - //} + cursor_x = event->x(); + cursor_y = event->y(); } void simulationWindow::resizeEvent(QResizeEvent * event) @@ -122,6 +115,7 @@ else view3DTools->hide(); + if(ui.view2D->isVisible()) { view2DTextTools->show(); @@ -624,11 +618,17 @@ switch(renderer->getStorage()->getDimension()) { case 1: - update1DTable(); - update1DTableMem(); + if(ui.view3D->isVisible()) + { + update1DTable(); + update1DTableMem(); + } + else + table1DUpdateRequest = 1; break; case 3: - renderer->repaint(); + if(ui.view3D->isVisible()) + renderer->repaint(); case 2: if(ui.view2D->isVisible()) @@ -777,11 +777,11 @@ switch(mode) { case 0: - renderer->setRealPerspective(); + renderer->setRealPerspective(0); renderer->repaint(); break; case 1: - renderer->setOrtoPerspective(); + renderer->setOrtoPerspective(0); renderer->repaint(); break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-15 01:42:50
|
Revision: 171 http://svn.sourceforge.net/qcell/?rev=171&view=rev Author: lessm Date: 2007-01-14 17:42:48 -0800 (Sun, 14 Jan 2007) Log Message: ----------- - Local Observer added Modified Paths: -------------- trunk/qcell/baseheaders/CalculationData.h trunk/qcell/baseheaders/Renderer.h trunk/qcell/baseheaders/basetools.h trunk/qcell/baseheaders/basetools.ui trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/baseheaders/view3dtools.ui trunk/qcell/basesources/CalculationData.cpp trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/basetools.cpp trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/CalculationData.h =================================================================== --- trunk/qcell/baseheaders/CalculationData.h 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/CalculationData.h 2007-01-15 01:42:48 UTC (rev 171) @@ -28,6 +28,7 @@ public: CalculationData(); + CalculationData(CalculationData &cData); ~CalculationData(); int getValueAt_i(int x); @@ -74,7 +75,7 @@ /*const*/ char *getDataPointer(void); void fillData(char *dataPointer); - void setForeignDataPointer(char *dataPointer); + void setForeignDataPointer(char *dataPointer, bool silent=0); QString createXmlHeader(void); bool setFromXmlString(QString *xmlString); Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-15 01:42:48 UTC (rev 171) @@ -118,8 +118,15 @@ void setOrtoPerspective(bool noClear=1); void setRealPerspective(bool noClear=1); + void fillSelected(int value); + + QVector<int> getSelectedCoord(void); + protected slots: void resizeDataEvent(void); + +signals: + void objectSelected(int x, int y, int z); }; #endif Modified: trunk/qcell/baseheaders/basetools.h =================================================================== --- trunk/qcell/baseheaders/basetools.h 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/basetools.h 2007-01-15 01:42:48 UTC (rev 171) @@ -22,6 +22,8 @@ protected slots: void modeChangeSelect(void); void modeChangeEdit(void); + void modeChangeGlobalView(void); + void modeChangeLocalView(void); void commandCopy(void); void commandPaste(void); void commandFill(void); Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/basetools.ui 2007-01-15 01:42:48 UTC (rev 171) @@ -6,41 +6,51 @@ <x>0</x> <y>0</y> <width>102</width> - <height>300</height> + <height>375</height> </rect> </property> <property name="windowTitle" > <string>BaseTools</string> </property> - <widget class="QGroupBox" name="groupBox" > + <widget class="QGroupBox" name="EditToolsGroup" > <property name="geometry" > <rect> <x>1</x> - <y>0</y> + <y>140</y> <width>100</width> - <height>71</height> + <height>91</height> </rect> </property> <property name="title" > - <string>Edit Mode</string> + <string>Edit Tools</string> </property> - <widget class="QToolButton" name="ModeEditButton" > + <widget class="QToolButton" name="FillButton" > <property name="geometry" > <rect> <x>10</x> + <y>60</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Fill</string> + </property> + </widget> + <widget class="QToolButton" name="PasteButton" > + <property name="geometry" > + <rect> + <x>10</x> <y>40</y> <width>81</width> <height>20</height> </rect> </property> <property name="text" > - <string>Edit</string> + <string>Paste</string> </property> - <property name="checkable" > - <bool>true</bool> - </property> </widget> - <widget class="QToolButton" name="ModeSelectButton" > + <widget class="QToolButton" name="CopyButton" > <property name="geometry" > <rect> <x>10</x> @@ -50,42 +60,46 @@ </rect> </property> <property name="text" > - <string>Select</string> + <string>Copy</string> </property> - <property name="checkable" > - <bool>true</bool> - </property> - <property name="checked" > - <bool>true</bool> - </property> </widget> </widget> - <widget class="QGroupBox" name="groupBox_2" > + <widget class="QGroupBox" name="ValuesGroup" > <property name="geometry" > <rect> <x>1</x> - <y>70</y> + <y>240</y> <width>100</width> - <height>91</height> + <height>131</height> </rect> </property> <property name="title" > - <string>Edit Tools</string> + <string>Values</string> </property> - <widget class="QToolButton" name="FillButton" > + <widget class="QTableWidget" name="valueTable" > <property name="geometry" > <rect> - <x>10</x> - <y>60</y> - <width>81</width> - <height>20</height> + <x>5</x> + <y>20</y> + <width>90</width> + <height>101</height> </rect> </property> - <property name="text" > - <string>Fill</string> - </property> </widget> - <widget class="QToolButton" name="PasteButton" > + </widget> + <widget class="QGroupBox" name="ViewModeGroup" > + <property name="geometry" > + <rect> + <x>1</x> + <y>0</y> + <width>100</width> + <height>71</height> + </rect> + </property> + <property name="title" > + <string>View Mode</string> + </property> + <widget class="QToolButton" name="LocalViewButton" > <property name="geometry" > <rect> <x>10</x> @@ -95,10 +109,13 @@ </rect> </property> <property name="text" > - <string>Paste</string> + <string>Local</string> </property> + <property name="checkable" > + <bool>true</bool> + </property> </widget> - <widget class="QToolButton" name="CopyButton" > + <widget class="QToolButton" name="GlobalVievButton" > <property name="geometry" > <rect> <x>10</x> @@ -108,31 +125,62 @@ </rect> </property> <property name="text" > - <string>Copy</string> + <string>Global</string> </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> </widget> </widget> - <widget class="QGroupBox" name="groupBox_3" > + <widget class="QGroupBox" name="EditModeGroup" > <property name="geometry" > <rect> <x>1</x> - <y>160</y> + <y>70</y> <width>100</width> - <height>131</height> + <height>71</height> </rect> </property> <property name="title" > - <string>Values</string> + <string>Edit Mode</string> </property> - <widget class="QTableWidget" name="valueTable" > + <widget class="QToolButton" name="ModeEditButton" > <property name="geometry" > <rect> - <x>5</x> + <x>10</x> + <y>40</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Edit</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + </widget> + <widget class="QToolButton" name="ModeSelectButton" > + <property name="geometry" > + <rect> + <x>10</x> <y>20</y> - <width>90</width> - <height>101</height> + <width>81</width> + <height>20</height> </rect> </property> + <property name="text" > + <string>Select</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> + <property name="checked" > + <bool>true</bool> + </property> </widget> </widget> </widget> Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-15 01:42:48 UTC (rev 171) @@ -18,6 +18,7 @@ #include "view3dtools.h" #include "view2dtexttools.h" #include "view1dtexttools.h" +#include "math.h" #include <QToolBox> @@ -61,13 +62,21 @@ int selectedSymbol, workMode; + QVector<CalculationData> loclaViewMemory; + QVector<int> localObserverPosition; + int cycleTable, maxTime, usedSpace; + char *storeCurentTable; + CalculationData localView; + bool localViewFlag; + virtual void mouseMoveEvent(QMouseEvent * event); virtual void mousePressEvent(QMouseEvent * event); virtual void wheelEvent(QWheelEvent * event); virtual void resizeEvent(QResizeEvent * event); virtual void paintEvent(QPaintEvent * event); - + void localViewReinterprete(void); + int calculateDistans(int x, int y, int z, bool box=1); protected: void update2DTable(bool forceUpdate=0); @@ -108,11 +117,15 @@ void workModeChange(int mode); void selectSymbol(int index); -signals: - void progressUpdate(int val); + void commandExecute(int cmd); + void view3DselectedObject(int x, int y, int z); +//signals: +// void progressUpdate(int val); + + }; #endif // SIMULATIONWINDOW_H Modified: trunk/qcell/baseheaders/view3dtools.ui =================================================================== --- trunk/qcell/baseheaders/view3dtools.ui 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/baseheaders/view3dtools.ui 2007-01-15 01:42:48 UTC (rev 171) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>102</width> - <height>80</height> + <height>76</height> </rect> </property> <property name="windowTitle" > Modified: trunk/qcell/basesources/CalculationData.cpp =================================================================== --- trunk/qcell/basesources/CalculationData.cpp 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/basesources/CalculationData.cpp 2007-01-15 01:42:48 UTC (rev 171) @@ -54,6 +54,18 @@ haveForeignDataPointer = 0; } +CalculationData::CalculationData(CalculationData &cData) +{ + dataType = baseDataTypes::CHAR; + sizeX = sizeY = sizeZ = sizeT = 0; + dimension = -1; + dataSize = sizeof(char); + data = NULL; + haveForeignDataPointer = 0; + + *this = cData; +} + CalculationData::~CalculationData() { dataType = baseDataTypes::NONE; @@ -713,12 +725,13 @@ } } -void CalculationData::setForeignDataPointer(char *dataPointer) +void CalculationData::setForeignDataPointer(char *dataPointer, bool silent) { clearData(); data = dataPointer; haveForeignDataPointer = 1; - emit dataUpdated(); + if(!silent) + emit dataUpdated(); } QString CalculationData::createXmlHeader(void) Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-15 01:42:48 UTC (rev 171) @@ -278,6 +278,12 @@ if(mouseButtons==Qt::LeftButton) { selectOne(event->x(), event->y()); + if(selectetObjects.size()>0) + { + QVector<int> sCoord = getSelectedCoord(); + emit objectSelected(sCoord[0], sCoord[1], sCoord[2]); + } + } showSelectRect = 0; repaint(); @@ -888,3 +894,34 @@ glMatrixMode(GL_MODELVIEW); corectPerspective = 1; } + +void Renderer::fillSelected(int value) +{ + for(int i=0;i<selectetObjects.size();++i) + getStorage()->setValueAt(value, selectetObjects[i]); + repaint(); +} + +QVector<int> Renderer::getSelectedCoord(void) +{ + int x=0, y=0, z=0, index; + QVector<int> out; + if(selectetObjects.size()==0) + return out; + + out.resize(3); + index = selectetObjects[0]; + + out[0] = index % getStorage()->getSizeX(); + index /= getStorage()->getSizeX(); + if(index<getStorage()->getSizeY()) + { + out[1] = index; + return out; + } + out[1] = index % getStorage()->getSizeY(); + index /= getStorage()->getSizeY(); + + out[2] = index; + return out; +} Modified: trunk/qcell/basesources/basetools.cpp =================================================================== --- trunk/qcell/basesources/basetools.cpp 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/basesources/basetools.cpp 2007-01-15 01:42:48 UTC (rev 171) @@ -7,11 +7,15 @@ editMode = 0; connect(ui.CopyButton, SIGNAL(clicked(bool)), SLOT(commandCopy())); connect(ui.PasteButton, SIGNAL(clicked(bool)), SLOT(commandPaste())); - connect(ui.PasteButton, SIGNAL(clicked(bool)), SLOT(commandFill())); + connect(ui.FillButton, SIGNAL(clicked(bool)), SLOT(commandFill())); connect(ui.ModeSelectButton, SIGNAL(clicked(bool)), SLOT(modeChangeSelect())); connect(ui.ModeEditButton, SIGNAL(clicked(bool)), SLOT(modeChangeEdit())); + + connect(ui.GlobalVievButton, SIGNAL(clicked(bool)), SLOT(modeChangeGlobalView())); + connect(ui.LocalViewButton, SIGNAL(clicked(bool)), SLOT(modeChangeLocalView())); + connect(ui.valueTable, SIGNAL(cellClicked(int, int)), SLOT(updateSelectedSymbol(int, int))); } @@ -47,6 +51,44 @@ } } +void BaseTools::modeChangeGlobalView(void) +{ + ui.GlobalVievButton->setChecked(1); + ui.LocalViewButton->setChecked(0); + ui.EditModeGroup->show(); + ui.EditToolsGroup->show(); + ui.ValuesGroup->show(); + if(editMode!=2) + { + editMode=2; + emit toolsModeUpdate(2); + if(ui.ModeEditButton->isChecked()) + { + emit toolsModeUpdate(1); + editMode = 1; + } + else + { + emit toolsModeUpdate(0); + editMode = 0; + } + } +} + +void BaseTools::modeChangeLocalView(void) +{ + ui.GlobalVievButton->setChecked(0); + ui.LocalViewButton->setChecked(1); + ui.EditModeGroup->hide(); + ui.EditToolsGroup->hide(); + ui.ValuesGroup->hide(); + if(editMode!=3) + { + editMode=3; + emit toolsModeUpdate(3); + } +} + void BaseTools::commandCopy(void) { emit command(0); Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 22:26:29 UTC (rev 170) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 01:42:48 UTC (rev 171) @@ -104,6 +104,8 @@ view2DTextTools->move(width() - 101, basetools->height() + 1); view1DTextTools->move(width() - 101, basetools->height() + 1); + + } void simulationWindow::paintEvent(QPaintEvent * event) @@ -172,6 +174,71 @@ } } +void simulationWindow::localViewReinterprete(void) +{ + int dist, index; + switch(getStorage()->getDimension()) + { + case 1: + for(int x=0;x<getStorage()->getSizeX();++x) + { + dist = calculateDistans(x, 0, 0); + index = (cycleTable - dist); + while(index<0) + index += maxTime; + if(usedSpace<dist) + localView.setValueAt(0, x); + else + localView.setValueAt(loclaViewMemory[index].getValueAt_i(x), x); + } + + break; + case 2: + for(int y=0;y<getStorage()->getSizeY();++y) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + dist = calculateDistans(x, y, 0); + index = (cycleTable - dist); + while(index<0) + index += maxTime; + if(usedSpace<dist) + localView.setValueAt(0, x, y); + else + localView.setValueAt(loclaViewMemory[index].getValueAt_i(x, y), x, y); + } + } + break; + case 3: + for(int z=0;z<getStorage()->getSizeZ();++z) + { + for(int y=0;y<getStorage()->getSizeY();++y) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + dist = calculateDistans(x, y, z); + index = (cycleTable - dist); + while(index<0) + index += maxTime; + if(usedSpace<dist) + localView.setValueAt(0, x, y, z); + else + localView.setValueAt(loclaViewMemory[index].getValueAt_i(x, y, z), x, y, z); + } + } + } + break; + } +} + +int simulationWindow::calculateDistans(int x, int y, int z, bool box) +{ + if(box) + return max(max(max(x, localObserverPosition[0]), max(y, localObserverPosition[1])), max(z, localObserverPosition[2])); + else + return sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2]))); +} + void simulationWindow::update2DTable(bool forceUpdate) { bool showProgres=0; @@ -533,7 +600,7 @@ table2D = new QTableWidget(ui.view2D); - connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest())); + bool ret = connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest())); connect(renderer->getStorage(), SIGNAL(dataResized()), SLOT(dataResizeRequest())); @@ -575,6 +642,16 @@ connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int))); connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear())); + + connect(basetools, SIGNAL(command(int)), SLOT(commandExecute(int))); + + localObserverPosition.resize(3); + maxTime = 0; + cycleTable = 0; + usedSpace = 0; + localViewFlag = 0; + + connect(renderer, SIGNAL(objectSelected(int, int, int)), SLOT(view3DselectedObject(int, int, int))); } simulationWindow::~simulationWindow() @@ -615,6 +692,25 @@ void simulationWindow::dataUpdateRequest(void) { + //********** this part is for local view ************************ + if(localViewFlag) + { + if(usedSpace<maxTime) + { + usedSpace++; + cycleTable = usedSpace % maxTime; + } + else + ++cycleTable %= maxTime; + + loclaViewMemory[cycleTable] = *getStorage(); + localViewReinterprete(); + storeCurentTable = getStorage()->getDataPointer(); + getStorage()->setForeignDataPointer(localView.getDataPointer(), 1); + } + + //*************************************************************** + switch(renderer->getStorage()->getDimension()) { case 1: @@ -645,6 +741,7 @@ graph2DUpdateRequest = 1; break; } + //****************************************** } void simulationWindow::dataResizeRequest(void) @@ -657,6 +754,10 @@ ui.tabWidget->setTabEnabled(2, 0); ui.tabWidget->setTabEnabled(3, 1); table1DUpdateRequest = 2; + maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX())); + //maxTime = getStorage()->getSizeX() + 1; + loclaViewMemory.resize(maxTime); + break; case 2: @@ -668,6 +769,9 @@ graph2DUpdateRequest = 1; view2DTextTools->setZPlaneMax(0); view2DTextTools->Pure2DMode(1); + maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX()) + (float)(getStorage()->getSizeY() * getStorage()->getSizeY())); + //maxTime = max(getStorage()->getSizeX(), getStorage()->getSizeY()) + 1; + loclaViewMemory.resize(maxTime); break; @@ -680,8 +784,26 @@ graph2DUpdateRequest = 1; view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1); view2DTextTools->Pure2DMode(0); + maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX()) + (float)(getStorage()->getSizeY() * getStorage()->getSizeY()) + (float)(getStorage()->getSizeZ() * getStorage()->getSizeZ())); + //maxTime = max(getStorage()->getSizeZ(), max(getStorage()->getSizeX(), getStorage()->getSizeY())) + 1; + loclaViewMemory.resize(maxTime); break; } + //********** this part is for local view ************************ + usedSpace = 0; + localView = *getStorage(); + cycleTable = 0; + localObserverPosition[0] = 0; + localObserverPosition[1] = 0; + localObserverPosition[2] = 0; + if(localViewFlag) + { + loclaViewMemory[0] = *getStorage(); + localViewReinterprete(); + storeCurentTable = getStorage()->getDataPointer(); + getStorage()->setForeignDataPointer(localView.getDataPointer(), 1); + } + //**************************************************** repaint(); } @@ -832,6 +954,16 @@ } graph2DUpdateRequest = 1; } + + if(workMode==3) + { + localObserverPosition[0] = column; + localObserverPosition[1] = row; + localObserverPosition[2] = z_plane; + localViewReinterprete(); + update2DTable(); + graph2DUpdateRequest = 1; + } } void simulationWindow::GridView1DEdit(int row, int column) @@ -885,6 +1017,40 @@ void simulationWindow::workModeChange(int mode) { workMode = mode; + if(mode>1) + { + if(mode==3) + { + loclaViewMemory[cycleTable] = *getStorage(); + storeCurentTable = getStorage()->getDataPointer(); + localViewReinterprete(); + getStorage()->setForeignDataPointer(localView.getDataPointer(), 1); + localViewFlag = 1; + } + if(mode==2) + { + getStorage()->setForeignDataPointer(storeCurentTable, 1); + localViewFlag = 0; + } + + if(ui.view3D->isVisible()) + renderer->repaint(); + + if(ui.view2D->isVisible()) + update2DTable(); + else + table2DUpdateRequest = 1; + + if(ui.view2DGraph->isVisible()) + update2DGraph(); + else + graph2DUpdateRequest = 1; + + if(ui.view1D->isVisible()) + update1DTable(); + else + table1DUpdateRequest = 1; + } } void simulationWindow::selectSymbol(int index) @@ -892,3 +1058,50 @@ selectedSymbol = index; } +void simulationWindow::commandExecute(int cmd) +{ + QTableWidgetItem *item; + switch(cmd) + { + case 0: + break; + case 1: + break; + case 2: + if(workMode==0) + { + if(ui.view3D->isVisible()) + renderer->fillSelected(selectedSymbol); + if(ui.view2D->isVisible()) + { + for(int y=0;y<getStorage()->getSizeY();++y) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + item = table2D->item(y, x); + if(item->isSelected()) + { + getStorage()->setValueAt(selectedSymbol, x, y, z_plane); + } + } + } + update2DTable(); + } + } + break; + } +} + +void simulationWindow::view3DselectedObject(int x, int y, int z) +{ + if(workMode==3) + { + localObserverPosition[0] = x; + localObserverPosition[1] = y; + localObserverPosition[2] = z; + localViewReinterprete(); + table2DUpdateRequest = 1; + graph2DUpdateRequest = 1; + renderer->repaint(); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhu...@us...> - 2007-01-15 06:32:36
|
Revision: 172 http://svn.sourceforge.net/qcell/?rev=172&view=rev Author: dhubleizh Date: 2007-01-14 22:32:33 -0800 (Sun, 14 Jan 2007) Log Message: ----------- - layout for buttons in SymbolConfiguration Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-15 01:42:48 UTC (rev 171) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-15 06:32:33 UTC (rev 172) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>513</width> - <height>301</height> + <width>400</width> + <height>300</height> </rect> </property> <property name="sizePolicy" > @@ -25,8 +25,8 @@ <rect> <x>10</x> <y>10</y> - <width>490</width> - <height>283</height> + <width>251</width> + <height>78</height> </rect> </property> <property name="tabPosition" > @@ -62,32 +62,51 @@ <attribute name="title" > <string>Symbols Configuration</string> </attribute> - <widget class="QPushButton" name="addSymbol" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>75</width> - <height>23</height> - </rect> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>9</number> </property> - <property name="text" > - <string>Add Symbol</string> + <property name="spacing" > + <number>6</number> </property> - </widget> - <widget class="QPushButton" name="removeSymbol" > - <property name="geometry" > - <rect> - <x>80</x> - <y>0</y> - <width>84</width> - <height>23</height> - </rect> - </property> - <property name="text" > - <string>Remove Symbol</string> - </property> - </widget> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QPushButton" name="addSymbol" > + <property name="text" > + <string>Add Symbol</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="removeSymbol" > + <property name="text" > + <string>Remove Symbol</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> </widget> </widget> </widget> Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 01:42:48 UTC (rev 171) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 06:32:33 UTC (rev 172) @@ -590,6 +590,7 @@ table1DMem = new QTableWidget(ui.view1D); symbolTable = new QTableWidget(ui.symbolConfig); + ui.symbolConfig->layout()->addWidget(symbolTable); symbolTable->setColumnCount(5); symbolTable->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Value"))); symbolTable->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Symbol"))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-15 09:11:51
|
Revision: 174 http://svn.sourceforge.net/qcell/?rev=174&view=rev Author: lessm Date: 2007-01-15 01:11:48 -0800 (Mon, 15 Jan 2007) Log Message: ----------- - Renderer have work mode Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-01-15 06:58:34 UTC (rev 173) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-15 09:11:48 UTC (rev 174) @@ -61,6 +61,8 @@ int selectRect[4]; bool showSelectRect; + int workMode; + int editValue; protected: void initializeGL(); @@ -122,6 +124,10 @@ QVector<int> getSelectedCoord(void); + void modeSelect(void); + void modeEdit(void); + void setEditValue(int value); + protected slots: void resizeDataEvent(void); Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-15 06:58:34 UTC (rev 173) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-15 09:11:48 UTC (rev 174) @@ -129,3 +129,4 @@ }; #endif // SIMULATIONWINDOW_H + Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-15 06:58:34 UTC (rev 173) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-15 09:11:48 UTC (rev 174) @@ -280,6 +280,8 @@ selectOne(event->x(), event->y()); if(selectetObjects.size()>0) { + if(workMode==1) + getStorage()->setValueAt(editValue, selectetObjects[0]); QVector<int> sCoord = getSelectedCoord(); emit objectSelected(sCoord[0], sCoord[1], sCoord[2]); } @@ -393,6 +395,8 @@ numberOfSelectetObject = 0; selectetObjects.clear(); showSelectRect = 0; + workMode = 0; + editValue = 0; } Renderer::~Renderer() @@ -925,3 +929,18 @@ out[2] = index; return out; } + +void Renderer::modeSelect(void) +{ + workMode = 0; +} + +void Renderer::modeEdit(void) +{ + workMode = 1; +} + +void Renderer::setEditValue(int value) +{ + editValue = value; +} Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 06:58:34 UTC (rev 173) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 09:11:48 UTC (rev 174) @@ -1018,6 +1018,10 @@ void simulationWindow::workModeChange(int mode) { workMode = mode; + if(mode==1) + renderer->modeEdit(); + if(mode==0) + renderer->modeSelect(); if(mode>1) { if(mode==3) @@ -1027,6 +1031,7 @@ localViewReinterprete(); getStorage()->setForeignDataPointer(localView.getDataPointer(), 1); localViewFlag = 1; + renderer->modeEdit(); } if(mode==2) { @@ -1057,6 +1062,7 @@ void simulationWindow::selectSymbol(int index) { selectedSymbol = index; + renderer->setEditValue(index); } void simulationWindow::commandExecute(int cmd) @@ -1106,3 +1112,4 @@ renderer->repaint(); } } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-15 16:41:35
|
Revision: 175 http://svn.sourceforge.net/qcell/?rev=175&view=rev Author: lessm Date: 2007-01-15 08:41:12 -0800 (Mon, 15 Jan 2007) Log Message: ----------- - all modes and views work properly(i think) Modified Paths: -------------- trunk/qcell/baseheaders/Renderer.h trunk/qcell/basesources/Renderer.cpp trunk/qcell/basesources/simulationwindow.cpp Added Paths: ----------- trunk/qcell/bin/observer.png Modified: trunk/qcell/baseheaders/Renderer.h =================================================================== --- trunk/qcell/baseheaders/Renderer.h 2007-01-15 09:11:48 UTC (rev 174) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-15 16:41:12 UTC (rev 175) @@ -38,12 +38,15 @@ QPainter painter; bool discretValues; bool corectPerspective; - QVector<GLuint> primitives; + QVector<GLuint> primitives; + GLuint observer; + GLuint observerTexture; QVector<double> rotation, translation; GLuint generateBox(void); void generateGreed(void); + void generateObserver(void); int cursor_x, cursor_y; @@ -63,7 +66,10 @@ bool showSelectRect; int workMode; int editValue; + bool showLocalObserver; + QVector<int> localObserverCoords; + protected: void initializeGL(); void paintGL(); @@ -80,7 +86,7 @@ Renderer(QWidget *parent); ~Renderer(); - void selectOne(int x, int y); + 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); /* @@ -128,6 +134,9 @@ void modeEdit(void); void setEditValue(int value); + void showObserver(bool flag); + void setObserverPosition(int x, int y, int z); + protected slots: void resizeDataEvent(void); Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-15 09:11:48 UTC (rev 174) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-15 16:41:12 UTC (rev 175) @@ -155,6 +155,37 @@ glEndList(); } +void Renderer::generateObserver(void) +{ + glEnable(GL_TEXTURE_2D); + observerTexture = bindTexture(QPixmap(QString("./observer.png")), 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); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + if(observer>0) + glDeleteLists(observer, 1); + observer = glGenLists(1); + glNewList(observer, GL_COMPILE); + + glBegin(GL_QUADS); + glTexCoord2f(0.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 0.0f); + glTexCoord2f(1.0f, 0.0f); + glVertex3f( 1.0f, -1.0f, 0.0f); + glTexCoord2f(1.0f, 1.0f); + glVertex3f( 1.0f, 1.0f, 0.0f); + glTexCoord2f(0.0f, 1.0f); + glVertex3f( -1.0f, 1.0f, 0.0f); + glEnd(); + + glEndList(); + glDisable(GL_TEXTURE_2D); +} + QImage Renderer::render1D(void) { if(OGLpBuffer) @@ -231,6 +262,7 @@ glLightfv(GL_LIGHT0, GL_POSITION, position); primitives<<generateBox(); + generateObserver(); } void Renderer::paintGL() @@ -246,8 +278,10 @@ glRotatef(rotation[2], 0.0f, 0.0f, 1.0f); render(); + if(showSelectRect) drawRect(selectRect[0], selectRect[1], selectRect[2], selectRect[3]); + } void Renderer::resizeGL(int width, int height) @@ -270,15 +304,15 @@ void Renderer::mouseReleaseEvent(QMouseEvent * event) { - if(showSelectRect) + if(showSelectRect && workMode==0) { multiSelect(abs((selectRect[0] + selectRect[2])/2), abs((selectRect[1] + selectRect[3])/2), abs(selectRect[0] - selectRect[2]), abs(selectRect[1] - selectRect[3])); } else if(mouseButtons==Qt::LeftButton) { - selectOne(event->x(), event->y()); - if(selectetObjects.size()>0) + + if(selectOne(event->x(), event->y())) { if(workMode==1) getStorage()->setValueAt(editValue, selectetObjects[0]); @@ -397,6 +431,8 @@ showSelectRect = 0; workMode = 0; editValue = 0; + localObserverCoords.resize(3); + showLocalObserver = 0; } Renderer::~Renderer() @@ -405,8 +441,12 @@ for(int i=0;i<primitives.size();++i) glDeleteLists(primitives[i], 1); - glDeleteLists(greed, 1); + if(greed>0) + glDeleteLists(greed, 1); + if(observer>0) + glDeleteLists(observer, 1); + // if(painter) // delete painter; // painter = NULL; @@ -420,7 +460,7 @@ imageBuffer = NULL; } -void Renderer::selectOne(int x, int y) +bool Renderer::selectOne(int x, int y) { unsigned int minVal = 0xffffffff; int minValIndex = -1; @@ -439,6 +479,7 @@ selectetObjects<<minValIndex; updateGL(); } + return numberOfSelectetObject>0; } void Renderer::multiSelect(int x, int y, int width, int height) @@ -623,6 +664,7 @@ glEnable(GL_LIGHTING); } SYMBOL symbol; + for(int z=0;z<storage.getSizeZ();++z) { for(int y=storage.getSizeY();y>0;--y) @@ -696,6 +738,25 @@ } } } + if(showLocalObserver && !selectionMode) + { + + glPushMatrix(); + glTranslatef(mx + (float)localObserverCoords[0] * 2.0f , my + (storage.getSizeY() - (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); + + glBlendFunc(GL_ONE, GL_ONE); + glEnable(GL_BLEND); + glDisable(GL_LIGHTING); + glEnable(GL_TEXTURE_2D); + glCallList(observer); + glDisable(GL_TEXTURE_2D); + glEnable(GL_LIGHTING); + glDisable(GL_BLEND); + glPopMatrix(); + } } QImage Renderer::renderToQImage(int zplane) @@ -944,3 +1005,15 @@ { editValue = value; } + +void Renderer::showObserver(bool flag) +{ + showLocalObserver = flag; +} + +void Renderer::setObserverPosition(int x, int y, int z) +{ + localObserverCoords[0] = x; + localObserverCoords[1] = y; + localObserverCoords[2] = z; +} Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 09:11:48 UTC (rev 174) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 16:41:12 UTC (rev 175) @@ -653,6 +653,7 @@ localViewFlag = 0; connect(renderer, SIGNAL(objectSelected(int, int, int)), SLOT(view3DselectedObject(int, int, int))); + storeCurentTable = NULL; } simulationWindow::~simulationWindow() @@ -663,6 +664,8 @@ if(pixmap) delete pixmap; + + storeCurentTable = NULL; } Renderer * simulationWindow::getRenderer() @@ -689,6 +692,13 @@ if(ui.view2DGraph->isVisible()) update2DGraph(); } + if(workMode==3) + { + if(localObserverPosition[2]==i) + table2D->item(localObserverPosition[1], localObserverPosition[0])->setSelected(1); + else + table2D->item(localObserverPosition[1], localObserverPosition[0])->setSelected(0); + } } void simulationWindow::dataUpdateRequest(void) @@ -715,7 +725,7 @@ switch(renderer->getStorage()->getDimension()) { case 1: - if(ui.view3D->isVisible()) + if(ui.view1D->isVisible()) { update1DTable(); update1DTableMem(); @@ -797,6 +807,7 @@ localObserverPosition[0] = 0; localObserverPosition[1] = 0; localObserverPosition[2] = 0; + renderer->setObserverPosition(0,0,0); if(localViewFlag) { loclaViewMemory[0] = *getStorage(); @@ -961,6 +972,9 @@ localObserverPosition[0] = column; localObserverPosition[1] = row; localObserverPosition[2] = z_plane; + + renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); + localViewReinterprete(); update2DTable(); graph2DUpdateRequest = 1; @@ -1013,11 +1027,24 @@ } } } + if(workMode==3) + { + localObserverPosition[0] = column; + localObserverPosition[1] = row; + localObserverPosition[2] = 0; + renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); + localViewReinterprete(); + update1DTable(); + graph2DUpdateRequest = 1; + } } void simulationWindow::workModeChange(int mode) { workMode = mode; + + renderer->showObserver(mode==3); + if(mode==1) renderer->modeEdit(); if(mode==0) @@ -1032,6 +1059,9 @@ getStorage()->setForeignDataPointer(localView.getDataPointer(), 1); localViewFlag = 1; renderer->modeEdit(); + if(ui.view2D->isVisible()) + zPlaneChange(z_plane); + table1D->item(localObserverPosition[1], localObserverPosition[0])->setSelected(1); } if(mode==2) { @@ -1106,6 +1136,7 @@ localObserverPosition[0] = x; localObserverPosition[1] = y; localObserverPosition[2] = z; + renderer->setObserverPosition(localObserverPosition[0], localObserverPosition[1], localObserverPosition[2]); localViewReinterprete(); table2DUpdateRequest = 1; graph2DUpdateRequest = 1; Added: trunk/qcell/bin/observer.png =================================================================== (Binary files differ) Property changes on: trunk/qcell/bin/observer.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-15 19:26:05
|
Revision: 177 http://svn.sourceforge.net/qcell/?rev=177&view=rev Author: lessm Date: 2007-01-15 11:26:00 -0800 (Mon, 15 Jan 2007) Log Message: ----------- - edit Tools start to work Modified Paths: -------------- trunk/qcell/baseheaders/simulationwindow.h trunk/qcell/basesources/simulationwindow.cpp Modified: trunk/qcell/baseheaders/simulationwindow.h =================================================================== --- trunk/qcell/baseheaders/simulationwindow.h 2007-01-15 17:49:58 UTC (rev 176) +++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-15 19:26:00 UTC (rev 177) @@ -69,6 +69,8 @@ CalculationData localView; bool localViewFlag; + QList< QVector<int> > dataToCopy; + virtual void mouseMoveEvent(QMouseEvent * event); virtual void mousePressEvent(QMouseEvent * event); virtual void wheelEvent(QWheelEvent * event); @@ -121,11 +123,12 @@ void view3DselectedObject(int x, int y, int z); -//signals: -// void progressUpdate(int val); + +public: + void storeSelectedData(void); + void pasteStoredData(void); - }; #endif // SIMULATIONWINDOW_H Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 17:49:58 UTC (rev 176) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 19:26:00 UTC (rev 177) @@ -1114,8 +1114,11 @@ switch(cmd) { case 0: + storeSelectedData(); break; case 1: + if(!dataToCopy.isEmpty()) + pasteStoredData(); break; case 2: if(workMode==0) @@ -1157,3 +1160,118 @@ } } +void simulationWindow::storeSelectedData(void) +{ + int xofset=0, yofset=0, zofset=0; + bool test = 0; + QTableWidgetItem *item; + QVector<int> coords; + coords.resize(4); + dataToCopy.clear(); + if(ui.view1D->isVisible()) + { + coords[1] = coords[2] = 0; + for(int x=0;x<getStorage()->getSizeX();++x) + { + item = table1D->item(0, x); + if(item->isSelected()) + { + if(!test) + { + xofset = x; + test=1; + } + coords[0] = x - xofset; + coords[3] = getStorage()->getValueAt_i(x); + dataToCopy<<coords; + } + } + } + + if(ui.view2D->isVisible()) + { + for(int y=0;y<getStorage()->getSizeY();++y) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + item = table2D->item(y, x); + if(item->isSelected()) + { + if(!test) + { + xofset = x; + yofset = y; + test=1; + } + coords[0] = x - xofset; + coords[1] = y - yofset; + coords[3] = getStorage()->getValueAt_i(x, y, z_plane); + dataToCopy<<coords; + } + } + } + } + + if(ui.view3D->isVisible()) + { + + } +} + +void simulationWindow::pasteStoredData(void) +{ + QVector<int> temp; + QVector<int> offset; + temp.resize(4); + if(ui.view1D->isVisible()) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + if(table1D->item(0, x)->isSelected()) + { + offset.resize(3); + offset[0] = x; + offset[1] = 0; + offset[2] = 0; + break; + } + } + } + + if(ui.view2D->isVisible()) + { + for(int y=0;y<getStorage()->getSizeY();++y) + { + for(int x=0;x<getStorage()->getSizeX();++x) + { + if(table2D->item(y, x)->isSelected()) + { + offset.resize(3); + offset[0] = x; + offset[1] = y; + offset[2] = z_plane; + break; + } + } + if(!offset.isEmpty()) + break; + } + } + + if(ui.view3D->isVisible()) + { + offset = renderer->getSelectedCoord(); + } + + if(!offset.isEmpty()) + { + foreach(temp, dataToCopy) + { + if((offset[0] + temp[0])<getStorage()->getSizeX() && (offset[1] + temp[1])<getStorage()->getSizeY() && (offset[2] + temp[2])<getStorage()->getSizeZ()) + getStorage()->setValueAt(temp[3], offset[0] + temp[0], offset[1] + temp[1], offset[2] + temp[2]); + } + table2DUpdateRequest = table1DUpdateRequest = graph2DUpdateRequest = 1; + renderer->repaint(); + repaint(); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-15 19:58:17
|
Revision: 178 http://svn.sourceforge.net/qcell/?rev=178&view=rev Author: lessm Date: 2007-01-15 11:57:54 -0800 (Mon, 15 Jan 2007) Log Message: ----------- - edit tools work fully in 3D view 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-01-15 19:26:00 UTC (rev 177) +++ trunk/qcell/baseheaders/Renderer.h 2007-01-15 19:57:54 UTC (rev 178) @@ -80,6 +80,7 @@ virtual void wheelEvent(QWheelEvent * event); void executeSelect(int x, int y, int width=1, int height=1); + QVector<int> indexToCoords(int index); public: @@ -137,6 +138,8 @@ void showObserver(bool flag); void setObserverPosition(int x, int y, int z); + QList< QVector<int> > getSelectData(void); + protected slots: void resizeDataEvent(void); Modified: trunk/qcell/basesources/Renderer.cpp =================================================================== --- trunk/qcell/basesources/Renderer.cpp 2007-01-15 19:26:00 UTC (rev 177) +++ trunk/qcell/basesources/Renderer.cpp 2007-01-15 19:57:54 UTC (rev 178) @@ -396,8 +396,26 @@ setOrtoPerspective(); } +QVector<int> Renderer::indexToCoords(int index) + { + int x=0, y=0, z=0; + QVector<int> out; + out.resize(3); + out[0] = index % getStorage()->getSizeX(); + index /= getStorage()->getSizeX(); + if(index<getStorage()->getSizeY()) + { + out[1] = index; + return out; + } + out[1] = index % getStorage()->getSizeY(); + index /= getStorage()->getSizeY(); + out[2] = index; + return out; + } + Renderer::Renderer(QWidget *parent) : QGLWidget(parent) { discretValues = 1; @@ -969,26 +987,9 @@ QVector<int> Renderer::getSelectedCoord(void) { - int x=0, y=0, z=0, index; - QVector<int> out; if(selectetObjects.size()==0) - return out; - - out.resize(3); - index = selectetObjects[0]; - - out[0] = index % getStorage()->getSizeX(); - index /= getStorage()->getSizeX(); - if(index<getStorage()->getSizeY()) - { - out[1] = index; - return out; - } - out[1] = index % getStorage()->getSizeY(); - index /= getStorage()->getSizeY(); - - out[2] = index; - return out; + return QVector<int>(); + return indexToCoords(selectetObjects[0]); } void Renderer::modeSelect(void) @@ -1017,3 +1018,18 @@ localObserverCoords[1] = y; localObserverCoords[2] = z; } + +QList< QVector<int> > Renderer::getSelectData(void) +{ + int index; + QList< QVector<int> > out; + if(selectetObjects.isEmpty()) + return out; + + foreach(index, selectetObjects) + { + out << indexToCoords(index); + (out.last())<<storage.getValueAt_i(index); + } + return out; +} Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 19:26:00 UTC (rev 177) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-15 19:57:54 UTC (rev 178) @@ -1214,7 +1214,24 @@ if(ui.view3D->isVisible()) { + xofset = getStorage()->getSizeX(); + yofset = getStorage()->getSizeY(); + zofset = getStorage()->getSizeZ(); + dataToCopy = renderer->getSelectData(); + foreach(coords, dataToCopy) + { + xofset = coords[0]<xofset ? coords[0] : xofset; + yofset = coords[1]<yofset ? coords[1] : yofset; + zofset = coords[2]<zofset ? coords[2] : zofset; + } + + for(int i=0;i<dataToCopy.size();++i) + { + (dataToCopy[i])[0] -= xofset; + (dataToCopy[i])[1] -= yofset; + (dataToCopy[i])[2] -= zofset; + } } } @@ -1274,4 +1291,4 @@ renderer->repaint(); repaint(); } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-17 18:33:53
|
Revision: 187 http://svn.sourceforge.net/qcell/?rev=187&view=rev Author: lessm Date: 2007-01-17 10:33:40 -0800 (Wed, 17 Jan 2007) Log Message: ----------- -some GUI changes Modified Paths: -------------- trunk/qcell/baseheaders/basetools.ui trunk/qcell/baseheaders/simulationwindow.ui trunk/qcell/baseheaders/view1dtexttools.ui trunk/qcell/baseheaders/view2dtexttools.ui trunk/qcell/baseheaders/view3dtools.ui trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/doc/licenciate_thesis/thesis.tex Added Paths: ----------- trunk/qcell/doc/licenciate_thesis/1d.png trunk/qcell/doc/licenciate_thesis/2d.png trunk/qcell/doc/licenciate_thesis/3d.png trunk/qcell/doc/licenciate_thesis/mainwindow.png Modified: trunk/qcell/baseheaders/basetools.ui =================================================================== --- trunk/qcell/baseheaders/basetools.ui 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/baseheaders/basetools.ui 2007-01-17 18:33:40 UTC (rev 187) @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>102</width> + <width>115</width> <height>375</height> </rect> </property> @@ -17,37 +17,37 @@ <rect> <x>1</x> <y>140</y> - <width>100</width> + <width>113</width> <height>91</height> </rect> </property> <property name="title" > <string>Edit Tools</string> </property> - <widget class="QToolButton" name="FillButton" > + <widget class="QToolButton" name="PasteButton" > <property name="geometry" > <rect> <x>10</x> - <y>60</y> - <width>81</width> + <y>40</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Fill</string> + <string>Paste</string> </property> </widget> - <widget class="QToolButton" name="PasteButton" > + <widget class="QToolButton" name="FillButton" > <property name="geometry" > <rect> <x>10</x> - <y>40</y> - <width>81</width> + <y>60</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Paste</string> + <string>Fill</string> </property> </widget> <widget class="QToolButton" name="CopyButton" > @@ -55,7 +55,7 @@ <rect> <x>10</x> <y>20</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -64,68 +64,45 @@ </property> </widget> </widget> - <widget class="QGroupBox" name="ValuesGroup" > + <widget class="QGroupBox" name="EditModeGroup" > <property name="geometry" > <rect> <x>1</x> - <y>240</y> - <width>100</width> - <height>131</height> - </rect> - </property> - <property name="title" > - <string>Values</string> - </property> - <widget class="QTableWidget" name="valueTable" > - <property name="geometry" > - <rect> - <x>5</x> - <y>20</y> - <width>90</width> - <height>101</height> - </rect> - </property> - </widget> - </widget> - <widget class="QGroupBox" name="ViewModeGroup" > - <property name="geometry" > - <rect> - <x>1</x> - <y>0</y> - <width>100</width> + <y>70</y> + <width>113</width> <height>71</height> </rect> </property> <property name="title" > - <string>View Mode</string> + <string>Edit Mode</string> </property> - <widget class="QToolButton" name="LocalViewButton" > + <widget class="QToolButton" name="ModeEditButton" > <property name="geometry" > <rect> <x>10</x> <y>40</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Local</string> + <string>Edit</string> </property> <property name="checkable" > <bool>true</bool> </property> </widget> - <widget class="QToolButton" name="GlobalVievButton" > + <widget class="QToolButton" name="ModeSelectButton" > <property name="geometry" > <rect> <x>10</x> <y>20</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Global</string> + <string>Select</string> </property> <property name="checkable" > <bool>true</bool> @@ -135,45 +112,45 @@ </property> </widget> </widget> - <widget class="QGroupBox" name="EditModeGroup" > + <widget class="QGroupBox" name="ViewModeGroup" > <property name="geometry" > <rect> <x>1</x> - <y>70</y> - <width>100</width> + <y>0</y> + <width>113</width> <height>71</height> </rect> </property> <property name="title" > - <string>Edit Mode</string> + <string>View Mode</string> </property> - <widget class="QToolButton" name="ModeEditButton" > + <widget class="QToolButton" name="LocalViewButton" > <property name="geometry" > <rect> <x>10</x> <y>40</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Edit</string> + <string>Local</string> </property> <property name="checkable" > <bool>true</bool> </property> </widget> - <widget class="QToolButton" name="ModeSelectButton" > + <widget class="QToolButton" name="GlobalVievButton" > <property name="geometry" > <rect> <x>10</x> <y>20</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Select</string> + <string>Global</string> </property> <property name="checkable" > <bool>true</bool> @@ -183,6 +160,29 @@ </property> </widget> </widget> + <widget class="QGroupBox" name="ValuesGroup" > + <property name="geometry" > + <rect> + <x>1</x> + <y>240</y> + <width>113</width> + <height>131</height> + </rect> + </property> + <property name="title" > + <string>Values</string> + </property> + <widget class="QTableWidget" name="valueTable" > + <property name="geometry" > + <rect> + <x>5</x> + <y>20</y> + <width>101</width> + <height>101</height> + </rect> + </property> + </widget> + </widget> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/baseheaders/simulationwindow.ui =================================================================== --- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-17 18:33:40 UTC (rev 187) @@ -36,7 +36,7 @@ <enum>QTabWidget::Rounded</enum> </property> <property name="currentIndex" > - <number>4</number> + <number>0</number> </property> <widget class="QWidget" name="view3D" > <attribute name="title" > Modified: trunk/qcell/baseheaders/view1dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-17 18:33:40 UTC (rev 187) @@ -5,62 +5,36 @@ <rect> <x>0</x> <y>0</y> - <width>102</width> + <width>115</width> <height>145</height> </rect> </property> <property name="windowTitle" > <string>View1DTextTools</string> </property> - <widget class="QGroupBox" name="groupBox_2" > - <property name="geometry" > - <rect> - <x>1</x> - <y>90</y> - <width>100</width> - <height>51</height> - </rect> - </property> - <property name="title" > - <string>Memory</string> - </property> - <widget class="QToolButton" name="MemoryClearButton" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>81</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>Clear</string> - </property> - </widget> - </widget> <widget class="QGroupBox" name="groupBox" > <property name="geometry" > <rect> <x>1</x> <y>1</y> - <width>100</width> + <width>113</width> <height>91</height> </rect> </property> <property name="title" > <string>View 1D Text</string> </property> - <widget class="QToolButton" name="ColorsButton" > + <widget class="QToolButton" name="SymbolsButton" > <property name="geometry" > <rect> <x>10</x> - <y>20</y> - <width>81</width> + <y>60</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Colors</string> + <string>Symbols</string> </property> <property name="checkable" > <bool>true</bool> @@ -71,7 +45,7 @@ <rect> <x>10</x> <y>40</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -85,23 +59,49 @@ <bool>true</bool> </property> </widget> - <widget class="QToolButton" name="SymbolsButton" > + <widget class="QToolButton" name="ColorsButton" > <property name="geometry" > <rect> <x>10</x> - <y>60</y> - <width>81</width> + <y>20</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Symbols</string> + <string>Colors</string> </property> <property name="checkable" > <bool>true</bool> </property> </widget> </widget> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>1</x> + <y>90</y> + <width>113</width> + <height>51</height> + </rect> + </property> + <property name="title" > + <string>Memory</string> + </property> + <widget class="QToolButton" name="MemoryClearButton" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>91</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>Clear</string> + </property> + </widget> + </widget> </widget> <layoutdefault spacing="6" margin="11" /> <resources/> Modified: trunk/qcell/baseheaders/view2dtexttools.ui =================================================================== --- trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-17 18:33:40 UTC (rev 187) @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>102</width> + <width>115</width> <height>157</height> </rect> </property> @@ -17,7 +17,7 @@ <rect> <x>1</x> <y>100</y> - <width>100</width> + <width>113</width> <height>51</height> </rect> </property> @@ -29,7 +29,7 @@ <rect> <x>10</x> <y>20</y> - <width>71</width> + <width>91</width> <height>22</height> </rect> </property> @@ -40,54 +40,54 @@ <rect> <x>1</x> <y>1</y> - <width>100</width> + <width>113</width> <height>91</height> </rect> </property> <property name="title" > <string>View 2D Text</string> </property> - <widget class="QToolButton" name="ValuesButton" > + <widget class="QToolButton" name="ColorsButton" > <property name="geometry" > <rect> <x>10</x> - <y>40</y> - <width>81</width> + <y>20</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Values</string> + <string>Colors</string> </property> <property name="checkable" > <bool>true</bool> </property> - <property name="checked" > - <bool>true</bool> - </property> </widget> - <widget class="QToolButton" name="ColorsButton" > + <widget class="QToolButton" name="ValuesButton" > <property name="geometry" > <rect> <x>10</x> - <y>20</y> - <width>81</width> + <y>40</y> + <width>91</width> <height>20</height> </rect> </property> <property name="text" > - <string>Colors</string> + <string>Values</string> </property> <property name="checkable" > <bool>true</bool> </property> + <property name="checked" > + <bool>true</bool> + </property> </widget> <widget class="QToolButton" name="SymbolsButton" > <property name="geometry" > <rect> <x>10</x> <y>60</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> Modified: trunk/qcell/baseheaders/view3dtools.ui =================================================================== --- trunk/qcell/baseheaders/view3dtools.ui 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/baseheaders/view3dtools.ui 2007-01-17 18:33:40 UTC (rev 187) @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>102</width> + <width>115</width> <height>205</height> </rect> </property> @@ -17,7 +17,7 @@ <rect> <x>1</x> <y>1</y> - <width>100</width> + <width>113</width> <height>71</height> </rect> </property> @@ -29,7 +29,7 @@ <rect> <x>10</x> <y>20</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -48,7 +48,7 @@ <rect> <x>10</x> <y>40</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -65,29 +65,19 @@ <rect> <x>1</x> <y>70</y> - <width>100</width> + <width>113</width> <height>131</height> </rect> </property> <property name="title" > <string>Section</string> </property> - <widget class="QSpinBox" name="maskValue" > - <property name="geometry" > - <rect> - <x>10</x> - <y>100</y> - <width>81</width> - <height>22</height> - </rect> - </property> - </widget> <widget class="QToolButton" name="EnableButton" > <property name="geometry" > <rect> <x>10</x> <y>20</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -103,7 +93,7 @@ <rect> <x>10</x> <y>40</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -122,7 +112,7 @@ <rect> <x>10</x> <y>60</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -138,7 +128,7 @@ <rect> <x>10</x> <y>80</y> - <width>81</width> + <width>91</width> <height>20</height> </rect> </property> @@ -149,6 +139,16 @@ <bool>true</bool> </property> </widget> + <widget class="QSpinBox" name="maskValue" > + <property name="geometry" > + <rect> + <x>10</x> + <y>100</y> + <width>91</width> + <height>22</height> + </rect> + </property> + </widget> </widget> </widget> <layoutdefault spacing="6" margin="11" /> Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-17 18:33:40 UTC (rev 187) @@ -99,10 +99,10 @@ symbolTable->move(0, 35); symbolTable->resize(ui.symbolConfig->width() - 7, ui.symbolConfig->height() -42); - basetools->move(width() - 101, 0); - view3DTools->move(width() - 101, basetools->height() + 1); - view2DTextTools->move(width() - 101, basetools->height() + 1); - view1DTextTools->move(width() - 101, basetools->height() + 1); + basetools->move(width() - 116, 0); + view3DTools->move(width() - 116, basetools->height() + 1); + view2DTextTools->move(width() - 116, basetools->height() + 1); + view1DTextTools->move(width() - 116, basetools->height() + 1); @@ -661,6 +661,10 @@ connect(view3DTools, SIGNAL(maskSet(int, int, int)), SLOT(maskChange(int, int, int))); + ui.tabWidget->setTabEnabled(0, 0); + ui.tabWidget->setTabEnabled(1, 0); + ui.tabWidget->setTabEnabled(2, 0); + ui.tabWidget->setTabEnabled(3, 0); } simulationWindow::~simulationWindow() @@ -1063,7 +1067,7 @@ { if(mode==3) { - //loclaViewMemory[cycleTable] = *getStorage(); + loclaViewMemory[cycleTable] = *getStorage(); //localViewFlag = 1; storeCurentTable = getStorage()->getDataPointer(); renderer->modeEdit(); Added: trunk/qcell/doc/licenciate_thesis/1d.png =================================================================== (Binary files differ) Property changes on: trunk/qcell/doc/licenciate_thesis/1d.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/qcell/doc/licenciate_thesis/2d.png =================================================================== (Binary files differ) Property changes on: trunk/qcell/doc/licenciate_thesis/2d.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/qcell/doc/licenciate_thesis/3d.png =================================================================== (Binary files differ) Property changes on: trunk/qcell/doc/licenciate_thesis/3d.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/qcell/doc/licenciate_thesis/mainwindow.png =================================================================== (Binary files differ) Property changes on: trunk/qcell/doc/licenciate_thesis/mainwindow.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/qcell/doc/licenciate_thesis/thesis.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-01-17 18:24:56 UTC (rev 186) +++ trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-01-17 18:33:40 UTC (rev 187) @@ -26,6 +26,10 @@ % Korzystamy z bajer\xF3w pdf'a, jak kolorowe linki \pdfcompresslevel=9 + +%grafika +\usepackage{graphicx} + % Na razie wy\xB3\xB1czam, dop\xF3ki nie wymy\xB6l\xEA, jak poradzi\xE6 sobie ze stron\xB1 tytu\xB3ow\xB1 \usepackage[colorlinks,hyperindex,plainpages=false]{hyperref} @@ -248,10 +252,51 @@ \chapter{Instrukcja obs\xB3ugi pakietu} IMHO nie ma sensu tworzenia rozdzia\xB3u ,,Pokaz mo\xBFliwo\xB6ci pakietu'', gdy\xBF 'mo\xBFliwo\xB6ci programu' zostan\xB1 zademonstrowane (zrzutami ekranu) w~tym rozdziale - ka\xBFda funkcjonalno\xB6\xE6 z~osobna. + \section{Typowy przebieg eksperymentu [Quickstart? Jak to nazwa\xE6?]} -\chapter{Zako\xF1czenie} +\begin{enumerate} + \item Menu g\xB3\xF3wne + \item Opcje symulacji + \item Zak\xB3adki tryb\xF3w wizualizacji + \item Panel narz\xEAdzi + \item Widok g\xB3\xF3wny +\end{enumerate} +\subsection{Menu g\xB3owne} +\label{sec:} +Zawiera podstawowe komendy umo\xBFliwiajace wczytanie konfiguracji eksperymentu, funkcj lokalnej, pliku sasiedztwa oraz konfiguracji inicjalnej eksperymentu. +\subsection{Opcje symulacji} +\label{sec:} +Umo\xBFliwia sterowanie symulacja, prace krokow\xB9 oraz ciag\xB3a. + +\subsection{Zak\xB3adki tryb\xF3w wizualizacji } +\label{sec:} +Zak\xB3adki przypisane s\xB9 do poszczeg\xF3lnych tryb\xF3w wizualizaji. Umo\xBFliwiaj\xB9 prze\xB3aczanie powi\xEAdzy trybami 1D, 2D, 3D. Nie wszystkie wizualizacje dost\xEApne s\xB9 dla wszystkich konfiguracji. + +\subsection{Panel narz\xEAdzi} +\label{sec:} +Panel ten zawiera narzedzia przypisane do poszczeg\xF3lnych widok\xF3w eksperyment oraz podstawowe narzedzia edycji i trybu obserwatora. W trybie obserwatora lokalnego narz\xEAdzia edycji s\xB9 niedost\xEApne. + +\subsection{Widok g\xB3\xF3wny} +\label{sec:} + +\section{Konfiguracja Symboli} +\label{sec:} +W celu dokonania konfiguracji symboli przechodzimy do zakladki "Konfiguracja Symboli" przedstawiaj\xB9cej aktualne ustawienia. Widoczna tabela zawiera: + +\begin{enumerate} + \item przycisk nowy dodajacy symbol + \item przycisk usuwajacy ostatni symbol z tabeli(minimalna liczba symboli 2) + \item wartos\xE6 + \item symbol tekstowy przypisany do wartosci + \item kolor w trybie graficznym + \item model w trybie 3D + \item flaga ukrycia(zaznaczenie oznacza ukryci wartosci w trybie 3D); +\end{enumerate} + +Zmiany dokonyujemy klikaj\xB9c 2xLPM + % Bibliografia w zewn\xEAtrznym pliku w/g standardu natbib \bibliographystyle{plain} \bibliography{thesis} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <le...@us...> - 2007-01-18 10:03:49
|
Revision: 193 http://svn.sourceforge.net/qcell/?rev=193&view=rev Author: lessm Date: 2007-01-18 02:03:41 -0800 (Thu, 18 Jan 2007) Log Message: ----------- - edition work properly - back/forward work now - thesis.tex is converted to utf8 (that format i can edit unicode or utf8) Modified Paths: -------------- trunk/qcell/basesources/Calculator.cpp trunk/qcell/basesources/simulationwindow.cpp trunk/qcell/doc/licenciate_thesis/thesis.tex trunk/qcell/visgui/MainWindow.cpp Modified: trunk/qcell/basesources/Calculator.cpp =================================================================== --- trunk/qcell/basesources/Calculator.cpp 2007-01-17 20:44:17 UTC (rev 192) +++ trunk/qcell/basesources/Calculator.cpp 2007-01-18 10:03:41 UTC (rev 193) @@ -293,8 +293,8 @@ resizeData(cData.getSizeX(), cData.getSizeY(), cData.getSizeZ(), cData.getSizeT()); break; } + } fillData(cData.getDataPointer()); - } return *this; } Modified: trunk/qcell/basesources/simulationwindow.cpp =================================================================== --- trunk/qcell/basesources/simulationwindow.cpp 2007-01-17 20:44:17 UTC (rev 192) +++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-18 10:03:41 UTC (rev 193) @@ -779,7 +779,6 @@ maxTime = sqrt((float)(getStorage()->getSizeX() * getStorage()->getSizeX())); //maxTime = getStorage()->getSizeX() + 1; loclaViewMemory.resize(maxTime); - break; case 2: @@ -980,7 +979,7 @@ } graph2DUpdateRequest = 1; } - + if(workMode==3) { localObserverPosition[0] = column; @@ -1255,6 +1254,7 @@ { QVector<int> temp; QVector<int> offset; + int six = getStorage()->getSizeX(), siy = getStorage()->getSizeY(), siz = getStorage()->getSizeZ(); temp.resize(4); if(ui.view1D->isVisible()) { @@ -1295,12 +1295,18 @@ { offset = renderer->getSelectedCoord(); } + + if(siy==0) + siy = 1; + + if(siz==0) + siz = 1; if(!offset.isEmpty()) { foreach(temp, dataToCopy) { - if((offset[0] + temp[0])<getStorage()->getSizeX() && (offset[1] + temp[1])<getStorage()->getSizeY() && (offset[2] + temp[2])<getStorage()->getSizeZ()) + if((offset[0] + temp[0])<six && (offset[1] + temp[1])<siy && (offset[2] + temp[2])<siz) getStorage()->setValueAt(temp[3], offset[0] + temp[0], offset[1] + temp[1], offset[2] + temp[2]); } table2DUpdateRequest = table1DUpdateRequest = graph2DUpdateRequest = 1; Modified: trunk/qcell/doc/licenciate_thesis/thesis.tex =================================================================== --- trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-01-17 20:44:17 UTC (rev 192) +++ trunk/qcell/doc/licenciate_thesis/thesis.tex 2007-01-18 10:03:41 UTC (rev 193) @@ -57,9 +57,9 @@ %Jedziemy z koksem \chapter{Wprowadzenie} \section{Cel i~zakres pracy} -Celem niniejszego opracowania jest stworzenie \xB6rodowiska do efektywnego przeprowadzania symulacji jedno-, dwu- oraz tr\xF3jwymiarowych automat\xF3w kom\xF3rkowych. +Celem niniejszego opracowania jest stworzenie \x9Crodowiska do efektywnego przeprowadzania symulacji jedno-, dwu- oraz tr\xF3jwymiarowych automat\xF3w kom\xF3rkowych. -W~zakres pracy wchodzi synteza funkcjonalno\xB6ci zapewniaj\xB1cych szerok\xB1 gam\xEA mo\xBFliwo\xB6ci prowadzenia eksperyment\xF3w z~\ac{AK}, oparta o~krytyczn\xB1 analiz\xEA istniej\xB1cych rozwi\xB1za\xF1. Na podstawie uzyskanych wynik\xF3w %napiszemy program - jak to uj\xB1\xE6? +W~zakres pracy wchodzi synteza funkcjonalno\x9Cci zapewniaj\xB9cych szerok\xB9 gam\xEA mo\xBFliwo\x9Cci prowadzenia eksperyment\xF3w z~\ac{AK}, oparta o~krytyczn\xB9 analiz\xEA istniej\xB9cych rozwi\xB9za\xF1. Na podstawie uzyskanych wynik\xF3w %napiszemy program - jak to uj\xB1\xE6? \section{Uzasadnienie tematu} \begin{itemize} \item Klasyczne metody obliczeniowe @@ -72,28 +72,28 @@ \subsection{Cezary Krzy\xBFanowski} \begin{itemize} \item Wymagania dla symulator\xF3w \ac{AK} - \item Program symulacji modelu \ac{AK} 3d - interfejs i~\xB6rodki doboru modelu - \item Opracowanie i~wdro\xBFenie \xB6rodk\xF3w intensyfikacji eksperyment\xF3w + \item Program symulacji modelu \ac{AK} 3d - interfejs i~\x9Crodki doboru modelu + \item Opracowanie i~wdro\xBFenie \x9Crodk\xF3w intensyfikacji eksperyment\xF3w \item Testy programu \end{itemize} \subsection{Leszek Smentek} \begin{itemize} - \item Symulator modelu \ac{AK}; \xB6rodki doboru danych + \item Symulator modelu \ac{AK}; \x9Crodki doboru danych \item Wizualizacja i~tryby eksperyment\xF3w dla r\xF3\xBFnych obserwator\xF3w - \item Opracowanie i~wdro\xBFenie \xB6rodk\xF3w dokumentowania eksperyment\xF3w + \item Opracowanie i~wdro\xBFenie \x9Crodk\xF3w dokumentowania eksperyment\xF3w \end{itemize} \chapter{Zakres problematyki} \section{Cechy idealnego symulatora przetwarza\xF1 kom\xF3rkowych} \begin{itemize} - \item Wspieranie w~edycji danych pocz\xB1tkowych - \item Ustawienia domy\xB6lne - \item Podgl\xB1d element\xF3w sk\xB3adowych eksperymentu + \item Wspieranie w~edycji danych pocz\xB9tkowych + \item Ustawienia domy\x9Clne + \item Podgl\xB9d element\xF3w sk\xB3adowych eksperymentu \begin{itemize} \item Model \begin{itemize} - \item s\xB1siedztwo + \item s\xB9siedztwo \item funkcja lokalna \end{itemize} \item dane @@ -123,23 +123,23 @@ \begin{itemize} \item krokowo \begin{itemize} - \item ustalanie d\xB3ugo\xB6ci kroku + \item ustalanie d\xB3ugo\x9Cci kroku \end{itemize} - \item do wyst\xB1pienia warunku - \item ci\xB1g\xB3e + \item do wyst\xB9pienia warunku + \item ci\xB9g\xB3e \end{itemize} - \item ustalanie pr\xEAdko\xB6ci eksperymentu + \item ustalanie pr\xEAdko\x9Cci eksperymentu \item p\xB3ynne poruszanie si\xEA do przodu i~wstecz iteracji \item zmiany danych i~modelu w~trakcie eksperymentu \item tryb por\xF3wnawczy r\xF3\xBFnie zdefiniowanych eksperyment\xF3w \item utrwalanie wynik\xF3w \begin{itemize} - \item Zapis ca\xB3ego przebiegu (wraz z~histori\xB1) + \item Zapis ca\xB3ego przebiegu (wraz z~histori\xB9) \item plik multimedialny \end{itemize} - \item \gls{Serializacja} i~deserializacja - zachowanie ca\xB3o\xB6ci dokumentu i~p\xF3\xBCniejsze wznowienie. + \item \gls{Serializacja} i~deserializacja - zachowanie ca\xB3o\x9Cci dokumentu i~p\xF3\x9Fniejsze wznowienie. \end{itemize} -\section{Przegl\xB1d mo\xBFliwo\xB6ci znanych \ac{AK} [tabelka Leszku?]} +\section{Przegl\xB9d mo\xBFliwo\x9Cci znanych \ac{AK} [tabelka Leszku?]} \begin{itemize} \item Mcell \item DD Lab @@ -150,17 +150,17 @@ \section{Dobieranie modelu sieciowego} Tego to wspiera\xE6 nie b\xEAdziemy? \section{Formaty FL} - \ac{FQT} gotowe. Pozosta\xB3e formaty zdaj\xB1 si\xEA by\xE6 mo\xBFliwe do zaimplementowania i~przekszta\xB3cenia do wewn\xEAtrznej reprezentacji funkcji. - \section{Integralno\xB6\xE6 modelu} - Dopasowywanie s\xB1siedztwa do siatek. + \ac{FQT} gotowe. Pozosta\xB3e formaty zdaj\xB9 si\xEA by\xE6 mo\xBFliwe do zaimplementowania i~przekszta\xB3cenia do wewn\xEAtrznej reprezentacji funkcji. + \section{Integralno\x9C\xE6 modelu} + Dopasowywanie s\xB9siedztwa do siatek. - Czy jest jaka\xB6 mo\xBFliwo\xB6\xE6/potrzeba dopasowywania funkcji? (wydaje si\xEA trudne na pierwszy rzut\ldots pomy\xB6lenia) - \section{Dob\xF3r danych pocz\xB1tkowych} + Czy jest jaka\x9C mo\xBFliwo\x9C\xE6/potrzeba dopasowywania funkcji? (wydaje si\xEA trudne na pierwszy rzut\ldots pomy\x9Clenia) + \section{Dob\xF3r danych pocz\xB9tkowych} \begin{itemize} - \item \xACr\xF3d\xB3a + \item \x9Fr\xF3d\xB3a \item Tworzenie danych \begin{itemize} - \item Modyfikowanie ustawie\xF1 domy\xB6lnych + \item Modyfikowanie ustawie\xF1 domy\x9Clnych \end{itemize} \item Wizualna modyfikacja danych \end{itemize} @@ -185,12 +185,12 @@ \item Eksperymenty przetwarzania \begin{itemize} \item Praca krokowa - \item Ci\xB1g\xB3a (zatrzymanie, wznowienie) + \item Ci\xB9g\xB3a (zatrzymanie, wznowienie) \item Poruszanie si\xEA do przodu i wstecz \item \xA3apanie zdarze\xF1 \end{itemize} - \item Eksperymenty szukania element\xF3w modelu [Na pewno zd\xB1\xBFymy to zaimplementowa\xE6 Leszek?] - \item Eksperymenty szukania danych [To te\xBF zd\xB1\xBFymy?] + \item Eksperymenty szukania element\xF3w modelu [Na pewno zd\xB9\xBFymy to zaimplementowa\xE6 Leszek?] + \item Eksperymenty szukania danych [To te\xBF zd\xB9\xBFymy?] \item Zapisywanie wynik\xF3w eksperymentu \begin{itemize} \item Do pliku @@ -204,12 +204,12 @@ \subsection{Przy pisaniu projektu} \begin{description} - \item [autotools] GNU Build System --- Zestaw narz\xEAdzi stworzonych przez projekt GNU\footnote{\url{http://www.gnu.org/}} , kt\xF3re pomagaj\xB1 w budowaniu pakiet\xF3w w wielu systemach UNIXopodobnych. Jest cz\xEA\xB6ci\xB1 GNU Toolchain.\citep{plwiki}\\\url{http://sources.redhat.com/autobook/} - \item[gcc] Wieloplatformowy zestaw kompilator\xF3w. W szczeg\xF3lno\xB6ci u\xBFywany by\xB3 kompilator j\xEAzyka C++~--- gcc-c++ w wersji 4.2.\\\url{http://gcc.gnu.org/} + \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 \xB6rodowisku 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\xB6ci do tworzenia \ac{GUI} o natywnym, dla danej platformy, wygl\xB1dzie. Biblioteki te zawieraj\xB1 szerok\xB1 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\xB1 gam\xB1 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/} + \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[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} @@ -217,11 +217,11 @@ \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 \xB6rodowisku \gls{GNOME} na platformie Linux.\\\url{http://www.gnome.org/projects/evince/} + \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 [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 [TexLive 2005] Kompletne \xB6rodowisko \TeX{}-a tworzone przez \ac{TUG}. + \item [TexLive 2005] Kompletne \x9Crodowisko \TeX{}-a tworzone przez \ac{TUG}. \end{description} \section{Ograniczenia pakietu} @@ -235,17 +235,17 @@ \section{Usability} Na to chyba nie ma dobrego t\xB3umaczenia :/ -Chodzi tutaj o~pobawienie si\xEA obracaniem, rzutowaniem, zoomowaniem, interpretowaniem i~innymi ficzerami wp\xB3ywaj\xB1cymi na realn\xB1 u\xBFyteczno\xB6\xE6 pakietu, a~nie daj\xB1cymi si\xEA zmierzy\xE6, jak wydajno\xB6\xE6, czy warunki brzegowe. +Chodzi tutaj o~pobawienie si\xEA obracaniem, rzutowaniem, zoomowaniem, interpretowaniem i~innymi ficzerami wp\xB3ywaj\xB9cymi na realn\xB9 u\xBFyteczno\x9C\xE6 pakietu, a~nie daj\xB9cymi si\xEA zmierzy\xE6, jak wydajno\x9C\xE6, czy warunki brzegowe. -\section{Poprawno\xB6ci oblicze\xF1} -\subsection{?? W\xB3a\xB6ciwe eksperymenty??} -Nie wiem, jak te sekcj\xEA nazwa\xE6\ldots Nie wiem te\xBF, jakby obiektywnie dobra\xE6 takie \xB6rodowiska 1-3d, kt\xF3re by wystestowa\xB3y mo\xBFliwie najwi\xEAksz\xB1 mo\xBFliw\xB1 kombinacj\xEA sytuacji, kt\xF3re mog\xB1 si\xEA pojawi\xE6 podczas eksperyment\xF3w. +\section{Poprawno\x9Cci oblicze\xF1} +\subsection{?? W\xB3a\x9Cciwe eksperymenty??} +Nie wiem, jak te sekcj\xEA nazwa\xE6\ldots Nie wiem te\xBF, jakby obiektywnie dobra\xE6 takie \x9Crodowiska 1-3d, kt\xF3re by wystestowa\xB3y mo\xBFliwie najwi\xEAksz\xB9 mo\xBFliw\xB9 kombinacj\xEA sytuacji, kt\xF3re mog\xB9 si\xEA pojawi\xE6 podczas eksperyment\xF3w. -Czy znane s\xB1 jakie\xB6 takie funkcje \ac{AK}, kt\xF3re pozwoli\xB3yby na wyczerpanie ca\xB3ego przedzia\xB3u alfabetu wej\xB6ciowego i~wyj\xB6ciowego na zadanej wielko\xB6ci KI ? +Czy znane s\xB9 jakie\x9C takie funkcje \ac{AK}, kt\xF3re pozwoli\xB3yby na wyczerpanie ca\xB3ego przedzia\xB3u alfabetu wej\x9Cciowego i~wyj\x9Cciowego na zadanej wielko\x9Cci KI ? \subsection{Warunki brzegowe} -W~rozumieniu wyszukiwania mniej 'typowych' warto\xB6ci r\xF3\xBFnych p\xF3l, sprawdzania dziele\xF1 przez zero, poprawno\xB6ci 'przekr\xEAcania licznik\xF3w', jak np. warunki Torusowe etc\ldots -\section{Wydajno\xB6ciowe} -W~zale\xBFno\xB6ci od pozosta\xB3ego czasu, przeprowadz\xEA i~udokumentuj\xEA tutaj jaki\xB6 'typowy' eksperyment (co to znaczy typowy?) 1-3d, jak si\xEA uda to na dw\xF3ch maszynach i~mo\xBFe na Linux + Windows. +W~rozumieniu wyszukiwania mniej 'typowych' warto\x9Cci r\xF3\xBFnych p\xF3l, sprawdzania dziele\xF1 przez zero, poprawno\x9Cci 'przekr\xEAcania licznik\xF3w', jak np. warunki Torusowe etc\ldots +\section{Wydajno\x9Cciowe} +W~zale\xBFno\x9Cci od pozosta\xB3ego czasu, przeprowadz\xEA i~udokumentuj\xEA tutaj jaki\x9C 'typowy' eksperyment (co to znaczy typowy?) 1-3d, jak si\xEA uda to na dw\xF3ch maszynach i~mo\xBFe na Linux + Windows. Spr\xF3buj\xEA ekstrapolowa\xE6 te wyniki i~oszacowa\xE6 minimalne wymagania. \subsection{Automaty jednowymiarowe} @@ -253,7 +253,7 @@ \subsection{Automaty tr\xF3jwymiarowe} \chapter{Instrukcja obs\xB3ugi pakietu} -IMHO nie ma sensu tworzenia rozdzia\xB3u ,,Pokaz mo\xBFliwo\xB6ci pakietu'', gdy\xBF 'mo\xBFliwo\xB6ci programu' zostan\xB1 zademonstrowane (zrzutami ekranu) w~tym rozdziale - ka\xBFda funkcjonalno\xB6\xE6 z~osobna. +IMHO nie ma sensu tworzenia rozdzia\xB3u ,,Pokaz mo\xBFliwo\x9Cci pakietu'', gdy\xBF 'mo\xBFliwo\x9Cci programu' zostan\xB9 zademonstrowane (zrzutami ekranu) w~tym rozdziale - ka\xBFda funkcjonalno\x9C\xE6 z~osobna. \section{Typowy przebieg eksperymentu [Quickstart? Jak to nazwa\xE6?]} Modified: trunk/qcell/visgui/MainWindow.cpp =================================================================== --- trunk/qcell/visgui/MainWindow.cpp 2007-01-17 20:44:17 UTC (rev 192) +++ trunk/qcell/visgui/MainWindow.cpp 2007-01-18 10:03:41 UTC (rev 193) @@ -484,7 +484,8 @@ { // Start the calculation timing t.start(); - if((iteration + 1) >= data.count()) + iteration++; + if((iteration) >= data.count()) { /// @todo Use the updated API of Calculator /// @todo Pass the calculated CalculationData to the data list @@ -495,10 +496,9 @@ } else { + calc = *(data[iteration]); /// @todo Is this needed? } - - iteration++; break; } @@ -511,7 +511,8 @@ } iteration--; - calc = *data[iteration]; + calc = *(data[iteration]); + data.removeLast(); } } @@ -534,8 +535,9 @@ void MainWindow::update() { // *sw->getStorage() = *data[iteration]; -sw->getStorage()->resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1); -// sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); +// sw->getStorage()->resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1); + //calc.resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1); + sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1); iterationLCD->display(iteration); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |