r307: additions for plotfile
[ctsim.git] / libctsupport / plotfile.cpp
index 588c014180f9b5db7f48e307b573e29d7fa213eb..b8744515cfc61ef8ac0a66e524e9dfecd1f1fed5 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: plotfile.cpp,v 1.1 2000/12/19 21:37:10 kevin Exp $
+**  $Id: plotfile.cpp,v 1.2 2000/12/20 14:39:09 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
@@ -104,6 +104,19 @@ PlotFile::addColumn (int iCol, const float* const pdColData)
   return true;\r
 }\r
 \r
+void\r
+PlotFile::getColumn (int iCol, double* pdColData) const\r
+{\r
+  if (iCol < 0 || iCol >= m_iNumColumns) {\r
+    sys_error (ERR_SEVERE, "Illegal column number %d [PlotFile::addColumn]", iCol);\r
+    return;\r
+  }\r
+\r
+  for (int iRec = 0; iRec < m_iNumRecords; iRec++)\r
+    pdColData[iRec] = m_vecCurves[ iRec + (iCol * m_iNumRecords) ];\r
+\r
+}\r
+\r
 bool
 PlotFile::fileWrite (const char* const filename)
 {