r156: *** empty log message ***
[ctsim.git] / libctsim / trace.cpp
diff --git a/libctsim/trace.cpp b/libctsim/trace.cpp
new file mode 100644 (file)
index 0000000..3bb8ce8
--- /dev/null
@@ -0,0 +1,58 @@
+/*****************************************************************************
+** FILE IDENTIFICATION
+**
+**   Name:        trace.cpp        Class for trace
+**   Programmer:   Kevin Rosenberg
+**   Date Started: June 2000
+**
+**  This is part of the CTSim program
+**  Copyright (C) 1983-2000 Kevin Rosenberg
+**
+**  $Id: trace.cpp,v 1.1 2000/07/20 11:17:31 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
+**  published by the Free Software Foundation.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+**
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+******************************************************************************/
+
+#include "ct.h"
+
+const char TraceLevel::TRACE_NONE_STR[]=     "none";
+const char TraceLevel::TRACE_TEXT_STR[]=     "text";
+const char TraceLevel::TRACE_PHM_STR[]=      "phm";
+const char TraceLevel::TRACE_RAYS_STR[]=     "rays";
+const char TraceLevel::TRACE_PLOT_STR[]=     "plot";
+const char TraceLevel::TRACE_CLIPPING_STR[]= "clipping";
+
+
+TraceID
+TraceLevel::convertTraceNameToID (const char *traceString)
+{
+  TraceID traceID = TRACE_INVALID;
+
+  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;
+
+  return (traceID);
+}
+
+