1 /*****************************************************************************
4 ** Name: trace.cpp Class for trace
5 ** Programmer: Kevin Rosenberg
6 ** Date Started: June 2000
8 ** This is part of the CTSim program
9 ** Copyright (C) 1983-2000 Kevin Rosenberg
11 ** $Id: trace.cpp,v 1.3 2000/08/27 20:32:55 kevin Exp $
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.
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.
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 ******************************************************************************/
29 const int Trace::TRACE_INVALID = -1;
30 const int Trace::TRACE_NONE = 0;
31 const int Trace::TRACE_CONSOLE = 1;
32 const int Trace::TRACE_PHANTOM = 2;
33 const int Trace::TRACE_PROJECTIONS = 3;
34 const int Trace::TRACE_PLOT = 4;
35 const int Trace::TRACE_CLIPPING = 5;
37 const int Trace::BIT_CONSOLE = 0x0001;
38 const int Trace::BIT_PHANTOM = 0x0002;
39 const int Trace::BIT_PROJECTIONS = 0x0004;
40 const int Trace::BIT_PLOT = 0x0008;
41 const int Trace::BIT_CLIPPING = 0x0010;
43 const char* Trace::s_aszTraceName[] =
53 const char* Trace::s_aszTraceTitle[] =
63 const int Trace::s_iTraceCount = sizeof(s_aszTraceName) / sizeof(const char*);
67 Trace::convertTraceIDToName (const int idTrace)
69 const char *name = "";
71 if (idTrace >= 0 && idTrace < s_iTraceCount)
72 return (s_aszTraceName[idTrace]);
78 Trace::convertTraceIDToTitle (const int idTrace)
80 const char *title = "";
82 if (idTrace >= 0 && idTrace < s_iTraceCount)
83 return (s_aszTraceName[idTrace]);
89 Trace::convertTraceNameToID (const char* const traceName)
91 int id = Trace::TRACE_INVALID;
93 for (int i = 0; i < s_iTraceCount; i++)
94 if (strcasecmp (traceName, s_aszTraceName[i]) == 0) {