X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctgraphics%2Fezset.cpp;h=f04178728a2dff94027a883f063e14490349071e;hp=222b3cd5a77c08d1986847f7b0be87cf9002a160;hb=9f29c8b32c972db1178d6f8551d5cd57ceb67083;hpb=5c6b29ab4885308cc3381af6e0a68f4804956d2e diff --git a/libctgraphics/ezset.cpp b/libctgraphics/ezset.cpp index 222b3cd..f041787 100644 --- a/libctgraphics/ezset.cpp +++ b/libctgraphics/ezset.cpp @@ -4,9 +4,9 @@ ** EZSET - Parameter control for EZPLOT ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ezset.cpp,v 1.15 2000/12/29 15:45:06 kevin Exp $ +** $Id: ezset.cpp,v 1.17 2001/01/28 19:10:18 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 @@ -26,17 +26,17 @@ #include "ezplot.h" #include "pol.h" - -bool -EZPlot::ezset (const std::string& command) -{ - return ezset (command.c_str()); -} + +bool +EZPlot::ezset (const std::string& command) +{ + return ezset (command.c_str()); +} bool EZPlot::ezset (const char* const command) { - + return ezcmd (command); } @@ -91,8 +91,8 @@ EZPlot::do_cmd (int lx) c_title = strIn; break; case S_LEGEND: - m_pol.readText (strIn, sizeof(strIn)); - if (m_iCurrentCurve >= 0) + m_pol.readText (strIn, sizeof(strIn)); + if (m_iCurrentCurve >= 0) setLegend (m_iCurrentCurve, strIn); break; case S_XLABEL: @@ -171,24 +171,24 @@ EZPlot::do_cmd (int lx) o_linestyle = SGP::LS_SOLID; break; case S_DASH: - int ls; - ls = SGP::LS_DASH1; - if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { + int ls; + ls = SGP::LS_DASH1; + if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { if (n == 1) ls = SGP::LS_DASH1; else if (n == 2) ls = SGP::LS_DASH2; else if (n == 3) ls = SGP::LS_DASH3; - else if (n == 4) - ls = SGP::LS_DASH4; - else if (n == 5) - ls = SGP::LS_DOTTED; - } - if (m_iCurrentCurve < 0) - o_linestyle = ls; - else - setLinestyle (m_iCurrentCurve, ls); + else if (n == 4) + ls = SGP::LS_DASH4; + else if (n == 5) + ls = SGP::LS_DOTTED; + } + if (m_iCurrentCurve < 0) + o_linestyle = ls; + else + setLinestyle (m_iCurrentCurve, ls); break; case S_NOLINE: o_linestyle = SGP::LS_NOLINE; @@ -197,11 +197,11 @@ EZPlot::do_cmd (int lx) case S_COLOR: if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { - if (n >= 0) { + if (n >= 0) { if (m_iCurrentCurve < 0) - o_color = n; - else - setColor (m_iCurrentCurve, n); + o_color = n; + else + setColor (m_iCurrentCurve, n); } else bad_option("The color you picked"); } @@ -283,36 +283,36 @@ EZPlot::do_cmd (int lx) case S_SYMBOL: if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { if (n > 0 && n <= MAXSYMBOL) { - if (m_iCurrentCurve < 0) - o_symbol = n; - else - setSymbol (m_iCurrentCurve, n); - } + if (m_iCurrentCurve < 0) + o_symbol = n; + else + setSymbol (m_iCurrentCurve, n); + } } else { if (m_pol.readWord("every",5) == TRUE) { - if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { + if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { int sym = 1; - if (n > 0) - sym = n; - if (m_iCurrentCurve < 0) - o_symfreq = sym; - else - setSymbolFreq (m_iCurrentCurve, sym); + if (n > 0) + sym = n; + if (m_iCurrentCurve < 0) + o_symfreq = sym; + else + setSymbolFreq (m_iCurrentCurve, sym); } } else if (m_pol.readWord ("none",4) == TRUE) { o_symbol = -1; } } break; - case S_CURVE: - if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { - if (n > 0) - m_iCurrentCurve = n - 1; - } else { - if (m_pol.readWord ("all",3) == TRUE) - m_iCurrentCurve = -1; - } - break; + case S_CURVE: + if (m_pol.readInteger (&n, POL::TT_REAL, FALSE, 0, 0) == TRUE) { + if (n > 0) + m_iCurrentCurve = n - 1; + } else { + if (m_pol.readWord ("all",3) == TRUE) + m_iCurrentCurve = -1; + } + break; case S_XTICKS: if (m_pol.readUserToken(str,&lx) == FALSE) break; @@ -382,21 +382,21 @@ EZPlot::do_cmd (int lx) } - + void EZPlot::bad_option (char *opt) { sys_error (ERR_WARNING, "INVALID option: %s", opt); } - + //---------------------------------------------------------------------- // KEYWORDS / CODES TABLE //---------------------------------------------------------------------- -const struct KeywordCodeTable EZPlot::m_sKeywords[] = -{ +const struct KeywordCodeTable EZPlot::m_sKeywords[] = +{ {"solid", S_SOLID}, - {"dash", S_DASH}, + {"dash", S_DASH}, {"curve", S_CURVE}, {"noline", S_NOLINE}, {"black", S_BLACK}, @@ -473,7 +473,7 @@ const struct KeywordCodeTable EZPlot::m_sKeywords[] = {"textsize", S_TEXTSIZE}, }; - + const int EZPlot::NKEYS = (sizeof(EZPlot::m_sKeywords) / sizeof (struct KeywordCodeTable)); void