1 /*=========================================================================
4 Module: $RCSfile: wxMaracasIRMView.h,v $
6 Date: $Date: 2009/05/04 07:35:42 $
7 Version: $Revision: 1.3 $
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, double 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();
156 void deleteActor(int propid);
158 static wxMaracasIRMView* instance;
160 wxMaracasIRMViewManager* irmmanager;
162 wxAuiManager* wxauimanager;
164 void createFileChooser();
172 class wxMaracasIRMViewProp3D : public wxMaracasIRMViewPanel{
174 wxMaracasIRMViewProp3D(wxWindow* parent, int propid);
175 ~wxMaracasIRMViewProp3D();
176 virtual void createControls();
177 void onOpacityRelease(wxScrollEvent& event );
178 void onCheckBoxChange(wxCommandEvent& event);
179 void onColorChange(wxCommandEvent& event);
183 wxCheckBox* checkbox;
185 wxBitmapButton* _colorchoose;
193 class wxMaracasIRMViewProp3DMHD : public wxMaracasIRMViewProp3D{
195 wxMaracasIRMViewProp3DMHD(wxWindow* parent, int propid);
196 ~wxMaracasIRMViewProp3DMHD();
197 void onIsoValueRelease(wxScrollEvent& event );
198 void createControls(int maxisovalue);
210 class ToolBar : public wxToolBar{
214 ToolBar(wxWindow * parent,std::string iconsdir);
218 void onLoadImageFile(wxCommandEvent& event);
225 DECLARE_EVENT_TABLE()