]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingProp3DMHD.cxx
no newline at end of file
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSurfaceRenderingProp3DMHD.cxx
1 #include "wxMaracasSurfaceRenderingProp3DMHD.h"
2
3 #include "wxMaracasSurfaceRendering.h"
4 #include <OpenImage.xpm>
5 /**
6 **      SurfaceRenderingProp3DMHD implementation
7 **/
8 wxMaracasSurfaceRenderingProp3DMHD::wxMaracasSurfaceRenderingProp3DMHD(wxWindow* parent, int propid)
9 : wxMaracasSurfaceRenderingProp3D(parent, propid)
10 {
11         
12 }
13 wxMaracasSurfaceRenderingProp3DMHD::~wxMaracasSurfaceRenderingProp3DMHD(){
14         //this->Show(false);
15         //wxMaracasSurfaceRendering::getInstance()->addRemoveActor(_propid, false);
16 }
17 void wxMaracasSurfaceRenderingProp3DMHD::createControls(int maxisovalue){
18         
19         wxFlexGridSizer* sizer = new wxFlexGridSizer(1,1,1);
20
21         wxStaticText* label = new wxStaticText(this, -1, wxString(_T("IsoValue")));
22         sizer->Add(label, wxFIXED_MINSIZE);
23         //this->addControl(label);
24         isovalue = new wxSlider(this, -1,maxisovalue,0,maxisovalue,wxDefaultPosition,wxDefaultSize,wxSL_HORIZONTAL|wxSL_LABELS);
25         sizer->Add(isovalue, wxFIXED_MINSIZE);
26         //this->addControl(isovalue);
27
28         wxBitmap bitmap(OpenImage_xpm);
29         _viewimage = new wxBitmapButton(this, -1, bitmap, wxDefaultPosition, wxSize(30,30));    
30         Connect(_viewimage->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3DMHD::onViewImage);                    
31         sizer->Add(_viewimage,wxFIXED_MINSIZE);
32
33         this->addControl(sizer);        
34         Connect(isovalue->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease);        
35
36         
37
38 }
39
40 void wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease(wxScrollEvent& event ){
41
42         wxMaracasSurfaceRendering::getInstance()->changeIsoValue(this->getPropId(), isovalue->GetValue()/1.0);
43         
44 }
45
46 void wxMaracasSurfaceRenderingProp3DMHD::onViewImage(wxCommandEvent& event){    
47
48         //if(mwxwidget->ShowModal()==wxID_OK){
49     
50         //      mwxwidget->Show(false);
51         //}     
52 }
53