1 /*=========================================================================
4 Module: $RCSfile: CutModel2MainPanel.h,v $
6 Date: $Date: 2009/11/19 15:00:32 $
7 Version: $Revision: 1.1 $
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 __CutModel2MainPanelPanelH__
19 #define __CutModel2MainPanelPanelH__
23 #include <wx/treebook.h>
24 #include "wx/aui/aui.h"
25 #include <wx/toolbar.h>
30 #include "CutModel2Manager.h"
31 #include "CutModel2Exception.h"
32 #include "CutModel2View.h"
34 #include "vtkImageData.h"
35 #include "vtkRenderWindowInteractor.h"
38 class creaMaracasVisu_EXPORT CutModel2MainPanel : public wxPanel
43 ~CutModel2MainPanel( );
45 static CutModel2MainPanel* getInstance(wxWindow* parent=NULL, std::string path ="");
47 //static CutModel2MainPanel* getInstance();
49 void setImageData(vtkImageData* img);
51 void setInteractor(vtkRenderWindowInteractor* interactor);
53 void setRenderer(vtkRenderer* renderer);
55 void initialize(std::string path);
57 void onAddCutModel2();
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);
90 CutModel2MainPanel( wxWindow* parent, std::string path);
92 static CutModel2MainPanel* instance;
94 CutModel2Manager* cutmanager;
96 void checkInvariant() throw( CutModel2Exception);
98 void showErrorDialog(std::string str);
100 void SaveCutModel2Data(std::string filename);
102 void LoadCutModel2Data(std::string filename);
104 std::vector<CutModel2View*> viewpanels;
106 wxAuiManager* _wxauimanager;
109 int addNewViewPanel()throw( CutModel2Exception);
111 CutModel2View* getModelView(int id)throw( CutModel2Exception);
117 class ToolBarEventHandlerCutModel2 : public wxEvtHandler{
120 ToolBarEventHandlerCutModel2();
121 ~ToolBarEventHandlerCutModel2();
123 void onAdd(wxCommandEvent& event);
125 void onUndo(wxCommandEvent& event);
127 void onRedo(wxCommandEvent& event);
129 void onExecuteAll(wxCommandEvent& event);
133 DECLARE_EVENT_TABLE()
136 class ToolBarCutModel2 : public wxToolBar{
140 ToolBarCutModel2(wxWindow * parent);
141 ~ToolBarCutModel2(void);
146 ToolBarEventHandlerCutModel2* _evthand;