From 4a5567b8df652cc3168bb9d439bc23f973a2b5ea Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 27 Jan 2001 21:02:20 +0000 Subject: [PATCH] r450: Fixed tick-labels --- ChangeLog | 11 ++++--- include/dlgezplot.h | 4 +-- libctgraphics/dlgezplot.cpp | 14 +++++---- libctgraphics/sgp.cpp | 8 ++--- libctsim/array2dfile.cpp | 4 +-- libctsim/backprojectors.cpp | 4 +-- libctsim/reconstruct.cpp | 13 +++++--- libctsim/scanner.cpp | 24 +++++++++++---- libctsupport/clip.cpp | 4 +-- libctsupport/consoleio.cpp | 4 +-- msvc/ctsim/ctsim.plg | 59 +++++++++++++++++++++++++++++++------ src/dlgprojections.cpp | 10 ++++++- src/dlgprojections.h | 4 +-- src/dlgreconstruct.cpp | 4 +-- 14 files changed, 119 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e8a5bc..64c37a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,17 +2,20 @@ * ctsim: Added most-recently-used files to File menu with registry storage between executions. - - * ctsim: Added MDI interface for Windows version + + * ctsim: Added MDI interface for Windows version and made it default * ctsim: Added graphical About box - * ctsim: Added accelerator (hotkeys) to windows + * ctsim: Added accelerator (hotkeys) to frames * ctsim: Online help added as well as HTML help - * ctsim: Added icons to Frames on Windows versions + * ctsim: Added icons to Frames on X-Window and MS Windows versions + * ctsim: Fixed tick-label placement for plots on projection and + reconstruction dialogs. + * pjinfo: Fixed bug when doing --dump and not specifing --endview * ctsimtext-lam: Changes for first version to compile under lam diff --git a/include/dlgezplot.h b/include/dlgezplot.h index 33aa7c3..28cdbd5 100644 --- a/include/dlgezplot.h +++ b/include/dlgezplot.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: dlgezplot.h,v 1.1 2001/01/13 04:47:50 kevin Exp $ +** $Id: dlgezplot.h,v 1.2 2001/01/27 21:02:20 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 @@ -81,7 +81,7 @@ private: EZPlotControl* m_pEZPlotCtrl; public: - EZPlotDialog (wxWindow *parent = NULL); + EZPlotDialog (wxWindow *parent = NULL, bool bCancelButton = false); ~EZPlotDialog(); diff --git a/libctgraphics/dlgezplot.cpp b/libctgraphics/dlgezplot.cpp index 869d451..4dbc6fe 100644 --- a/libctgraphics/dlgezplot.cpp +++ b/libctgraphics/dlgezplot.cpp @@ -7,9 +7,9 @@ ** Date Started: Jan 2001 ** ** This is part of the CTSim program -** Copyright (C) 1983-2001 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: dlgezplot.cpp,v 1.3 2001/01/19 22:53:56 kevin Exp $ +** $Id: dlgezplot.cpp,v 1.4 2001/01/27 21:02:20 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 @@ -103,6 +103,7 @@ EZPlotControl::OnPaint (wxPaintEvent& event) m_pSGPDriver = new SGPDriver (&dc, m_iClientX, m_iClientY); m_pSGP = new SGP (*m_pSGPDriver); m_pSGP->setTextPointSize(10); +// m_pSGP->setViewport (0, 0, 1., 0.5); // for debugging testing only if (m_pEZPlot && m_pSGP) { m_pSGP->eraseWindow(); m_pEZPlot->plot (m_pSGP); @@ -110,7 +111,7 @@ EZPlotControl::OnPaint (wxPaintEvent& event) } -EZPlotDialog::EZPlotDialog (wxWindow *parent) +EZPlotDialog::EZPlotDialog (wxWindow *parent, bool bCancelButton) : wxDialog((parent ? parent : theApp->getMainFrame()), -1, wxString("EZPlot"), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL), m_parentTop(0) { @@ -127,10 +128,11 @@ EZPlotDialog::EZPlotDialog (wxWindow *parent) wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL); wxButton* pButtonOk = new wxButton (this, wxID_OK, "Ok"); - wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel"); pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10); - pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10); - + if (bCancelButton) { + wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel"); + pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10); + } pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER); SetAutoLayout (true); diff --git a/libctgraphics/sgp.cpp b/libctgraphics/sgp.cpp index ec6b89d..1bd9a1c 100644 --- a/libctgraphics/sgp.cpp +++ b/libctgraphics/sgp.cpp @@ -5,9 +5,9 @@ ** Programmer: Kevin Rosenberg ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: sgp.cpp,v 1.27 2001/01/12 21:53:27 kevin Exp $ +** $Id: sgp.cpp,v 1.28 2001/01/27 21:02:20 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 @@ -564,7 +564,7 @@ SGP::getCharHeight () if (m_driver.isWX()) { dHeight = m_driver.idWX()->GetCharHeight(); dHeight /= static_cast(m_iPhysicalYSize); - dHeight /= (yv_max - yv_min); // scale to viewport; + dHeight /= (yv_max - yv_min); // scale to viewport; } #endif dHeight *= (yw_max - yw_min); // scale to world coordinates @@ -580,7 +580,7 @@ SGP::getCharWidth () if (m_driver.isWX()) { dWidth = m_driver.idWX()->GetCharWidth(); dWidth /= static_cast(m_iPhysicalXSize); - dWidth /= (xv_max - xv_min); // scale to viewport + dWidth /= (xv_max - xv_min); // scale to viewport } #endif dWidth *= (xw_max - xw_min); //scale to world coordinates diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index 555d22e..bda7925 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -7,9 +7,9 @@ ** Date Started: June 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.27 2001/01/02 16:02:13 kevin Exp $ +** $Id: array2dfile.cpp,v 1.28 2001/01/27 21:02:20 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 diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index 8343314..0a386fb 100644 --- a/libctsim/backprojectors.cpp +++ b/libctsim/backprojectors.cpp @@ -6,9 +6,9 @@ ** Date Started: June 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: backprojectors.cpp,v 1.23 2001/01/04 21:28:41 kevin Exp $ +** $Id: backprojectors.cpp,v 1.24 2001/01/27 21:02:20 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 diff --git a/libctsim/reconstruct.cpp b/libctsim/reconstruct.cpp index c858027..245a36e 100644 --- a/libctsim/reconstruct.cpp +++ b/libctsim/reconstruct.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: reconstruct.cpp,v 1.7 2001/01/02 16:02:13 kevin Exp $ +** $Id: reconstruct.cpp,v 1.8 2001/01/27 21:02:20 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 @@ -178,21 +178,26 @@ Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP, bool ezplotProj.ezset ("xticks major 5"); ezplotProj.ezset ("xlabel "); ezplotProj.ezset ("ylabel "); - ezplotProj.ezset ("yporigin .5"); - ezplotProj.ezset ("ylength .5"); + ezplotProj.ezset ("yporigin 0.1"); + ezplotProj.ezset ("ylength 0.45"); + ezplotProj.ezset ("xlength 0.66"); ezplotProj.ezset ("box."); ezplotProj.ezset ("grid."); ezplotProj.addCurve (m_adPlotXAxis, detval, m_rProj.nDet()); + pSGP->setTextPointSize(12); ezplotProj.plot (pSGP); ezplotProj.ezset ("clear"); ezplotProj.ezset ("title Filtered Projection"); ezplotProj.ezset ("xticks major 5"); ezplotProj.ezset ("xlabel "); ezplotProj.ezset ("ylabel "); - ezplotProj.ezset ("ylength .5"); + ezplotProj.ezset ("yporigin 0.55"); + ezplotProj.ezset ("ylength 0.45"); + ezplotProj.ezset ("xlength 0.66"); ezplotProj.ezset ("box"); ezplotProj.ezset ("grid"); ezplotProj.addCurve (m_adPlotXAxis, adFilteredProj, m_nFilteredProjections); + pSGP->setTextPointSize(12); ezplotProj.plot (pSGP); } #endif //HAVE_SGP diff --git a/libctsim/scanner.cpp b/libctsim/scanner.cpp index 453e913..d577ebb 100644 --- a/libctsim/scanner.cpp +++ b/libctsim/scanner.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: scanner.cpp,v 1.25 2001/01/17 11:00:18 kevin Exp $ +** $Id: scanner.cpp,v 1.26 2001/01/27 21:02:20 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 @@ -318,6 +318,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iS m_pSGP->moveAbs (0., 0.); m_pSGP->drawCircle (m_dFocalLength); m_pSGP->setColor (C_BLUE); + m_pSGP->setTextPointSize (9); phm.draw (*m_pSGP); m_dTextHeight = m_pSGP->getCharHeight (); @@ -535,13 +536,24 @@ Scanner::traceShowParamRasterOp (int iRasterOp, const char *szLabel, const char #ifdef HAVE_SGP if (m_pSGP) { m_pSGP->setRasterOp (iRasterOp); - double dYPos = m_dYMaxWin - (row * m_dTextHeight); - m_pSGP->moveAbs (m_dXMinWin, dYPos); m_pSGP->setTextColor (color, -1); - m_pSGP->drawText (szLabel); double dValueOffset = (m_dXMaxWin - m_dXMinWin) / 4; - m_pSGP->moveAbs (m_dXMinWin + dValueOffset, dYPos); - m_pSGP->drawText (szValue); + if (row < 4) { + double dYPos = m_dYMaxWin - (row * m_dTextHeight); + double dXPos = m_dXMinWin; + m_pSGP->moveAbs (dXPos, dYPos); + m_pSGP->drawText (szLabel); + m_pSGP->moveAbs (dXPos + dValueOffset, dYPos); + m_pSGP->drawText (szValue); + } else { + row -= 4; + double dYPos = m_dYMaxWin - (row * m_dTextHeight); + double dXPos = m_dXMinWin + (m_dXMaxWin - m_dXMinWin) * 0.5; + m_pSGP->moveAbs (dXPos, dYPos); + m_pSGP->drawText (szLabel); + m_pSGP->moveAbs (dXPos + dValueOffset, dYPos); + m_pSGP->drawText (szValue); + } } else #endif { diff --git a/libctsupport/clip.cpp b/libctsupport/clip.cpp index e11e334..44d982d 100644 --- a/libctsupport/clip.cpp +++ b/libctsupport/clip.cpp @@ -12,9 +12,9 @@ ** the SNARK size of the object (u,v) ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: clip.cpp,v 1.7 2001/01/02 16:02:13 kevin Exp $ +** $Id: clip.cpp,v 1.8 2001/01/27 21:02:20 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 diff --git a/libctsupport/consoleio.cpp b/libctsupport/consoleio.cpp index fd895e8..64a189c 100644 --- a/libctsupport/consoleio.cpp +++ b/libctsupport/consoleio.cpp @@ -1,8 +1,8 @@ /***************************************************************************** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: consoleio.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $ +** $Id: consoleio.cpp,v 1.4 2001/01/27 21:02:20 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 diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index e5faf80..7e23f3a 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -3,16 +3,59 @@
 

