]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / CutModule / interface / CutModelMainPanel.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: CutModelMainPanel.h,v $
5   Language:  C++
6   Date:      $Date: 2009/08/31 08:46:09 $
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 #ifndef __CutModelMainPanelPanelH__
19 #define __CutModelMainPanelPanelH__
20
21 #include <vector>
22 #include <wx/wx.h>
23 #include <wx/treebook.h>
24 #include "wx/aui/aui.h"
25 #include <wx/toolbar.h>
26 #include <iostream>
27 #include "marTypes.h"
28
29
30 #include "CutModelManager.h"
31 #include "CutModelException.h"
32 #include "CutModelView.h"
33
34 #include "vtkImageData.h"
35 #include "vtkRenderWindowInteractor.h"
36
37
38 class  creaMaracasVisu_EXPORT  CutModelMainPanel : public wxPanel
39 {
40
41 public:
42         CutModelMainPanel( wxWindow* parent);
43     ~CutModelMainPanel( );
44
45         static CutModelMainPanel* getInstance(wxWindow* parent);
46
47         static CutModelMainPanel* getInstance();
48
49         void setImageData(vtkImageData* img);
50
51         void setInteractor(vtkRenderWindowInteractor* interactor);
52
53         void setRenderer(vtkRenderer* renderer);
54
55         void initialize();
56
57         void onAddCutModel();
58
59         void onUndo();
60
61         void onRedo();
62
63         void changeOpacity(int id,int opacity);
64
65         void ShowViewBox(int id,bool check);
66
67         void ChangeShape(int id,int selection);
68         
69         void changeColor(int id,double r,double g,double b);
70
71         void updateActorDirection(int id);
72
73         void RemoveActor(int id);
74
75         void ExecuteCut(int id, double* range, bool isinside);
76
77         void ExecuteAll();
78
79         vtkImageData* GetResultImage();
80
81         void ShowCurrentPanel(int id);
82
83         void ShowPopUpMenu(int id);
84 private:
85         static CutModelMainPanel* instance;
86
87         CutModelManager* cutmanager;    
88
89         void checkInvariant() throw( CutModelException);
90
91         void showErrorDialog(std::string str);
92
93         std::vector<CutModelView*> viewpanels;
94
95         wxAuiManager* _wxauimanager;
96
97
98          int addNewViewPanel()throw( CutModelException);
99
100          CutModelView* getModelView(int id)throw( CutModelException);
101
102          int _panelid;
103 };
104
105
106 class ToolBarEventHandlerCutModel : public wxEvtHandler{
107
108         public:
109                 ToolBarEventHandlerCutModel();
110                 ~ToolBarEventHandlerCutModel();
111
112                 void onAdd(wxCommandEvent& event);
113
114                 void onUndo(wxCommandEvent& event);
115
116                 void onRedo(wxCommandEvent& event);
117
118                 void onExecuteAll(wxCommandEvent& event);
119
120         private:
121
122                 DECLARE_EVENT_TABLE()
123         };
124
125 class ToolBarCutModel : public wxToolBar{
126
127         
128 public:
129         ToolBarCutModel(wxWindow * parent);
130         ~ToolBarCutModel(void);
131
132
133 private:
134
135         ToolBarEventHandlerCutModel* _evthand;
136
137 };
138
139 #endif
140