]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasIRMView.h
d8de471a0cffbf998c184fc27e068b8cc750dac1
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasIRMView.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: wxMaracasIRMView.h,v $
5   Language:  C++
6   Date:      $Date: 2009/04/01 16:16:59 $
7   Version:   $Revision: 1.1 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
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.
15
16 =========================================================================*/
17
18
19 #ifndef __wxMaracasIRMViewH__
20 #define __wxMaracasIRMViewH__
21
22
23 #include <wx/wx.h>
24 #include "wx/aui/aui.h"
25
26 #include <iostream>
27
28 #include "marTypes.h"
29
30 #include "vtkProp3D.h"
31
32 #include "wxMaracasIRMViewManager.h"
33
34 class  creaMaracasVisu_EXPORT  wxMaracasIRMView : public wxPanel
35 {       
36
37 public:
38     wxMaracasIRMView( wxWindow* parent);
39     ~wxMaracasIRMView( );
40         
41         static wxMaracasIRMView* getInstance(wxWindow* parent);
42
43         static wxMaracasIRMView* getInstance();
44
45         void setRenderer(vtkRenderer*  renderer);
46
47         void changeOpacity(int _propid, int value);
48
49         void changeIsoValue(int _propid, int value);
50
51
52
53         void addProp3D(vtkProp3D* prop3D);
54
55
56         void loadProp3D();
57
58 private:
59         static wxMaracasIRMView* instance;
60
61         wxMaracasIRMViewManager* irmmanager;
62
63         wxAuiManager* wxauimanager;
64
65         void createFileChooser();
66 };
67
68 #endif // __wxMaracasIRMViewH__
69
70 // EOF - wxMaracasIRMView.h
71
72 #ifndef __wxMaracasIRMViewPanelH__
73 #define __wxMaracasIRMViewPanelH__
74
75 class wxMaracasIRMViewPanel : public wxPanel{
76 public:
77         wxMaracasIRMViewPanel(wxWindow* parent)
78                 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
79                         createPanel();
80         }       
81         //virtual ~wxMaracasIRMViewPanel();
82         virtual void createPanel(){
83                 show = false;
84         wxBoxSizer* sizerButtons = new wxBoxSizer(wxVERTICAL);
85
86                 wxButton* b = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
87                                                                 wxDefaultValidator, wxString(_T("-"))); 
88                 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedHide);
89                 wxButton* b1 = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, 
90                                                                 wxDefaultValidator, wxString(_T("x"))); 
91                 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedEliminate);
92
93                 sizerButtons->Add(b, wxFIXED_MINSIZE);
94                 sizerButtons->Add(b1, wxFIXED_MINSIZE);
95
96                 sizercontrols = new wxBoxSizer(wxVERTICAL);
97
98                 wxBoxSizer* sizerpanel = new wxBoxSizer(wxHORIZONTAL);
99
100                 sizerpanel->Add(sizerButtons,wxGROW);
101                 sizerpanel->Add(sizercontrols,wxGROW);
102         
103                 this->SetSizer(sizerpanel, true);               
104                 this->SetAutoLayout( true );
105         }
106
107         /**
108         **      Adds a new control to the panel (sizer, radiob, etc)
109         **/
110         virtual void addControl(wxWindow* win){
111                 if(sizercontrols!=NULL){
112                         sizercontrols->Add(win, wxGROW);
113                 }
114         }
115
116         /**
117         **      Hides or show the controls in the panel
118         **/
119         virtual void onActionButtonPressedHide( wxCommandEvent& event ){
120                 wxList list = sizercontrols->GetChildren();             
121                 int i;
122                 for(i=0; i<list.size();i++){
123                         sizercontrols->Show(i,show);
124                 }
125                 show = !show;
126                 sizercontrols->Layout();
127                 this->Layout();
128         }
129
130     /**
131         **      The user must implement this function to remove the panel from the 
132         **/
133         virtual void onActionButtonPressedEliminate( wxCommandEvent& event )=0;
134
135         /**
136         **      The user must implement this function to add the necessary controls to the panel
137         **/
138         virtual void createControls( )=0;
139
140 private:
141         wxBoxSizer* sizercontrols;
142         bool show;
143
144 };
145
146 #endif 
147
148 #ifndef __wxMaracasIRMViewPanelProp3DH__
149 #define __wxMaracasIRMViewPanelProp3DH__
150
151 class wxMaracasIRMViewProp3D : public wxMaracasIRMViewPanel{
152 public:
153         wxMaracasIRMViewProp3D(wxWindow* parent, int propid);
154         ~wxMaracasIRMViewProp3D();
155         void createControls();
156         void onActionButtonPressedEliminate( wxCommandEvent& event );
157         void onOpacityRelease(wxScrollEvent& event );
158         void onIsoValueRelease(wxScrollEvent& event );
159         void onRadioBoxChange(wxCommandEvent& event);
160
161         
162 private:
163         wxRadioBox* radiob;
164         wxSlider* opacity;
165         wxSlider* isovalue;
166         int _propid;
167         
168 };
169 #endif 
170
171
172 #pragma once
173
174 #ifndef __ToolBar__
175 #define __ToolBar__
176
177 #include <vector>
178
179 #include <wx/wx.h>
180
181
182
183 class ToolBar : public wxToolBar{
184
185 public:
186         
187         ToolBar(wxWindow * parent,std::string iconsdir="C:/Creatis/creaAppli/Development/creaPipeline/Data/Icons/");
188         ~ToolBar(void);
189         
190         
191         void onExecPipeline(wxCommandEvent& event);
192
193         void onLoadConfig(wxCommandEvent& event);
194         
195 private:
196
197         
198
199         
200 DECLARE_EVENT_TABLE()
201 };
202
203 #endif
204