** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.h,v 1.16 2001/01/02 06:29:23 kevin Exp $
+** $Id: array2dfile.h,v 1.17 2001/01/02 07:47:36 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 print (std::ostream& os) const;
void printBrief (std::ostream& os) const;\r
+ void printBrief (std::ostringstream& os) const;\r
Array2dFileLabel (const Array2dFileLabel& rhs);
void printLabels (std::ostream& os) const;\r
void printLabelsBrief (std::ostream& os) const;\r
+ void printLabelsBrief (std::ostringstream& os) const;\r
\r
unsigned int nLabels() const\r
{ return m_labels.size(); }\r
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsupport.h,v 1.20 2001/01/01 10:14:34 kevin Exp $
+** $Id: ctsupport.h,v 1.21 2001/01/02 07:47:36 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
#include <vector>\r
#include <algorithm>\r
+#if defined(MSVC) || HAVE_SSTREAM\r
+#include <sstream>
+#else\r
+#include <sstream_subst>
+#endif\r
+
#define TRUE 1
#define FALSE 0
#define OK TRUE
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: phantom.h,v 1.18 2001/01/02 05:33:37 kevin Exp $
+** $Id: phantom.h,v 1.19 2001/01/02 07:47:36 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
const double v() const {return m_v;}\r
\r
void printDefinition (std::ostream& os) const;
+ void printDefinition (std::ostringstream& os) const;
private:
PhmElemType m_type; // pelem type (box, ellipse, etc)
void convertToImagefile (ImageFile& im, const int in_nsample, const int trace) const;
\r
void printDefinitions (std::ostream& os) const;\r
+ void printDefinitions (std::ostringstream& os) const;\r
bool fail() const {return m_fail;}
const std::string& failMessage() const {return m_failMessage;}
void addStdSheppLoganBordered ();
void print (std::ostream& os) const;
+ void print (std::ostringstream& os) const;
const double maxAxisLength () const {return (((m_xmax - m_xmin) > (m_ymax - m_ymin)) ? (m_xmax - m_xmin) : (m_ymax - m_ymin));}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: plotfile.h,v 1.4 2000/12/23 18:12:35 kevin Exp $
+** $Id: plotfile.h,v 1.5 2001/01/02 07:47:36 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_strFilename; }
void printHeaders (std::ostream& os) const;
+ void printHeaders (std::ostringstream& os) const;
};
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.cpp,v 1.25 2001/01/02 06:29:23 kevin Exp $
+** $Id: array2dfile.cpp,v 1.26 2001/01/02 07:47:36 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
os << "Unknown (" << getDateString() << "): " << m_strLabel << std::endl;\r
}\r
}\r
+
+void\r
+Array2dFileLabel::printBrief (std::ostringstream& os) const\r
+{\r
+ if (m_labelType == L_HISTORY) {\r
+ os << "History (";\r
+ if (m_calcTime > 0)\r
+ os << m_calcTime << " secs, ";\r
+ os << getDateString().c_str() << "): " << m_strLabel.c_str() << "\n";
+ } else if (m_labelType == L_USER) {\r
+ os << "Note (" << getDateString() << "): " << m_strLabel << "\n";
+ } else {\r
+ os << "Unknown (" << getDateString() << "): " << m_strLabel << "\n";
+ }\r
+}\r
\r
///////////////////////////////////////////////////////////////////////////
}\r
}\r
\r
+void
+Array2dFile::printLabelsBrief (std::ostringstream& os) const\r
+{\r
+ for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) {\r
+ const Array2dFileLabel& label = **l;\r
+ \r
+ label.printBrief (os);\r
+ }\r
+}\r
+\r
const Array2dFileLabel&
Array2dFile::labelGet (int i) const
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: phantom.cpp,v 1.24 2001/01/02 05:33:37 kevin Exp $
+** $Id: phantom.cpp,v 1.25 2001/01/02 07:47:36 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
os << rPE.xOutline()[i] << "," << rPE.yOutline()[i] << "\n";
}
}
+void
+Phantom::print (std::ostringstream& os) const
+{
+ os << "Number of PElements: " << m_nPElem << "\n";
+ os << "Limits: xmin=" << m_xmin << ", ymin=" << m_ymin << ", xmax=" << m_xmax << ", ymax=" << m_ymax << "\n";
+
+ for (PElemConstIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) {\r
+ const PhantomElement& rPE = **i;
+ os << "PhantomElement: nPoints=" << rPE.nOutlinePoints();\r
+ os << ", atten=" << rPE.atten() << " rot=" << convertRadiansToDegrees (rPE.rot()) << "\n";
+ os << "xmin=" << rPE.xmin() << ", ymin=" << rPE.ymin() << ", xmax=" << rPE.xmax() << ", ymax=" << rPE.ymax() << "\n";
+ \r
+ if (false)
+ for (int i = 0; i < rPE.nOutlinePoints(); i++)
+ os << rPE.xOutline()[i] << "," << rPE.yOutline()[i] << "\n";
+ }
+}
\r
void\r
Phantom::printDefinitions (std::ostream& os) const\r
}\r
}
\r
+void\r
+Phantom::printDefinitions (std::ostringstream& os) const\r
+{\r
+ for (PElemConstIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) {\r
+ const PhantomElement& rPE = **i;\r
+ rPE.printDefinition (os);\r
+ }\r
+}
+\r
/* NAME
* show Show vector outline of Phantom to user
<< m_v << " " << convertRadiansToDegrees (m_rot) << " " << m_atten << "\n";\r
}\r
+void\r
+PhantomElement::printDefinition (std::ostringstream& os) const\r
+{\r
+ os << convertTypeToName (m_type) << " " << m_cx << " " << m_cy << " " << m_u << " "\r
+ << m_v << " " << convertRadiansToDegrees (m_rot) << " " << m_atten << "\n";\r
+}\r
+
PhmElemType
PhantomElement::convertNameToType (const char* const typeName)
{
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: plotfile.cpp,v 1.8 2001/01/02 05:34:57 kevin Exp $
+** $Id: plotfile.cpp,v 1.9 2001/01/02 07:47:36 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
fs.seekp (0);
fs << m_iNumColumns << " " << m_iNumRecords << "\n";\r
\r
- int i;
+ unsigned int i;
for (i = 0; i < m_vecStrEzsetCommands.size(); i++)\r
fs << m_vecStrEzsetCommands[i] << "\n";\r
\r
for (unsigned int iDesc = 0; iDesc < m_vecStrDescriptions.size(); iDesc++)\r
os << m_vecStrDescriptions[iDesc] << "\n";
}
+
+void
+PlotFile::printHeaders (std::ostringstream& os) const
+{\r
+ os << "EZSet Commands\n";\r
+ for (unsigned int iEZ = 0; iEZ < m_vecStrEzsetCommands.size(); iEZ++)\r
+ os << m_vecStrEzsetCommands[iEZ] << "\n";\r
+\r
+ os << "Descriptions\n";\r
+ for (unsigned int iDesc = 0; iDesc < m_vecStrDescriptions.size(); iDesc++)\r
+ os << m_vecStrDescriptions[iDesc] << "\n";
+}