]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
#3327 creaContours Feature New Normal - Jump Slice
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index 0e7bff41f9cd3939a1ef3ab49906833ce1c6ac99..33db75f8652b799e2e366ebc8186d9058709bb5e 100644 (file)
@@ -2415,6 +2415,22 @@ void wxContourMainFrame::onBeforeAfterContour(bool before,bool after)
        RefreshInterface();
 }
 
+void wxContourMainFrame::onJumpSlice(int step, int shift)
+{
+       std::vector<int> tempVector;
+       _instantPanel->getInstant( tempVector );
+       int ss  = abs(step);
+       int pos         = tempVector[1];
+       int maxZ        = interfMainPanel::getInstance()->GetImageDataSizeZ();
+       pos=(pos/ss)*ss+step+shift;
+       if ((pos>=0) && (pos<maxZ)) 
+       {
+               tempVector[1]=pos;
+               _instantPanel->setInstant( tempVector );
+               RefreshInterface();
+       } // if pos     
+}
+
 void wxContourMainFrame::onShowTextContour(bool show)
 {
        _theViewPanel->onShowTextContour(show);