--------------------Configuration: ctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA82.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6F.tmp" with contents
[
-/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0beta1\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\src\graph3dview.cpp"
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"C:\ctsim\src\ctsim.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA82.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA83.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6F.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB70.tmp" with contents
[
comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib opengl32.lib glu32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib"
.\Debug\ctsim.obj
.\Debug\dlgprojections.obj
.\Debug\dlgreconstruct.obj
.\Debug\docs.obj
+.\Debug\graph3dview.obj
.\Debug\views.obj
.\Debug\ctsim.res
-.\Debug\graph3dview.obj
\ctsim\msvc\libctsim\Debug\libctsim.lib
"\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib"
"\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib"
\wx2.2.5\lib\zlibd.lib
\wx2.2.5\lib\tiffd.lib
]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA83.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB70.tmp"
<h3>Output Window</h3>
Compiling...
-graph3dview.cpp
-C:\ctsim\src\graph3dview.cpp(222) : warning C4101: 'n2' : unreferenced local variable
-C:\ctsim\src\graph3dview.cpp(222) : warning C4101: 'n3' : unreferenced local variable
-C:\ctsim\src\graph3dview.cpp(222) : warning C4101: 'n4' : unreferenced local variable
-C:\ctsim\src\graph3dview.cpp(292) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(292) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(292) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(297) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(297) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(297) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(298) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
-C:\ctsim\src\graph3dview.cpp(298) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
+ctsim.cpp
Linking...
<h3>Results</h3>
-ctsim.exe - 0 error(s), 11 warning(s)
+ctsim.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: graph3dview.cpp,v 1.2 2001/01/30 10:58:13 kevin Exp $
+** $Id: graph3dview.cpp,v 1.3 2001/01/30 13:47:46 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
m_bDoubleBuffer = GL_TRUE;
m_bSmooth = GL_TRUE;
m_bLighting = GL_TRUE;
-
+ m_dXRotate = 0;
+ m_dYRotate = 0;
}
Graph3dFileView::~Graph3dFileView()
}
else {
#endif
-#if 0
-// glBegin( GL_TRIANGLE_STRIP );
- //glBegin (GL_QUADS);
- //glNormal3f (0.0, 0.0, 1.0); glVertex3f (-1.0, -1.0, 0.0); glVertex3f (0.0, -1.0, 0.0); glVertex3f (0.0, 0.0, 0.0); glVertex3f (-1.0, 0.0, 0.0); glNormal3f (0.0, 0.0, 1.0); glVertex3f (0.0, -1.0, 0.0); glVertex3f (1.0, -1.0, 0.0); glVertex3f (1.0, 0.0, 0.0); glVertex3f (0.0, 0.0, 0.0); glNormal3f (0.0, 0.0, 1.0); glVertex3f (0.0, 0.0, 0.0); glVertex3f (1.0, 0.0, 0.0); glVertex3f (1.0, 1.0, 0.0); glVertex3f (0.0, 1.0, 0.0); glNormal3f (0.0, 0.0, 1.0); glVertex3f (0.0, 0.0, 0.0); glVertex3f (0.0, 1.0, 0.0); glVertex3f (-1.0, 1.0, 0.0); glVertex3f (-1.0, 0.0, 0.0);
- glColor3f(1.0,1.0,1.0);
- glBegin (GL_POINTS);
- for (GLint i = 0;i < nVertices; i++) {
- // glNormal3fv( &pNormals[i] );
- glVertex3fv( pVertices[i] );
- }
- glEnd();
-#else
double edge = 1.;
unsigned int nx = GetDocument()->m_nx;
unsigned int ny = GetDocument()->m_ny;
const ImageFileArray v = GetDocument()->m_array;
- double actOffset = 0;
+ if (nx == 0 || ny == 0 || ! v)
+ return;
+
+ double dMin = v[0][0];
+ double dMax = dMin;
+ unsigned int ix;
+ for (ix = 0; ix < nx; ix++)
+ for (unsigned int iy = 0; iy < ny; iy++)
+ if (v[ix][iy] < dMin)
+ dMin = v[ix][iy];
+ else if (v[ix][iy] > dMax)
+ dMax = v[ix][iy];
+
+ double actOffset = dMin;
+ double actScale = 0.3 * sqrt(nx*nx+ny*ny) / (dMax - dMin);
+
+ glRotatef( m_dYRotate, 0.0, 0.0, 1.0 );
+ glRotatef( m_dXRotate, 1.0, 0.0, 0.0 );
+ glTranslatef (-static_cast<double>(nx) / 2, -static_cast<double>(ny) / 2, 0);
// glNewList(opnListNum++,GL_COMPILE);
- for(int ix = 0; ix < nx-1; ix++){
- for(int iy = 0; iy < ny-1; iy++){
+ for (ix = 0; ix < nx-1; ix++) {
+ for (unsigned int iy = 0; iy < ny-1; iy++) {
float p1[3], p2[3], p3[3], p4[3];
float n1[3], n2[3], n3[3], n4[3];
glBegin(GL_LINE_LOOP);
- p1[0] = edge*(iy); p1[1] = v[ix][iy] + actOffset; p1[2] = edge*(ix);
- p2[0] = edge*(iy+1); p2[1] = v[ix+1][iy] + actOffset; p2[2] = edge*(ix );
- p3[0] = edge*(iy+1); p3[1] = v[ix+1][iy] + actOffset; p3[2] = edge*(ix +1);
- p4[0] = edge*(iy); p4[1] = v[ix][iy] + actOffset; p4[2] = edge*(ix +1);
+ p1[0] = ix; p1[1] = actScale * (v[ix][iy] + actOffset); p1[2] = iy;
+ p2[0] = ix+1; p2[1] = actScale * (v[ix+1][iy] + actOffset); p2[2] = iy;
+ p3[0] = ix+1; p3[1] = actScale * (v[ix+1][iy+1] + actOffset); p3[2] = iy;
+ p4[0] = ix; p4[1] = actScale * (v[ix][iy+1] + actOffset); p4[2] = iy;
n1[0] = -(p2[1] - p1[1])*(p3[2] - p1[2]) + (p2[2] - p1[2])*(p3[1] - p2[1]);
n1[1] = -(p2[2] - p1[2])*(p3[0] - p2[0]) + (p2[0] - p1[0])*(p3[2] - p2[2]);
}
glEndList();
-
-#endif
+
#ifdef GL_EXT_vertex_array
}
#endif
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
- glRotatef( m_dYRotate, 0.0, 1.0, 0.0 );
- glRotatef( m_dXRotate, 1.0, 0.0, 0.0 );
-
DrawSurface();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho (-100, 100, -100, 100, -500, 500);
+ glOrtho (-300, 300, -300, 300, 200, -200);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef( 100, -6, 100 );
-
+
}
void
return;
switch(event.KeyCode()) {
- case WXK_ESCAPE:
- exit(0);
case WXK_LEFT:
m_pView->m_dYRotate -= 15.0;
break;
}
}
- Refresh(FALSE);
+ Refresh (false);
}
void
Graph3dFileCanvas::Reshape (int width, int height)
{
- glViewport(0, 0, (GLint)width, (GLint)height);
+ glViewport (0, 0, (GLint)width, (GLint)height);
}