#include <creaImageIOWxGimmickPanel.h>
Public Types | |
typedef boost::signal< void(bool)> | SendImageSignalType |
typedef SendImageSignalType::slot_function_type | SendImageCallbackType |
Public Member Functions | |
WxGimmickPanel () | |
WxGimmickPanel (wxWindow *parent, const wxWindowID id, const wxPoint &pos, const wxSize &size, const std::string i_namedescp, const std::string i_namedb="Local Database", int threads=0) | |
~WxGimmickPanel () | |
Destructor. | |
void | ConnectSendImageObserver (SendImageCallbackType callback) |
void | GetSelectedImages (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 | OnSelectedImage (bool t) |
Callback method on a selection. | |
void | AddImagesToDB (std::string dir) |
Private Attributes | |
boost::shared_ptr< Gimmick > | mGimmick |
WxGimmickView * | mView |
SendImageSignalType | mSendImageSignal |
The sendImage signal. |
Definition at line 20 of file creaImageIOWxGimmickPanel.h.
typedef SendImageSignalType::slot_function_type creaImageIO::WxGimmickPanel::SendImageCallbackType |
Definition at line 36 of file creaImageIOWxGimmickPanel.h.
typedef boost::signal<void (bool)> creaImageIO::WxGimmickPanel::SendImageSignalType |
Definition at line 35 of file creaImageIOWxGimmickPanel.h.
creaImageIO::WxGimmickPanel::WxGimmickPanel | ( | ) |
creaImageIO::WxGimmickPanel::WxGimmickPanel | ( | wxWindow * | parent, | |
const wxWindowID | id, | |||
const wxPoint & | pos, | |||
const wxSize & | size, | |||
const std::string | i_namedescp, | |||
const std::string | i_namedb = "Local Database" , |
|||
int | threads = 0 | |||
) |
Definition at line 10 of file creaImageIOWxGimmickPanel.cpp.
References creaImageIO::GimmickView::ConnectValidationObserver(), GimmickDebugMessage, creaImageIO::GimmickView::Initialize(), mGimmick, mView, and OnSelectedImage().
: wxPanel( parent, id, pos, size, wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxCAPTION ), //mGimmick(0), mView(0) { GimmickDebugMessage(1,"WxGimmickPanel::WxGimmickPanel" <<std::endl); wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); try { mGimmick = boost::shared_ptr<Gimmick>(new Gimmick()); mGimmick->Initialize(i_namedescp,i_namedb); int min_dim = GIMMICK_2D_IMAGE_SELECTION; int max_dim = GIMMICK_3D_IMAGE_SELECTION; mView = new WxGimmickView(mGimmick, this, -1, wxDefaultPosition, size, min_dim, max_dim, threads); mView->Initialize(); // Connect the AddProgress callback mView->ConnectValidationObserver ( boost::bind( &WxGimmickPanel::OnSelectedImage , this, _1 ) ); } catch (crea::Exception e) { e.Print(); return; } topsizer->Add( mView,1,wxGROW,0); SetSizer( topsizer ); Layout(); }
creaImageIO::WxGimmickPanel::~WxGimmickPanel | ( | ) |
Destructor.
Definition at line 65 of file creaImageIOWxGimmickPanel.cpp.
References GimmickDebugMessage, mGimmick, and mView.
{ GimmickDebugMessage(1,"WxGimmickPanel::~WxGimmickPanel" <<std::endl); if (mView) { delete mView; } if (mGimmick) { mGimmick->Finalize(); } }
void creaImageIO::WxGimmickPanel::AddImagesToDB | ( | std::string | dir | ) |
Definition at line 89 of file creaImageIOWxGimmickPanel.cpp.
References creaImageIO::WxGimmickView::AddDir(), and mView.
{ mView->AddDir(dir); }
void creaImageIO::WxGimmickPanel::ConnectSendImageObserver | ( | SendImageCallbackType | callback | ) |
Adds the function f to the list of functions to call when the addition progresses. f is of type ProgressCallbackType which is: void (*ProgressCallbackType)(Progress&) To pass a member function 'f' of an instance 'c' of a class 'C' as callback you have to 'bind' it, i.e. call: ConnectSendImageObserver ( boost::bind( &C::f , c, _1 ) );
Definition at line 103 of file creaImageIOWxGimmickPanel.cpp.
References mSendImageSignal.
{ mSendImageSignal.connect(callback); }
void creaImageIO::WxGimmickPanel::getSelected | ( | std::vector< OutStrGimmick > & | outG, | |
std::vector< std::string > | i_attr, | |||
bool | mult, | |||
const std::string | outmodel | |||
) | [inline] |
Definition at line 71 of file creaImageIOWxGimmickPanel.h.
{ mView->getSelectedFiles(outG, i_attr, mult, outmodel); }
void creaImageIO::WxGimmickPanel::GetSelectedImages | ( | std::vector< vtkImageData * > & | s, | |
int | dim | |||
) | [inline] |
Definition at line 54 of file creaImageIOWxGimmickPanel.h.
{ mView->GetSelectedImages(s, dim); }
void creaImageIO::WxGimmickPanel::OnSelectedImage | ( | bool | t | ) |
Callback method on a selection.
Definition at line 84 of file creaImageIOWxGimmickPanel.cpp.
References mSendImageSignal.
Referenced by WxGimmickPanel().
{ mSendImageSignal(t); }
boost::shared_ptr<Gimmick> creaImageIO::WxGimmickPanel::mGimmick [private] |
Definition at line 83 of file creaImageIOWxGimmickPanel.h.
Referenced by WxGimmickPanel(), and ~WxGimmickPanel().
The sendImage signal.
Definition at line 87 of file creaImageIOWxGimmickPanel.h.
Referenced by ConnectSendImageObserver(), and OnSelectedImage().
WxGimmickView* creaImageIO::WxGimmickPanel::mView [private] |
Definition at line 84 of file creaImageIOWxGimmickPanel.h.
Referenced by AddImagesToDB(), WxGimmickPanel(), and ~WxGimmickPanel().