creaImageIO_lib
creaImageIO::WxGimmickReaderDialog Class Reference

#include <creaImageIOWxGimmickReaderDialog.h>

Inheritance diagram for creaImageIO::WxGimmickReaderDialog:
Collaboration diagram for creaImageIO::WxGimmickReaderDialog:

Public Types

typedef WxGimmickView::EventType EventType
 

Public Member Functions

 WxGimmickReaderDialog ()
 
 WxGimmickReaderDialog (wxWindow *parent, const wxWindowID id, const std::string i_namedescp, const std::string i_namedb, wxString title, 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)
 
boost::shared_ptr< GimmickGetGimmick ()
 
 ~WxGimmickReaderDialog ()
 Destructor. More...
 
void GetSelectedImages (std::vector< vtkImageData * > &s, int dim)
 
void GetSelectedImagesInVector (std::vector< vtkImageData * > &s, int dim)
 
void getSelected (std::vector< OutStrGimmick > &outG, std::vector< std::string > i_attr, bool mult, const std::string outmodel)
 
void GetSelectedFiles (std::vector< std::string > &s)
 
void OnSelChanged (EventType &event)
 
void OnContextualMenu (EventType &event)
 
void OnMenuTest (wxCommandEvent &event)
 
void OnValid (bool valid)
 Callback method on a selection. More...
 
void OnExit ()
 
void deleteMessage ()
 
void stopReading ()
 

Private Types

enum  { TVID = 1 }
 

Private Attributes

boost::shared_ptr< GimmickmGimmick
 
WxGimmickViewmView
 
wxButton * mOkButton
 
wxButton * mCancelButton
 
wxBoxSizer * mtopsizer
 

Detailed Description

Definition at line 46 of file creaImageIOWxGimmickReaderDialog.h.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
private
Enumerator
TVID 

Definition at line 113 of file creaImageIOWxGimmickReaderDialog.h.

114  {
115  TVID = 1
116  // OKID = 2,
117  // CANCELID = 3
118  };

Constructor & Destructor Documentation

creaImageIO::WxGimmickReaderDialog::WxGimmickReaderDialog ( )
creaImageIO::WxGimmickReaderDialog::WxGimmickReaderDialog ( wxWindow *  parent,
const wxWindowID  id,
const std::string  i_namedescp,
const std::string  i_namedb,
wxString  title,
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 
)

Definition at line 38 of file creaImageIOWxGimmickReaderDialog.cpp.

References creaImageIO::GimmickView::ConnectValidationObserver(), GimmickDebugMessage, creaImageIO::GimmickView::Initialize(), mCancelButton, mGimmick, mOkButton, mtopsizer, mView, OnValid(), and TVID.

49  : wxDialog( parent,
50  id,
51  title,
52  pos,
53  size,
54  wxRESIZE_BORDER |
55  wxSYSTEM_MENU |
56  wxCLOSE_BOX |
57  wxMAXIMIZE_BOX |
58  wxMINIMIZE_BOX |
59  wxCAPTION
60  ),
61  // mGimmick(0),
62  mView(0)
63  {
64  GimmickDebugMessage(1,"WxGimmickReaderDialog::WxGimmickReaderDialog"
65  <<std::endl);
66  mtopsizer = new wxBoxSizer(wxVERTICAL);
67 
68  try {
69 
70  mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
71  mGimmick->Initialize(i_namedescp,i_namedb);
72 
73  mView = new WxGimmickView(mGimmick,
74  this,
75  TVID,
76  wxDefaultPosition,
77  size,
78  min_dim,
79  max_dim,
80  threads);
81  mView->Initialize();
82  // Connect the AddProgress callback
84  ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) );
85  }
86  catch (crea::Exception e)
87  {
88  e.Print();
89  return;
90  }
91 
92  mtopsizer->Add( mView,1,wxGROW,0);
93 
94  wxSizer* bsizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
95  /*mOkButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(170,50));
96  mCancelButton = new wxButton(this, wxID_CANCEL, _T("CANCEL"), wxPoint(210,50));
97  */ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
98  mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
99 
100  mOkButton->Enable(false);
101  mtopsizer->Add ( bsizer, 0, wxGROW );
102 
103  SetSizer( mtopsizer );
104 
105  Layout();
106  }

Here is the call graph for this function:

