#include <wxMaracasApp.h>
Public Member Functions | |
void | SetVolumeData (int dimX, int dimY, int dimZ, float spacingX, float spacingY, float spacingZ, float rescaleSlope, float rescaleIntercept, unsigned short *pixels) |
void | ShowFrame (int cmdShow) |
bool | Initialized () |
void | Reset () |
bool | OnInit () |
int | OnExit () |
void | Run () |
wxBitmap * | GetSnapshot () |
Private Member Functions | |
void | Initialize () |
Private Attributes | |
bool | initialized |
marInterface * | _mar |
marSimpleDicom * | _marSimpleDicom |
wxMaracasFrame * | m_pFrame |
Definition at line 46 of file wxMaracasApp.h.
void wxMaracasApp::SetVolumeData | ( | int | dimX, | |
int | dimY, | |||
int | dimZ, | |||
float | spacingX, | |||
float | spacingY, | |||
float | spacingZ, | |||
float | rescaleSlope, | |||
float | rescaleIntercept, | |||
unsigned short * | pixels | |||
) |
Definition at line 1151 of file wxMaracasApp.cxx.
References _mar, _marSimpleDicom, marInterface::_parameters, marParameters::getInvestSliceOrder(), Initialized(), marSimpleDicom::SetInvestSliceOrder(), and marSimpleDicom::SetVolumeData().
01155 { 01156 if (Initialized()) 01157 { 01158 _marSimpleDicom->SetInvestSliceOrder( _mar->_parameters->getInvestSliceOrder() ); 01159 _marSimpleDicom->SetVolumeData(dimX, dimY, dimZ, 01160 spacingX, spacingY, spacingZ, 01161 rescaleSlope, rescaleIntercept, 01162 pixels); 01163 } 01164 }
void wxMaracasApp::ShowFrame | ( | int | cmdShow | ) |
Definition at line 1119 of file wxMaracasApp.cxx.
References Initialized(), m_pFrame, SHOW_WINDOW_MAXIMIZED, SHOW_WINDOW_MINIMIZED, and SHOW_WINDOW_RESTORE.
01120 { 01121 //EEDxx2.4 DEBuG 01122 // wxLogDebug("----------- Show Frame"); 01123 if (Initialized()) 01124 { 01125 if ( SHOW_WINDOW_MINIMIZED == cmdShow ) 01126 { 01127 m_pFrame->Iconize(); 01128 } 01129 else if ( SHOW_WINDOW_RESTORE == cmdShow ) 01130 { 01131 m_pFrame->Maximize(false); 01132 m_pFrame->Raise(); 01133 } 01134 else if (SW_NORMAL == cmdShow ) 01135 { 01136 m_pFrame->Raise(); 01137 } 01138 else if ( SHOW_WINDOW_MAXIMIZED == cmdShow ) 01139 { 01140 m_pFrame->Maximize(true); 01141 m_pFrame->Raise(); 01142 } 01143 else 01144 { 01145 m_pFrame->Raise(); 01146 } 01147 } 01148 }
bool wxMaracasApp::Initialized | ( | ) |
Definition at line 1114 of file wxMaracasApp.cxx.
References initialized.
Referenced by OnExit(), SetVolumeData(), and ShowFrame().
01114 { 01115 return initialized; 01116 }
void wxMaracasApp::Reset | ( | ) |
Definition at line 1052 of file wxMaracasApp.cxx.
References Initialize().
01052 { 01053 // TODO : we can make it more nicely 01054 //EEDxx2.4 DEBuG 01055 // wxLogDebug("---------------------------------------------------"); 01056 // wxLogDebug("----------- Reseting application"); 01057 // wxLogDebug("---------------------------------------------------"); 01058 //OnExit(); 01059 // OnInit(); 01060 Initialize(); 01061 }
bool wxMaracasApp::OnInit | ( | ) |
Definition at line 1004 of file wxMaracasApp.cxx.
01005 { 01006 #ifdef __WXGTK__ 01007 //See http://www.wxwindows.org/faqgtk.htm#locale 01008 setlocale(LC_NUMERIC, "C"); 01009 #endif 01010 01011 01012 // PS -> #ifndef DXMM 01013 // PS -> // GO ! 01014 // PS -> SetExitOnFrameDelete(true); 01015 // PS -> m_pFrame->Show( true ); 01016 // PS -> #else 01017 SetExitOnFrameDelete(false); 01018 // PS -> #endif 01019 01020 return( true ); 01021 }
int wxMaracasApp::OnExit | ( | ) |
Definition at line 1023 of file wxMaracasApp.cxx.
References initialized, Initialized(), and m_pFrame.
01023 { 01024 if (Initialized()) 01025 { 01026 initialized=false; 01027 // delete _mar; 01028 m_pFrame->Destroy(); 01029 } 01030 ProcessIdle(); 01031 01032 //EEDxx2.4 DEBuG 01033 // wxLogDebug("----------- Exiting application"); 01034 // wxLogDebug("---------------------------------------------------"); 01035 01036 return true; 01037 }
void wxMaracasApp::Run | ( | ) |
Definition at line 1040 of file wxMaracasApp.cxx.
References m_pFrame, and wxMaracasFrame::OnStartExperiment().
01040 { 01041 01042 m_pFrame->Show( true ); 01043 wxCommandEvent cmdEvt=wxCommandEvent(); 01044 m_pFrame->OnStartExperiment(cmdEvt); 01045 m_pFrame->Maximize(true); 01046 01047 //EEDxx2.4 DEBuG 01048 // wxLogDebug("----------- Running application"); 01049 }
wxBitmap * wxMaracasApp::GetSnapshot | ( | ) |
Definition at line 1166 of file wxMaracasApp.cxx.
References m_pFrame.
01166 { 01167 wxWindowDC *wxwindc = new wxWindowDC(m_pFrame); 01168 wxCoord w, h; 01169 wxwindc->GetSize(&w, &h); 01170 wxBitmap *wxbitmap = new wxBitmap(w, h); 01171 01172 wxMemoryDC *wxmemorydc = new wxMemoryDC(); 01173 wxmemorydc->SelectObject(*wxbitmap); 01174 wxmemorydc->Blit(0,0,w,h,wxwindc,0,0); 01175 01176 delete wxwindc; 01177 delete wxmemorydc; 01178 01179 return wxbitmap; 01180 }
void wxMaracasApp::Initialize | ( | ) | [private] |
Definition at line 1064 of file wxMaracasApp.cxx.
References _mar, _marSimpleDicom, marInterface::_parameters, initialized, marInterface::loadParameters(), m_pFrame, MAR_DEFAULT_FILE_DICTIONARY, MAR_DEFAULT_FILE_PARAMETERS, marInterface::saveParameters(), marInterface::SetDicom(), and marInterface::SetParamFileName().
Referenced by Reset().
01064 { 01065 #ifdef __WXDEBUG__ 01066 //static wxLogWindow * myLogWindow=new wxLogWindow(NULL,"Log Window",false,false); 01067 static wxLogWindow * myLogWindow=new wxLogWindow(NULL,"Log Window",true,false); 01068 wxLog::SetActiveTarget(myLogWindow); 01069 myLogWindow->ClearTraceMasks(); 01070 #endif 01071 //EEDxx2.4 DEBuG 01072 // wxLogDebug("---------------------------------------------------"); 01073 // wxLogDebug("----------- Initialising application"); 01074 01075 01076 int nSize=_MAX_PATH; 01077 LPTSTR lpFilename=(LPTSTR) (new char[nSize]); 01078 GetModuleFileName(NULL,lpFilename,nSize); 01079 01080 wxString moduleFileName(lpFilename); 01081 01082 wxString paramFileName=moduleFileName.BeforeLast('\\') 01083 +wxString('\\') 01084 +wxString(MAR_DEFAULT_FILE_PARAMETERS); 01085 01086 wxString dictionaryFileName=moduleFileName.BeforeLast('\\') 01087 +wxString('\\') 01088 +wxString(MAR_DEFAULT_FILE_DICTIONARY); 01089 01090 // Initialize MARACAS 01091 01092 01093 _mar = new marInterface(); 01094 _mar->SetParamFileName(paramFileName.c_str()); 01095 _mar->loadParameters(); 01096 _marSimpleDicom = new marSimpleDicom( _mar->_parameters ); 01097 _mar->SetDicom(_marSimpleDicom); 01098 01099 01100 01101 // Create the main frame window 01102 m_pFrame = new wxMaracasFrame( ( wxFrame* )NULL, -1 , _mar , _marSimpleDicom ,(const char*)dictionaryFileName.mb_str()); 01103 01104 01105 m_pFrame->Maximize( ); 01106 this->SetTopWindow( m_pFrame ); 01107 _mar->saveParameters( ); 01108 01109 initialized=true; 01110 SetExitOnFrameDelete(false); 01111 }
bool wxMaracasApp::initialized [private] |
Definition at line 61 of file wxMaracasApp.h.
Referenced by Initialize(), Initialized(), and OnExit().
marInterface* wxMaracasApp::_mar [private] |
marSimpleDicom* wxMaracasApp::_marSimpleDicom [private] |
wxMaracasFrame* wxMaracasApp::m_pFrame [private] |
Definition at line 64 of file wxMaracasApp.h.
Referenced by GetSnapshot(), Initialize(), OnExit(), Run(), and ShowFrame().