** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.h,v 1.8 2000/12/04 04:15:48 kevin Exp $
+** $Id: array2dfile.h,v 1.9 2000/12/06 15:17:51 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
#endif
#include <sys/types.h>
-#include <string.h>
+#include <cstring>
#include <string>
#include <fstream>
#include <iostream>
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ct.h,v 1.41 2000/12/04 05:36:57 kevin Exp $
+** $Id: ct.h,v 1.42 2000/12/06 15:17:51 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
#define CT_H
#ifdef MSVC
- extern "C" {int strcasecmp(const char*, const char*);}
+ // extern "C" {int strcasecmp(const char*, const char*);}
typedef long off_t;
- #define HAVE_STRING_H 1
- #include <fcntl.h>
- #define strcasecmp stricmp
- #define strncasecmp strnicmp
+ #define HAVE_STRING_H 1\r
+ #include <fcntl.h>\r
+ #define strdup _strdup
+ #define strcasecmp _stricmp
+ #define strncasecmp _strnicmp
#endif
#ifdef HAVE_CONFIG_H
#include <cstdarg>
#include <cstdlib>
using namespace std;
-
+\r
+#if defined(MSVC) || HAVE_SSTREAM\r
#include <sstream>
+#else\r
+#include <sstream_subst>\r
+#endif\r
+\r
#include <fstream>
#include <iostream>
#include <string>
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsupport.h,v 1.8 2000/12/06 01:46:43 kevin Exp $
+** $Id: ctsupport.h,v 1.9 2000/12/06 15:17:51 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
// clip.cpp
bool clip_rect (double& x1, double& y1, double& x2, double& y2, const double rect[4]);
-int clip_segment (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
-int clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
-int clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2);
-int clip_triangle (double& x1, double& y1, double& x2, double& y2, const double u, const double v, const int clip_xaxis);
+bool clip_segment (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
+bool clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
+bool clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2);
+bool clip_triangle (double& x1, double& y1, double& x2, double& y2, const double u, const double v, const int clip_xaxis);
// xform.cpp
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezplot.h,v 1.16 2000/12/06 01:46:43 kevin Exp $
+** $Id: ezplot.h,v 1.17 2000/12/06 15:17:51 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
void clearCurves ();
bool ezcmd (char *comm);
- int do_cmd(int lx);
+ bool do_cmd(int lx);
void bad_option(char *opt);
void initPlotSettings();
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: sgp.h,v 1.20 2000/12/06 01:46:43 kevin Exp $
+** $Id: sgp.h,v 1.21 2000/12/06 15:17:51 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
{ return m_sWindowTitle; }
bool isWX () const
- { return (m_idDriver & SGPDRIVER_WXWINDOWS); }
+ { return (m_idDriver & SGPDRIVER_WXWINDOWS ? true : false); }
bool isG2 () const
- { return (m_idDriver & SGPDRIVER_G2); }
+ { return (m_idDriver & SGPDRIVER_G2 ? true : false); }
int idG2 () const
{ return m_idG2; }
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
- ** $Id: ezset.cpp,v 1.8 2000/12/06 01:46:43 kevin Exp $
+ ** $Id: ezset.cpp,v 1.9 2000/12/06 15:17:51 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
}
-int
+bool
EZPlot::do_cmd (int lx)
{
char str [1024];
}
pol_reader ();
- return (TRUE);
+ return (true);
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.cpp,v 1.15 2000/12/06 01:46:43 kevin Exp $
+** $Id: array2dfile.cpp,v 1.16 2000/12/06 15:17:51 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 "array2dfile.h"
-#include <ctime>
-#include <sstream>
-
+#include <ctime>\r
+#ifdef MSVC\r
+typedef long off_t;\r
+#endif
using namespace std;
const string&
Array2dFileLabel::getDateString (void) const
{
- ostringstream oss;
- oss << static_cast<int>(m_month + 1) <<"/"<< static_cast<int>(m_day) <<"/"<< static_cast<int>(m_year + 1900) << " " << static_cast<int>(m_hour) <<":"<< static_cast<int>(m_minute) <<":"<< static_cast<int>(m_second);
- m_strDate = oss.str();
+ char szDate [128];\r
+ snprintf (szDate, sizeof(szDate), "%2d/%02d/%4d %02d:%02d:%02d",\r
+ m_month + 1, m_day, m_year + 1900, m_hour, m_minute, m_second);
+ m_strDate = szDate;
return m_strDate;
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: backprojectors.cpp,v 1.17 2000/12/06 01:46:43 kevin Exp $
+** $Id: backprojectors.cpp,v 1.18 2000/12/06 15:17:51 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
}
void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, double L, int iDetPos)
-{
+{\r
+#if 1
ostringstream os;
os << "ix=" << ix << ", iy=" << iy << ", theta=" << theta << ", L=" << L << ", detinc=" << detInc << "\n";
os << "ndet=" << nDet << ", detInc=" << detInc << ", iDetCenter=" << iDetCenter << "\n";
os << "yMin=" << yMin << ", yMax=" << yMax << ", yInc=" << yInc << "\n";
os << "iDetPos index outside bounds: " << iDetPos << " [backprojector]";;
- sys_error (ERR_WARNING, os.str().c_str());
+ sys_error (ERR_WARNING, os.str().c_str());\r
+#endif
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: clip.cpp,v 1.5 2000/12/06 01:46:43 kevin Exp $
+** $Id: clip.cpp,v 1.6 2000/12/06 15:17:51 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 u,v Dimensions of segment
*/
-int
+bool
clip_segment (double& x1, double& y1, double& x2, double& y2, const double u, const double v)
{
double xc1 = x1 * u;
* double u,v Size of sector
*/
-int
+bool
clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, const double v)
{
double xc1 = x1 * u;
* double t1,t2 Starting & stopping angles of clipping
*/
-int
+bool
clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2)
{
double xc1 = x1;
static int tcode (const double x, const double y, const double m, const double b, const int clip_xaxis);
-int
+bool
clip_triangle (double& x1, double& y1, double& x2, double& y2, const double u, const double v, const int clip_xaxis)
{
double m = v / u; // slope of triangle lines