1 /*=========================================================================
4 Module: $RCSfile: CutModelMainPanel.h,v $
6 Date: $Date: 2009/12/08 13:42:48 $
7 Version: $Revision: 1.4 $
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
43 ~CutModelMainPanel( );
45 static CutModelMainPanel* getInstance(wxWindow* parent=NULL, std::string path ="");
47 //static CutModelMainPanel* getInstance();
49 void setImageData(vtkImageData* img);
51 void setInteractor(vtkRenderWindowInteractor* interactor);
53 void setRenderer(vtkRenderer* renderer);
55 void initialize(std::string path);
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 void SetType(int type);
94 CutModelMainPanel( wxWindow* parent, std::string path);
96 static CutModelMainPanel* instance;
98 CutModelManager* cutmanager;
100 void checkInvariant() throw( CutModelException);
102 void showErrorDialog(std::string str);
104 void SaveCutModelData(std::string filename);
106 void LoadCutModelData(std::string filename);
108 std::vector<CutModelView*> viewpanels;
110 wxAuiManager* _wxauimanager;
113 int addNewViewPanel()throw( CutModelException);
115 CutModelView* getModelView(int id)throw( CutModelException);
123 class ToolBarEventHandlerCutModel : public wxEvtHandler{
126 ToolBarEventHandlerCutModel();
127 ~ToolBarEventHandlerCutModel();
129 void onAdd(wxCommandEvent& event);
131 void onUndo(wxCommandEvent& event);
133 void onRedo(wxCommandEvent& event);
135 void onExecuteAll(wxCommandEvent& event);
139 DECLARE_EVENT_TABLE()
142 class ToolBarCutModel : public wxToolBar{
146 ToolBarCutModel(wxWindow * parent);
147 ~ToolBarCutModel(void);
152 ToolBarEventHandlerCutModel* _evthand;