r487: no message
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 4 Feb 2001 22:58:41 +0000 (22:58 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 4 Feb 2001 22:58:41 +0000 (22:58 +0000)
msvc/ctsim/ctsim.plg
src/graph3dview.cpp
src/graph3dview.h

index f7919e4cbaf7924f69dd00d193733b8d75154df7..f81c43f3c7510966b160136f5b378c0b0b564b30 100644 (file)
@@ -6,13 +6,22 @@
 --------------------Configuration: ctsim - Win32 Debug--------------------
 </h3>
 <h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP18A.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D3.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.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
+"D:\ctsim\src\ctsim.cpp"
+"D:\ctsim\src\dialogs.cpp"
+"D:\ctsim\src\docs.cpp"
+"D:\ctsim\src\views.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D3.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D4.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"
+"D:\ctsim\src\graph3dview.cpp"
 ]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP18A.tmp" 
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP18B.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D4.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D5.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
@@ -33,9 +42,14 @@ 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\RSP18B.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9D5.tmp"
 <h3>Output Window</h3>
 Compiling...
+ctsim.cpp
+dialogs.cpp
+docs.cpp
+views.cpp
+Compiling...
 graph3dview.cpp
 Linking...
 
index d0d53edeb839b0293cd1e40b5147b0a7e0a7213c..9098e25faec12e0eb2eb4b37fc3f6680727ec96b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: graph3dview.cpp,v 1.10 2001/02/04 21:28:19 kevin Exp $
+**  $Id: graph3dview.cpp,v 1.11 2001/02/04 22:58:41 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
@@ -230,20 +230,7 @@ Graph3dFileView::CreateCanvas (wxFrame* parent)
   int width, height;
   parent->GetClientSize (&width, &height);
   
-#ifdef __WXMSW__
-  int *gl_attrib = NULL;
-#else
-  int gl_attrib[20] = { GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
-    GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, GLX_DOUBLEBUFFER, None };
-#endif
-  
-  if(! m_bDoubleBuffer) {
-#ifdef __WXGTK__
-    gl_attrib[9] = None;
-#endif
-  }
-  
-  pCanvas = new Graph3dFileCanvas (this, parent, wxPoint(0, 0), wxSize(200, 200), 0, gl_attrib);
+  pCanvas = new Graph3dFileCanvas (this, parent, wxPoint(0, 0), wxSize(200, 200), 0);
   
   pCanvas->SetBackgroundColour(*wxWHITE);
   pCanvas->Clear();
@@ -280,10 +267,9 @@ Graph3dFileView::DrawSurface()
   unsigned int nx = GetDocument()->nx();
   unsigned int ny = GetDocument()->ny();
   glRotated (m_dZRotate, 0.0, 1.0, 0.0);
-  glTranslated (-static_cast<double>(nx) / 2, 0.0, -static_cast<double>(ny) / 2);
-  glRotated (m_dYRotate, 1.0, 0.0, 0.0);
   glRotated (m_dXRotate, 0.0, 0.0, 1.0);
-  
+  glRotated (m_dYRotate, 1.0, 0.0, 0.0);
+  glTranslated (-static_cast<double>(nx - 1) / 2, 0.0, -static_cast<double>(ny - 1) / 2);
   glCallList (DISPLAYLIST_SURFACE);
 }
 
@@ -305,17 +291,23 @@ Graph3dFileView::CreateDisplayList()
   double dIntensityScale = m_dColorScaleMax - m_dColorScaleMin;
   double actOffset = m_dGraphMin;
   double actScale = 0.4 * sqrt(nx*nx+ny*ny) / (m_dGraphMax - m_dGraphMin);
-  
+  double dXOffset = -(static_cast<double>(nx) - 1) / 2.;
+  double dYOffset = -(static_cast<double>(ny) - 1) / 2.;
+  dXOffset = 0;
+  dYOffset = 0;
+
   if (! m_bColor)
     glColor3f (1.0f, 1.0f, 1.0f);
   
