r635: no message
[ctsim.git] / src / graph3dview.cpp
index a391599a8012089e0cb04627db8cffb70d3942c2..d92912fb09a653f164d88460d4067eb86bfd8ac7 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: graph3dview.cpp,v 1.13 2001/02/16 02:36:18 kevin Exp $
+**  $Id: graph3dview.cpp,v 1.19 2001/03/13 04:44:25 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
 #pragma interface
 #endif
 
-// For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
 #endif
@@ -172,7 +167,7 @@ EVT_MENU(GRAPH3D_VIEW_SCALE_FULL, Graph3dFileView::OnScaleFull)
 END_EVENT_TABLE()
 
 Graph3dFileView::Graph3dFileView ()
-: m_pFileMenu(NULL), m_pViewMenu(NULL)
+  : m_pFileMenu(NULL), m_pViewMenu(NULL), m_pCanvas(NULL), m_pFrame(NULL)
 {
   m_bDoubleBuffer = true;
   m_bSmooth = true;
@@ -197,7 +192,6 @@ bool
 Graph3dFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
 {
   m_pFrame = CreateChildFrame(doc, this);
-  (m_pFrame);
   
   int width, height;
   m_pFrame->GetClientSize (&width, &height);
@@ -301,14 +295,14 @@ Graph3dFileView::CreateDisplayList()
   
   double dXPos = -dXOffset;
   for (unsigned ix = 0; ix < nx - 1; ix++, dXPos++) {
-       double dYPos = -dYOffset;
+    double dYPos = -dYOffset;
     glBegin(GL_QUAD_STRIP);
-    double p1[3], p2[3], p3[3];
-    double n1[3]; 
+    double p1[3], p2[3], p3[3], n1[3]; 
     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) {
       dIntensity1 = (v[ix][0] - dMin) / dIntensityScale;
@@ -585,8 +579,8 @@ Graph3dFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
   if (! GetDocument())
     return;
   
-  int nx = GetDocument()->nx();
-  int ny = GetDocument()->ny();
+  unsigned int nx = GetDocument()->nx();
+  unsigned int ny = GetDocument()->ny();
   const ImageFileArrayConst v = GetDocument()->getArray();
   if (v != NULL && nx != 0 && ny != 0) {
     double min = v[0][0];
@@ -614,7 +608,7 @@ Graph3dFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
   
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
-#if 1
+#if 0
   GLfloat eyep[3], lookp[3], up[3];
   eyep[0] = -nx/2; eyep[1] = 0; eyep[2] = -ny/2;
   lookp[0] = 0; lookp[1] = 0, lookp[2] = 0;