]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererPanel.cxx
TransferFunctionfinish
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasMultipleVolumeRendererPanel.cxx
index 6337f764210bbe01be1d5354aaf34b9e1599a489..de919ee40e6742181ca7281caf722a56dc7ff41d 100644 (file)
@@ -35,10 +35,15 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){
 
        sizerirmprop->Add(checkbox,wxFIXED_MINSIZE);    
        
-       wxBitmap bitmap(Color_xpm);
-       _colorchoose = new wxBitmapButton(this, -1, bitmap,wxDefaultPosition,wxSize(30,30));    
-       Connect(_colorchoose->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onColorChange);                      
-       sizerirmprop->Add(_colorchoose,wxFIXED_MINSIZE);        
+       //wxBitmap bitmap(Color_xpm);
+       //_colorchoose = new wxBitmapButton(this, -1, bitmap,wxDefaultPosition,wxSize(30,30));  
+       //Connect(_colorchoose->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onColorChange);                    
+
+       mwxwidget = new HistogramDialogComboBox(this);
+       mwxwidget->setImageData(img);
+    //mwxwidget->PushEventHandler(this);
+       Connect(mwxwidget->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onColorChange);
+       sizerirmprop->Add(mwxwidget,wxFIXED_MINSIZE);   
 
        
        this->SetSizer(sizerirmprop, true);             
@@ -56,17 +61,14 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){
        Connect(button3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&wxMaracasMultipleVolumeRendererPanel::onUpdate);                                */
 
 
-       mwxwidget = new HistogramDialog(this, _T("Color Transfer Function"));
-       mwxwidget->initializeHistogram(img);
+       
 
-       mwxwidget->erasePointsTransferenceFunction();
+       /*mwxwidget->erasePointsTransferenceFunction();
        double range[2];
        img->GetScalarRange(range);
        double max = range[1];
 
-       /*
-       adding the poinst of the transference function
-       */
+       
        //X
        mwxwidget->addPointToTransferenceFunction(max * 0/2,0.0);
        mwxwidget->addPointToTransferenceFunction(max * 1/2,100.0);
@@ -76,7 +78,7 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){
        mwxwidget->addColorPoint(max*1/4,(int)(1.0*255),(int)(0.0*255),(int)(0.0*255));
        mwxwidget->addColorPoint(max*2/4,(int)(0.0*255),(int)(0.0*255),(int)(1.0*255));
        mwxwidget->addColorPoint(max*3/4,(int)(0.0*255),(int)(1.0*255),(int)(0.0*255));
-       mwxwidget->addColorPoint(max*4/4,(int)(0.0*255),(int)(0.0*255),(int)(0.2*255)); 
+       mwxwidget->addColorPoint(max*4/4,(int)(0.0*255),(int)(0.0*255),(int)(0.2*255)); */
 
        /*wxBoxSizer* boxSizer0 = new wxBoxSizer(wxHORIZONTAL);
        boxSizer0->Add(mwxwidget, 4, wxGROW);
@@ -100,8 +102,8 @@ void wxMaracasMultipleVolumeRendererPanel::createControls(vtkImageData* img){
 
        _frame->Refresh();
        _frame->Update();*/     
-       mwxwidget->SetFunctions(wxMaracasMultipleVolumeRendererView::getInstance()->GetTransferFunction(getPropId()),
-                                                       wxMaracasMultipleVolumeRendererView::getInstance()->GetColorFunction(getPropId()));
+       //mwxwidget->SetFunctions(wxMaracasMultipleVolumeRendererView::getInstance()->GetTransferFunction(getPropId()),
+       //                                              wxMaracasMultipleVolumeRendererView::getInstance()->GetColorFunction(getPropId()));
        mwxwidget->Refresh();   
 }
 void wxMaracasMultipleVolumeRendererPanel::onOK(wxCommandEvent& event){
@@ -133,10 +135,10 @@ void wxMaracasMultipleVolumeRendererPanel::updateVolume(){
 }
 void wxMaracasMultipleVolumeRendererPanel::onColorChange(wxCommandEvent& event){       
 
-       if(mwxwidget->ShowModal()==wxID_OK){
+       //if(mwxwidget->ShowModal()==wxID_OK){
         updateVolume();
-               mwxwidget->Show(false);
-       }       
+       //      mwxwidget->Show(false);
+       //}     
 }
 void wxMaracasMultipleVolumeRendererPanel::onCheckBoxChange(wxCommandEvent& event){    
        wxMaracasMultipleVolumeRendererView::getInstance()->addRemoveActor(this->getPropId(), checkbox->GetValue());