r118: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 22 Jun 2000 10:42:39 +0000 (10:42 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 22 Jun 2000 10:42:39 +0000 (10:42 +0000)
include/ct.h
include/imagefile.h
include/trace.h
libctsim/dialogs.cpp

index ead95ad7381edd02fa98a2a25b8122ca912c974a..10f7feb0034cc2f8703a7586a01e11b7a77d4e9c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ct.h,v 1.21 2000/06/22 10:17:28 kevin Exp $
+**  $Id: ct.h,v 1.22 2000/06/22 10:42:39 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
 **
 **  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
@@ -142,46 +142,7 @@ using namespace std;
 #include "backprojectors.h"
 #include "filter.h"
 #include "projections.h"
 #include "backprojectors.h"
 #include "filter.h"
 #include "projections.h"
-
-//----------------------------------------------------------------------//
-//                             USER SYMBOLS                            //
-//----------------------------------------------------------------------//
-
-// Trace levels
-static const char O_TRACE_NONE_STR[]=     "none";
-static const char O_TRACE_TEXT_STR[]=     "text";
-static const char O_TRACE_PHM_STR[]=      "phm";
-static const char O_TRACE_RAYS_STR[]=     "rays";
-static const char O_TRACE_PLOT_STR[]=     "plot";
-static const char O_TRACE_CLIPPING_STR[]= "clipping";
-
-enum {
-  TRACE_NONE,          /* No tracing */
-  TRACE_TEXT,          /* Minimal status */
-  TRACE_PHM,           /* Show phantom */
-  TRACE_RAYS,          /* Show all rays */
-  TRACE_PLOT,          /* Plot raysums */
-  TRACE_CLIPPING       /* Plot clipping */
-};
-
-
-/*************************************************************************
- *  FUNCTION DECLARATIONS
- ************************************************************************/
-
-// dialogs.cpp 
-bool phm_add_pelem_kb (Phantom& phm);
-const Phantom& phm_select (Phantom& phm);
-int interpolation_select (void);
-int filter_select (double *filter_param);
-
-// options.cpp 
-int opt_set_trace(const char *optarg);
-
-// imagefile.cpp 
-void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, double filt_param, const int opt_trace);
-int image_display (const ImageFile& im);
-int image_display_scale (const ImageFile& im, const int scale, const double pmin, const double pmax);
+#include "trace.h"
 
 
 #endif
 
 
 #endif
index 607f7166cd1cef4bd2f323c273830c0b38bb23e7..3b1882f24e7d64e3ce06c404d32cfa31a740b66f 100644 (file)
@@ -692,6 +692,13 @@ typedef kfloat32*  ImageFileColumn;
 typedef kfloat32** ImageFileArray;
 #endif
 
 typedef kfloat32** ImageFileArray;
 #endif
 
+
+// imagefile.cpp 
+void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, double filt_param, const int opt_trace);
+int image_display (const ImageFile& im);
+int image_display_scale (const ImageFile& im, const int scale, const double pmin, const double pmax);
+
+
 #endif
 
 
 #endif
 
 
index d302d3c2f7e1f8afa61e73c2e63c66db55d3fdc9..20e3186e8cc70164c98c81f10b04c154b8eb736f 100644 (file)
@@ -1,14 +1,6 @@
 #ifndef TRACE_H
 #define TRACE_H
 
 #ifndef TRACE_H
 #define TRACE_H
 
