X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Ftrace.cpp;fp=libctsim%2Ftrace.cpp;h=3bb8ce8ca6a6b997fce31b002be2edd97902b92d;hb=27a474e0622ebb7229fd5705552021f63d8f932d;hp=0000000000000000000000000000000000000000;hpb=ab4a3ba2c1ba9672136b5022897f81fc55d03493;p=ctsim.git diff --git a/libctsim/trace.cpp b/libctsim/trace.cpp new file mode 100644 index 0000000..3bb8ce8 --- /dev/null +++ b/libctsim/trace.cpp @@ -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); +} + +