From: Eduardo Davila Date: Thu, 7 May 2009 15:35:46 +0000 (+0000) Subject: BUG histogram X-Git-Tag: EED.02Oct2009~90 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1bf58cfa1758464b422d1d0cca808e528043e691;p=creaMaracasVisu.git BUG histogram --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx index 8466cda..affe13c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx @@ -145,6 +145,7 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint yValues[4]=0; pGraphicalFunction * tf = plotter ->getFunctionForVectors( xValues, 5, yValues, 5 ); + printf("EED %p HistogramWidget::drawTransferenceFunction %p\n", this , tf); // Including and drawing the created function in the plotter if (tf) { @@ -266,8 +267,12 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint */ bool HistogramWidget::addPointToTransferenceFunction(double x, double y) { + bool result=false; pGraphicalFunction* tf=plotter->getFunction(idTransferenceFunction); - return tf->AddPoint(x,y); +printf("EED %p HistogramWidget::addPointToTransferenceFunction tp%p x%f y%f %d\n",this, tf, x ,y, idTransferenceFunction); + if (tf!=NULL) { result=tf->AddPoint(x,y); } + + return result; } /* add a color point to the histogram @@ -294,15 +299,16 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint { // we have to erase the points pGraphicalFunction* tf=plotter->getFunction(idTransferenceFunction); - int numOfPoints=tf->getSizePoints(); - int i=numOfPoints-1;//-2; - while(i>=0) - { - tf->deletePointAt(i); - i--; - } - - } + if (tf!=NULL){ + int numOfPoints=tf->getSizePoints(); + int i=numOfPoints-1;//-2; + while(i>=0) + { + tf->deletePointAt(i); + i--; + } // while + } // if tf + } // if transferenceFunctionHasPoints //we set for actual the histogram //plotter->setActual() diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx index b04e17c..0eed1ed 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx @@ -159,15 +159,18 @@ bool pGraphicalFunction:: AddNewPoint(int x,int y) */ bool pGraphicalFunction::AddPoint(int aX, int aY,bool order) { - - bool added=logicFunction -> AddPoint( aX, aY,order ); - if(!fromWindow) - setUp(); - else - { - logicFunction->setEndPoints(); - logicFunction->setStartPoints(); - } + printf("EED %p pGraphicalFunction::AddPoint %p (%d %d) \n", this, logicFunction, aX, aY); + bool added=false; + if (logicFunction!=NULL){ + added=logicFunction -> AddPoint( aX, aY,order ); + if(!fromWindow) + setUp(); + else + { + logicFunction->setEndPoints(); + logicFunction->setStartPoints(); + } // if fromWindow + } // if logicFunction return added; } @@ -822,7 +825,7 @@ void pGraphicalFunction :: setColorPoints(std::vector &colorVecto { f_colorPoints.clear(); int i = 0; - while(i &colorVecto void pGraphicalFunction :: getColorPoints(std::vector &colorVector) { int i = 0; - while(igetRealX(), originaslPoint->getColor(), originaslPoint->isTemporalColor()); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx index 7635f60..5bc7148 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx @@ -1387,10 +1387,15 @@ int pPlotterWindow:: addFunction(pGraphicalFunction * function) function->initializeSplineVectors(); UpdateAll(); } - // bool added1= functions.Append(function)!=NULL; // JPRx + +// bool added1= functions.Append(function)!=NULL; // JPRx + functions.Append(function); //EED int id=functions.IndexOf(function); - /* bool added2= */ AddLayer(function);// JPRx + + // bool added2= AddLayer(function);// JPRx + AddLayer(function); //EED + UpdateAll(); return id;//added1 && added2; } @@ -1799,7 +1804,9 @@ void pPlotterWindow::moveFunctions( float porcentageMinX,float porcentageMaxX) */ int pPlotterWindow::addFunctionToMove(pGraphicalFunction *function) { - // bool added1= functionsToMove.Append(function)!=NULL; // JPRx + //bool added1= functionsToMove.Append(function)!=NULL; // JPRx + functionsToMove.Append(function); // EED + int id=functionsToMove.IndexOf(function); UpdateAll(); return id; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx index f3217a2..a46feff 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx @@ -341,7 +341,6 @@ void vtkMPR3DDataViewer::Refresh() int x = (int)(_vtkmprbasedata->GetX()); int y = (int)(_vtkmprbasedata->GetY()); int z = (int)(_vtkmprbasedata->GetZ()); - std::cout<<" vtkMPR3DDataViewer::Refresh() x="<_wxvtkmpr3Dview->GetVtkMPR3DDataViewer(); // JPRx @@ -3383,6 +3390,8 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) std::vector* bctf = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetBlueColorsOfColorTransferenceFVector(); vtkImageData *imagedata = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData(); + + //use for update in the refresh /* vtkVolumeRayCastMapper* volumeMapper = this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetVolumeMapper(); @@ -3612,10 +3621,12 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc){ } void wxVtkMPR3DView::Configure(){ - _wxvtk3Dbaseview->Configure(); _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel(); - _wxvtk3Dbaseview->GetRenderer()->Clear(); + +//EED ?????? 07Mai2009 +// _wxvtk3Dbaseview->GetRenderer()->Clear(); + // Actors are added to the renderer. vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index 5d3233f..f9822d1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $ Language: C++ - Date: $Date: 2009/05/04 07:35:42 $ - Version: $Revision: 1.10 $ + Date: $Date: 2009/05/07 15:35:46 $ + Version: $Revision: 1.11 $ Copyright: (c) 2002, 2003 License: @@ -146,11 +146,8 @@ mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D ); - vtkmpr3Ddataviewer = new vtkMPR3DDataViewer(); - - wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor(); wxPanel *panelControl = new wxPanel(panelClipping3D,-1);