Build Log

---------------------Configuration: ctsim - Win32 Debug-------------------- +--------------------Configuration: libctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C3.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP243.tmp" with contents +[ +/nologo /G6 /MTd /W3 /Gm /GR /GX /Zi /Od /I "..\..\..\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\ctsim\libctsim\scanner.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP243.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP244.tmp" with contents [ -/nologo /G6 /MTd /W3 /Gm /GR /GX /Zi /Od /I "\wx2\include" /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"2.5.0\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"C:\ctsim\src\views.cpp" +/nologo /out:"Debug\libctsim.lib" +.\Debug\array2dfile.obj +.\Debug\backprojectors.obj +.\Debug\clip.obj +.\Debug\consoleio.obj +.\Debug\dlgezplot.obj +.\Debug\ezplot.obj +.\Debug\ezset.obj +.\Debug\ezsupport.obj +.\Debug\filter.obj +.\Debug\fnetorderstream.obj +.\Debug\fourier.obj +.\Debug\getopt.obj +.\Debug\getopt1.obj +.\Debug\globalvars.obj +.\Debug\hashtable.obj +.\Debug\imagefile.obj +.\Debug\mathfuncs.obj +.\Debug\phantom.obj +.\Debug\plotfile.obj +.\Debug\pol.obj +.\Debug\procsignal.obj +.\Debug\projections.obj +.\Debug\reconstruct.obj +.\Debug\scanner.obj +.\Debug\sgp.obj +.\Debug\strfuncs.obj +.\Debug\syserror.obj +.\Debug\trace.obj +.\Debug\transformmatrix.obj +.\Debug\xform.obj ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C3.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C4.tmp" with contents +Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP244.tmp" +

