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-2009 Kevin Rosenberg
11 ** This program is free software; you can redistribute it and/or modify
12 ** it under the terms of the GNU General Public License (version 2) as
13 ** published by the Free Software Foundation.
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ** GNU General Public License for more details.
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program; if not, write to the Free Software
22 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 ******************************************************************************/
27 const int Trace::TRACE_INVALID = -1;
28 const int Trace::TRACE_NONE = 0;
29 const int Trace::TRACE_CONSOLE = 1;
30 const int Trace::TRACE_PHANTOM = 2;
31 const int Trace::TRACE_PROJECTIONS = 3;
32 const int Trace::TRACE_PLOT = 4;
33 const int Trace::TRACE_CLIPPING = 5;
35 const int Trace::BIT_CONSOLE = 0x0001;
36 const int Trace::BIT_PHANTOM = 0x0002;
37 const int Trace::BIT_PROJECTIONS = 0x0004;
38 const int Trace::BIT_PLOT = 0x0008;
39 const int Trace::BIT_CLIPPING = 0x0010;
41 const char* Trace::s_aszTraceName[] =
51 const char* Trace::s_aszTraceTitle[] =
61 const int Trace::s_iTraceCount = sizeof(s_aszTraceName) / sizeof(const char*);
65 Trace::convertTraceIDToName (const int idTrace)
67 const char *name = "";
69 if (idTrace >= 0 && idTrace < s_iTraceCount)
70 return (s_aszTraceName[idTrace]);
76 Trace::convertTraceIDToTitle (const int idTrace)
78 const char *title = "";
80 if (idTrace >= 0 && idTrace < s_iTraceCount)
81 return (s_aszTraceName[idTrace]);
87 Trace::convertTraceNameToID (const char* const traceName)
89 int id = Trace::TRACE_INVALID;
91 for (int i = 0; i < s_iTraceCount; i++)
92 if (strcasecmp (traceName, s_aszTraceName[i]) == 0) {