r333: *** empty log message ***
[ctsim.git] / libctsim / phantom.cpp
index d8fa862f625724968e328fc86be4eabdb03deaea..b74e531930a067cbc295b0b36a7075e29b77d9f8 100644 (file)
@@ -9,7 +9,7 @@
 **  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
@@ -299,6 +299,23 @@ Phantom::print (std::ostream& os) const
           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
@@ -309,6 +326,15 @@ Phantom::printDefinitions (std::ostream& os) const
   }\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
@@ -583,6 +609,13 @@ PhantomElement::printDefinition (std::ostream& os) const
     << 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)
 {