r184: *** empty log message ***
[ctsim.git] / libctsim / trace.cpp
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:         trace.cpp        Class for trace
5 **   Programmer:   Kevin Rosenberg
6 **   Date Started: June 2000
7 **
8 **  This is part of the CTSim program
9 **  Copyright (C) 1983-2000 Kevin Rosenberg
10 **
11 **  $Id: trace.cpp,v 1.2 2000/08/25 15:59:13 kevin Exp $
12 **
13 **  This program is free software; you can redistribute it and/or modify
14 **  it under the terms of the GNU General Public License (version 2) as
15 **  published by the Free Software Foundation.
16 **
17 **  This program is distributed in the hope that it will be useful,
18 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 **  GNU General Public License for more details.
21 **
22 **  You should have received a copy of the GNU General Public License
23 **  along with this program; if not, write to the Free Software
24 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25 ******************************************************************************/
26
27 #include "ct.h"
28
29 const char TraceLevel::TRACE_NONE_STR[]=     "none";
30 const char TraceLevel::TRACE_TEXT_STR[]=     "text";
31 const char TraceLevel::TRACE_PHM_STR[]=      "phm";
32 const char TraceLevel::TRACE_RAYS_STR[]=     "rays";
33 const char TraceLevel::TRACE_PLOT_STR[]=     "plot";
34 const char TraceLevel::TRACE_CLIPPING_STR[]= "clipping";
35
36
37 int
38 TraceLevel::convertTraceNameToID (const char *traceString)
39 {
40   int traceID = TRACE_INVALID;
41
42   if (strcasecmp (traceString, TRACE_NONE_STR) == 0)
43     traceID = TRACE_NONE;
44   else if (strcasecmp (traceString, TRACE_TEXT_STR) == 0)
45     traceID = TRACE_TEXT;
46   else if (strcasecmp (traceString, TRACE_PHM_STR) == 0)
47     traceID = TRACE_PHM;
48   else if (strcasecmp (traceString, TRACE_PLOT_STR) == 0)
49     traceID = TRACE_PLOT;
50   else if (strcasecmp (traceString, TRACE_CLIPPING_STR) == 0)
51     traceID = TRACE_CLIPPING;
52   else if (strcasecmp (traceString, TRACE_RAYS_STR) == 0)
53     traceID = TRACE_RAYS;
54
55   return (traceID);
56 }
57
58