r168: *** empty log message ***
[ctsim.git] / libctsim / scanner.cpp
index d4a398ef995006d1e1eca15f9ecec17a40482aaf..5888d45569a16ea9ed0784003278dfd37bace071 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: scanner.cpp,v 1.6 2000/07/28 08:28:08 kevin Exp $
+**  $Id: scanner.cpp,v 1.9 2000/08/02 18:06:00 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
@@ -180,7 +180,7 @@ Scanner::convertGeometryNameToID (const char* const geomName)
 */
 
 void
-Scanner::collectProjections (Projections& proj, const Phantom& phm, const int start_view, const int trace = TRACE_NONE, SGP* pSGP = NULL)
+Scanner::collectProjections (Projections& proj, const Phantom& phm, const int start_view = 0, const int trace = TRACE_NONE, SGP* pSGP = NULL)
 {
   GRFMTX_2D rotmtx_initial, temp;
   GRFMTX_2D rotmtx_incr;
@@ -202,28 +202,26 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st
 
 #ifdef HAVE_SGP 
   if (pSGP && m_trace >= TRACE_PHM) {
-    double wsize = 1.42 * m_phmLen / 2;        /* sqrt(2) * radius */
+    double halfPhmLen = m_phmLen / 2;
+    double wsize = SQRT2 * halfPhmLen;
 
+    pSGP->setRasterOp (RO_SET);
+    pSGP->eraseWindow ();
     pSGP->setColor (C_LTBLUE);
     pSGP->setWindow (xcent - wsize, ycent - wsize, xcent + wsize, ycent + wsize);
     pSGP->setColor (C_BROWN);
-#if RADIUS
-    pSGP->drawCircle (m_phmLen / 2);
-#else
-    pSGP->drawRect (xcent - m_phmLen / 2, ycent - m_phmLen / 2,
-                   xcent + m_phmLen / 2, ycent + m_phmLen / 2);
-#endif
+    pSGP->drawRect (xcent - halfPhmLen, ycent - halfPhmLen, xcent + halfPhmLen, ycent + halfPhmLen);
     pSGP->setColor (C_BROWN);
     pSGP->moveAbs (0., 0.);
     pSGP->drawCircle (wsize);
-    //      raysum_trace_menu_column = (crt->xsize * crt->asp) / 8 + 3;
-    traceShowParam ("X-Ray Simulator", "%s", RAYSUM_TRACE_ROW_TITLE, 8+C_LTWHITE, " ");
-    traceShowParam ("---------------", "%s", RAYSUM_TRACE_ROW_TITLE2, 8+C_LTWHITE, " ");
+
+    traceShowParam ("X-Ray Simulator", "%s", RAYSUM_TRACE_ROW_TITLE, C_BLACK, " ");
+    traceShowParam ("---------------", "%s", RAYSUM_TRACE_ROW_TITLE2, C_BLACK, " ");
     traceShowParam ("Phantom:",       "%s", RAYSUM_TRACE_ROW_PHANT_ID, C_YELLOW, " Herman");
     traceShowParam ("Chomaticity  :", "%s", RAYSUM_TRACE_ROW_CHROMATIC, C_LTGREEN, "Mono");
     traceShowParam ("Scatter      :", "%5.1f", RAYSUM_TRACE_ROW_SCATTER, C_LTGREEN, 0.);
     traceShowParam ("Photon Uncert:", "%5.1f", RAYSUM_TRACE_ROW_PHOT_STAT, C_LTGREEN, 0.);
-    traceShowParam ("Num Scanners:", "%5d", RAYSUM_TRACE_ROW_NDET, C_LTRED, proj.nDet());
+    traceShowParam ("Num Detectors:", "%5d", RAYSUM_TRACE_ROW_NDET, C_LTRED, proj.nDet());
     traceShowParam ("Num Views    :", "%5d", RAYSUM_TRACE_ROW_NVIEW, C_LTRED, proj.nView());
     traceShowParam ("Samples / Ray:", "%5d", RAYSUM_TRACE_ROW_SAMPLES, C_LTRED, m_nSample);
     
@@ -260,6 +258,8 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st
 
 #ifdef HAVE_SGP
     if (pSGP && m_trace >= TRACE_PHM) {
+      pSGP->setRasterOp (RO_XOR);
+      pSGP->setColor (C_RED);
       pSGP->moveAbs (xd1, yd1);
       pSGP->lineAbs (xd2, yd2);
       pSGP->moveAbs (xs1, ys1);
@@ -275,6 +275,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st
 #ifdef HAVE_SGP
     if (pSGP && m_trace >= TRACE_PHM) {
       //       rs_plot (detArray, xd1, yd1, xcent, ycent, theta);
+      pSGP->setColor (C_RED);
       pSGP->moveAbs (xd1, yd1);
       pSGP->lineAbs (xd2, yd2);
       pSGP->moveAbs (xs1, ys1);
@@ -348,6 +349,7 @@ Scanner::projectSingleView (const Phantom& phm, DetectorArray& detArray, const d
       for (unsigned int i = 0; i < m_nSample; i++) {
 #ifdef HAVE_SGP
        if (pSGP && m_trace >= TRACE_RAYS) {
+         pSGP->setColor (C_LTBLUE);
          pSGP->moveAbs (xs, ys);
          pSGP->lineAbs (xd, yd);
        }
@@ -359,6 +361,7 @@ Scanner::projectSingleView (const Phantom& phm, DetectorArray& detArray, const d
 
 #ifdef HAVE_SGP
        if (pSGP && m_trace >= TRACE_RAYS) {
+         pSGP->setColor (C_LTBLUE);
          pSGP->moveAbs (xs, ys);
          pSGP->lineAbs (xd, yd);
        }