r175: *** empty log message ***
[ctsim.git] / tools / phm2pj.cpp
index 69c6ea5b853a366498d07e5863d2c237dae5302c..82cad2f5ab8d92b69e97280a04336c233ed909ac 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phm2pj.cpp,v 1.1 2000/07/13 07:01:35 kevin Exp $
+**  $Id: phm2pj.cpp,v 1.9 2000/08/03 09:57:29 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
@@ -47,6 +47,8 @@ static struct option phm2pj_options[] =
   {0, 0, 0, 0}
 };
 
+static const char* g_szIdStr = "$Id: phm2pj.cpp,v 1.9 2000/08/03 09:57:29 kevin Exp $";
+
 
 void 
 phm2pj_usage (const char *program)
@@ -88,7 +90,7 @@ int
 phm2pj_main (int argc, char* argv[])
 {
   Phantom phm;
-  string optGeometryName = Scanner::GEOMETRY_PARALLEL_STR;
+  string optGeometryName = Scanner::convertGeometryIDToName(Scanner::GEOMETRY_PARALLEL);
   char *opt_outfile = NULL;
   string opt_desc;
   string optPhmFileName;
@@ -96,7 +98,7 @@ phm2pj_main (int argc, char* argv[])
   int opt_nview;
   int opt_nray = 1;
   int opt_trace = 0;
-  string optPhmName = Phantom::PHM_HERMAN_STR;
+  string optPhmName (Phantom::convertPhantomIDToName(Phantom::PHM_HERMAN));
   int opt_verbose = 0;
   int opt_debug = 0;
   double opt_rotangle = 1;
@@ -133,7 +135,7 @@ phm2pj_main (int argc, char* argv[])
        break;
        break;
       case O_TRACE:
-       if ((opt_trace = convertTraceNameToID(optarg)) == TRACE_INVALID) {
+       if ((opt_trace = TraceLevel::convertTraceNameToID(optarg)) == TRACE_INVALID) {
          phm2pj_usage(argv[0]);
          return (1);
        }
@@ -161,7 +163,7 @@ phm2pj_main (int argc, char* argv[])
        break;
         case O_VERSION:
 #ifdef VERSION
-         cout << "Version: " << VERSION << endl;
+         cout << "Version: " << VERSION << endl << g_szIdStr << endl;
 #else
           cout << "Unknown version number" << endl;
 #endif
@@ -285,8 +287,26 @@ phm2pj_main (int argc, char* argv[])
 
 #else
   Projections pjGlobal (scanner);
+#if HAVE_SGP
+  SGPDriver* pSGPDriver = NULL;
+  SGP* pSGP = NULL;
+  if (opt_trace >= TRACE_PHM) {
+    pSGPDriver = new SGPDriver ("phm2pj", 600, 600);
+    pSGP = new SGP (*pSGPDriver);
+  }
+  scanner.collectProjections (pjGlobal, phm, 0, opt_trace, pSGP);
+  if (opt_trace >= TRACE_PHM) {
+    cout << "Press enter to continue\n";
+    cio_kb_getc();
+    delete pSGP;  pSGP = NULL;
+    delete pSGPDriver;  pSGPDriver = NULL;
+  }
+
+#else
   scanner.collectProjections (pjGlobal, phm, 0, opt_trace);
 #endif
+
+#endif
   
 #ifdef HAVE_MPI
   if (mpiWorld.getRank() == 0) 
@@ -358,6 +378,9 @@ main (int argc, char* argv[])
 
   try {
     retval = phm2pj_main(argc, argv);
+#if HAVE_DMALLOC
+    //    dmalloc_shutdown();
+#endif
   } catch (exception e) {
     cerr << "Exception: " << e.what() << endl;
   } catch (...) {