]> Creatis software - clitk.git/commitdiff
simplified code
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 26 Jul 2012 11:13:26 +0000 (13:13 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 26 Jul 2012 11:13:26 +0000 (13:13 +0200)
vv/vvSlicer.cxx

index 1e133d6f863cfd8dcad8ec52fa6c02a01cbe8296..247820561076c445f95e7943857878d62fd2f672 100644 (file)
@@ -920,9 +920,8 @@ void vvSlicer::UpdateDisplayExtent()
         double cpos = (double)cam->GetPosition()[this->SliceOrientation];
         double range = fabs(spos - cpos);
         double *spacing = input->GetSpacing();
-        double avg_spacing =
-          ((double)spacing[0] + (double)spacing[1] + (double)spacing[2]) / 3.0;
-        cam->SetClippingRange(range - avg_spacing * 3.0, range + avg_spacing * 3.0);
+        double sumSpacing = spacing[0] + spacing[1] + spacing[2];
+        cam->SetClippingRange(range - sumSpacing, range + sumSpacing);
       }
     }
   }