From: Kevin M. Rosenberg Date: Tue, 30 Jan 2001 13:47:46 +0000 (+0000) Subject: r474: no message X-Git-Tag: debian-4.5.3-3~543 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=c81a502b726ff9f61d9661979cef0a5d5efadb22 r474: no message --- diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index ef6aecb..20f9842 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -6,13 +6,13 @@ --------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

-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 @@ -20,9 +20,9 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w .\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" @@ -33,27 +33,16 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w \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"

Output Window

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...

Results

-ctsim.exe - 0 error(s), 11 warning(s) +ctsim.exe - 0 error(s), 0 warning(s) diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 78745a2..a9966b3 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.62 2001/01/30 10:58:13 kevin Exp $ +** $Id: ctsim.cpp,v 1.63 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 @@ -70,7 +70,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.62 2001/01/30 10:58:13 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.63 2001/01/30 13:47:46 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -448,6 +448,7 @@ MainFrame::OnCreateFilter (wxCommandEvent& WXUNUSED(event)) *theApp->getLog() << os.str().c_str() << "\n"; wxString filename = "untitled.if"; ImageFileDocument* pFilterDoc = theApp->newImageDoc(); + pFilterDoc->setBadFileOpen(); if (! pFilterDoc) { sys_error (ERR_SEVERE, "Unable to create filter image"); return; diff --git a/src/graph3dview.cpp b/src/graph3dview.cpp index 909dc10..a29089a 100644 --- a/src/graph3dview.cpp +++ b/src/graph3dview.cpp @@ -9,7 +9,7 @@ ** 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 @@ -118,7 +118,8 @@ Graph3dFileView::Graph3dFileView () m_bDoubleBuffer = GL_TRUE; m_bSmooth = GL_TRUE; m_bLighting = GL_TRUE; - + m_dXRotate = 0; + m_dYRotate = 0; } Graph3dFileView::~Graph3dFileView() @@ -196,36 +197,42 @@ Graph3dFileView::DrawSurface() } 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(nx) / 2, -static_cast(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]); @@ -240,8 +247,7 @@ Graph3dFileView::DrawSurface() } glEndList(); - -#endif + #ifdef GL_EXT_vertex_array } #endif @@ -276,9 +282,6 @@ Graph3dFileView::Draw () { 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(); @@ -336,11 +339,10 @@ Graph3dFileView::InitGL () 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 @@ -544,8 +546,6 @@ Graph3dFileCanvas::OnChar(wxKeyEvent& event) return; switch(event.KeyCode()) { - case WXK_ESCAPE: - exit(0); case WXK_LEFT: m_pView->m_dYRotate -= 15.0; break; @@ -581,13 +581,13 @@ Graph3dFileCanvas::OnChar(wxKeyEvent& event) } } - 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); }