** 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)
{