]> Creatis software - creaMaracasVisu.git/commitdiff
Divides in two panels the Surface/Volume tab. It was changed only the class "maracasV...
authorRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Wed, 17 Mar 2010 16:52:51 +0000 (16:52 +0000)
committerRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Wed, 17 Mar 2010 16:52:51 +0000 (16:52 +0000)
Commentaries with //RaC tag

lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.cxx [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.h [new file with mode: 0644]

index 61063ce9c6e61efef087362f5def7d229cf9d7f7..a8b83ccf7b37c4e2f798fd5c5a19c2ea83c26b83 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMPRWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/11/30 20:52:50 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2010/03/17 16:52:51 $
+  Version:   $Revision: 1.16 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -405,7 +405,7 @@ wxPanel* wxMPRWidget::CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkm
 
                wxPanel                 *panelControl                   = new wxPanel(panelClipping3D,-1);      
                wxPanel                 *controlPanelMPR3D              = _wxvtkmpr3Dview_BB->CreateControlPanel(panelControl, false);
-               wxPanel                 *controlPanelClipping3D = _wxvtkclipping3Dview_BB->CreateControlPanel(panelControl);
+               wxPanel                 *controlPanelClipping3D = _wxvtkclipping3Dview_BB->CreateSurfControlPanel(panelControl);
                                 _btnCutImageData               = new wxCheckBox(panelControl,-1,_T("Cut Module"));
                Connect(_btnCutImageData->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED  , (wxObjectEventFunction) &wxMPRWidget::OnCutImagaData );
 
@@ -531,7 +531,7 @@ wxPanel* wxMPRWidget::CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkm
 
        wxPanel         *panelControl                   = new wxPanel(panelMPR3D,-1);
        wxPanel         *controlPanelMPR3D              = _wxvtkmpr3Dview->CreateControlPanel(panelControl, false);
-       wxPanel         *controlPanelClipping3D = _wxvtkclipping3Dview->CreateControlPanel(panelControl);
+       wxPanel         *controlPanelClipping3D = _wxvtkclipping3Dview->CreateSurfControlPanel(panelControl);
 
 
 
index d27baa5a5052d1793b0b54d7fc034416f84dddf5..2df266f8300cabad55b8d5155d8b68d2c4b22f8a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxManualTree_MPRWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/11/30 20:55:40 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2010/03/17 16:52:51 $
+  Version:   $Revision: 1.4 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -100,7 +100,7 @@ wxPanel* wxManualTree_MPRWidget::Create3DViewContour( wxWindow *parent, vtkMPRBa
 
        wxPanel         *panelControl                   = new wxPanel(panelClipping3D,-1);      
        wxPanel         *controlPanelMPR3D              = _wxvtkmpr3Dview_C->CreateControlPanel(panelControl, false);
-       wxPanel         *controlPanelClipping3D = _wxvtkclipping3Dview_C->CreateControlPanel(panelControl);
+       wxPanel         *controlPanelClipping3D = _wxvtkclipping3Dview_C->CreateSurfControlPanel(panelControl);
 
 //     wxBoxSizer  *sizerCtrol             = new wxBoxSizer(wxVERTICAL);
        wxFlexGridSizer  *sizerCtrol             = new wxFlexGridSizer(1);
index 26f8dbf475c38ac14be547137695d61743efee40..66d647ef5e373504159a2ea02fb2bf8b52938438 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMaracas_ViewerWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/05 23:03:18 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2010/03/17 16:52:51 $
+  Version:   $Revision: 1.24 $
 
   Copyright: (c) 2002, 2003
   License:
 //             wxPanel *panelControl                                   = 0;
 //             wxFlexGridSizer  *sizerCtrol                    = 0;            
                wxPanel *controlPanelMPR3D                              = 0;
-               wxPanel *controlPanelClipping3D                 = 0;
+               wxPanel *controlPanelClippingSurf3D             = 0;
+               //RaC 03-2010 Adding a tab
+               wxPanel *controlPanelClippingVol3D              = 0;
+
                wxBoxSizer *sizer                                               = 0;
 
 
 
 //--                   
                        wxNotebook *notebook = new wxNotebook(panelClipping3D, -1);
+
+                       // First tab
                        controlPanelMPR3D               = mwxvtkmpr3Dview->CreateControlPanel(notebook, true);
-                       controlPanelClipping3D  = mwxvtkclipping3Dview->CreateControlPanel(notebook);
                        notebook->AddPage(controlPanelMPR3D, _T("Planes") );
-                       notebook->AddPage(controlPanelClipping3D, _T("Volume / Surface") );
+
+                       // Second Tab
+                       controlPanelClippingSurf3D      = mwxvtkclipping3Dview->CreateSurfControlPanel(notebook);                       
+                       notebook->AddPage(controlPanelClippingSurf3D, _T("Surface") );
+                       
+                       //Third tab
+                       //RaC 03-2010 Moving the volume functionnality to other tab. The changes were realized only in the wxVtkClipping3DViewCntrlPanel class
+                       controlPanelClippingVol3D       = mwxvtkclipping3Dview->CreateVolControlPanel(notebook);
+                       notebook->AddPage(controlPanelClippingVol3D, _T("Volume") );
+
+
                        panelClipping3D -> SplitHorizontally( notebook , window3D , 10  );
                        panelClipping3D -> SetMinimumPaneSize( 15 );
                        
index 7333e9334ec9bc140b99774d851bcc7cf5e81945..5408597346f24748df7880e91e616395f74bf095 100644 (file)
@@ -1,6 +1,7 @@
 #include "wxVtkClipping3DView.h"
 
 #include "wxVtkClipping3DViewCntrlPanel.h"
+#include "wxVtkClipping3DViewVolCntrlPanel.h"
 
 wxVtkClipping3DView::wxVtkClipping3DView(wxVtk3DBaseView* wxvtk3Dbaseview)
 {
@@ -49,11 +50,21 @@ void wxVtkClipping3DView::Refresh()
        }
 }
 //-------------------------------------------------------------------
-wxPanel* wxVtkClipping3DView::CreateControlPanel(wxWindow *parent)
+wxPanel* wxVtkClipping3DView::CreateSurfControlPanel(wxWindow *parent)
 {
        _wxvtkclipping3DviewCntrlPanel = new wxVtkClipping3DViewCntrlPanel(parent,this);
        return _wxvtkclipping3DviewCntrlPanel;
 }
+
+//RaC 03-2010 Divide in two panels
+//-------------------------------------------------------------------
+wxPanel* wxVtkClipping3DView::CreateVolControlPanel(wxWindow *parent)
+{
+       _wxvtkclipping3DviewVolCntrlPanel = new wxVtkClipping3DViewVolCntrlPanel(parent,this);
+       return _wxvtkclipping3DviewVolCntrlPanel;
+}
+
+
 //-------------------------------------------------------------------
 vtkClipping3DDataViewer* wxVtkClipping3DView::GetVtkClipping3DDataViewer()
 {
index badd3fda9f4c45741d8c593d110aa00b77986144..ac6185faa725b30c26aab32bbd4ddb961d4d54dc 100644 (file)
@@ -16,7 +16,10 @@ public:
        virtual void                            Refresh();
        virtual void                            Configure();
        void                                            SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
-       wxPanel*                                        CreateControlPanel(wxWindow *parent);
+
+       wxPanel*                                        CreateSurfControlPanel(wxWindow *parent);
+       wxPanel*                                        CreateVolControlPanel(wxWindow *parent);
+       
        vtkClipping3DDataViewer*        GetVtkClipping3DDataViewer();
 
        void                                            VisibleActor(int idTissue, bool visTissue);
@@ -33,6 +36,7 @@ private:
        vtkBoxWidget                                    *_boxWidgetS1;
        vtkBoxWidget                                    *_boxWidgetVolume;
        wxPanel                                                 *_wxvtkclipping3DviewCntrlPanel;
+       wxPanel                                                 *_wxvtkclipping3DviewVolCntrlPanel;
 protected:
 };
 
index 75a549b7997e0d648001454c48d4fef0313065d1..44753e2039bf269ee6c52f478003023e9f67aa3f 100644 (file)
@@ -23,9 +23,13 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
                                        _surfC                  = new wxRadioButton(panel,-1,_T("C"));
                                        _surfD                  = new wxRadioButton(panel,-1,_T("D"));
 
-       wxCheckBox              *ckVolum                = new wxCheckBox(panel,-1,_T("Vol"));
+
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //wxCheckBox            *ckVolum                = new wxCheckBox(panel,-1,_T("Vol"));
        wxCheckBox              *ckBoxSurface   = new wxCheckBox(panel,-1,_T("Surface Box"));
-       wxCheckBox              *ckBoxVolume    = new wxCheckBox(panel,-1,_T("Volume Box"));
+       
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //wxCheckBox            *ckBoxVolume    = new wxCheckBox(panel,-1,_T("Volume Box"));
 
                                        _color                  = new wxButton(panel,-1,_T(""));
                                        _visible                = new wxCheckBox(panel,-1,_T("Vis"));
@@ -56,12 +60,15 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
        wxButton *btnSTL                                = new wxButton(panel,-1,_T("Create STL File"));
        wxButton *btnSaveRaw                    = new wxButton(panel,-1,_T("Save Raw Volume"));
 
-       wxButton *btnVolumeFunctions    = new wxButton(panel,-1,_T("Read Volume Functions"));
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //wxButton *btnVolumeFunctions  = new wxButton(panel,-1,_T("Read Volume Functions"));
 
 
        Connect(btnSTL->GetId()                         , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL    ); 
        Connect(btnSaveRaw->GetId()                     , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume    ); 
-       Connect(btnVolumeFunctions->GetId()     , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions  ); 
+       
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //Connect(btnVolumeFunctions->GetId()   , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions  ); 
 
 
        wxButton *btnMeshVTKLoad        = new wxButton(panel,-1,_T("Load Mesh"));
@@ -82,7 +89,11 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
 
 //     ckVolum->Enable(false);
        ckBoxSurface->SetValue(false);
-       ckBoxVolume->SetValue(false);
+       
+       
+       //ckBoxVolume->SetValue(false);
+
+
        _color->SetSize(40,20);
        _opacity->SetSize(370,20);
 //     ckBoxX->SetValue(true);
@@ -96,8 +107,9 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
 //     _positionY->SetSize(400,20);
 //     _positionZ->SetSize(400,20);
 
-       Connect(ckVolum->GetId()                , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleVolume                             );
-       Connect(ckBoxVolume->GetId()    , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume                  );
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //Connect(ckVolum->GetId()              , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleVolume                             );
+       //Connect(ckBoxVolume->GetId()  , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnVisibleBoxVolume                  );
 
        Connect(_surfA->GetId()                 , wxEVT_COMMAND_RADIOBUTTON_SELECTED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnSurface                                       );
        Connect(_surfB->GetId()                 , wxEVT_COMMAND_RADIOBUTTON_SELECTED  , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnSurface                                       );
@@ -134,12 +146,13 @@ wxVtkClipping3DViewCntrlPanel::wxVtkClipping3DViewCntrlPanel(wxWindow *parent, w
        //wxFlexGridSizer *sizerH5 = new wxFlexGridSizer(10); // JPRx
        //wxFlexGridSizer *sizerH6 = new wxFlexGridSizer(10); // JPRx
 
-       sizerH0->Add( ckVolum                                                                   , 1, wxALL|wxEXPAND, 0);
-       sizerH0->Add( new wxStaticText(panel, -1,_T("          "))      , 1, wxALL|wxEXPAND, 0);
-       sizerH0->Add( ckBoxVolume                                                               , 1, wxALL|wxEXPAND, 0);
-       sizerH0->Add( new wxStaticText(panel, -1,_T("          "))      , 1, wxALL|wxEXPAND, 0);
-       sizerH0->Add( btnVolumeFunctions                                                , 1, wxALL|wxEXPAND, 0);
-       sizerH0->Add( new wxStaticText(panel, -1,_T("          "))      , 1, wxALL|wxEXPAND, 0);
+       //RaC 03-2010 Divides in two panels thje last tab Surface/Volume        
+       //sizerH0->Add( ckVolum                                                                 , 1, wxALL|wxEXPAND, 0);
+       //sizerH0->Add( new wxStaticText(panel, -1,_T("          "))    , 1, wxALL|wxEXPAND, 0);
+       //sizerH0->Add( ckBoxVolume                                                             , 1, wxALL|wxEXPAND, 0);
+       //sizerH0->Add( new wxStaticText(panel, -1,_T("          "))    , 1, wxALL|wxEXPAND, 0);
+       //sizerH0->Add( btnVolumeFunctions                                              , 1, wxALL|wxEXPAND, 0);
+       //sizerH0->Add( new wxStaticText(panel, -1,_T("          "))    , 1, wxALL|wxEXPAND, 0);
        sizerH0->Add( btnMeshVTKLoad                                                    , 1, wxALL|wxEXPAND, 0);
 
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.cxx
new file mode 100644 (file)
index 0000000..6a4fd6b
--- /dev/null
@@ -0,0 +1,251 @@
+//-------------------------------------------------------------------
+//RaC 03-2010 Divides in two panels thje last tab Surface/Volume
+//-------------------------------------------------------------------
+
+#include "wxVtkClipping3DViewVolCntrlPanel.h"
+#include "wx/colordlg.h"
+#include "vtkTriangleFilter.h"
+#include "vtkPolyDataConnectivityFilter.h"
+#include "vtkClosePolyData.h"
+#include "vtkSTLWriter.h"
+#include "HistogramDialog.h"
+#include "marDicomBase.h"
+
+wxVtkClipping3DViewVolCntrlPanel::wxVtkClipping3DViewVolCntrlPanel(wxWindow *parent, wxVtkClipping3DView *wxvtkclipping3Dview )
+: wxPanel(parent, -1)
+{
+       wxPanel *panel  = this;
+       _wxvtkclipping3Dview    = wxvtkclipping3Dview;
+
+
+       wxCheckBox              *ckVolum                = new wxCheckBox(panel,-1,_T("Vol"));
+       wxCheckBox              *ckBoxVolume    = new wxCheckBox(panel,-1,_T("Volume Box"));
+
+       wxButton *btnVolumeFunctions    = new wxButton(panel,-1,_T("Read Volume Functions"));
+
+       Connect(btnVolumeFunctions->GetId()     , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions       ); 
+
+       ckBoxVolume->SetValue(false);
+
+       Connect(ckVolum->GetId()                , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume                          );
+       Connect(ckBoxVolume->GetId()    , wxEVT_COMMAND_CHECKBOX_CLICKED          , (wxObjectEventFunction) &wxVtkClipping3DViewVolCntrlPanel::OnVisibleBoxVolume                       );
+
+       wxFlexGridSizer *sizer   = new wxFlexGridSizer(1);
+       wxFlexGridSizer *sizerH0 = new wxFlexGridSizer(20);
+
+       sizerH0->Add( ckVolum                                                                   , 1, wxALL|wxEXPAND, 0);
+       sizerH0->Add( new wxStaticText(panel, -1,_T("          "))      , 1, wxALL|wxEXPAND, 0);
+       sizerH0->Add( ckBoxVolume                                                               , 1, wxALL|wxEXPAND, 0);
+       sizerH0->Add( new wxStaticText(panel, -1,_T("          "))      , 1, wxALL|wxEXPAND, 0);
+       sizerH0->Add( btnVolumeFunctions                                                , 1, wxALL|wxEXPAND, 0);
+
+
+       sizer->Add( sizerH0 , 1, wxALL|wxEXPAND, 2);
+
+       panel->SetSize(300,60);
+       panel->SetAutoLayout(true);
+       panel->SetSizer(sizer);
+       panel->Layout();
+
+       panel->SetEventHandler((wxEvtHandler*)this);
+
+}
+//-------------------------------------------------------------------
+wxVtkClipping3DViewVolCntrlPanel::~wxVtkClipping3DViewVolCntrlPanel()
+{
+}
+//-------------------------------------------------------------------
+void wxVtkClipping3DViewVolCntrlPanel::Refresh()
+{
+}
+
+//-------------------------------------------------------------------
+void wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(wxCommandEvent& event)
+{
+       _wxvtkclipping3Dview->VisibleVolumeActor( event.IsChecked()  );
+       _wxvtkclipping3Dview->Refresh();
+
+       wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
+       _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+}
+
+//-------------------------------------------------------------------
+void wxVtkClipping3DViewVolCntrlPanel::OnVisibleBoxVolume(wxCommandEvent& event)
+{
+       _wxvtkclipping3Dview->SetVisibleBoxVolume(event.IsChecked() );
+       _wxvtkclipping3Dview->Refresh();
+}
+
+//EED 22 Fevrier 2007
+//-------------------------------------------------------------------
+void wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event)
+{
+       
+       int /*i=0,*/ xi,yi,r,g,b;  // JPRx
+       vtkColorTransferFunction* ctfun = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetColorTransferenceFunction();
+       vtkPiecewiseFunction* tfun      = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTransferencefunction();
+       std::vector<double>* gtf                = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetGreyValuesTransferenceFVector();
+       std::vector<double>* itf                = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetIntensityValuesTransferenceFVector();
+       std::vector<double>* greyctf    = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetGreyValueColorsOfColorTransferenceFVector();
+       std::vector<double>* rctf               = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetRedColorsOfColorTransferenceFVector();
+       std::vector<double>* gctf               = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetGreenColorsOfColorTransferenceFVector();
+       std::vector<double>* bctf               = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetBlueColorsOfColorTransferenceFVector();
+       vtkImageData *imagedata = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+
+       //use for update in the refresh
+       /*
+       vtkVolumeRayCastMapper* volumeMapper = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVolumeMapper();
+       vtkVolume* newvol       =this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVolumeActor();
+       */
+
+       /*
+       MMLR BORRAME 
+       wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.MarVolConf"), wxOPEN);
+       if (dialog.ShowModal() == wxID_OK)
+       {
+               _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions( (char *)dialog.GetPath().c_str() );
+               
+       
+       }
+       */
+
+       HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Histogram Dialog"),imagedata,1);
+       // 
+       // put in a method
+       //
+       int tfSize=gtf->size();
+               if(tfSize>0)
+               {
+                       int i=0;
+                       hDlg->erasePointsTransferenceFunction();
+                       while(i<tfSize)
+                       {
+                               double g=(*gtf)[i];
+                               double in=(*itf)[i];
+                               hDlg->addPointToTransferenceFunction(g,in*100);
+                               i++;
+                       }
+                       
+               }
+
+       int ctfSize=rctf->size();
+       if(ctfSize>0)
+       {
+               int i=0;
+                       while(i<ctfSize)
+                       {
+                               double gr=(*greyctf)[i];
+                               double r=(*rctf)[i];
+                               double g=(*gctf)[i];
+                               double b=(*bctf)[i];
+                               hDlg->addColorPoint(gr,(int)(r*255),(int)(g*255),(int)(b*255));
+                               i++;
+                       }
+       }
+       //setting variables if the user wants to do refresh
+       hDlg->setCTF(ctfun);
+       hDlg->setTF(tfun);
+       //hDlg->setClipping3DView(_wxvtkclipping3Dview);
+       /*
+       hDlg->setVolume(newvol);
+       hDlg->setVolumeMapper(volumeMapper);
+       */
+       //
+       // when the user had changed the transference Function
+       //
+       if(hDlg->ShowModal()== wxID_OK )
+       {       
+                       // -- vtkPiecewiseFunction --
+                       tfun->RemoveAllPoints();
+                       gtf->clear();
+                       itf->clear();
+               
+                       int nTFPoints=hDlg->getSizeTransferenceFunction();
+                       int i=0;
+                       while(i<nTFPoints)
+                       {
+                               hDlg->getTransferenceFunctionPoint(i,xi,yi);
+                               tfun->AddPoint( xi , yi/100.0 );
+                               gtf->push_back(xi);
+                               itf->push_back(yi/100.0);
+                               i++;
+                       }       
+                       // -- vtkColorTransferFunction  --
+                       ctfun->RemoveAllPoints ();
+                       //clean colors
+                       rctf->clear();
+                       gctf->clear();
+                       bctf->clear();
+                       greyctf->clear();
+
+                       int nCTFpoints=hDlg->getSizeBarColor();
+                       i=0;    
+                       while(i<nCTFpoints)
+                       {
+                               hDlg->getDataBarColorPoint(i,xi,r,g,b);
+                               ctfun->AddRGBPoint(xi,r/255.0,g/255.0,b/255.0 );
+                               rctf->push_back(r/255.0);
+                               gctf->push_back(g/255.0);
+                               bctf->push_back(b/255.0);
+                               greyctf->push_back(xi);
+                               i++;
+                       }
+                       //---------------------------------
+                       // Refreshing and sending the event
+                       //---------------------------------
+                       //_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions();
+                       _wxvtkclipping3Dview->Refresh();
+                       wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
+                       _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+                       
+                       /*
+                       volumeMapper->Update();
+                       newvol->Update();
+                       */
+       } else  {
+               if(hDlg->getRefreshed())
+               {
+                       int i=0,size;
+                       //--Transference Function----
+                       tfun->RemoveAllPoints();
+                       i=0;
+                       size=gtf->size();
+                       for(i=0;i<size;i++)
+                       {
+                               double grey1=(*gtf)[i];
+                               double  in2=(*itf)[i];
+                               tfun->AddPoint( grey1 , in2 );
+                       }
+                       
+                       // -- vtkColorTransferFunction  --
+                       ctfun->RemoveAllPoints ();
+                       
+                       i=0;
+                       size=greyctf->size();           
+                       for(i=0;i<size;i++)
+                       {
+                               double grey2=(*greyctf)[i];
+                               double red =(*rctf)[i];
+                               double green =(*gctf)[i];
+                               double blue = (*bctf)[i];
+                               ctfun->AddRGBPoint(grey2,red,green,blue);
+                       }
+               
+                       //---------------------------------
+                       // Refreshing and sending the event
+                       //---------------------------------
+                       //_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions();
+                       _wxvtkclipping3Dview->Refresh();
+                       wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
+                       _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+                       
+                       /*
+                       volumeMapper->Update();
+                       newvol->Update();
+                       */
+                }
+                
+       }
+       //destroy the dialog
+       hDlg->Destroy();
+}
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewVolCntrlPanel.h
new file mode 100644 (file)
index 0000000..4a7c134
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef WXVTKCLIPPING3DVIEWVOLCNTRLPANEL_H_
+#define WXVTKCLIPPING3DVIEWVOLCNTRLPANEL_H_
+
+#include "wxVtkClipping3DView.h"
+#include "wx/wx.h"
+
+class wxVtkClipping3DViewVolCntrlPanel: public wxPanel
+{
+public:
+       wxVtkClipping3DViewVolCntrlPanel(wxWindow *parent, wxVtkClipping3DView *_wxvtkclipping3Dview);
+       ~wxVtkClipping3DViewVolCntrlPanel();
+               
+                       void    OnVisibleVolume(wxCommandEvent& event);
+                       void    OnVisibleBoxVolume(wxCommandEvent& event);
+                       virtual void    Refresh();
+                       void    OnBtnVolumeFunctions(wxCommandEvent& event);
+
+
+private:
+       wxVtkClipping3DView     *_wxvtkclipping3Dview;
+
+protected:
+
+};
+
+#endif /*WXVTKCLIPPING3DVIEWVOLCNTRLPANEL_H_*/