From baedf84edee0776111219f64436cc08803ed14c3 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 28 Oct 2014 12:54:13 +0100 Subject: [PATCH] #2469 creaVtk Bug New Normal windows compilation conflit witn math.h definitions --- .../src/bbcreaVtkPointRotation.cxx | 3 ++- .../creaVtkUnMosaicVectorVtkImageData.cpp | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx index 0ca30a2..575150c 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx @@ -4,7 +4,8 @@ #include "bbcreaVtkPointRotation.h" #include "bbcreaVtkPackage.h" -#include +#define _USE_MATH_DEFINES // for C +#include namespace bbcreaVtk { diff --git a/lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp b/lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp index c3334e9..3609557 100644 --- a/lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp +++ b/lib/creaVtk/creaVtkUnMosaicVectorVtkImageData.cpp @@ -26,7 +26,10 @@ */ #include "creaVtkUnMosaicVectorVtkImageData.h" + +#define _USE_MATH_DEFINES // for C #include + creaVtkUnMosaicVectorVtkImageData::creaVtkUnMosaicVectorVtkImageData() { } @@ -39,15 +42,21 @@ std::vector creaVtkUnMosaicVectorVtkImageData::unMosaicVectorVtkI { std::vector nbImagesPerRow; std::vector 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] ); } } -- 2.47.1