Output Window

+Compiling... +scanner.cpp +Creating library... +

+--------------------Configuration: ctsim - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP245.tmp" with contents [ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lpng108\msvc\win32\libpng\lib_dbg\libpng.lib ..\..\..\lpng108\msvc\win32\zlib\lib_dbg\zlib.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib ../../../wx2/lib/wxd.lib xpmd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" /libpath:"..\..\..\wx2\lib" .\Debug\ctsim.obj @@ -28,10 +71,8 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w \wx2\lib\wxd.lib \wx2\lib\xpmd.lib ] -Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C4.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP245.tmp"

Output Window

-Compiling... -views.cpp Linking... diff --git a/src/dlgprojections.cpp b/src/dlgprojections.cpp index dfe4929..c5888c2 100644 --- a/src/dlgprojections.cpp +++ b/src/dlgprojections.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dlgprojections.cpp,v 1.18 2001/01/17 11:00:18 kevin Exp $ +** $Id: dlgprojections.cpp,v 1.19 2001/01/27 21:02:20 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 @@ -169,7 +169,15 @@ ProjectionsDialog::showView (int iViewNumber) ezplot.ezset ("box"); ezplot.ezset ("yticks left"); ezplot.addCurve (detValues, detPos, detArray.nDet()); +#if 1 + ezplot.ezset ("xporigin 0.67"); + ezplot.ezset ("yporigin 0.10"); + ezplot.ezset ("xlength 0.33"); + ezplot.ezset ("ylength 0.90"); + m_pSGP->setViewport (0., 0., 1., 1.); +#else m_pSGP->setViewport (0.67, 0.1, 1., 1.); +#endif ezplot.plot (m_pSGP); delete detPos; } diff --git a/src/dlgprojections.h b/src/dlgprojections.h index eedd7b8..deb76de 100644 --- a/src/dlgprojections.h +++ b/src/dlgprojections.h @@ -7,9 +7,9 @@ ** Date Started: August 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: dlgprojections.h,v 1.5 2000/12/17 22:30:34 kevin Exp $ +** $Id: dlgprojections.h,v 1.6 2001/01/27 21:02:20 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 diff --git a/src/dlgreconstruct.cpp b/src/dlgreconstruct.cpp index 4fd7b1a..6f4cff4 100644 --- a/src/dlgreconstruct.cpp +++ b/src/dlgreconstruct.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dlgreconstruct.cpp,v 1.13 2001/01/02 16:02:13 kevin Exp $ +** $Id: dlgreconstruct.cpp,v 1.14 2001/01/27 21:02:20 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 @@ -172,7 +172,7 @@ ReconstructDialog::showView (int iViewNumber, bool bBackprojectView) m_pSGP->drawText (szProgress); m_pSGP->setTextSize (dCharHeight); - m_pSGP->setViewport (0.0, 0.1, 0.66, 1.); + // m_pSGP->setViewport (0.0, 0.1, 0.66, 1.); // viewport equiv now done in subroutine m_rReconstructor.reconstructView (iViewNumber, 1, m_pSGP, bBackprojectView); ImageFileArrayConst v = m_rImageFile.getArray(); -- 2.34.1