projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r348: fix linefeed problem
[ctsim.git]
/
libctsim
/
projections.cpp
diff --git
a/libctsim/projections.cpp
b/libctsim/projections.cpp
index edbed03dc8ecbea37166d9ebde3589a16f036053..f6fff539bb7c4f6a7d7e5b8362b71cb5f09964bc 100644
(file)
--- a/
libctsim/projections.cpp
+++ b/
libctsim/projections.cpp
@@
-8,7
+8,7
@@
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.3
2 2000/12/16 06:12:47
kevin Exp $
+** $Id: projections.cpp,v 1.3
5 2001/01/02 16:02:13
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
**
** 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
@@
-25,8
+25,8
@@
******************************************************************************/
#include "ct.h"
******************************************************************************/
#include "ct.h"
-
\r
-const kuint16 Projections::m_signature = ('P'*256 + 'J');
\r
+
+const kuint16 Projections::m_signature = ('P'*256 + 'J');
/* NAME
* Projections Constructor for projections matrix storage
/* NAME
* Projections Constructor for projections matrix storage
@@
-71,6
+71,15
@@
Projections::init (const int nView, const int nDet)
m_nView = nView;
m_nDet = nDet;
newProjData ();
m_nView = nView;
m_nDet = nDet;
newProjData ();
+
+ time_t t = time (NULL);
+ tm* lt = localtime (&t);
+ m_year = lt->tm_year;
+ m_month = lt->tm_mon;
+ m_day = lt->tm_mday;
+ m_hour = lt->tm_hour;
+ m_minute = lt->tm_min;
+ m_second = lt->tm_sec;
}
void
}
void
@@
-262,7
+271,7
@@
Projections::headerRead (fnetorderstream& fs)
}
pszRemarkStorage[_remarksize] = 0;
m_remark = pszRemarkStorage;
}
pszRemarkStorage[_remarksize] = 0;
m_remark = pszRemarkStorage;
- delete pszRemarkStorage;
\r
+ delete pszRemarkStorage;
off_t _hsizeread = fs.tellg();
if (!fs || _hsizeread != _hsize) {
off_t _hsizeread = fs.tellg();
if (!fs || _hsizeread != _hsize) {
@@
-307,10
+316,14
@@
Projections::read (const std::string& filename)
bool
Projections::read (const char* filename)
{
bool
Projections::read (const char* filename)
{
- frnetorderstream fileRead (filename, ios::in | ios::binary);
m_filename = filename;
m_filename = filename;
+#ifdef MSVC
+ frnetorderstream fileRead (m_filename.c_str(), std::ios::in | std::ios::binary);
+#else
+ frnetorderstream fileRead (m_filename.c_str(), std::ios::in | std::ios::binary | std::ios::nocreate);
+#endif
- if (
! fileRead
)
+ if (
fileRead.fail()
)
return false;
if (! headerRead (fileRead))
return false;
if (! headerRead (fileRead))
@@
-438,17
+451,6
@@
Projections::write (const char* filename)
return false;
}
return false;
}
-#ifdef HAVE_TIME
- time_t t = time(NULL);
- tm* lt = localtime(&t);
- m_year = lt->tm_year;
- m_month = lt->tm_mon;
- m_day = lt->tm_mday;
- m_hour = lt->tm_hour;
- m_minute = lt->tm_min;
- m_second = lt->tm_sec;
-#endif
-
if (! headerWrite (fs))
return false;
if (! headerWrite (fs))
return false;