TODO
Read PlotFile's.
- Fix display of ylabel.
-
- Review old ezset.c and add in concept of curve number. Add to ezset
- std::vector for individual curve parameters such as color, linestyle,
- symbol. Read these vectors during plot generation
-
Add help button onto dialog's for reconstruction & projections.
Consider use of wxWindows help file classes.
Consider changing POL into a Class. Consider making it read tag tokens.
- Consider being able to write Phantom files as text
+ Consider being able to write Phantom files as text and view as
+ text in ctsim.
3.0alpha1 - Released 12/30/00
* ctsim: Added row and column plot comparisons between two image
files.
- * Reworked statistics algorithm to share between imagefile and
- plotfile classes.
+ * mathfuncs.cpp: Reworked statistics algorithm to share between
+ imagefile and plotfile classes.
* imagefile.cpp: Fixed scaling bug when rasterizing Phantom with
nsamples > 2. Added generic mage math functions, moved from
* if1: Updated to use new ImageFile class math functions
- * ezplot.h: Updated to more C++ conventions
+ * ezplot: Reworked to better store colors/linestyles/symbols with
+ Individual curves. Updated to more C++ conventions.
+
+ * sgp: Added linestyle settings
2.5.0 - 12/18/00
First Microsoft Windows GUI version
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezplot.h,v 1.20 2000/12/23 18:12:35 kevin Exp $
+** $Id: ezplot.h,v 1.21 2000/12/25 21:54:26 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
double *x;
double *y;
int m_iPointCount;
- int m_iLineStyle;
- int m_iSymbol;
- int m_iSymbolFreq;
- int m_iColor;
- std::string m_sLegend;
- EZPlotCurve (const double* x, const double* y, int n, int color, int linestyle, int symbol, int sumbolFreq, const std::string& legend);
+ EZPlotCurve (const double* x, const double* y, int n);
~EZPlotCurve();
};
enum {
S_DATA = 2,
S_HELP,
- S_EXIT,
+ S_EXIT,\r
+ S_CURVE,
S_SOLID,
S_DASH,
S_NOLINE,
static const int NKEYS;\r
std::vector<class EZPlotCurve*> m_vecCurves;
-
+ std::vector<int> m_veciColor;\r
+ std::vector<bool> m_vecbColorSet;\r
+ std::vector<int> m_veciSymbol;\r
+ std::vector<bool> m_vecbSymbolSet;\r
+ std::vector<int> m_veciSymbolFreq;\r
+ std::vector<bool> m_vecbSymbolFreqSet;\r
+ std::vector<int> m_veciLinestyle;\r
+ std::vector<bool> m_vecbLinestyleSet;\r
+ std::vector<std::string> m_vecsLegend;\r
+ std::vector<bool> m_vecbLegendSet;\r
+\r
+ int getColor (unsigned int iCurve) const;\r
+ int getSymbol (unsigned int iCurve) const;\r
+ const std::string* getLegend (unsigned int iCurve) const;\r
+ int getSymbolFreq (unsigned int iCurve) const;\r
+ int getLinestyle (unsigned int iCurve) const;\r
+\r
+ void setColor (unsigned int iCurve, int iColor);\r
+ void setSymbol (unsigned int iCurve, int iSymbol);\r
+ void setSymbolFreq (unsigned int iCurve, int iSymbolFreq);\r
+ void setLinestyle (unsigned int iCurve, int iLinestyle);\r
+ void setLegend (unsigned int iCurve, const std::string& strLegend);\r
+ void setLegend (unsigned int iCurve, const char* const pszLegend);\r
+\r
+ int m_iCurrentCurve;\r
+
// Colors
int clr_axis; // color of all axis lines
int clr_title; // color of main title
std::string c_xlabel; // label for x axis
std::string c_ylabel; // label for y axis
std::string c_title; // title to print above graph
- std::string c_legend;; // current legend specified
int o_linestyle, o_color; // style to use for curves all subsequent curves to EZPLOT
int o_xaxis, o_yaxis; // Specifies where axis & labels are drawn
double m_dVP_xscale, m_dVP_yscale;
double m_xWorldScale, m_yWorldScale;
- void drawAxes(void);
+ void drawAxes();
void symbol (int sym, double symwidth, double symheight);
void make_numfmt(char *fmtstr, int *fldwid, int *nfrac, double min, double max, int nint);
int axis_scale (double min, double max, int nint, double *minp, double *maxp, int *nintp);
void clearCurves ();
- bool ezcmd (const char const *comm);\r
+ bool ezcmd (const char* const comm);\r
bool do_cmd(int lx);
void bad_option(char *opt);
void initPlotSettings();
- static void initkw(void);
+ static void initKeywords ();
static bool ezset_initialized;
~EZPlot ();
bool ezset (const std::string& command);\r
- bool ezset (const char const *command);
+ bool ezset (const char* const command);
void addCurve (const float* x, const double* y, int num);
void addCurve (const double* x, const float* y, int num);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: pol.h,v 1.5 2000/12/20 14:39:09 kevin Exp $
+** $Id: pol.h,v 1.6 2000/12/25 21:54:26 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
******************************************************************************/
#ifndef __H_POL
#define __H_POL
+\r
-/* codes for pol_usefile */
-
-#define P_USE_STR 1 /* use string as input source */
-#define P_USE_FILE 2 /* use file as input source */
-
-/* codes for pol_int and pol_float */
-/* if in reject catagory, get new number from terminal */
-
-#define P_FLTINT 1 /* get a real or integer number */
-#define P_BFLTINT 2 /* get a real or integer number, clip against bounds */
-#define P_CBFLTINT 3 /* get real or int, reject if outside bounds */
-
-#define P_FLT 4 /* get a real number */
-#define P_BFLT 5 /* get a real, clip against bounds */
-#define P_CBFLT 6 /* get a floating, reject if outside bounds */
+// codes for pol_usefile
+enum {\r
+ P_USE_STR = 1, // use string as input source
+ P_USE_FILE, // use file as input source \r
+};
-#define P_INT 7 /* get a integer number */
-#define P_BINT 8 /* get a integer, clip against bounds */
-#define P_CBINT 9 /* get a integer, reject if outside bounds */
+// codes for pol_int and pol_float
+// if in reject catagory, get new number from terminal
+enum {
+ P_FLTINT = 1, // get a real or integer number
+ P_BFLTINT, // get a real or integer number, clip against bounds
+ P_CBFLTINT, // get real or int, reject if outside bounds
+ P_FLT, // get a real number
+ P_BFLT, // get a real, clip against bounds
+ P_CBFLT, // get a floating, reject if outside bounds
+ P_INT, // get a integer number
+ P_BINT, // get a integer, clip against bounds
+ P_CBINT, // get a integer, reject if outside bounds
+};\r
+\r
#define LETTER 'a'
#define DIGIT '0'
#define MIN_INT -32768
#define MAX_INT 32767
-
-/* token types */
-
-#define TT_STRING 1 /* string token */
-#define TT_INT 2 /* integer token */
-#define TT_REAL 3 /* floating point token */
-#define TT_ALPHA 4 /* alphabetic token */
-#define TT_ALPNUM 5 /* alphanumeric token */
-#define TT_NUMALPHA 6
-#define TT_SPECLCHAR 7
-
-#define TT_EOF 8 /* end of file reached */
-#define TT_ERROR 9 /* error in token, caused by call to wrong */
- /* type of token reader */
-#define TT_BLANK 10 /* white space token. pol_tok() skips these */
-#define TT_USERTOK 11 /* user defined token */
+\r
+
+// token types
+enum {
+ TT_STRING = 1, // string token
+ TT_INT, // integer token
+ TT_REAL, // floating point token
+ TT_ALPHA, // alphabetic token
+ TT_ALPNUM, // alphanumeric token
+ TT_NUMALPHA,
+ TT_SPECLCHAR,
+ TT_EOF, // end of file reached
+ TT_ERROR, // error in token, caused by call to wrong type of token reader
+ TT_BLANK, // white space token. pol_tok() skips these
+ TT_USERTOK, // user defined token
+};\r
+\r
struct symlist {
char *name;
typedef struct symlist SYMBOL;
struct token_st {
- int ready; /* TRUE if token is ready */
- char tokstr[MAXTOK+1]; /* token string */
- int type; /* type of token 'TT_' */
- int code; /* holds code for user defined tokens */
- double fnum; /* real value of token */
- int inum; /* integer value of token */
+ int ready; // TRUE if token is ready
+ char tokstr[MAXTOK+1]; // token string
+ int type; // type of token 'TT_'
+ int code; // holds code for user defined tokens
+ double fnum; // real value of token
+ int inum; // integer value of token
};
typedef struct token_st TOKEN;
+\r
/* pol.c */
void pol_init (void);
void pol_skpword (char *w);
int pol_inchar (void);
void pol_ungetch (int c);
int get_inputline (FILE *fp);
-void set_inputline (const char const *line);
+void set_inputline (const char* const line);
+
+#endif\r
-#endif
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: sgp.h,v 1.22 2000/12/16 06:12:47 kevin Exp $
+** $Id: sgp.h,v 1.23 2000/12/25 21:54:26 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
double m_dTextAngle;
bool m_bRecalcTransform;
double m_dPointsPerPixel; // points (72pt/in) per screen pixel;
+ int m_iLinestyle;\r
// Master coordinates are coordinates before CTM transformation
// World coordinates are coordinates defined by setWindow()
#if HAVE_WXWINDOWS
wxPen m_pen;
- wxFont m_font;
+ wxFont* m_pFont;
#endif
public:
static const unsigned char MARKER_BITMAP[MARK_COUNT][5];
SGP (const SGPDriver& driver);
+ ~SGP();\r
void drawCircle (const double r);
void drawArc (const double r, double start, double stop);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezplot.cpp,v 1.21 2000/12/23 18:12:35 kevin Exp $
+** $Id: ezplot.cpp,v 1.22 2000/12/25 21:54:26 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
static const int DEF_CURVE_CLR = C_RED;
-EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n, int color, int linestyle, int symbol, int symfreq, const std::string& legend)
-: x(NULL), y(NULL), m_sLegend (legend)
+EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n)
+: x(NULL), y(NULL)
{
x = new double [n];
y = new double [n];
memcpy (y, yData, copyCount);
m_iPointCount = n;
- m_iColor = color;
- m_iLineStyle = linestyle;
- m_iSymbol = symbol;
- m_iSymbolFreq = symfreq;
}
EZPlotCurve::~EZPlotCurve ()
if (num < 1)
return;
- EZPlotCurve* pCurve = new EZPlotCurve (x, y, num, o_color, o_linestyle, o_symbol, o_symfreq, c_legend);
+ EZPlotCurve* pCurve = new EZPlotCurve (x, y, num);
m_vecCurves.push_back (pCurve);
}
{
charheight = rSGP.getCharHeight();
charwidth = rSGP.getCharWidth();
-
+\r
+ m_iCurrentCurve = -1;\r
+
c_xlabel = "";
c_ylabel = "";
c_title = "";
- c_legend = "";
o_xporigin = 0.0;
o_yporigin = 0.0;
s_textsize = FALSE;
clr_axis = C_BLACK; // set fixed colors
- clr_title = C_CYAN;
- clr_label = C_CYAN;
- clr_legend = C_RED;
+ clr_title = C_RED;
+ clr_label = C_BLUE;
+ clr_legend = C_CYAN;
clr_number = C_GREEN;
clr_grid = C_LTGRAY;
}
-
+void\r
+EZPlot::setColor (unsigned int iCurve, int iColor)\r
+{\r
+ if (m_veciColor.size() <= iCurve) {\r
+ m_veciColor.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbColorSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_veciColor [iCurve] = iColor;\r
+ m_vecbColorSet [iCurve] = true;\r
+}\r
+\r
+void\r
+EZPlot::setSymbol (unsigned int iCurve, int iSymbol)\r
+{\r
+ if (m_veciSymbol.size() <= iCurve) {\r
+ m_veciSymbol.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbSymbolSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_veciSymbol [iCurve] = iSymbol;\r
+ m_vecbSymbolSet [iCurve] = true;\r
+}\r
+\r
+void\r
+EZPlot::setSymbolFreq (unsigned int iCurve, int iSymbolFreq)\r
+{\r
+ if (m_veciSymbolFreq.size() <= iCurve) {\r
+ m_veciSymbolFreq.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbSymbolFreqSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_veciSymbolFreq [iCurve] = iSymbolFreq;\r
+ m_vecbSymbolFreqSet [iCurve] = true;\r
+}\r
+\r
+void\r
+EZPlot::setLinestyle (unsigned int iCurve, int iLinestyle)\r
+{\r
+ if (m_veciLinestyle.size() <= iCurve) {\r
+ m_veciLinestyle.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbLinestyleSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_veciLinestyle [iCurve] = iLinestyle;\r
+ m_vecbLinestyleSet [iCurve] = true;\r
+}\r
+\r
+void\r
+EZPlot::setLegend (unsigned int iCurve, const std::string& strLegend)\r
+{\r
+ if (m_vecsLegend.size() <= iCurve) {\r
+ m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_vecsLegend [iCurve] = strLegend;\r
+ m_vecbLegendSet [iCurve] = true;\r
+}\r
+\r
+void\r
+EZPlot::setLegend (unsigned int iCurve, const char* const pszLegend)\r
+{\r
+ if (m_vecsLegend.size() <= iCurve) {\r
+ m_vecsLegend.resize ((m_iCurrentCurve + 1) * 2);\r
+ m_vecbLegendSet.resize ((m_iCurrentCurve + 1) * 2);\r
+ }\r
+ m_vecsLegend [iCurve] = pszLegend;\r
+ m_vecbLegendSet [iCurve] = true;\r
+}\r
+\r
+int\r
+EZPlot::getColor (unsigned int iCurve) const\r
+{\r
+ if (m_veciColor.size() > iCurve && m_vecbColorSet[iCurve])\r
+ return m_veciColor[iCurve];\r
+ else\r
+ return o_color;\r
+}\r
+ \r
+int\r
+EZPlot::getSymbol (unsigned int iCurve) const\r
+{\r
+ if (m_veciSymbol.size() > iCurve && m_vecbSymbolSet[iCurve])\r
+ return m_veciSymbol[iCurve];\r
+ else\r
+ return o_symbol;\r
+}\r
+ \r
+int\r
+EZPlot::getSymbolFreq (unsigned int iCurve) const\r
+{\r
+ if (m_veciSymbolFreq.size() > iCurve && m_vecbSymbolFreqSet[iCurve])\r
+ return m_veciSymbolFreq[iCurve];\r
+ else\r
+ return o_symfreq;\r
+}\r
+ \r
+int\r
+EZPlot::getLinestyle (unsigned int iCurve) const\r
+{\r
+ if (m_veciLinestyle.size() > iCurve && m_vecbLinestyleSet[iCurve])\r
+ return m_veciLinestyle[iCurve];\r
+ else\r
+ return o_linestyle;\r
+}\r
+ \r
+const std::string*\r
+EZPlot::getLegend (unsigned int iCurve) const\r
+{\r
+ if (m_vecsLegend.size() > iCurve && m_vecbLegendSet[iCurve])\r
+ return &m_vecsLegend[iCurve];\r
+ else\r
+ return NULL;\r
+}\r
+ \r
+\r
/* NAME
* plot Plots all curves collected by addCurves ()
*
void
EZPlot::plot ()
{\r
-#if 0\r
- wxFont* myFont = new wxFont (12, wxMODERN, wxNORMAL, wxNORMAL);\r
- rSGP.getDriver().idWX()->SetFont (*myFont);\r
-#endif
if (m_vecCurves.size() <= 0)
return;
rSGP.setWindow (0., 0., 1., 1.);
- if (s_textsize == TRUE) {
- charheight = v_textsize;
- charwidth = rSGP.getCharWidth();
- } else {
- charheight = rSGP.getCharHeight();
- charwidth = rSGP.getCharWidth();
- }
-
- const EZPlotCurve& firstCurve = *m_vecCurves[0];
+ if (s_textsize == TRUE)
+ rSGP.setTextPointSize (v_textsize);\r
+ charheight = rSGP.getCharHeight();
+ charwidth = rSGP.getCharWidth();
+
+ const EZPlotCurve& firstCurve = *m_vecCurves[0];\r
double xmin = firstCurve.x[0]; // extent of curves in world coord
double xmax = xmin;
double ymin = firstCurve.y[0];
- double ymax = ymin;
-
- for (EZPlotCurveConstIterator iterCurve = m_vecCurves.begin(); iterCurve != m_vecCurves.end(); iterCurve++) {
- const EZPlotCurve& curve = **iterCurve;
+ double ymax = ymin; \r
+ unsigned int iCurve;
+ for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
+ const EZPlotCurve* const pCurve = m_vecCurves [iCurve];
- for (int ip = 0; ip < curve.m_iPointCount; ip++) {
- if (curve.x[ip] > xmax)
- xmax = curve.x[ip];
- else if (curve.x[ip] < xmin)
- xmin = curve.x[ip];
- if (curve.y[ip] > ymax)
- ymax = curve.y[ip];
- else if (curve.y[ip] < ymin)
- ymin = curve.y[ip];
+ for (int ip = 0; ip < pCurve->m_iPointCount; ip++) {
+ if (pCurve->x[ip] > xmax)
+ xmax = pCurve->x[ip];
+ else if (pCurve->x[ip] < xmin)
+ xmin = pCurve->x[ip];
+ if (pCurve->y[ip] > ymax)
+ ymax = pCurve->y[ip];
+ else if (pCurve->y[ip] < ymin)
+ ymin = pCurve->y[ip];
}
}
ya_max = yp_max;
// adjust frame for title
+ title_row = ya_max;;\r
if (c_title.length() > 0)
ya_max -= 2 * charheight;
- title_row = ya_max + 2 * charheight;
// calculate legend box boundaries
int max_leg = 0; // longest legend in characters
- int num_leg = 0; // number of legend titles
- for (EZPlotCurveConstIterator iterCurve2 = m_vecCurves.begin(); iterCurve2 != m_vecCurves.end(); iterCurve2++) {
- const EZPlotCurve& curve = **iterCurve2;
- int nLegend = curve.m_sLegend.length();
- if (nLegend > 0) {
- ++num_leg;
- if (nLegend > max_leg)\r
- nLegend = max_leg;
+ int num_leg = 0; // number of legend titles \r
+ for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
+ const std::string* pstrLegend = getLegend (iCurve);\r
+ if (pstrLegend && pstrLegend->length() > 0) {\r
+ int nLegend = pstrLegend->length();
+ if (nLegend > 0) {
+ ++num_leg;
+ if (nLegend > max_leg)\r
+ nLegend = max_leg;\r
+ }
}
}
rSGP.setColor (clr_legend);
rSGP.drawRect (xl_min, yl_min, xl_max, yl_max);
- int iLegend = 0; // current legend position
- for (EZPlotCurveIterator iterCurve = m_vecCurves.begin(); iterCurve != m_vecCurves.end(); iterCurve++) {
- const EZPlotCurve& curve = **iterCurve;
-
- if (curve.m_sLegend.length() == 0)
+ int iLegend = 0; // current legend position \r
+ for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
+ const std::string* pstrLegend = getLegend (iCurve);
+ if (! pstrLegend || pstrLegend->length() == 0)
continue;
double xmin = xl_min + 1.0 * charwidth;
double xmax = xl_max - 1.0 * charwidth;
double y = yl_max - (2.0 + iLegend * 3) * charheight;
- rSGP.moveAbs (xmin, y + 0.5 * charheight);
- rSGP.drawText (curve.m_sLegend);
- rSGP.setColor (curve.m_iColor);
- if (curve.m_iLineStyle != SGP::LS_NOLINE) {
- rSGP.setLineStyle (curve.m_iLineStyle);
+ rSGP.moveAbs (xmin, y + 0.5 * charheight);\r
+ rSGP.drawText (pstrLegend->c_str());
+ rSGP.setColor (getColor (iCurve));\r
+ int iLS = getLinestyle (iCurve);
+ if (iLS != SGP::LS_NOLINE) {
+ rSGP.setLineStyle (iLS);
rSGP.moveAbs (xmin, y);
rSGP.lineAbs (xmax, y);
- }
- if (curve.m_iSymbol > 0) {
+ }\r
+ int iSymbol = getSymbol (iCurve);
+ if (iSymbol > 0) {
double xinc = (xmax - xmin) / (5 - 1);
rSGP.setLineStyle (SGP::LS_SOLID);
for (int j = 0; j < 5; j++) {
rSGP.moveAbs (xmin + j * xinc, y);
- symbol(curve.m_iSymbol, 0.5 * charwidth, 0.5 * charheight);
+ symbol(iSymbol, 0.5 * charwidth, 0.5 * charheight);
}
}
++iLegend; // move to next legend position
// X-Label
if (c_xlabel.length() > 0)
- ya_min += 3.0 * charheight;
+ ya_min += 2.0 * charheight;
xlbl_row = xp_min; // put x-label on bottom of plot frame
// Y-Label
if (c_ylabel.length() > 0)
- xa_min += 3.0 * charwidth; // reverse rSGP.setTextSize because writing text sideways
- ylbl_col = xp_min + 2 * charwidth;
+ xa_min += 2.0 * charheight;
+ ylbl_col = xp_min;
/*------------------------------*/
/* adjust frame for tick labels */
if (o_xaxis == NOAXIS || o_xtlabel == FALSE)
xtl_ofs = 0.0;
else if (o_xticks == BELOW)
- xtl_ofs = -1.5 * charheight; // kr
+ xtl_ofs = -1.5 * charheight;
else if (o_xticks == ABOVE)
xtl_ofs = 1.5 * charheight;
\r
double clipRect[4];\r
clipRect[0] = xgn_min; clipRect[1] = ygn_min; clipRect[2] = xgn_max; clipRect[3] = ygn_max;\r
-
- for (EZPlotCurveIterator iterCurve3 = m_vecCurves.begin(); iterCurve3 != m_vecCurves.end(); iterCurve3++) {
- const EZPlotCurve& curve = **iterCurve3;
-
- rSGP.setColor (curve.m_iColor);
+\r
+ for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
+ const EZPlotCurve* const pCurve = m_vecCurves [iCurve];
\r
- bool bOutside = false;
- if (curve.m_iLineStyle != SGP::LS_NOLINE) {
- rSGP.setLineStyle (curve.m_iLineStyle);
- double x1 = convertWorldToNDC_X (curve.x[0]);
- double y1 = convertWorldToNDC_Y (curve.y[0]);\r
- for (int i = 1; i < curve.m_iPointCount; i++) {
- double x2 = convertWorldToNDC_X (curve.x[i]);
- double y2 = convertWorldToNDC_Y (curve.y[i]);\r
+ rSGP.setColor (getColor (iCurve));\r
+ int iSym = getSymbol (iCurve);\r
+ int iLS = getLinestyle (iCurve);\r
+\r
+ if (iLS != SGP::LS_NOLINE) {
+ rSGP.setLineStyle (iLS);
+ double x1 = convertWorldToNDC_X (pCurve->x[0]);
+ double y1 = convertWorldToNDC_Y (pCurve->y[0]);\r
+ for (int i = 1; i < pCurve->m_iPointCount; i++) {
+ double x2 = convertWorldToNDC_X (pCurve->x[i]);
+ double y2 = convertWorldToNDC_Y (pCurve->y[i]);\r
double x2Clip = x2;\r
double y2Clip = y2;\r
if (clip_rect (x1, y1, x2Clip, y2Clip, clipRect)) {\r
y1 = y2;\r
}
}
- if (curve.m_iSymbol > 0) {
+ if (iSym > 0) {\r
+ int iSymFreq = getSymbolFreq (iCurve);
rSGP.setLineStyle (SGP::LS_SOLID);
- double x = convertWorldToNDC_X (curve.x[0]);
- double y = convertWorldToNDC_Y (curve.y[0]);
+ double x = convertWorldToNDC_X (pCurve->x[0]);
+ double y = convertWorldToNDC_Y (pCurve->y[0]);
rSGP.moveAbs (x, y);
- symbol (curve.m_iSymbol, symwidth, symheight);
- for (int i = 1; i < curve.m_iPointCount; i++)
- if (i % curve.m_iSymbolFreq == 0 || i == curve.m_iPointCount - 1) {
- x = convertWorldToNDC_X (curve.x[i]);
- y = convertWorldToNDC_Y (curve.y[i]);\r
+ symbol (iSym, symwidth, symheight);
+ for (int i = 1; i < pCurve->m_iPointCount; i++)
+ if (i % iSymFreq == 0 || i == pCurve->m_iPointCount - 1) {
+ x = convertWorldToNDC_X (pCurve->x[i]);
+ y = convertWorldToNDC_Y (pCurve->y[i]);\r
if (y >= ygn_min && y <= ygn_max) {
rSGP.moveAbs (x, y);
- symbol (curve.m_iSymbol, symwidth, symheight);\r
+ symbol (iSym, symwidth, symheight);\r
}
}
}
rSGP.moveAbs (xa_max, y);
rSGP.lineAbs (xa_min, y);
}
- }
- rSGP.moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - c_ylabel.length()*charheight*1.5);\r
- rSGP.getDriver().idWX()->SetFont(*wxSWISS_FONT);
+ }\r
+#if 0\r
+ rSGP.moveAbs(.5,.5);\r
+ char s[128];\r
+ snprintf(s,sizeof(s),"%f, %f",charwidth, charheight);\r
+ rSGP.drawText(s);\r
+#endif\r
rSGP.setTextAngle (HALFPI);
rSGP.setTextSize (1.5 * charheight);
- rSGP.setTextColor (clr_label, -1);
+ rSGP.setTextColor (clr_label, -1);\r
+ double xExtent, yExtent;\r
+ rSGP.getTextExtent (c_ylabel.c_str(), &xExtent, &yExtent);\r
+ rSGP.moveAbs (ylbl_col, ya_min + (ya_max-ya_min)/2 - yExtent);\r
+ rSGP.drawText (c_ylabel);
rSGP.setTextAngle (0.0);
rSGP.setTextSize (charheight);
minorinc = yn_tickinc / (o_yminortick + 1);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezset.cpp,v 1.11 2000/12/23 18:12:35 kevin Exp $
+** $Id: ezset.cpp,v 1.12 2000/12/25 21:54:26 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
bool\r
EZPlot::ezset (const std::string& command)\r
{\r
- return ezset (command.c_str());\r
+ return ezset (command.c_str());\r
}\r
bool
-EZPlot::ezset (const char const *command)
+EZPlot::ezset (const char* const command)
{
- if (! ezset_initialized) {
- pol_init();
- initkw();
- pol_skpword ("please");
- pol_skpword ("use");
- pol_skpword ("are");
- pol_skpword ("and");
- pol_skpword ("is");
- pol_skpword ("the");
- pol_skpword ("equals");
- pol_skpchar ("=");
-
- pol_usefile (P_USE_STR,"");
- set_inputline ("!eoc ,");
- pol_reader ();
- pol_closefile ();
- ezset_initialized = true;
- }
- return ezcmd (command);
+ if (! ezset_initialized) {
+ pol_init();
+ initKeywords();
+ pol_skpword ("please");
+ pol_skpword ("use");
+ pol_skpword ("are");
+ pol_skpword ("and");
+ pol_skpword ("is");
+ pol_skpword ("the");
+ pol_skpword ("equals");
+ pol_skpchar ("=");
+
+ pol_usefile (P_USE_STR,"");
+ set_inputline ("!eoc ,");
+ pol_reader ();
+ pol_closefile ();
+ ezset_initialized = true;
+ }
+ return ezcmd (command);
}
bool
-EZPlot::ezcmd (const char const *comm)
+EZPlot::ezcmd (const char* const comm)
{
- pol_usefile (P_USE_STR, "");
- set_inputline (comm);
-
- char str[MAXTOK+1];
- int code;
- bool retval = true;
- if (! pol_usertok (str, &code)) {
- sys_error(ERR_WARNING, "Illegal EZSET command: %s", str);
- pol_reader();
- retval = false;
- }
- else
- retval = do_cmd (code);
-
- pol_closefile(); /* close input string file */
- return (retval);
+ pol_usefile (P_USE_STR, "");
+ set_inputline (comm);
+
+ char str[MAXTOK+1];
+ int code;
+ bool retval = true;
+ if (! pol_usertok (str, &code)) {
+ sys_error(ERR_WARNING, "Illegal EZSET command: %s", str);
+ pol_reader();
+ retval = false;
+ }
+ else
+ retval = do_cmd (code);
+
+ pol_closefile(); /* close input string file */
+ return (retval);
}
bool
EZPlot::do_cmd (int lx)
{
- char str [1024];
- char strIn [1024];
- int n;
- double f;
-
- switch (lx) {
- case S_TEXTSIZE:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- {
- if (f >= 0.0 && f <= 1.0) {
- v_textsize = f;
- s_textsize = TRUE;
- } else
- s_textsize = FALSE;
- }
- break;
- case S_REPLOT:
- plot ();
- break;
- case S_CLEAR:
- clearCurves ();
- break;
- case S_TITLE:
- gettext (strIn, sizeof(strIn));
- c_title = strIn;
- break;
- case S_LEGEND:
- gettext (strIn, sizeof(strIn));
- c_legend = strIn;
- break;
- case S_XLABEL:
- gettext (strIn, sizeof(strIn));
- c_xlabel = strIn;
- break;
- case S_YLABEL:
- gettext (strIn, sizeof(strIn));
- c_ylabel = strIn;
- break;
- case S_XCROSS:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_xcross = f;
- s_xcross = TRUE;
- } else
- s_xcross = FALSE;
- break;
- case S_YCROSS:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_ycross = f;
- s_ycross = TRUE;
- } else
- s_ycross = FALSE;
- break;
- case S_NOXAXIS:
- o_xaxis = NOAXIS;
- break;
- case S_NOYAXIS:
- o_yaxis = NOAXIS;
- break;
- case S_XLIN:
- o_xaxis = LINEAR;
- break;
- case S_YLIN:
- o_yaxis = LINEAR;
- break;
- case S_XLOG:
- o_xaxis = LOG;
- break;
- case S_YLOG:
- o_yaxis = LOG;
- break;
- case S_XAUTOSCALE:
- s_xmin = FALSE;
- s_xmax = FALSE;
- break;
- case S_YAUTOSCALE:
- s_ymin = FALSE;
- s_ymax = FALSE;
- break;
- case S_XMIN:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_xmin = f;
- s_xmin = TRUE;
- }
- break;
- case S_XMAX:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_xmax = f;
- s_xmax = TRUE;
- }
- break;
- case S_YMIN:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_ymin = f;
- s_ymin = TRUE;
- }
- break;
- case S_YMAX:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
- v_ymax = f;
- s_ymax = TRUE;
- }
- break;
- case S_SOLID:
- o_linestyle = SGP::LS_SOLID;
- break;
- case S_DASH:
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
- if (n == 1)
- o_linestyle = SGP::LS_DASH1;
- else if (n == 2)
- o_linestyle = SGP::LS_DASH2;
- else if (n == 3)
- o_linestyle = SGP::LS_DASH3;
- else if (n == 4)
- o_linestyle = SGP::LS_DASH4;
- else
- o_linestyle = SGP::LS_DASH1;
- } else
- o_linestyle = SGP::LS_DASH1;
- break;
- case S_NOLINE:
- o_linestyle = SGP::LS_NOLINE;
- break;
- case S_PEN:
- case S_COLOR:
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
- {
- if (n >= 0)
- o_color = n;
- else
- bad_option("The color you picked");
- }
- break;
- case S_BOX:
- o_box = TRUE;
- break;
- case S_NOBOX:
- o_box = FALSE;
- break;
- case S_GRID:
- o_grid = TRUE;
- break;
- case S_NOGRID:
- o_grid = FALSE;
- break;
- case S_XLENGTH:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- if (f > 0.0 && f <= 1.0)
- o_xlength = f;
- break;
- case S_YLENGTH:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- if (f > 0.0 && f <= 1.0)
- o_ylength = f;
- break;
- case S_XPORIGIN:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- if (f >= 0.0 && f < 1.0)
- o_xporigin = f;
- break;
- case S_YPORIGIN:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- if (f >= 0.0 && f < 1.0)
- o_yporigin = f;
- break;
- case S_TAG:
- if (pol_word("no", 2) == TRUE)
- o_tag = FALSE;
- else if (pol_word("off", 2) == TRUE)
- o_tag = FALSE;
- else
- o_tag = TRUE;
- break;
- case S_LEGENDBOX:
- if (pol_word("inside", 2) == TRUE)
- o_legendbox = INSIDE;
- else if (pol_word("outside", 3) == TRUE)
- o_legendbox = OUTSIDE;
- else if (pol_word("none",2) == TRUE)
- o_legendbox = NOLEGEND;
- else {
- gettext (str, MAXTOK);
- bad_option(str);
- }
- break;
- case S_XLEGEND:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- {
- if (f >= 0.0 && f < 1.0) {
- v_xlegend = f;
- s_xlegend = TRUE;
- }
- else
- s_xlegend = FALSE;
- }
- break;
- case S_YLEGEND:
- if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
- {
- if (f >= 0.0 && f < 1.0) {
- v_ylegend = f;
- s_ylegend = TRUE;
- }
- else
- s_ylegend = FALSE;
- }
- break;
- case S_SYMBOL:
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
- if (n > 0 && n <= MAXSYMBOL)
- o_symbol = n;
- else
- o_symbol = 1;
- } else {
- if (pol_word("every",5) == TRUE) {
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
- if (n > 0)
- o_symfreq = n;
- else
- o_symfreq = 1;
- }
- } else if (pol_word ("none",4) == TRUE) {
- o_symbol = -1;
- }
- }
- break;
- case S_XTICKS:
- if (pol_usertok(str,&lx) == FALSE)
- break;
- if (lx == S_ABOVE)
- o_xticks = ABOVE;
- else if (lx == S_BELOW)
- o_xticks = BELOW;
- else if (lx == S_NOLABEL)
- o_xtlabel = FALSE;
- else if (lx == S_LABEL)
- o_xtlabel = TRUE;
- else if (lx == S_MAJOR) {
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
- if (n > 1 && n < 100)
- o_xmajortick = n;
- } else if (lx == S_MINOR)
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
- if (n >= 0 && n < 100)
- o_xminortick = n;
- break;
- case S_YTICKS:
- if (pol_usertok(str,&lx) == FALSE)
- break;
- if (lx == S_RIGHT)
- o_yticks = RIGHT;
- else if (lx == S_LEFT)
- o_yticks = LEFT;
- else if (lx == S_NOLABEL)
- o_ytlabel = FALSE;
- else if (lx == S_LABEL)
- o_ytlabel = TRUE;
- else if (lx == S_MAJOR) {
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
- if (n > 1 && n < 100)
- o_ymajortick = n;
- } else if (lx == S_MINOR)
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
- if (n >= 0 && n < 100)
- o_yminortick = n;
- break;
- case S_LXFRAC:
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
- if (n >= 0) {
- v_lxfrac = n;
- s_lxfrac = TRUE;
- }
- } else
- s_lxfrac = FALSE;
- break;
- case S_LYFRAC:
- if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
- if (n >= 0) {
- v_lyfrac = n;
- s_lyfrac = TRUE;
- }
- } else
- s_lyfrac = FALSE;
- break;
- break;
- default:
- fprintf (stderr, "Unimplemented EZPLOT command\n");
- break;
+ char str [1024];
+ char strIn [1024];
+ int n;
+ double f;
+
+ switch (lx) {
+ case S_TEXTSIZE:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ if (f >= 0.0 && f <= 1.0) {
+ v_textsize = f;
+ s_textsize = TRUE;
+ } else
+ s_textsize = FALSE;
+ }
+ break;
+ case S_REPLOT:
+ plot ();
+ break;
+ case S_CLEAR:
+ clearCurves ();
+ break;
+ case S_TITLE:
+ gettext (strIn, sizeof(strIn));
+ c_title = strIn;
+ break;
+ case S_LEGEND:
+ gettext (strIn, sizeof(strIn));\r
+ if (m_iCurrentCurve >= 0)\r
+ setLegend (m_iCurrentCurve, strIn);
+ break;
+ case S_XLABEL:
+ gettext (strIn, sizeof(strIn));
+ c_xlabel = strIn;
+ break;
+ case S_YLABEL:
+ gettext (strIn, sizeof(strIn));
+ c_ylabel = strIn;
+ break;
+ case S_XCROSS:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_xcross = f;
+ s_xcross = TRUE;
+ } else
+ s_xcross = FALSE;
+ break;
+ case S_YCROSS:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_ycross = f;
+ s_ycross = TRUE;
+ } else
+ s_ycross = FALSE;
+ break;
+ case S_NOXAXIS:
+ o_xaxis = NOAXIS;
+ break;
+ case S_NOYAXIS:
+ o_yaxis = NOAXIS;
+ break;
+ case S_XLIN:
+ o_xaxis = LINEAR;
+ break;
+ case S_YLIN:
+ o_yaxis = LINEAR;
+ break;
+ case S_XLOG:
+ o_xaxis = LOG;
+ break;
+ case S_YLOG:
+ o_yaxis = LOG;
+ break;
+ case S_XAUTOSCALE:
+ s_xmin = FALSE;
+ s_xmax = FALSE;
+ break;
+ case S_YAUTOSCALE:
+ s_ymin = FALSE;
+ s_ymax = FALSE;
+ break;
+ case S_XMIN:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_xmin = f;
+ s_xmin = TRUE;
+ }
+ break;
+ case S_XMAX:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_xmax = f;
+ s_xmax = TRUE;
+ }
+ break;
+ case S_YMIN:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_ymin = f;
+ s_ymin = TRUE;
+ }
+ break;
+ case S_YMAX:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE) {
+ v_ymax = f;
+ s_ymax = TRUE;
+ }
+ break;
+ case S_SOLID:
+ o_linestyle = SGP::LS_SOLID;
+ break;
+ case S_DASH:
+ int ls;\r
+ ls = SGP::LS_DASH1;\r
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {\r
+ 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)\r
+ ls = SGP::LS_DASH4;\r
+ else if (n == 5)\r
+ ls = SGP::LS_DOTTED;\r
+ }\r
+ if (m_iCurrentCurve < 0)\r
+ o_linestyle = ls;\r
+ else \r
+ setLinestyle (m_iCurrentCurve, ls);\r
+ break;
+ case S_NOLINE:
+ o_linestyle = SGP::LS_NOLINE;
+ break;
+ case S_PEN:
+ case S_COLOR:
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
+ {
+ if (n >= 0) {\r
+ if (m_iCurrentCurve < 0)
+ o_color = n;\r
+ else \r
+ setColor (m_iCurrentCurve, n);\r
+ } else
+ bad_option("The color you picked");
+ }
+ break;
+ case S_BOX:
+ o_box = TRUE;
+ break;
+ case S_NOBOX:
+ o_box = FALSE;
+ break;
+ case S_GRID:
+ o_grid = TRUE;
+ break;
+ case S_NOGRID:
+ o_grid = FALSE;
+ break;
+ case S_XLENGTH:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (f > 0.0 && f <= 1.0)
+ o_xlength = f;
+ break;
+ case S_YLENGTH:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (f > 0.0 && f <= 1.0)
+ o_ylength = f;
+ break;
+ case S_XPORIGIN:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (f >= 0.0 && f < 1.0)
+ o_xporigin = f;
+ break;
+ case S_YPORIGIN:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ if (f >= 0.0 && f < 1.0)
+ o_yporigin = f;
+ break;
+ case S_TAG:
+ if (pol_word("no", 2) == TRUE)
+ o_tag = FALSE;
+ else if (pol_word("off", 2) == TRUE)
+ o_tag = FALSE;
+ else
+ o_tag = TRUE;
+ break;
+ case S_LEGENDBOX:
+ if (pol_word("inside", 2) == TRUE)
+ o_legendbox = INSIDE;
+ else if (pol_word("outside", 3) == TRUE)
+ o_legendbox = OUTSIDE;
+ else if (pol_word("none",2) == TRUE)
+ o_legendbox = NOLEGEND;
+ else {
+ gettext (str, MAXTOK);
+ bad_option(str);
+ }
+ break;
+ case S_XLEGEND:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ {
+ if (f >= 0.0 && f < 1.0) {
+ v_xlegend = f;
+ s_xlegend = TRUE;
+ }
+ else
+ s_xlegend = FALSE;
+ }
+ break;
+ case S_YLEGEND:
+ if (pol_float (&f, TT_REAL, FALSE, 0.0, 0.0) == TRUE)
+ {
+ if (f >= 0.0 && f < 1.0) {
+ v_ylegend = f;
+ s_ylegend = TRUE;
+ }
+ else
+ s_ylegend = FALSE;
+ }
+ break;
+ case S_SYMBOL:
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (n > 0 && n <= MAXSYMBOL) {
+ if (m_iCurrentCurve < 0)\r
+ o_symbol = n;\r
+ else\r
+ setSymbol (m_iCurrentCurve, n);\r
+ }\r
+ } else {
+ if (pol_word("every",5) == TRUE) {
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {\r
+ int sym = 1;
+ if (n > 0)\r
+ sym = n;\r
+ if (m_iCurrentCurve < 0)\r
+ o_symfreq = sym;\r
+ else \r
+ setSymbolFreq (m_iCurrentCurve, sym);\r
+ }
+ } else if (pol_word ("none",4) == TRUE) {
+ o_symbol = -1;
+ }
+ }
+ break;
+ case S_CURVE:\r
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {\r
+ if (n > 0)\r
+ m_iCurrentCurve = n - 1;\r
+ } else {\r
+ if (pol_word ("all",3) == TRUE) \r
+ m_iCurrentCurve = -1;\r
+ }\r
+ break;\r
+ case S_XTICKS:
+ if (pol_usertok(str,&lx) == FALSE)
+ break;
+ if (lx == S_ABOVE)
+ o_xticks = ABOVE;
+ else if (lx == S_BELOW)
+ o_xticks = BELOW;
+ else if (lx == S_NOLABEL)
+ o_xtlabel = FALSE;
+ else if (lx == S_LABEL)
+ o_xtlabel = TRUE;
+ else if (lx == S_MAJOR) {
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
+ if (n > 1 && n < 100)
+ o_xmajortick = n;
+ } else if (lx == S_MINOR)
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
+ if (n >= 0 && n < 100)
+ o_xminortick = n;
+ break;
+ case S_YTICKS:
+ if (pol_usertok(str,&lx) == FALSE)
+ break;
+ if (lx == S_RIGHT)
+ o_yticks = RIGHT;
+ else if (lx == S_LEFT)
+ o_yticks = LEFT;
+ else if (lx == S_NOLABEL)
+ o_ytlabel = FALSE;
+ else if (lx == S_LABEL)
+ o_ytlabel = TRUE;
+ else if (lx == S_MAJOR) {
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
+ if (n > 1 && n < 100)
+ o_ymajortick = n;
+ } else if (lx == S_MINOR)
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE)
+ if (n >= 0 && n < 100)
+ o_yminortick = n;
+ break;
+ case S_LXFRAC:
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (n >= 0) {
+ v_lxfrac = n;
+ s_lxfrac = TRUE;
+ }
+ } else
+ s_lxfrac = FALSE;
+ break;
+ case S_LYFRAC:
+ if (pol_integer (&n, TT_REAL, FALSE, 0, 0) == TRUE) {
+ if (n >= 0) {
+ v_lyfrac = n;
+ s_lyfrac = TRUE;
+ }
+ } else
+ s_lyfrac = FALSE;
+ break;
+ break;
+ default:
+ fprintf (stderr, "Unimplemented EZPLOT command\n");
+ break;
}
pol_reader ();
}
-
+\r
void
EZPlot::bad_option (char *opt)
{
- sys_error (ERR_WARNING, "INVALID option: %s", opt);
+ sys_error (ERR_WARNING, "INVALID option: %s", opt);
}
-
+\r
//----------------------------------------------------------------------
// KEYWORDS / CODES TABLE
const struct KeywordCodeTable EZPlot::m_sKeywords[] =\r
{\r
{"solid", S_SOLID},
- {"dash", S_DASH},
- {"noline", S_NOLINE},
- {"black", S_BLACK},
- {"red", S_RED},
- {"blue", S_BLUE},
- {"green", S_GREEN},
- {"pen", S_PEN},
- {"symbol", S_SYMBOL},
- {"every", S_EVERY},
- {"none", S_NONE},
- {"legend", S_LEGEND},
- {"xlegend", S_XLEGEND},
- {"ylegend", S_YLEGEND},
-
- {"xlin", S_XLIN},
- {"ylin", S_YLIN},
- {"xlog", S_XLOG},
- {"ylog", S_YLOG},
- {"xlabel", S_XLABEL},
- {"ylabel", S_YLABEL},
- {"xlength", S_XLENGTH},
- {"ylength", S_YLENGTH},
-
- {"xticks", S_XTICKS},
- {"yticks", S_YTICKS},
- {"above", S_ABOVE},
- {"label", S_LABEL},
- {"below", S_BELOW},
- {"nolabel", S_NOLABEL},
- {"right", S_RIGHT},
- {"left", S_LEFT},
-
- {"xautoscale", S_XAUTOSCALE},
- {"yautoscale", S_YAUTOSCALE},
- {"xmin", S_XMIN},
- {"ymin", S_YMIN},
- {"xmax", S_XMAX},
- {"ymax", S_YMAX},
- {"lxfrac", S_LXFRAC},
- {"lyfrac", S_LYFRAC},
- {"xcross", S_XCROSS},
- {"ycross", S_YCROSS},
- {"noxaxis", S_NOXAXIS},
- {"noyaxis", S_NOYAXIS},
- {"xporigin", S_XPORIGIN},
- {"yporigin", S_YPORIGIN},
- {"title", S_TITLE},
- {"xtitle", S_XTITLE},
- {"ytitle", S_YTITLE},
-
- {"replot", S_REPLOT},
- {"clear", S_CLEAR},
- {"store", S_STORE},
- {"restore", S_RESTORE},
- {"amark", S_AMARK},
- {"units", S_UNITS},
- {"inches", S_INCHES},
- {"user", S_USER},
-
- {"data", S_DATA},
- {"help", S_HELP},
- {"exit", S_EXIT},
-
- {"box", S_BOX},
- {"nobox", S_NOBOX},
- {"grid", S_GRID},
- {"nogrid", S_NOGRID},
- {"major", S_MAJOR},
- {"minor", S_MINOR},
- {"color", S_COLOR},
- {"legendbox", S_LEGENDBOX},
-
- {"no", S_NO},
-
- {"textsize", S_TEXTSIZE},
+ {"dash", S_DASH},\r
+ {"curve", S_CURVE},
+ {"noline", S_NOLINE},
+ {"black", S_BLACK},
+ {"red", S_RED},
+ {"blue", S_BLUE},
+ {"green", S_GREEN},
+ {"pen", S_PEN},
+ {"symbol", S_SYMBOL},
+ {"every", S_EVERY},
+ {"none", S_NONE},
+ {"legend", S_LEGEND},
+ {"xlegend", S_XLEGEND},
+ {"ylegend", S_YLEGEND},
+
+ {"xlin", S_XLIN},
+ {"ylin", S_YLIN},
+ {"xlog", S_XLOG},
+ {"ylog", S_YLOG},
+ {"xlabel", S_XLABEL},
+ {"ylabel", S_YLABEL},
+ {"xlength", S_XLENGTH},
+ {"ylength", S_YLENGTH},
+
+ {"xticks", S_XTICKS},
+ {"yticks", S_YTICKS},
+ {"above", S_ABOVE},
+ {"label", S_LABEL},
+ {"below", S_BELOW},
+ {"nolabel", S_NOLABEL},
+ {"right", S_RIGHT},
+ {"left", S_LEFT},
+
+ {"xautoscale", S_XAUTOSCALE},
+ {"yautoscale", S_YAUTOSCALE},
+ {"xmin", S_XMIN},
+ {"ymin", S_YMIN},
+ {"xmax", S_XMAX},
+ {"ymax", S_YMAX},
+ {"lxfrac", S_LXFRAC},
+ {"lyfrac", S_LYFRAC},
+ {"xcross", S_XCROSS},
+ {"ycross", S_YCROSS},
+ {"noxaxis", S_NOXAXIS},
+ {"noyaxis", S_NOYAXIS},
+ {"xporigin", S_XPORIGIN},
+ {"yporigin", S_YPORIGIN},
+ {"title", S_TITLE},
+ {"xtitle", S_XTITLE},
+ {"ytitle", S_YTITLE},
+
+ {"replot", S_REPLOT},
+ {"clear", S_CLEAR},
+ {"store", S_STORE},
+ {"restore", S_RESTORE},
+ {"amark", S_AMARK},
+ {"units", S_UNITS},
+ {"inches", S_INCHES},
+ {"user", S_USER},
+
+ {"data", S_DATA},
+ {"help", S_HELP},
+ {"exit", S_EXIT},
+
+ {"box", S_BOX},
+ {"nobox", S_NOBOX},
+ {"grid", S_GRID},
+ {"nogrid", S_NOGRID},
+ {"major", S_MAJOR},
+ {"minor", S_MINOR},
+ {"color", S_COLOR},
+ {"legendbox", S_LEGENDBOX},
+
+ {"no", S_NO},
+
+ {"textsize", S_TEXTSIZE},
};
\r
const int EZPlot::NKEYS = (sizeof(EZPlot::m_sKeywords) / sizeof (struct KeywordCodeTable));
void
-EZPlot::initkw(void)
+EZPlot::initKeywords ()
{
- for (unsigned int i = 0; i < NKEYS; i++)
- if (! pol_install (m_sKeywords[i].keyword, m_sKeywords [i].code))
- sys_error(ERR_SEVERE, "error installing ezset keywords [EZPlot::initkw]");
+ for (int i = 0; i < NKEYS; i++)
+ if (! pol_install (m_sKeywords[i].keyword, m_sKeywords [i].code))
+ sys_error(ERR_SEVERE, "error installing ezset keywords [EZPlot::initKeywords]");
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: pol.cpp,v 1.4 2000/12/20 14:39:09 kevin Exp $
+** $Id: pol.cpp,v 1.5 2000/12/25 21:54:26 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
#include "pol.h"
-static const int HASHSIZE=20;
+static const int HASHSIZE=100;
-/* Tables words stored with install() & found with lookup() */
-static SYMBOL *skiptable[HASHSIZE]; /* words to ignore and skip */
-static SYMBOL *cmdtable[HASHSIZE]; /* pol parameter commands */
-static SYMBOL *usertable[HASHSIZE]; /* user defined symbols */
+// Tables words stored with install() & found with lookup()
+static SYMBOL *skiptable[HASHSIZE]; // words to ignore and skip
+static SYMBOL *cmdtable[HASHSIZE]; // pol parameter commands
+static SYMBOL *usertable[HASHSIZE]; // user defined symbols
-static struct token_st token; /* current token */
+static struct token_st token; // current token
+\r
static struct metachar {
char eoc; /* end of command character */
char inb; /* input from graphics device */
} meta;
-/* current pol state */
-
+\r
+// current pol state
static struct pol_st {
- char skipchars[MAXSKIPCHAR]; /* characters to skip */
- int nl_eoc; /* TRUE if newline character ends a command */
- int trace; /* TRUE if trace is on */
+ char skipchars[MAXSKIPCHAR]; // characters to skip
+ int nl_eoc; // TRUE if newline character ends a command
+ int trace; // TRUE if trace is on
} pol;
struct key {
int code;
};
-/* internal codes for pol commands */
-
-#define PC_EOC 1
-#define PC_STR 2
-#define PC_COM 3
-#define PC_CMD 4
-#define PC_PRG 5
-#define PC_CON 6
-#define PC_OUT 7
-#define PC_TER 8
-#define PC_INB 9
-#define PC_NL_EOC 10
-#define PC_NL_NEOC 11
-#define PC_TRON 12
-#define PC_TROFF 13
-#define PC_FILE 14
-#define PC_DUMP 15
-
+// Internal codes for pol commands
+enum {\r
+ PC_EOC = 1,
+ PC_STR,
+ PC_COM,
+ PC_CMD,
+ PC_PRG,
+ PC_CON,
+ PC_OUT,
+ PC_TER,
+ PC_INB,
+ PC_NL_EOC,
+ PC_NL_NEOC,
+ PC_TRON,
+ PC_TROFF,
+ PC_FILE,
+ PC_DUMP,
+};
+\r
static struct key cmdlist[] = {
{ "eoc", PC_EOC,},
{ "str", PC_STR,},
{ "dump", PC_DUMP,},
};
-#define NUMCMD (sizeof(cmdlist) / sizeof (struct key))
+const int NUMCMD = (sizeof(cmdlist) / sizeof (struct key));
+\r
static int skiptok(char term[]);
static int pol_tok(struct token_st *token);
static int hash(char *s);
static SYMBOL *lookup(SYMBOL *table[], char *s);
static SYMBOL *install(SYMBOL *table[], char *s, int def);
-static void synerr(char *msg);
static int pol_getch(FILE *fp);
{
if (install (usertable, str, code) == NULL)
{
- synerr ("Out ot memory installing user tokens");
+ sys_error (ERR_SEVERE, "Out of memory installing user tokens");
return (FALSE);
}
tt = getalpha (str, MAXTOK);
if (tt == TT_ERROR) {
- synerr ("error in pol parameter command");
+ sys_error (ERR_WARNING, "Error in POL parameter command");
pol_reader();
return(FALSE);
}
if ((cmd = lookup (cmdtable,str)) == NULL) {
- synerr ("unrecognized command");
+ sys_error (ERR_WARNING, "POL: Unrecognized command %s", cmd);
pol_reader();
return (FALSE);
} else {
if (found == FALSE) {
tt = gettok (&tok);
if (tt != TT_SPECLCHAR) {
- synerr("illegal command character");
+ sys_error (ERR_SEVERE, "POL: Illegal command character");
return (FALSE);
}
switch(cmd->code) {
pol_ungetch(s[i]);
if (i >= toksiz)
- synerr("token too long.");
+ sys_error (ERR_SEVERE, "POL token too long.");
s[i] = EOS; /* terminate token */
return (alphatype);
for (i = 0; (c = pol_inchar()) != delim; i++) {
if (c == NEWLINE) {
- synerr ("Missing closing delimiter.");
+ sys_error (ERR_WARNING, "Missing closing delimiter.");
break;
}
if (i >= toksiz) {
- synerr("string too long.");
+ sys_error (ERR_SEVERE, "string too long.");
break;
}
if (c == EOF) {
pol_ungetch(c);
- synerr("end of file inside quotation");
+ sys_error (ERR_SEVERE, "end of file inside quotation");
break;
} else if (c == BSLASH) { /* escape character */
s[i++] = c;
if ((np = lookup (table, name)) == NULL) { /* not found */
np = (SYMBOL *) malloc (sizeof(*np));
if (np == NULL) {
- synerr(installerr);
+ sys_error (ERR_SEVERE, installerr);
return (NULL);
}
if ((np->name = strdup(name)) == NULL) {
- synerr(installerr);
+ sys_error (ERR_SEVERE, installerr);
return (NULL);
}
str_lower (np->name);
static char inputline[MAXLINE]; /* current input line */
static int lineptr; /* current position in inputline */
-static void
-synerr (char *msg)
-{
- fputs (fname[currentf], stderr);
- fputs (msg, stderr);
- fputc (NEWLINE, stderr);
-}
-/*----------------------------------------------------------------------*/
-/* POL INPUT */
-/*----------------------------------------------------------------------*/
+//----------------------------------------------------------------------
+// POL INPUT
+//----------------------------------------------------------------------
#define BUFSIZE 100
static int bp = 0; /* pointer to next free position */
++currentf;
if (currentf >= MAXFILE) {
--currentf;
- synerr ("files nested too deeply");
+ sys_error (ERR_SEVERE, "files nested too deeply");
return;
}
fp = stdin;
} else if ((fp = fopen(fn, "r")) == NULL) {
--currentf;
- synerr ("can't open file");
+ sys_error (ERR_SEVERE, "can't open file");
return;
}
filep[currentf] = fp;
}
void
-set_inputline (const char const *line)
+set_inputline (const char* const line)
{
lineptr = 0;
bp = 0;
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: sgp.cpp,v 1.22 2000/12/18 06:47:03 kevin Exp $
+** $Id: sgp.cpp,v 1.23 2000/12/25 21:54:26 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
m_ctm.setIdentity();
#if HAVE_WXWINDOWS
- m_pen.SetWidth(1);
- m_pen.SetStyle(wxSOLID);
+ m_pen.SetWidth (1);
if (m_driver.isWX()) {
static const double dScreenDPI = 82;
static const double dPointsPerInch = 72.;
m_dPointsPerPixel = dPointsPerInch / dScreenDPI;
- const int iTestPointSize = 12;
- m_font.SetPointSize (iTestPointSize);
- m_driver.idWX()->SetFont(m_font);
+ const int iTestPointSize = 12;\r
+ m_pFont = new wxFont (wxROMAN, wxNORMAL, wxNORMAL, wxNORMAL);
+ m_pFont->SetPointSize (iTestPointSize);\r
+ m_pFont->SetWeight (wxNORMAL);\r
+ m_pFont->SetStyle (wxNORMAL);
+ m_pFont->SetFamily (wxROMAN);\r
+#ifdef MSVC\r
+ m_pFont->SetFaceName(wxString("times new roman"));\r
+#endif\r
+ m_driver.idWX()->SetFont (*m_pFont);
double dTestCharHeight = m_driver.idWX()->GetCharHeight();
m_dPointsPerPixel = iTestPointSize / dTestCharHeight;\r
-// wxWHITE_BRUSH->SetColour (255, 255, 255);\r
-// wxWHITE_BRUSH->SetStyle (wxSOLID);\r
- m_driver.idWX()->SetBackground (*wxWHITE_BRUSH);
+ m_driver.idWX()->SetBackground (*wxWHITE_BRUSH);
}
#endif
setTextAngle (0.);
setTextPointSize (12);
- setColor (C_BLACK);
+ setColor (C_BLACK);\r
+ setLineStyle (LS_SOLID);
}
+SGP::~SGP()\r
+{\r
+#if HAVE_WXWINDOWS\r
+ if (m_driver.isWX()) {\r
+ m_driver.idWX()->SetFont (wxNullFont);\r
+ delete m_pFont;\r
+ }\r
+#endif\r
+}\r
void
SGP::stylusNDC (double x, double y, bool beam)
//==============================================================
void
SGP::setLineStyle (int style)
-{
+{\r
+ m_iLinestyle = style;\r
+
+#if HAVE_WXWINDOWS\r
+ if (m_driver.isWX()) {\r
+ switch (m_iLinestyle) {\r
+ case LS_SOLID:\r
+ m_pen.SetStyle (wxSOLID);\r
+ break;\r
+ case LS_DASH1:\r
+ m_pen.SetStyle (wxLONG_DASH);\r
+ break;\r
+ case LS_DASH2:\r
+ m_pen.SetStyle (wxSHORT_DASH);\r
+ break;\r
+ case LS_DASH3:\r
+ m_pen.SetStyle (wxDOT_DASH);\r
+ break;\r
+ case LS_DASH4:\r
+ m_pen.SetStyle (wxCROSS_HATCH);\r
+ break;\r
+ case LS_DOTTED:\r
+ m_pen.SetStyle (wxDOT);\r
+ break;\r
+ default:\r
+ m_pen.SetStyle (wxSOLID);\r
+ break;\r
+ }\r
+ m_driver.idWX()->SetPen (m_pen);\r
+ }\r
+#endif\r
}
//==============================================================
if (m_driver.isWX()) {
double dHeightPixels = height * m_iPhysicalYSize;
double dHeightPoints = dHeightPixels * m_dPointsPerPixel;
- m_font.SetPointSize (nearest<int>(dHeightPoints));
- m_driver.idWX()->SetFont (m_font);
+ m_pFont->SetPointSize (nearest<int>(dHeightPoints));
+ m_driver.idWX()->SetFont (*m_pFont);
}
#endif
}
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
double dHeightPoints = dHeightPixels * m_dPointsPerPixel;
- m_font.SetPointSize (nearest<int>(dHeightPoints));
- m_driver.idWX()->SetFont (m_font);
+ m_pFont->SetPointSize (nearest<int>(dHeightPoints));
+ m_driver.idWX()->SetFont (*m_pFont);
}
#endif
}
#endif
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
- m_font.SetPointSize (static_cast<int>(height+0.5));
- m_driver.idWX()->SetFont (m_font);
+ m_pFont->SetPointSize (static_cast<int>(height+0.5));
+ m_driver.idWX()->SetFont (*m_pFont);
}
#endif
}
wxString sText (szText);
wxCoord deviceW, deviceH;
m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH);
- *worldW = static_cast<double>(deviceW) / static_cast<double>(m_iPhysicalXSize);;
- *worldH = static_cast<double>(deviceH) / static_cast<double>(m_iPhysicalYSize);
- *worldW *= (xw_max - xw_min);
- *worldH *= (yw_max - yw_min);
+ *worldW = (xw_max - xw_min) * deviceW / static_cast<double>(m_iPhysicalXSize);;
+ *worldH = (yw_max - yw_min) * deviceH / static_cast<double>(m_iPhysicalYSize);
}
#endif
}
\r
###############################################################################\r
\r
+Project: "DrawingVC"="..\..\wx2\samples\drawing\DrawingVC.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
Project: "FFTW2st"="..\..\fftw-2.1.3\Win32\FFTW2st\FFTW2st.dsp" - Package Owner=<4>\r
\r
Package=<5>\r
--------------------Configuration: libctsim - Win32 Debug--------------------\r
</h3>\r
<h3>Command Lines</h3>\r
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFC.tmp" with contents\r
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26F.tmp" with contents\r
[\r
/nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c \r
"C:\ctsim-2.0.6\libctgraphics\ezplot.cpp"\r
]\r
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFC.tmp" \r
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFD.tmp" with contents\r
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26F.tmp" \r
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP270.tmp" with contents\r
[\r
/nologo /out:"Debug\libctsim.lib" \r
".\Debug\array2dfile.obj"\r
".\Debug\transformmatrix.obj"\r
".\Debug\xform.obj"\r
]\r
-Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFD.tmp"\r
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP270.tmp"\r
<h3>Output Window</h3>\r
Compiling...\r
ezplot.cpp\r
--------------------Configuration: ctsim - Win32 Debug--------------------\r
</h3>\r
<h3>Command Lines</h3>\r
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFE.tmp" with contents\r
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP271.tmp" with contents\r
+[\r
+/nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "\wx2\include" /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"2.5.0\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"2.5.0\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c \r
+"C:\ctsim-2.0.6\src\ctsim.cpp"\r
+"C:\ctsim-2.0.6\src\dialogs.cpp"\r
+"C:\ctsim-2.0.6\src\docs.cpp"\r
+"C:\ctsim-2.0.6\src\views.cpp"\r
+]\r
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP271.tmp" \r
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP272.tmp" with contents\r
[\r
comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lpng108\msvc\win32\libpng\lib_dbg\libpng.lib ..\..\..\lpng108\msvc\win32\zlib\lib_dbg\zlib.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib ../../../wx2/lib/wxd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrtd.lib" /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" \r
".\Debug\ctsim.obj"\r
"\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib"\r
"\wx2\lib\wxd.lib"\r
]\r
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPFE.tmp"\r
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP272.tmp"\r
<h3>Output Window</h3>\r
+Compiling...\r
+views.cpp\r
+Skipping... (no relevant changes detected)\r
+ctsim.cpp\r
+dialogs.cpp\r
+docs.cpp\r
Linking...\r
+Creating command line "bscmake.exe /nologo /o"Debug/ctsim.bsc" ".\Debug\ctsim.sbr" ".\Debug\dialogs.sbr" ".\Debug\dlgprojections.sbr" ".\Debug\dlgreconstruct.sbr" ".\Debug\docs.sbr" ".\Debug\views.sbr""\r
+Creating browse info file...\r
+BSCMAKE: warning BK4503 : minor error in .SBR file '.\Debug\views.sbr' ignored\r
+<h3>Output Window</h3>\r
\r
\r
\r
<h3>Results</h3>\r
-ctsim.exe - 0 error(s), 0 warning(s)\r
+ctsim.exe - 0 error(s), 1 warning(s)\r
</pre>\r
</body>\r
</html>\r
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.h,v 1.12 2000/12/22 04:18:00 kevin Exp $
+** $Id: ctsim.h,v 1.13 2000/12/25 21:54:26 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
wxString getUntitledFilename();
\r
void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector<ImageFileDocument*>& vecIF);\r
+\r
+ bool getSetModifyNewDocs() const\r
+ { return false; }\r
private:
wxDocManager* m_docManager;
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.37 2000/12/23 18:12:35 kevin Exp $
+** $Id: views.cpp,v 1.38 2000/12/25 21:54:26 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
}\r
if (event.LeftUp()) {\r
std::ostringstream os;\r
- os << "Selected column" << pt.x << " and row" << pt.y << "\n";\r
+ os << "Selected column " << pt.x << " , row " << pt.y << "\n";\r
*theApp->getLog() << os.str().c_str();\r
}\r
}
return;\r
}\r
\r
- pDifferenceDoc->Modify(true);\r
+ if (theApp->getSetModifyNewDocs())\r
+ pDifferenceDoc->Modify(true);\r
pDifferenceDoc->UpdateAllViews(this);\r
pDifferenceDoc->GetFirstView()->OnUpdate (this, NULL);\r
}\r
}\r
delete pX;\r
delete pY;\r
- pPlotDoc->Modify(true);\r
+ if (theApp->getSetModifyNewDocs())\r
+ pPlotDoc->Modify(true);\r
}\r
\r
}\r
}\r
delete pX;\r
delete pY;\r
- pPlotDoc->Modify(true);\r
+ if (theApp->getSetModifyNewDocs())\r
+ pPlotDoc->Modify(true);\r
}\r
}\r
\r
rPlotFile.addEzsetCommand (title.c_str());\r
rPlotFile.addEzsetCommand ("xlabel Row");\r
rPlotFile.addEzsetCommand ("ylabel Pixel Value");\r
+ rPlotFile.addEzsetCommand ("curve 1");\r
+ rPlotFile.addEzsetCommand ("color 2");\r
+ rPlotFile.addEzsetCommand ("curve 2");\r
+ rPlotFile.addEzsetCommand ("color 4");\r
+ rPlotFile.addEzsetCommand ("dash 5");\r
rPlotFile.addEzsetCommand ("box");\r
rPlotFile.addEzsetCommand ("grid");\r
rPlotFile.setCurveSize (3, nx);\r
delete pX;\r
delete pY1;\r
delete pY2;\r
- pPlotDoc->Modify(true);\r
+ if (theApp->getSetModifyNewDocs())\r
+ pPlotDoc->Modify(true);\r
}\r
}\r
}\r
rPlotFile.addEzsetCommand (title.c_str());\r
rPlotFile.addEzsetCommand ("xlabel Column");\r
rPlotFile.addEzsetCommand ("ylabel Pixel Value");\r
+ rPlotFile.addEzsetCommand ("curve 1");\r
+ rPlotFile.addEzsetCommand ("color 2");\r
+ rPlotFile.addEzsetCommand ("curve 2");\r
+ rPlotFile.addEzsetCommand ("color 4");\r
+ rPlotFile.addEzsetCommand ("dash 5");\r
rPlotFile.addEzsetCommand ("box");\r
rPlotFile.addEzsetCommand ("grid");\r
rPlotFile.setCurveSize (3, ny);\r
delete pX;\r
delete pY1;\r
delete pY2;\r
- pPlotDoc->Modify(true);\r
+ if (theApp->getSetModifyNewDocs())\r
+ pPlotDoc->Modify(true);\r
}\r
}\r
}\r
theApp->getDocManager()->ActivateView (pView, true, false);
}
::wxYield();
- pProjectionDoc->Modify(true);
+ if (theApp->getSetModifyNewDocs())\r
+ pProjectionDoc->Modify(true);
pProjectionDoc->UpdateAllViews(this);
}
}
return;
}
}
- pRasterDoc->Modify(true);
+ if (theApp->getSetModifyNewDocs())\r
+ pRasterDoc->Modify(true);
pRasterDoc->UpdateAllViews(this);
ImageFileView* rasterView = dynamic_cast<ImageFileView*>(pRasterDoc->GetFirstView());\r
if (rasterView) {\r
}
}
delete pReconstruct;
- pReconDoc->Modify(true);
+ if (theApp->getSetModifyNewDocs())\r
+ pReconDoc->Modify(true);
pReconDoc->UpdateAllViews(this);
ImageFileView* rasterView = dynamic_cast<ImageFileView*>(pReconDoc->GetFirstView());\r
if (rasterView) {\r