X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fphantom.cpp;h=b74e531930a067cbc295b0b36a7075e29b77d9f8;hp=d8fa862f625724968e328fc86be4eabdb03deaea;hb=4076fbc077adfd9ee610beef09b52d9e12c14abb;hpb=c39188dafe238b70c0e2dd45fd1cd2e2be95a7dc diff --git a/libctsim/phantom.cpp b/libctsim/phantom.cpp index d8fa862..b74e531 100644 --- a/libctsim/phantom.cpp +++ b/libctsim/phantom.cpp @@ -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++) { + 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 @@ -309,6 +326,15 @@ Phantom::printDefinitions (std::ostream& os) const } } +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); + } +} + /* 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"; } +void +PhantomElement::printDefinition (std::ostringstream& os) const +{ + os << convertTypeToName (m_type) << " " << m_cx << " " << m_cy << " " << m_u << " " + << m_v << " " << convertRadiansToDegrees (m_rot) << " " << m_atten << "\n"; +} + PhmElemType PhantomElement::convertNameToType (const char* const typeName) {