creaImageIO::WxGimmickReaderDialog::~WxGimmickReaderDialog ( )

Destructor.

Definition at line 109 of file creaImageIOWxGimmickReaderDialog.cpp.

References GimmickDebugMessage, mGimmick, and mView.

110  {
111  GimmickDebugMessage(1,"WxGimmickReaderDialog::~WxGimmickReaderDialog"
112  <<std::endl);
113  if (mView)
114  {
115  delete mView;
116  }
117  if (mGimmick)
118  {
119  mGimmick->Finalize();
120  }
121 
122  }

Member Function Documentation

void creaImageIO::WxGimmickReaderDialog::deleteMessage ( )
boost::shared_ptr<Gimmick> creaImageIO::WxGimmickReaderDialog::GetGimmick ( )
inline

Definition at line 62 of file creaImageIOWxGimmickReaderDialog.h.

62 { return mGimmick; }
void creaImageIO::WxGimmickReaderDialog::getSelected ( std::vector< OutStrGimmick > &  outG,
std::vector< std::string >  i_attr,
bool  mult,
const std::string  outmodel 
)
inline

Definition at line 83 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by creaImageIO::WxSimpleDlg::OnReadGimmick().

84  {
85  mView->getSelectedFiles(outG, i_attr, mult, outmodel);
86  }

Here is the caller graph for this function:

void creaImageIO::WxGimmickReaderDialog::GetSelectedFiles ( std::vector< std::string > &  s)
inline

Definition at line 88 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by creaImageIO::WxAnySimpleDlg::OnReadGimmick().

89  { mView->GetSelectedFiles(s); }

Here is the caller graph for this function:

void creaImageIO::WxGimmickReaderDialog::GetSelectedImages ( std::vector< vtkImageData * > &  s,
int  dim 
)
inline

Definition at line 72 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by creaImageIO::GimmickReaderDialog().

73  { mView->GetSelectedImages(s, dim); }

Here is the caller graph for this function:

void creaImageIO::WxGimmickReaderDialog::GetSelectedImagesInVector ( std::vector< vtkImageData * > &  s,
int  dim 
)
inline

Definition at line 75 of file creaImageIOWxGimmickReaderDialog.h.

76  { mView->GetSelectedImagesInVector(s, dim); }
void creaImageIO::WxGimmickReaderDialog::OnContextualMenu ( EventType event)
void creaImageIO::WxGimmickReaderDialog::OnExit ( )
inline

Definition at line 95 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by creaImageIO::WxSimpleDlg::OnReadGimmick(), and creaImageIO::WxAnySimpleDlg::OnReadGimmick().

95 { mView->StopPlayer(); }

Here is the caller graph for this function:

void creaImageIO::WxGimmickReaderDialog::OnMenuTest ( wxCommandEvent &  event)
void creaImageIO::WxGimmickReaderDialog::OnSelChanged ( EventType event)
void creaImageIO::WxGimmickReaderDialog::OnValid ( bool  valid)

Callback method on a selection.

Definition at line 125 of file creaImageIOWxGimmickReaderDialog.cpp.

References mOkButton.

Referenced by WxGimmickReaderDialog().

126  {
127  mOkButton->Enable(t);
128  }

Here is the caller graph for this function:

void creaImageIO::WxGimmickReaderDialog::stopReading ( )
inline

Definition at line 99 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by creaImageIO::WxSimpleDlg::OnReadGimmick(), and creaImageIO::WxAnySimpleDlg::OnReadGimmick().

100  {
101  mView->stopReader();
102  }

Here is the caller graph for this function:

Member Data Documentation

wxButton* creaImageIO::WxGimmickReaderDialog::mCancelButton
private

Definition at line 110 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by WxGimmickReaderDialog().

boost::shared_ptr<Gimmick> creaImageIO::WxGimmickReaderDialog::mGimmick
private
wxButton* creaImageIO::WxGimmickReaderDialog::mOkButton
private

Definition at line 109 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by OnValid(), and WxGimmickReaderDialog().

wxBoxSizer* creaImageIO::WxGimmickReaderDialog::mtopsizer
private

Definition at line 111 of file creaImageIOWxGimmickReaderDialog.h.

Referenced by WxGimmickReaderDialog().

WxGimmickView* creaImageIO::WxGimmickReaderDialog::mView
private

The documentation for this class was generated from the following files: