1 /*=========================================================================
4 Module: $RCSfile: CutModelMainPanel.h,v $
6 Date: $Date: 2009/09/01 14:01:35 $
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 __CutModelMainPanelPanelH__
19 #define __CutModelMainPanelPanelH__
23 #include <wx/treebook.h>
24 #include "wx/aui/aui.h"
25 #include <wx/toolbar.h>
30 #include "CutModelManager.h"
31 #include "CutModelException.h"
32 #include "CutModelView.h"
34 #include "vtkImageData.h"
35 #include "vtkRenderWindowInteractor.h"
38 class creaMaracasVisu_EXPORT CutModelMainPanel : public wxPanel
42 CutModelMainPanel( wxWindow* parent);
43 ~CutModelMainPanel( );
45 static CutModelMainPanel* getInstance(wxWindow* parent);
47 static CutModelMainPanel* getInstance();
49 void setImageData(vtkImageData* img);
51 void setInteractor(vtkRenderWindowInteractor* interactor);
53 void setRenderer(vtkRenderer* renderer);
63 void changeOpacity(int id,int opacity);
65 void ShowViewBox(int id,bool check);
67 void ChangeShape(int id,int selection);
69 void changeColor(int id,double r,double g,double b);
71 void updateActorDirection(int id);
73 void RemoveActor(int id);
75 void ExecuteCut(int id, double* range, bool isinside);
79 vtkImageData* GetResultImage();
81 void ShowCurrentPanel(int id);
83 void ShowPopUpMenu(int id);
85 void ShowStatistics(int id);
87 static CutModelMainPanel* instance;
89 CutModelManager* cutmanager;
91 void checkInvariant() throw( CutModelException);
93 void showErrorDialog(std::string str);
95 std::vector<CutModelView*> viewpanels;
97 wxAuiManager* _wxauimanager;
100 int addNewViewPanel()throw( CutModelException);
102 CutModelView* getModelView(int id)throw( CutModelException);
108 class ToolBarEventHandlerCutModel : public wxEvtHandler{
111 ToolBarEventHandlerCutModel();
112 ~ToolBarEventHandlerCutModel();
114 void onAdd(wxCommandEvent& event);
116 void onUndo(wxCommandEvent& event);
118 void onRedo(wxCommandEvent& event);
120 void onExecuteAll(wxCommandEvent& event);
124 DECLARE_EVENT_TABLE()
127 class ToolBarCutModel : public wxToolBar{
131 ToolBarCutModel(wxWindow * parent);
132 ~ToolBarCutModel(void);
137 ToolBarEventHandlerCutModel* _evthand;