|
From: <le...@us...> - 2007-02-15 09:27:20
|
Revision: 329
http://svn.sourceforge.net/qcell/?rev=329&view=rev
Author: lessm
Date: 2007-02-15 01:27:18 -0800 (Thu, 15 Feb 2007)
Log Message:
-----------
- local observer bug resolved
Modified Paths:
--------------
trunk/qcell/basesources/simulationwindow.cpp
trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex
Modified: trunk/qcell/basesources/simulationwindow.cpp
===================================================================
--- trunk/qcell/basesources/simulationwindow.cpp 2007-02-15 09:21:49 UTC (rev 328)
+++ trunk/qcell/basesources/simulationwindow.cpp 2007-02-15 09:27:18 UTC (rev 329)
@@ -254,34 +254,38 @@
int simulationWindow::calculateDistans(int x, int y, int z, bool box)
{
+ int ox=getStorage()->getSizeX() / 2, oy=getStorage()->getSizeY() / 2, oz=getStorage()->getSizeZ() / 2;
- float d1 = sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2])));
+ x += ox - localObserverPosition[0];
+ y += oy - localObserverPosition[1];
+ z += oz - localObserverPosition[2];
+ if(x<0)
+ x+= getStorage()->getSizeX() - 1;
- x += getStorage()->getSizeX()- 1 - localObserverPosition[0];
- y += getStorage()->getSizeY()- 1 - localObserverPosition[1];
- z += getStorage()->getSizeZ()- 1 - localObserverPosition[2];
+ if(y<0)
+ y+= getStorage()->getSizeY() - 1;
+ if(z<0)
+ z+= getStorage()->getSizeZ() - 1;
+
if(x>=getStorage()->getSizeX())
- x -= getStorage()->getSizeX()-1;
+ x-= getStorage()->getSizeX() - 1;
+
if(y>=getStorage()->getSizeY())
- y -= getStorage()->getSizeY()-1;
+ y-= getStorage()->getSizeY() - 1;
+
if(z>=getStorage()->getSizeZ())
- z -= getStorage()->getSizeZ()-1;
-/*
+ z-= getStorage()->getSizeZ() - 1;
+
if(box)
{
- int mx = abs(localObserverPosition[0] - x), my = abs(localObserverPosition[1] - y), mz = abs(localObserverPosition[2] - z);
+ int mx = abs(ox - x), my = abs(oy - y), mz = abs(oz - z);
int tmp = mx>my ? mx : my;
return tmp > mz ? tmp : mz;
}
else
-*/
-// return sqrt((float)((x - localObserverPosition[0]) * (x - localObserverPosition[0])) * (float)((y - localObserverPosition[1]) * (y - localObserverPosition[1])) * (float)((z - localObserverPosition[2]) * (z - localObserverPosition[2])));
-
- float d2 = sqrt((float)((x - (getStorage()->getSizeX()-1)) * (x - (getStorage()->getSizeX()-1))) * (float)((y - (getStorage()->getSizeY()-1)) * (y - (getStorage()->getSizeY()-1))) * (float)((z - (getStorage()->getSizeZ()-1)) * (z - (getStorage()->getSizeZ()-1))));
-
- return d1<d2?d1:d2;
+ return (int)sqrt((float)((x - ox) * (x - ox)) + (float)((y - oy) * (y - oy)) + (float)((z - oz) * (z - oz)));
}
void simulationWindow::update2DTable(bool forceUpdate)
Modified: trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex
===================================================================
--- trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-15 09:21:49 UTC (rev 328)
+++ trunk/qcell/doc/licenciate_thesis/chap6/chap6.tex 2007-02-15 09:27:18 UTC (rev 329)
@@ -108,8 +108,8 @@
Zestaw narz\xEAdzi dla symulatora DAK. Zawiera nast\xEApuj\xB9ce opcje:
\begin{itemize}
\item Colors - interpretowanie za pomoc\xB9 kolor\xF3w
-\item Values - interpretowanie za pomoc\xB9 warto\x9Cci symboli
-\item Symbols - interpretacja za pomoc\xB9 symboli tekstowych
+\item Symbols - interpretowanie za pomoc\xB9 warto\x9Cci symboli
+\item Char - interpretacja za pomoc\xB9 znak\xF3w tekstowych
\item Z Plane - przesuni\xEAcie w p\xB3aszczy\x9Fnie przekroju XY (widocznie jedynie dla KI 3D)
\end{itemize}
@@ -122,8 +122,8 @@
Zestaw narz\xEAdzi dla symulatora LAK:
\begin{itemize}
\item Colors - interpretowanie za pomoc\xB9 kolor\xF3w
-\item Values - interpretowanie za pomoc\xB9 warto\x9Cci symboli
-\item Symbols - interpretacja za pomoc\xB9 symboli tekstowych
+\item Symbols - interpretowanie za pomoc\xB9 warto\x9Cci symboli
+\item Char - interpretacja za pomoc\xB9 znak\xF3w tekstowych
\item Clear - usuni\xEAcie z tabeli poprzednich krok\xF3w symulacji
\end{itemize}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|