CREA_WXMAIN_WITH_CONSOLE
bool myApp::OnInit( )
-{
+{
wxApp::OnInit();
#ifdef __WXGTK__
//See http://www.wxwindows.org/faqgtk.htm#locale
#endif
wxInitAllImageHandlers();
-
creaImageIO::SetGimmickMessageLevel(5);
creaImageIO::SetGimmickDebugMessageLevel(0);
-
int min_dim = GIMMICK_2D_IMAGE_SELECTION;
int max_dim = GIMMICK_3D_IMAGE_SELECTION;
int output_dim = NATIVE;
int threads = 1;
- creaImageIO::WxGimmickReaderDialog w(0,
- -1,
- _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
- wxDefaultPosition,
- wxSize(810,750),
- min_dim,
- max_dim,
- output_dim,
- threads);
+ creaImageIO::WxGimmickReaderDialog w(
+ 0,
+ -1,
+ _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
+ wxDefaultPosition,
+ wxSize(810,750),
+ min_dim,
+ max_dim,
+ output_dim,
+ threads);
w.ShowModal();
-
+
if (w.GetReturnCode() == wxID_OK)
{
std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
std::cout << "$$$$ selected files : "<<std::endl;
- //Puts filenames
+ //Puts filenames
std::vector<std::string> s;
w.GetSelectedFiles(s);
std::vector<std::string>::iterator i;
for (i=s.begin();i!=s.end();++i)
- {
- std::cout << *i << std::endl;
- }
+ {
+ std::cout << *i << std::endl;
+ }
std::cout << "$$$$ "<<std::endl;
- //Puts images
+ //Puts images
std::vector<vtkImageData*> images;
- w.GetSelectedImages(images,output_dim);
- std::cout<<images.size()<<std::endl;
+ w.GetSelectedImages(images,output_dim);
+ std::cout<<images.size()<<std::endl;
- crea::VtkBasicSlicer(images.front());
+ crea::VtkBasicSlicer(images.front());
images.front()->Delete();
- w.OnExit();
+ w.OnExit();
}
else if (w.GetReturnCode() == wxID_CANCEL)
{
- w.OnExit();
+ w.OnExit();
std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
}
else
{
- w.OnExit();
- std::cout << "$$$$ main : dialog ended without return code ! $$$$"
- <<std::endl;
-
+ w.OnExit();
+ std::cout << "$$$$ main : dialog ended without return code ! $$$$"
+ <<std::endl;
}
// std::cout << "$$$$ main : deleting dialog"<<std::endl;
void ConnectAddProgressObserver( AddProgressCallbackType callback )
{ mImageAdder.ConnectProgressObserver(callback); }
-
///
const AddProgress& GetAddProgress() const { return mImageAdder.GetProgress(); }
TreeHandlerMapType& GetTreeHandlerMap() { return mTreeHandlerMap; }
/// Returns the TreeHandlerMap (const ref)
const TreeHandlerMapType& GetTreeHandlerMap() const
- { return mTreeHandlerMap; }
-
+ { return mTreeHandlerMap; }
/// Add the files to the given TreeHandler
void AddFiles(const std::string& handler,
/**
* \ingroup GUI
*/
-
+
//=====================================================================
//=====================================================================
class CREAIMAGEIO_EXPORT WxGimmickReaderDialog : public wxDialog
{
public:
- WxGimmickReaderDialog();
- WxGimmickReaderDialog(wxWindow *parent,
+ WxGimmickReaderDialog();
+ WxGimmickReaderDialog(wxWindow *parent,
const wxWindowID id,
wxString title,
- const wxPoint& pos,
+ const wxPoint& pos,
const wxSize& size,
int image_min_dim = GIMMICK_2D_IMAGE_SELECTION,
int image_max_dim = GIMMICK_3D_IMAGE_SELECTION,
int output_dim = NATIVE,
int threads = 0);
-
+
Gimmick* GetGimmick() { return mGimmick; }
// typedef WxGimmick ViewType;
typedef WxGimmickView::EventType EventType;
//===============================================================================================
//Image Selection
//===============================================================================================
-
+
void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
{ mView->GetSelectedImages(s, dim); }
void OnSelChanged(EventType& event);
void OnContextualMenu(EventType& event);
void OnMenuTest(wxCommandEvent& event);
- void OnValid(bool valid);
- void OnExit(){mView->StopPlayer();}
- // void OnButtonOk(wxCommandEvent& event);
- // void OnButtonCancel(wxCommandEvent& event);
-
+ void OnValid(bool valid);
+ void OnExit(){ mView->StopPlayer(); }
+ // void OnButtonOk(wxCommandEvent& event);
+ // void OnButtonCancel(wxCommandEvent& event);
+
private :
-
+
Gimmick* mGimmick;
WxGimmickView* mView;