r246: More modifications for MSVC
[ctsim.git] / libctsim / scanner.cpp
index 7d95afd642506bb5eac5f031c69a56fabc6c1b36..c8c86632d1c15924cf9e9f4794ed8be6b9703c9a 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: scanner.cpp,v 1.14 2000/09/02 05:10:39 kevin Exp $
+**  $Id: scanner.cpp,v 1.17 2000/12/06 01:46:43 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
@@ -361,10 +361,12 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iS
       }
       m_pSGP->setPenWidth (1);
     }
-    if (m_trace >= Trace::TRACE_CONSOLE)
+    if (m_trace > Trace::TRACE_CONSOLE)
       traceShowParam ("Current View:", "%d (%.0f%%)", PROJECTION_TRACE_ROW_CURR_VIEW, C_RED, iView + iStartView, (iView + iStartView) / static_cast<double>(m_nView) * 100.);
 #endif
-           
+    if (m_trace == Trace::TRACE_CONSOLE)
+       cout << "Current View: " << iView+iStartView << endl;
+
     projectSingleView (phm, detArray, xd1, yd1, xd2, yd2, xs1, ys1, xs2, ys2, viewAngle + 3 * HALFPI);
     detArray.setViewAngle (viewAngle);
       
@@ -504,7 +506,11 @@ Scanner::traceShowParam (const char *szLabel, const char *fmt, int row, int colo
 {  
   va_list arg;
   va_start(arg, color);
+#ifdef HAVE_SGP
   traceShowParamRasterOp (RO_COPY, szLabel, fmt, row, color, arg);
+#else
+  traceShowParamRasterOp (0, szLabel, fmt, row, color, arg);
+#endif  
   va_end(arg);
 }
 
@@ -513,7 +519,11 @@ Scanner::traceShowParamXOR (const char *szLabel, const char *fmt, int row, int c
 {  
   va_list arg;
   va_start(arg, color);
+#ifdef HAVE_SGP
   traceShowParamRasterOp (RO_XOR, szLabel, fmt, row, color, arg);
+#else
+  traceShowParamRasterOp (0, szLabel, fmt, row, color, arg);
+#endif
   va_end(arg);
 }
 
@@ -522,12 +532,17 @@ Scanner::traceShowParamRasterOp (int iRasterOp, const char *szLabel, const char
 {  
   char szValue[256];
 
-  vsnprintf (szValue, sizeof(szValue), fmt, args);
+#ifdef MSVC
+  vsprintf (szValue, fmt, args);
+#else
+  vnsprintf (szValue, sizeof(szValue), fmt, args);
+#endif
 
   //  cio_set_cpos (raysum_trace_menu_column, row);
   //  cio_set_text_clr (color - 8, 0);
   //  cio_set_text_clr (color, 0);
 
+#ifdef HAVE_SGP
   if (m_pSGP) {
     m_pSGP->setRasterOp (iRasterOp);
     double dYPos = m_dYMaxWin - (row * m_dTextHeight);
@@ -537,11 +552,13 @@ Scanner::traceShowParamRasterOp (int iRasterOp, const char *szLabel, const char
     double dValueOffset = (m_dXMaxWin - m_dXMinWin) / 4;
     m_pSGP->moveAbs (m_dXMinWin + dValueOffset, dYPos);
     m_pSGP->drawText (szValue);
-  } else {
-    cio_put_str (szLabel);
-    cio_put_str (szValue);
-    cio_put_str ("\n");
-  }
+  } else 
+#endif
+    {
+      cio_put_str (szLabel);
+      cio_put_str (szValue);
+      cio_put_str ("\n");
+    }
 }