1 /*=========================================================================
4 Module: $RCSfile: wxMaracasIRMView.h,v $
6 Date: $Date: 2009/04/09 13:58:38 $
7 Version: $Revision: 1.2 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
18 #ifndef __wxMaracasIRMViewPanelH__
19 #define __wxMaracasIRMViewPanelH__
23 #include "wx/aui/aui.h"
26 #include "vtkProp3D.h"
28 #include "wxMaracasIRMViewManager.h"
30 class wxMaracasIRMViewPanel : public wxPanel{
32 wxMaracasIRMViewPanel(wxWindow* parent, int propid)
33 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
37 //virtual ~wxMaracasIRMViewPanel();
38 virtual void createPanel(){
40 /*wxBoxSizer* sizerButtons = new wxBoxSizer(wxVERTICAL);
42 wxButton* b = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
43 wxDefaultValidator, wxString(_T("-")));
44 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedHide);
45 wxButton* b1 = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
46 wxDefaultValidator, wxString(_T("x")));
47 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedEliminate);
49 sizerButtons->Add(b, wxFIXED_MINSIZE);
50 sizerButtons->Add(b1, wxFIXED_MINSIZE);*/
52 sizercontrols = new wxBoxSizer(wxVERTICAL);
54 wxBoxSizer* sizerpanel = new wxBoxSizer(wxHORIZONTAL);
56 //sizerpanel->Add(sizerButtons,wxGROW);
57 sizerpanel->Add(sizercontrols,wxGROW);
59 this->SetSizer(sizerpanel, true);
60 this->SetAutoLayout( true );
64 ** Adds a new control to the panel (sizer, radiob, etc)
66 virtual void addControl(wxWindow* win){
67 if(sizercontrols!=NULL){
68 sizercontrols->Add(win, wxGROW);
72 ** Adds a new control to the panel (sizer, radiob, etc)
74 virtual void addControl(wxSizer* sizer){
75 if(sizercontrols!=NULL){
76 sizercontrols->Add(sizer, wxGROW);
81 ** Hides or show the controls in the panel
83 virtual void onActionButtonPressedHide( wxCommandEvent& event ){
84 wxList list = sizercontrols->GetChildren();
86 for(i=0; i<list.size();i++){
87 sizercontrols->Show(i,show);
90 sizercontrols->Layout();
95 ** The user must implement this function to remove the panel from the
97 //virtual void onActionButtonPressedEliminate( wxCommandEvent& event )=0;
100 ** The user must implement this function to add the necessary controls to the panel
102 virtual void createControls( )=0;
104 ** returns the id of the panel
111 wxBoxSizer* sizercontrols;
121 class creaMaracasVisu_EXPORT wxMaracasIRMView : public wxPanel
125 wxMaracasIRMView( wxWindow* parent, std::string path);
126 ~wxMaracasIRMView( );
128 static wxMaracasIRMView* getInstance(wxWindow* parent,std::string path="");
130 static wxMaracasIRMView* getInstance();
132 void setRenderer(vtkRenderer* renderer);
134 void changeOpacity(int propid, int value);
136 void changeIsoValue(int propid, int value);
138 void addRemoveActor(int propid, bool addremove);
140 void changeColor(int propid, double red, double green, double blue);
142 void addProp3D(vtkProp3D* prop3D, std::string dataname="");
144 void addPropMHD(vtkImageData* imgdata, std::string dataname="");
146 void loadProp3D(wxString filename, wxString dataname);
148 void loadPropMHD(wxString filename, wxString dataname);
150 void onLoadImageFile();
152 void addIRMViewPanel(wxMaracasIRMViewPanel* irmview, std::string dataname="");
154 std::string getPath();
157 static wxMaracasIRMView* instance;
159 wxMaracasIRMViewManager* irmmanager;
161 wxAuiManager* wxauimanager;
163 void createFileChooser();
170 class wxMaracasIRMViewProp3D : public wxMaracasIRMViewPanel{
172 wxMaracasIRMViewProp3D(wxWindow* parent, int propid);
173 ~wxMaracasIRMViewProp3D();
174 virtual void createControls();
175 void onOpacityRelease(wxScrollEvent& event );
176 void onCheckBoxChange(wxCommandEvent& event);
177 void onColorChange(wxCommandEvent& event);
181 wxCheckBox* checkbox;
183 wxBitmapButton* _colorchoose;
191 class wxMaracasIRMViewProp3DMHD : public wxMaracasIRMViewProp3D{
193 wxMaracasIRMViewProp3DMHD(wxWindow* parent, int propid);
194 ~wxMaracasIRMViewProp3DMHD();
195 void onIsoValueRelease(wxScrollEvent& event );
196 void createControls(int maxisovalue);
208 class ToolBar : public wxToolBar{
212 ToolBar(wxWindow * parent,std::string iconsdir);
216 void onLoadImageFile(wxCommandEvent& event);
223 DECLARE_EVENT_TABLE()