]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx
#3245 creaMaracasVisu Bug New Normal - vtkClosePolyData migration vtk 5 -> 6 Confli...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pPlotterWindow.cxx
index b07e111fde985f905fd287f3ded77e7f9da2f90d..ea0be8fe85c003f009ff38ad7860058f22605576 100644 (file)
@@ -75,26 +75,26 @@ IMPLEMENT_CLASS(pPlotterWindow, mpWindow)
 //----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(pPlotterWindow,mpWindow)
-EVT_MOTION (pPlotterWindow::onMouseMove)
-EVT_LEFT_DCLICK(pPlotterWindow::onChangeActual)
-EVT_LEFT_DOWN(pPlotterWindow::onAddPoint)
-EVT_MENU(pwID_DELPOINT, pPlotterWindow::onDeletePoint)
-EVT_MENU(pwID_SHOWPOINTS, pPlotterWindow::onShowPoints)
-EVT_MENU(pwID_STARTDRAWING, pPlotterWindow::onStartDrawing)
-//EVT_MENU(pwID_DELFUNCTION,pPlotterWindow::onDeleteFunction)
-EVT_MENU(pwID_STOPDRAWING, pPlotterWindow::onStopDrawing)
-EVT_MENU(pwID_ADDNEWPOINT, pPlotterWindow::onAddNewPoint)
-EVT_MENU(pwID_NOSHOWPOINTS, pPlotterWindow::onNoShowPoints)
-EVT_MENU(pwID_MYZOOMOUT,pPlotterWindow::onMyZoomOut)
-EVT_MENU(pwID_MYZOOMIN,pPlotterWindow::onMyZoomIn)
-EVT_MENU(pwID_SPLINE,pPlotterWindow::onSplinePoints)
-EVT_MENU(pwID_LINE,pPlotterWindow::onLine)
-EVT_MENU(pwID_SAVE,pPlotterWindow::onSave)
-EVT_MENU(pwID_LOAD,pPlotterWindow::onLoad)
-EVT_MENU(pwID_CHANGECOLOR,pPlotterWindow::onChangeColor)
-EVT_MENU( mpID_LINE_GUIDES, pPlotterWindow::OnGuideLines)
-EVT_MENU( pwID_TRASLATEACTUALFUNCTION, pPlotterWindow::onMoveFunction)
-EVT_LEFT_UP(pPlotterWindow::onLeftUp)
+ EVT_MOTION (pPlotterWindow::onMouseMove)
+ EVT_LEFT_DCLICK(pPlotterWindow::onChangeActual)
+ EVT_LEFT_DOWN(pPlotterWindow::onAddPoint)
+ EVT_MENU(pwID_DELPOINT, pPlotterWindow::onDeletePoint)
+ EVT_MENU(pwID_SHOWPOINTS, pPlotterWindow::onShowPoints)
+ EVT_MENU(pwID_STARTDRAWING, pPlotterWindow::onStartDrawing)
+ //EVT_MENU(pwID_DELFUNCTION,pPlotterWindow::onDeleteFunction)
+ EVT_MENU(pwID_STOPDRAWING, pPlotterWindow::onStopDrawing)
+ EVT_MENU(pwID_ADDNEWPOINT, pPlotterWindow::onAddNewPoint)
+ EVT_MENU(pwID_NOSHOWPOINTS, pPlotterWindow::onNoShowPoints)
+ EVT_MENU(pwID_MYZOOMOUT,pPlotterWindow::onMyZoomOut)
+ EVT_MENU(pwID_MYZOOMIN,pPlotterWindow::onMyZoomIn)
+ EVT_MENU(pwID_SPLINE,pPlotterWindow::onSplinePoints)
+ EVT_MENU(pwID_LINE,pPlotterWindow::onLine)
+ EVT_MENU(pwID_SAVE,pPlotterWindow::onSave)
+ EVT_MENU(pwID_LOAD,pPlotterWindow::onLoad)
+ EVT_MENU(pwID_CHANGECOLOR,pPlotterWindow::onChangeColor)
+ EVT_MENU( mpID_LINE_GUIDES, pPlotterWindow::OnGuideLines)
+ EVT_MENU( pwID_TRASLATEACTUALFUNCTION, pPlotterWindow::onMoveFunction)
+ EVT_LEFT_UP(pPlotterWindow::onLeftUp)
 END_EVENT_TABLE()
 
 //----------------------------------------------------------------------------
@@ -1740,12 +1740,20 @@ void pPlotterWindow :: OnGuideLines (wxCommandEvent   &event)
 */
 pGraphicalFunction* pPlotterWindow::getFunction(int index)
 {
-       wxNode* node=functions.Item(index);
-       if(node==NULL){
+       wxNode* node=NULL;
+       if (functions.size()>index)
+       {
+               node=functions.Item(index);
+       } // if
+
+       if(node==NULL)
+       {
                return NULL;
-       }
+       } // if node
        return (pGraphicalFunction*)node->GetData();
 }
+
+
 /*
          move the functions that the user wants to move
          and that were set in functionsToMove
@@ -1755,9 +1763,7 @@ pGraphicalFunction* pPlotterWindow::getFunction(int index)
          @param porcentageMaxX:the percentage that the maxShowed
          of the functions have to be move
                0<=porcentageMaxX<=1
-
        */
-
 void pPlotterWindow::moveFunctions( float porcentageMinX,float porcentageMaxX)
        {
                //Adding the actual function