projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r3884: *** empty log message ***
[ctsim.git]
/
src
/
views.cpp
diff --git
a/src/views.cpp
b/src/views.cpp
index 72b79738d44dc361ee7ee25d92a70651793b6b08..e3922dafce711ee8e7c1c44a01ed10e76aa8bb50 100644
(file)
--- a/
src/views.cpp
+++ b/
src/views.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.1
64 2003/01/24 05:24:19
kevin Exp $
+** $Id: views.cpp,v 1.1
70 2003/01/30 21:53:16
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
@@
-329,6
+329,7
@@
ImageFileView::OnScaleAuto (wxCommandEvent& event)
m_dMinPixel = dMin;
m_dMaxPixel = dMax;
m_dAutoScaleFactor = dialogAutoScale.getAutoScaleFactor();
m_dMinPixel = dMin;
m_dMaxPixel = dMax;
m_dAutoScaleFactor = dialogAutoScale.getAutoScaleFactor();
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
}
GetDocument()->UpdateAllViews (this);
}
}
@@
-355,6
+356,7
@@
ImageFileView::OnScaleMinMax (wxCommandEvent& event)
m_bMaxSpecified = true;
m_dMinPixel = dialogMinMax.getMinimum();
m_dMaxPixel = dialogMinMax.getMaximum();
m_bMaxSpecified = true;
m_dMinPixel = dialogMinMax.getMinimum();
m_dMaxPixel = dialogMinMax.getMaximum();
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
@@
-366,6
+368,7
@@
ImageFileView::OnScaleFull (wxCommandEvent& event)
if (m_bMinSpecified || m_bMaxSpecified) {
m_bMinSpecified = false;
m_bMaxSpecified = false;
if (m_bMinSpecified || m_bMaxSpecified) {
m_bMinSpecified = false;
m_bMaxSpecified = false;
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
@@
-423,6
+426,7
@@
ImageFileView::OnCompare (wxCommandEvent& event)
pDifferenceImage->labelAdd (os.str().c_str());
if (theApp->getAskDeleteNewDocs())
pDifferenceDoc->Modify (true);
pDifferenceImage->labelAdd (os.str().c_str());
if (theApp->getAskDeleteNewDocs())
pDifferenceDoc->Modify (true);
+ OnUpdate(this, NULL);
pDifferenceDoc->UpdateAllViews(this);
pDifferenceDoc->getView()->setInitialClientSize();
pDifferenceDoc->Activate();
pDifferenceDoc->UpdateAllViews(this);
pDifferenceDoc->getView()->setInitialClientSize();
pDifferenceDoc->Activate();
@@
-440,6
+444,7
@@
ImageFileView::OnInvertValues (wxCommandEvent& event)
rIF.labelAdd ("Invert Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
rIF.labelAdd ("Invert Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-452,6
+457,7
@@
ImageFileView::OnSquare (wxCommandEvent& event)
rIF.labelAdd ("Square Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
rIF.labelAdd ("Square Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-464,6
+470,7
@@
ImageFileView::OnSquareRoot (wxCommandEvent& event)
rIF.labelAdd ("Square-root Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
rIF.labelAdd ("Square-root Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-476,6
+483,7
@@
ImageFileView::OnLog (wxCommandEvent& event)
rIF.labelAdd ("Logrithm base-e Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
rIF.labelAdd ("Logrithm base-e Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-488,6
+496,7
@@
ImageFileView::OnExp (wxCommandEvent& event)
rIF.labelAdd ("Exponent base-e Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
rIF.labelAdd ("Exponent base-e Pixel Values");
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-526,6
+535,7
@@
ImageFileView::OnAdd (wxCommandEvent& event)
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
+ OnUpdate(this, NULL);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
@@
-567,6
+577,7
@@
ImageFileView::OnSubtract (wxCommandEvent& event)
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
+ OnUpdate(this, NULL);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
@@
-608,6
+619,7
@@
ImageFileView::OnMultiply (wxCommandEvent& event)
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
+ OnUpdate(this, NULL);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
@@
-649,6
+661,7
@@
ImageFileView::OnDivide (wxCommandEvent& event)
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pNewDoc->Modify (true);
+ OnUpdate(this, NULL);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->setInitialClientSize();
pNewDoc->Activate();
@@
-668,6
+681,7
@@
ImageFileView::OnFFT (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-682,6
+696,7
@@
ImageFileView::OnIFFT (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-696,6
+711,7
@@
ImageFileView::OnFFTRows (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-710,6
+726,7
@@
ImageFileView::OnIFFTRows (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-724,6
+741,7
@@
ImageFileView::OnFFTCols (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-738,6
+756,7
@@
ImageFileView::OnIFFTCols (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-754,6
+773,7
@@
ImageFileView::OnFourier (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-769,6
+789,7
@@
ImageFileView::OnInverseFourier (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-783,6
+804,7
@@
ImageFileView::OnShuffleNaturalToFourierOrder (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-797,6
+819,7
@@
ImageFileView::OnShuffleFourierToNaturalOrder (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-811,6
+834,7
@@
ImageFileView::OnMagnitude (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
GetDocument()->UpdateAllViews (this);
GetDocument()->Activate();
}
@@
-826,6
+850,7
@@
ImageFileView::OnPhase (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
@@
-842,6
+867,7
@@
ImageFileView::OnReal (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
@@
-858,6
+884,7
@@
ImageFileView::OnImaginary (wxCommandEvent& event)
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
m_bMaxSpecified = false;
if (theApp->getAskDeleteNewDocs())
GetDocument()->Modify (true);
+ OnUpdate(this, NULL);
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
GetDocument()->UpdateAllViews (this);
}
GetDocument()->Activate();
@@
-1060,8
+1087,12
@@
ImageFileView::setInitialClientSize ()
void
ImageFileView::OnDraw (wxDC* dc)
{
void
ImageFileView::OnDraw (wxDC* dc)
{
- if (m_pBitmap && m_pBitmap->Ok())
+ if (m_pBitmap && m_pBitmap->Ok()) {
+#ifdef DEBUG
+ *theApp->getLog() << "Drawing bitmap\n";
+#endif
dc->DrawBitmap(*m_pBitmap, 0, 0, false);
dc->DrawBitmap(*m_pBitmap, 0, 0, false);
+ }
int xCursor, yCursor;
if (m_pCanvas->GetCurrentCursor (xCursor, yCursor))
int xCursor, yCursor;
if (m_pCanvas->GetCurrentCursor (xCursor, yCursor))
@@
-1111,8
+1142,13
@@
ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
}
}
wxImage image (nx, ny, imageData, true);
}
}
wxImage image (nx, ny, imageData, true);
- if (m_pBitmap)
+ if (m_pBitmap)
{
delete m_pBitmap;
delete m_pBitmap;
+ m_pBitmap = NULL;
+ }
+#ifdef DEBUG
+ *theApp->getLog() << "Making new bitmap\n";
+#endif
m_pBitmap = new wxBitmap (image);
delete imageData;
m_pCanvas->SetScrollbars(20, 20, nx/20, ny/20);
m_pBitmap = new wxBitmap (image);
delete imageData;
m_pCanvas->SetScrollbars(20, 20, nx/20, ny/20);
@@
-1311,6
+1347,7
@@
ImageFileView::OnScaleSize (wxCommandEvent& event)
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pScaledDoc->Modify (true);
*theApp->getLog() << os.str().c_str() << "\n";
if (theApp->getAskDeleteNewDocs())
pScaledDoc->Modify (true);
+ OnUpdate(this, NULL);
pScaledDoc->UpdateAllViews (this);
pScaledDoc->getView()->setInitialClientSize();
pScaledDoc->Activate();
pScaledDoc->UpdateAllViews (this);
pScaledDoc->getView()->setInitialClientSize();
pScaledDoc->Activate();
@@
-2176,6
+2213,7
@@
PhantomFileView::OnProjections (wxCommandEvent& event)
pProjectionDoc->setProjections (pProj);
if (theApp->getAskDeleteNewDocs())
pProjectionDoc-> Modify(true);
pProjectionDoc->setProjections (pProj);
if (theApp->getAskDeleteNewDocs())
pProjectionDoc-> Modify(true);
+ OnUpdate(this, NULL);
pProjectionDoc->UpdateAllViews (this);
pProjectionDoc->getView()->setInitialClientSize();
pProjectionDoc->Activate();
pProjectionDoc->UpdateAllViews (this);
pProjectionDoc->getView()->setInitialClientSize();
pProjectionDoc->Activate();
@@
-3153,8
+3191,10
@@
ProjectionFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)
}
}
wxImage image (nDet, nView, imageData, true);
}
}
wxImage image (nDet, nView, imageData, true);
- if (m_pBitmap)
+ if (m_pBitmap)
{
delete m_pBitmap;
delete m_pBitmap;
+ m_pBitmap = NULL;
+ }
m_pBitmap = new wxBitmap (image);
delete imageData;
}
m_pBitmap = new wxBitmap (image);
delete imageData;
}