Program: wxMaracas
Module: $RCSfile: wxMaracasIRMView.h,v $
Language: C++
- Date: $Date: 2009/04/01 16:16:59 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/06/16 13:25:58 $
+ Version: $Revision: 1.6 $
Copyright: (c) 2002, 2003
License:
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
+#ifndef __wxMaracasIRMViewPanelH__
+#define __wxMaracasIRMViewPanelH__
-#ifndef __wxMaracasIRMViewH__
-#define __wxMaracasIRMViewH__
-
-
+#include <vector>
#include <wx/wx.h>
#include "wx/aui/aui.h"
-
#include <iostream>
-
#include "marTypes.h"
-
#include "vtkProp3D.h"
#include "wxMaracasIRMViewManager.h"
+#include "wxMaracasIRMViewPanel.h"
+
+
class creaMaracasVisu_EXPORT wxMaracasIRMView : public wxPanel
-{
+{
public:
- wxMaracasIRMView( wxWindow* parent);
+ wxMaracasIRMView( wxWindow* parent, std::string path);
~wxMaracasIRMView( );
-
- static wxMaracasIRMView* getInstance(wxWindow* parent);
+
+ static wxMaracasIRMView* getInstance(wxWindow* parent,std::string path="");
static wxMaracasIRMView* getInstance();
void setRenderer(vtkRenderer* renderer);
- void changeOpacity(int _propid, int value);
+ void changeOpacity(int propid, int value);
+
+ void changeIsoValue(int propid, double value);
+
+ void addRemoveActor(int propid, bool addremove);
- void changeIsoValue(int _propid, int value);
+ void changeColor(int propid, double red, double green, double blue);
+ void addProp3D(vtkProp3D* prop3D, std::string dataname="");
+ void addPropMHD(vtkImageData* imgdata, std::string dataname="");
- void addProp3D(vtkProp3D* prop3D);
+ void loadProp3D(wxString filename, wxString dataname);
+ void loadPropMHD(wxString filename, wxString dataname);
- void loadProp3D();
+ void onLoadImageFile();
+ void addIRMViewPanel(wxMaracasIRMViewPanel* irmview, std::string dataname="");
+
+ std::string getPath();
+
+ void deleteActor(int propid);
private:
static wxMaracasIRMView* instance;
wxAuiManager* wxauimanager;
void createFileChooser();
-};
-#endif // __wxMaracasIRMViewH__
+ std::string _path;
-// EOF - wxMaracasIRMView.h
-
-#ifndef __wxMaracasIRMViewPanelH__
-#define __wxMaracasIRMViewPanelH__
-
-class wxMaracasIRMViewPanel : public wxPanel{
-public:
- wxMaracasIRMViewPanel(wxWindow* parent)
- : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize){
- createPanel();
- }
- //virtual ~wxMaracasIRMViewPanel();
- virtual void createPanel(){
- show = false;
- wxBoxSizer* sizerButtons = new wxBoxSizer(wxVERTICAL);
-
- wxButton* b = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
- wxDefaultValidator, wxString(_T("-")));
- Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedHide);
- wxButton* b1 = new wxButton(this, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
- wxDefaultValidator, wxString(_T("x")));
- Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasIRMViewPanel::onActionButtonPressedEliminate);
-
- sizerButtons->Add(b, wxFIXED_MINSIZE);
- sizerButtons->Add(b1, wxFIXED_MINSIZE);
-
- sizercontrols = new wxBoxSizer(wxVERTICAL);
-
- wxBoxSizer* sizerpanel = new wxBoxSizer(wxHORIZONTAL);
-
- sizerpanel->Add(sizerButtons,wxGROW);
- sizerpanel->Add(sizercontrols,wxGROW);
-
- this->SetSizer(sizerpanel, true);
- this->SetAutoLayout( true );
- }
-
- /**
- ** Adds a new control to the panel (sizer, radiob, etc)
- **/
- virtual void addControl(wxWindow* win){
- if(sizercontrols!=NULL){
- sizercontrols->Add(win, wxGROW);
- }
- }
-
- /**
- ** Hides or show the controls in the panel
- **/
- virtual void onActionButtonPressedHide( wxCommandEvent& event ){
- wxList list = sizercontrols->GetChildren();
- int i;
- for(i=0; i<list.size();i++){
- sizercontrols->Show(i,show);
- }
- show = !show;
- sizercontrols->Layout();
- this->Layout();
- }
-
- /**
- ** The user must implement this function to remove the panel from the
- **/
- virtual void onActionButtonPressedEliminate( wxCommandEvent& event )=0;
-
- /**
- ** The user must implement this function to add the necessary controls to the panel
- **/
- virtual void createControls( )=0;
-
-private:
- wxBoxSizer* sizercontrols;
- bool show;
+ wxToolBar* _toolb;
};
-#endif
-
-#ifndef __wxMaracasIRMViewPanelProp3DH__
-#define __wxMaracasIRMViewPanelProp3DH__
-
-class wxMaracasIRMViewProp3D : public wxMaracasIRMViewPanel{
-public:
- wxMaracasIRMViewProp3D(wxWindow* parent, int propid);
- ~wxMaracasIRMViewProp3D();
- void createControls();
- void onActionButtonPressedEliminate( wxCommandEvent& event );
- void onOpacityRelease(wxScrollEvent& event );
- void onIsoValueRelease(wxScrollEvent& event );
- void onRadioBoxChange(wxCommandEvent& event);
-
-
-private:
- wxRadioBox* radiob;
- wxSlider* opacity;
- wxSlider* isovalue;
- int _propid;
-
-};
-#endif
+class ToolBarEventHandler : public wxEvtHandler{
+ public:
+ ToolBarEventHandler();
+ ~ToolBarEventHandler();
-#pragma once
-
-#ifndef __ToolBar__
-#define __ToolBar__
-
-#include <vector>
-
-#include <wx/wx.h>
+ void onLoadImageFile(wxCommandEvent& event);
+ private:
+ DECLARE_EVENT_TABLE()
+ };
class ToolBar : public wxToolBar{
-public:
- ToolBar(wxWindow * parent,std::string iconsdir="C:/Creatis/creaAppli/Development/creaPipeline/Data/Icons/");
+public:
+ ToolBar(wxWindow * parent,std::string iconsdir);
~ToolBar(void);
-
-
- void onExecPipeline(wxCommandEvent& event);
- void onLoadConfig(wxCommandEvent& event);
-
+
private:
-
+ ToolBarEventHandler* _evthand;
-
-DECLARE_EVENT_TABLE()
};
#endif