]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingProp3DMHD.cxx
some memory leaks
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSurfaceRenderingProp3DMHD.cxx
index 7357c6b4544c769c5bb4b3894321a72c00b75354..a364a49e56992d553bf3280c1c08ab44c5d82adb 100644 (file)
@@ -1,45 +1,58 @@
 #include "wxMaracasSurfaceRenderingProp3DMHD.h"
 
 #include "wxMaracasSurfaceRendering.h"
+#include "wxMaracasRendererView.h"
 #include <OpenImage.xpm>
 /**
 **     SurfaceRenderingProp3DMHD implementation
 **/
-wxMaracasSurfaceRenderingProp3DMHD::wxMaracasSurfaceRenderingProp3DMHD(wxWindow* parent, int propid)
-: wxMaracasSurfaceRenderingProp3D(parent, propid)
-{
+wxMaracasSurfaceRenderingProp3DMHD::wxMaracasSurfaceRenderingProp3DMHD(wxWindow* parent, int propid, bool _isComplexBox, int _panID)
+: wxMaracasSurfaceRenderingProp3D(parent, propid, _isComplexBox, _panID){
        
 }
 wxMaracasSurfaceRenderingProp3DMHD::~wxMaracasSurfaceRenderingProp3DMHD(){
        //this->Show(false);
-       //wxMaracasSurfaceRendering::getInstance()->addRemoveActor(_propid, false);
+       if(this->isComplex())
+       {
+               //if(this->getPanId() == 1)
+               //      ((wxMaracasRenderTabbedPanel*)(wxMaracasRendererView::getInstance())->getTabbedPanel())->addRemoveActorSA(_propid, false);
+               //if(this->getPanId() == 2)
+               //      ((wxMaracasRenderTabbedPanel*)(wxMaracasRendererView::getInstance())->getTabbedPanel())->addRemoveActorSB(_propid, false);
+               //if(this->getPanId() == 3)
+               //      ((wxMaracasRenderTabbedPanel*)(wxMaracasRendererView::getInstance())->getTabbedPanel())->addRemoveActorSC(_propid, false);
+       }
+       //else
+               //wxMaracasSurfaceRendering::getInstance()->addRemoveActor(_propid, false);
 }
 void wxMaracasSurfaceRenderingProp3DMHD::createControls(int maxisovalue){
        
        wxFlexGridSizer* sizer = new wxFlexGridSizer(1,1,1);
 
        wxStaticText* label = new wxStaticText(this, -1, wxString(_T("IsoValue")));
-       sizer->Add(label, wxFIXED_MINSIZE);
+       sizer->Add(label, 1, wxGROW);
        //this->addControl(label);
        isovalue = new wxSlider(this, -1,maxisovalue,0,maxisovalue,wxDefaultPosition,wxDefaultSize,wxSL_HORIZONTAL|wxSL_LABELS);
-       sizer->Add(isovalue, wxFIXED_MINSIZE);
+       sizer->Add(isovalue, 1, wxGROW);
        //this->addControl(isovalue);
 
-       wxBitmap bitmap(OpenImage_xpm);
-       _viewimage = new wxBitmapButton(this, -1, bitmap, wxDefaultPosition, wxSize(30,30));    
-       Connect(_viewimage->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3DMHD::onViewImage);                    
-       sizer->Add(_viewimage,wxFIXED_MINSIZE);
-
        this->addControl(sizer);        
        Connect(isovalue->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction)&wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease);        
 
-       
-
 }
 
-void wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease(wxScrollEvent& event ){
-
-       wxMaracasSurfaceRendering::getInstance()->changeIsoValue(this->getPropId(), isovalue->GetValue()/1.0);
+void wxMaracasSurfaceRenderingProp3DMHD::onIsoValueRelease(wxScrollEvent& event )
+{
+       if(this->isComplex())
+       {
+               if(this->getPanId() == 1)
+                       ( (wxMaracasRendererView::getInstance())->getTabbedPanel(getPropId()) )->changeIsoValueA(this->getPropId(),isovalue->GetValue()/1.0);
+               if(this->getPanId() == 2)
+                       ( (wxMaracasRendererView::getInstance())->getTabbedPanel(getPropId()) )->changeIsoValueB(this->getPropId(),isovalue->GetValue()/1.0);
+               if(this->getPanId() == 3)
+                       ( (wxMaracasRendererView::getInstance())->getTabbedPanel(getPropId()) )->changeIsoValueC(this->getPropId(),isovalue->GetValue()/1.0);
+       }
+       else
+               wxMaracasSurfaceRendering::getInstance()->changeIsoValue(this->getPropId(), isovalue->GetValue()/1.0);
        
 }