-  for (unsigned ix = 0; ix < nx - 1; ix++) {
+  double dXPos = -dXOffset;
+  for (unsigned ix = 0; ix < nx - 1; ix++, dXPos++) {
+       double dYPos = -dYOffset;
     glBegin(GL_QUAD_STRIP);
     double p1[3], p2[3], p3[3];
     double n1[3]; 
-    p1[0] = ix;  p1[1] = actScale * (v[ix][0] + actOffset); p1[2] = 0;
-    p2[0] = ix+1; p2[1] = actScale * (v[ix+1][0] + actOffset); p2[2] = 0
-    p3[0] = ix; p3[1] = actScale * (v[ix][1] + actOffset); p3[2] = 1;
+    p1[0] = dXPos;  p1[1] = actScale * (v[ix][0] + actOffset); p1[2] = dYPos;
+    p2[0] = dXPos+1; p2[1] = actScale * (v[ix+1][0] + actOffset); p2[2] = dYPos
+    p3[0] = dXPos; p3[1] = actScale * (v[ix][1] + actOffset); p3[2] = dYPos + 1;
     CalculateVectorNormal (p1, p2, p3, &n1[0], &n1[1], &n1[2]);
     double dIntensity1, dIntensity2;
     if (m_bColor) {
@@ -337,9 +329,9 @@ Graph3dFileView::CreateDisplayList()
     glNormal3dv (n1);                                  
     double lastP[3];
     lastP[0] = ix; lastP[1] = actScale * (v[ix][0] + actOffset); lastP[2] = 0; 
-    for (unsigned int iy = 1; iy < ny - 1; iy++) {       
-      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;
+    for (unsigned int iy = 1; iy < ny - 1; iy++, dYPos++) {       
+      p1[0] = dXPos; p1[1] = actScale * (v[ix][iy] + actOffset); p1[2] = dYPos;
+      p2[0] = dXPos+1;  p2[1] = actScale * (v[ix+1][iy] + actOffset); p2[2] = dYPos;
       CalculateVectorNormal (p1, p2, lastP, &n1[0], &n1[1], &n1[2]);
       lastP[0] = p1[0]; lastP[1] = p1[1]; lastP[2] = p1[2];
       if (m_bColor) {
@@ -414,7 +406,9 @@ Graph3dFileView::OnDraw (wxDC* dc)
   if (! m_pCanvas->GetContext()) return;
 #endif
   
-  m_pCanvas->SwapBuffers();
+  if (! m_pCanvas)
+    return;
+  m_pCanvas->SetCurrent();
   Draw();
   std::ostringstream os;
   os << "Xangle=" << m_dXRotate << ", Yangle=" << m_dYRotate << ", Zangle=" << m_dZRotate;
@@ -823,8 +817,9 @@ END_EVENT_TABLE()
 
 
 Graph3dFileCanvas::Graph3dFileCanvas (Graph3dFileView* view, wxWindow *parent, const wxPoint& pos, 
-                                      const wxSize& size, long style, int* gl_attrib):
-wxGLCanvas (parent, -1, pos, size, style, _T("Graph3dCanvas"), gl_attrib), m_pView(view)
+                                      const wxSize& size, long style):
+wxGLCanvas (parent, -1, pos, size, style, _T("Graph3dCanvas")
+                       ), m_pView(view)
 {
   parent->Show (true);
   SetCurrent();
index 702309e19edbe9c31365e1c2571800d423ee7833..f5ae3e4afc19f78ecb175cb2ef0b384c2897269b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: graph3dview.h,v 1.5 2001/02/04 21:28:19 kevin Exp $
+**  $Id: graph3dview.h,v 1.6 2001/02/04 22:58:41 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
@@ -135,7 +135,7 @@ private:
 
 public:
    Graph3dFileCanvas (Graph3dFileView* view, wxWindow *parent, const wxPoint& pos = wxDefaultPosition,
-      const wxSize& size = wxDefaultSize, long style = 0, int* gl_attrib = NULL);
+      const wxSize& size = wxDefaultSize, long style = 0);
    virtual ~Graph3dFileCanvas();
 
    virtual void OnDraw(wxDC& dc);