- * print Print vertices of Phantom pelems
- *
- * SYNOPSIS
- * print (phm)
- */
-
-void
-Phantom::print () const
-{
- printf("PRINTING Phantom\n\n");
- printf("number of pelems in Phantom = %d\n", m_nPElem);
- printf("limits: xmin=%8.2g ymin=%8.2g xmax=%8.2g ymax=%8.2g\n",
- m_xmin, m_ymin, m_xmax, m_ymax);
-
- for (PElemIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) {
- printf("PELEM:\n");
- printf("# pts=%3d atten = %7.4f rot = %7.2f (deg)\n",
- (*i)->nOutlinePoints(), (*i)->atten(), convertRadiansToDegrees ((*i)->rot()));
-
- printf("xmin=%7.3g ymin=%7.3g xmax=%7.3g ymax=%7.3g\n",
- (*i)->xmin(), (*i)->ymin(), (*i)->xmax(), (*i)->ymax());
-
- // for (int i = 0; i < m_nPoints; i++)
- // printf("\t%8.3g %8.3g\n", i->xOutline()[i], i->yOutline()[i]);
+* print Print vertices of Phantom pelems
+*
+* SYNOPSIS
+* print (phm)
+*/
+
+void
+Phantom::print (std::ostream& 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++) {
+ const PhantomElement& rPE = **i;
+ os << "PhantomElement: nPoints=" << rPE.nOutlinePoints();
+ os << ", atten=" << rPE.atten() << " rot=" << convertRadiansToDegrees (rPE.rot()) << "\n";
+ os << "xmin=" << rPE.xmin() << ", ymin=" << rPE.ymin() << ", xmax=" << rPE.xmax() << ", ymax=" << rPE.ymax() << "\n";
+
+ if (false)
+ for (int i = 0; i < rPE.nOutlinePoints(); i++)
+ 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++) {
+ const PhantomElement& rPE = **i;
+ os << "PhantomElement: nPoints=" << rPE.nOutlinePoints();
+ os << ", atten=" << rPE.atten() << " rot=" << convertRadiansToDegrees (rPE.rot()) << "\n";
+ os << "xmin=" << rPE.xmin() << ", ymin=" << rPE.ymin() << ", xmax=" << rPE.xmax() << ", ymax=" << rPE.ymax() << "\n";
+
+ if (false)
+ for (int i = 0; i < rPE.nOutlinePoints(); i++)
+ os << rPE.xOutline()[i] << "," << rPE.yOutline()[i] << "\n";
+ }
+}
+
+void
+Phantom::printDefinitions (std::ostream& os) const
+{
+ for (PElemConstIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) {
+ const PhantomElement& rPE = **i;
+ rPE.printDefinition (os);
+ }
+}
+
+void
+Phantom::printDefinitions (std::ostringstream& os) const
+{
+ for (PElemConstIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) {
+ const PhantomElement& rPE = **i;
+ rPE.printDefinition (os);