-// Trace levels
-static const char TRACE_NONE_STR[]=     "none";
-static const char TRACE_TEXT_STR[]=     "text";
-static const char TRACE_PHM_STR[]=      "phm";
-static const char TRACE_RAYS_STR[]=     "rays";
-static const char TRACE_PLOT_STR[]=     "plot";
-static const char TRACE_CLIPPING_STR[]= "clipping";
-
 enum {
   TRACE_NONE,          /* No tracing */
   TRACE_TEXT,          /* Minimal status */
 enum {
   TRACE_NONE,          /* No tracing */
   TRACE_TEXT,          /* Minimal status */
@@ -18,29 +10,51 @@ enum {
   TRACE_CLIPPING       /* Plot clipping */
 };
 
   TRACE_CLIPPING       /* Plot clipping */
 };
 
+static const char TRACE_NONE_STR[]=     "none";
+static const char TRACE_TEXT_STR[]=     "text";
+static const char TRACE_PHM_STR[]=      "phm";
+static const char TRACE_RAYS_STR[]=     "rays";
+static const char TRACE_PLOT_STR[]=     "plot";
+static const char TRACE_CLIPPING_STR[]= "clipping";
+
+class TraceLevel
+{
+ public:
+    TraceLevel (const char* const traceString);
+
+    addTrace (const char* const traceString);
+
+    bool isTrace (const char* const traceQuery) const;
+
+ private:
+
+    bool addTraceElements (const char* const traceString);
+};
+
+
 inline int 
 inline int 
-opt_set_trace (const char *optarg)
+opt_set_trace (const char *traceString)
 {
 {
-  int opt;
-
-  if (strcmp(optarg, TRACE_NONE_STR) == 0)
-    opt = TRACE_NONE;
-  else if (strcmp(optarg, TRACE_TEXT_STR) == 0)
-    opt = TRACE_TEXT;
-  else if (strcmp(optarg, TRACE_PHM_STR) == 0)
-    opt = TRACE_PHM;
-  else if (strcmp(optarg, TRACE_PLOT_STR) == 0)
-    opt = TRACE_PLOT;
-  else if (strcmp(optarg, TRACE_CLIPPING_STR) == 0)
-    opt = TRACE_CLIPPING;
-  else if (strcmp(optarg, TRACE_RAYS_STR) == 0)
-    opt = TRACE_RAYS;
+  int traceID;
+
+  if (strcasecmp (traceString, TRACE_NONE_STR) == 0)
+    traceID = TRACE_NONE;
+  else if (strcasecmp (traceString, TRACE_TEXT_STR) == 0)
+    traceID = TRACE_TEXT;
+  else if (strcasecmp (traceString, TRACE_PHM_STR) == 0)
+    traceID = TRACE_PHM;
+  else if (strcasecmp (traceString, TRACE_PLOT_STR) == 0)
+    traceID = TRACE_PLOT;
+  else if (strcasecmp (traceString, TRACE_CLIPPING_STR) == 0)
+    traceID = TRACE_CLIPPING;
+  else if (strcasecmp (traceString, TRACE_RAYS_STR) == 0)
+    traceID = TRACE_RAYS;
   else {
   else {
-    sys_error(ERR_WARNING,"Invalid trace option %s\n", optarg);
-    opt = -1;
+    sys_error(ERR_WARNING,"Invalid trace option %s\n", traceString);
+    traceID = -1;
   }
 
   }
 
-  return (opt);
+  return (traceID);
 }
 
 
 }
 
 
index de12d98baed83a6302061a8d0423e0010bc1bd8b..e73f6e1382be1fe154d0c858417e64393c2281c3 100644 (file)
@@ -2,7 +2,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: dialogs.cpp,v 1.1 2000/06/19 02:59:34 kevin Exp $
+**  $Id: dialogs.cpp,v 1.2 2000/06/22 10:42:39 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
 **
 **  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
 
 #include "ct.h"
 
 
 #include "ct.h"
 
+/*************************************************************************
+ *  FUNCTION DECLARATIONS
+ ************************************************************************/
+
+// dialogs.cpp 
+bool phm_add_pelem_kb (Phantom& phm);
+const Phantom& phm_select (Phantom& phm);
+int interpolation_select (void);
+int filter_select (double *filter_param);
+
 
 /* NAME
  *   phm_add_pelem_kb                  Let user specify pelem, and add it to the pic
 
 /* NAME
  *   phm_add_pelem_kb                  Let user specify pelem, and add it to the pic