X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FpPlotterWindow.cxx;h=76ffc6a7b13b891006e46d79afb5273d8901358a;hb=8138ced89fa9f1cc6933ff739dfa28b1e3c3883b;hp=7442ce91f2029233afcb0ecb4e8b0f675fd8f606;hpb=8e7ab74a199d1f05b01dccfb75da7f2c4754ddc5;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx index 7442ce9..76ffc6a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx @@ -200,6 +200,7 @@ wxPoint pPlotterWindow:: getRealPoint(wxPoint pixelPoint) void pPlotterWindow::setActualScales() { // int maxX,maxY,minX,minY; // JPRx + int maxX,maxY;//,minX,minY; // JPRx //EED /* if the function is drawed interactively the maxX and the maxY in actual are sets by the user @@ -1387,10 +1388,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; } @@ -1533,7 +1539,7 @@ void pPlotterWindow::InitFunctionForVectors( pGraphicalFunction *ff ) m_popmenu.Enable(mpID_LINE_GUIDES,true); m_popmenu.Enable(pwID_TRASLATEACTUALFUNCTION,true); //------------------------------------------ - //Sending the paarticular event of changed actual function + //Sending the particular event of changed actual function //------------------------------------------- wxCommandEvent cevent( wxEVT_PPLOTTER_CHANGED_FUNCTION, GetId() ); cevent.SetEventObject(this); @@ -1674,7 +1680,7 @@ void pPlotterWindow :: actualizeViewRange(int newMinX, int newMaxX) UpdateAll(); } /* -* Guide lines menu handler method that reacts to the mpID_LINE_GUIDES cimmand event +* Guide lines menu handler method that reacts to the mpID_LINE_GUIDES command event * event The corresponding event to handle */ void pPlotterWindow :: OnGuideLines (wxCommandEvent &event) @@ -1710,16 +1716,19 @@ void pPlotterWindow :: OnGuideLines (wxCommandEvent &event) pGraphicalFunction* pPlotterWindow::getFunction(int index) { wxNode* node=functions.Item(index); + if(node==NULL){ + return NULL; + } return (pGraphicalFunction*)node->GetData(); } /* move the functions that the user wants to move - and that were setted in functionsToMove - @param porcentageMinX:the porcentage that the minShowed - of the funcntions have to be move + and that were set in functionsToMove + @param porcentageMinX:the percentage that the minShowed + of the functions have to be move 0<=porcentageMinX<=1 - @param porcentageMaxX:the porcentage that the maxShowed - of the funcntions have to be move + @param porcentageMaxX:the percentage that the maxShowed + of the functions have to be move 0<=porcentageMaxX<=1 */ @@ -1796,7 +1805,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;