creaImageIO_lib
creaImageIO::WxGimmickPanel Class Reference

#include <creaImageIOWxGimmickPanel.h>

Inheritance diagram for creaImageIO::WxGimmickPanel:
Collaboration diagram for creaImageIO::WxGimmickPanel:

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. More...
 
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. More...
 
void AddImagesToDB (std::string dir)
 

Private Attributes

boost::shared_ptr< GimmickmGimmick
 
WxGimmickViewmView
 
SendImageSignalType mSendImageSignal
 The sendImage signal. More...
 

Detailed Description

Definition at line 48 of file creaImageIOWxGimmickPanel.h.

Member Typedef Documentation

typedef SendImageSignalType::slot_function_type creaImageIO::WxGimmickPanel::SendImageCallbackType

Definition at line 64 of file creaImageIOWxGimmickPanel.h.

typedef boost::signal<void (bool)> creaImageIO::WxGimmickPanel::SendImageSignalType

Definition at line 63 of file creaImageIOWxGimmickPanel.h.

Constructor & Destructor Documentation

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 38 of file creaImageIOWxGimmickPanel.cpp.

References creaImageIO::GimmickView::ConnectValidationObserver(), GIMMICK_2D_IMAGE_SELECTION, GIMMICK_3D_IMAGE_SELECTION, GimmickDebugMessage, creaImageIO::GimmickView::Initialize(), mGimmick, mView, and OnSelectedImage().

45  : wxPanel( parent,
46  id,
47  pos,
48  size,
49  wxRESIZE_BORDER |
50  wxSYSTEM_MENU |
51  wxCLOSE_BOX |
52  wxMAXIMIZE_BOX |
53  wxMINIMIZE_BOX |
54  wxCAPTION
55  ),
56  //mGimmick(0),
57  mView(0)
58  {
59  GimmickDebugMessage(1,"WxGimmickPanel::WxGimmickPanel"
60  <<std::endl);
61  wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
62 
63  try {
64  mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
65  mGimmick->Initialize(i_namedescp,i_namedb);
66  int min_dim = GIMMICK_2D_IMAGE_SELECTION;
67  int max_dim = GIMMICK_3D_IMAGE_SELECTION;
68  mView = new WxGimmickView(mGimmick,
69  this,
70  -1,
71  wxDefaultPosition,
72  size,
73  min_dim,
74  max_dim,
75  threads);
76  mView->Initialize();
77  // Connect the AddProgress callback
78  mView->ConnectValidationObserver ( boost::bind( &WxGimmickPanel::OnSelectedImage , this, _1 ) );
79  }
80  catch (crea::Exception e)
81  {
82  e.Print();
83  return;
84  }
85 
86  topsizer->Add( mView,1,wxGROW,0);
87 
88  SetSizer( topsizer );
89  Layout();
90  }

Here is the call graph for this function:

creaImageIO::WxGimmickPanel::~WxGimmickPanel ( )

Destructor.

Definition at line 93 of file creaImageIOWxGimmickPanel.cpp.

References GimmickDebugMessage, mGimmick, and mView.

94  {
95  GimmickDebugMessage(1,"WxGimmickPanel::~WxGimmickPanel"
96  <<std::endl);
97  if (mView)
98  {
99  delete mView;
100  }
101  if (mGimmick)
102  {
103  mGimmick->Finalize();
104  }
105  }

Member Function Documentation

void creaImageIO::WxGimmickPanel::AddImagesToDB ( std::string  dir)

Definition at line 117 of file creaImageIOWxGimmickPanel.cpp.

References creaImageIO::WxGimmickView::AddDir(), and mView.

118  {
119  mView->AddDir(dir);
120  }

Here is the call graph for this function:

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 131 of file creaImageIOWxGimmickPanel.cpp.

References mSendImageSignal.

132  {
133  mSendImageSignal.connect(callback);
134  }
void creaImageIO::WxGimmickPanel::getSelected ( std::vector< OutStrGimmick > &  outG,
std::vector< std::string >  i_attr,
bool  mult,
const std::string  outmodel 
)
inline

Definition at line 99 of file creaImageIOWxGimmickPanel.h.

100  {
101  mView->getSelectedFiles(outG, i_attr, mult, outmodel);
102  }
void creaImageIO::WxGimmickPanel::GetSelectedImages ( std::vector< vtkImageData * > &  s,
int  dim 
)
inline

Definition at line 82 of file creaImageIOWxGimmickPanel.h.

83  {
84  mView->GetSelectedImages(s, dim);
85  }
void creaImageIO::WxGimmickPanel::OnSelectedImage ( bool  t)

Callback method on a selection.

Definition at line 112 of file creaImageIOWxGimmickPanel.cpp.

References mSendImageSignal.

Referenced by WxGimmickPanel().

113  {
114  mSendImageSignal(t);
115  }

Here is the caller graph for this function:

Member Data Documentation

boost::shared_ptr<Gimmick> creaImageIO::WxGimmickPanel::mGimmick
private

Definition at line 111 of file creaImageIOWxGimmickPanel.h.

Referenced by WxGimmickPanel(), and ~WxGimmickPanel().

SendImageSignalType creaImageIO::WxGimmickPanel::mSendImageSignal
private

The sendImage signal.

Definition at line 115 of file creaImageIOWxGimmickPanel.h.

Referenced by ConnectSendImageObserver(), and OnSelectedImage().

WxGimmickView* creaImageIO::WxGimmickPanel::mView
private

Definition at line 112 of file creaImageIOWxGimmickPanel.h.

Referenced by AddImagesToDB(), WxGimmickPanel(), and ~WxGimmickPanel().


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