]> Creatis software - creaVtk.git/commitdiff
#2469 creaVtk Bug New Normal windows compilation conflit witn math.h definitions
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 28 Oct 2014 11:54:13 +0000 (12:54 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 28 Oct 2014 11:54:13 +0000 (12:54 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx
lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp

index 0ca30a2b7d0522503742d04c0c1a72e20a08a272..575150c690e63fbec625624526cfee6da953894b 100644 (file)
@@ -4,7 +4,8 @@
 #include "bbcreaVtkPointRotation.h"
 #include "bbcreaVtkPackage.h"
 
-#include<math.h>
+#define _USE_MATH_DEFINES // for C
+#include <math.h>
 
 namespace bbcreaVtk
 {
index c3334e9d1ed5ce08ceca573cc8ec3e3ed862e734..3609557e26bdedac789b54c255b7c1809a0a4daf 100644 (file)
 */
 
 #include "creaVtkUnMosaicVectorVtkImageData.h"
+
+#define _USE_MATH_DEFINES // for C
 #include <math.h>
+
 creaVtkUnMosaicVectorVtkImageData::creaVtkUnMosaicVectorVtkImageData()
 {
 }
@@ -39,15 +42,21 @@ std::vector<vtkImageData*> creaVtkUnMosaicVectorVtkImageData::unMosaicVectorVtkI
 {
        std::vector<int> nbImagesPerRow;
        std::vector<int> nbImagesInMosaic;
+       double imagesInMosaic;
 
-       for(int i = 0; i < NbImagesInMosaicVector.size(); i++){
-               nbImagesPerRow.push_back( ceil(sqrt(NbImagesInMosaicVector[i])) );
+       for(int i = 0; i < NbImagesInMosaicVector.size(); i++)
+       {
+               imagesInMosaic = NbImagesInMosaicVector[i];
+               nbImagesPerRow.push_back( ceil(sqrt(imagesInMosaic)) );
                nbImagesInMosaic.push_back(NbImagesInMosaicVector[i]);
        }
 
-       if(imageInput.size() != NbImagesInMosaicVector.size()){
-               for(int j = NbImagesInMosaicVector.size(); j < imageInput.size(); j++)  {       
-                       nbImagesPerRow.push_back( ceil(sqrt(NbImagesInMosaicVector[NbImagesInMosaicVector.size()-1])) );                
+       if(imageInput.size() != NbImagesInMosaicVector.size())
+       {
+               for(int j = NbImagesInMosaicVector.size(); j < imageInput.size(); j++)  
+               {
+                       imagesInMosaic = NbImagesInMosaicVector[NbImagesInMosaicVector.size()-1];
+                       nbImagesPerRow.push_back( ceil(sqrt(imagesInMosaic)) );         
                        nbImagesInMosaic.push_back( NbImagesInMosaicVector[NbImagesInMosaicVector.size()-1] );
                }
        }