From 7245807a1af7869ba66a23262e90cf58d4070ac7 Mon Sep 17 00:00:00 2001 From: Michael Nilsson Date: Mon, 2 May 2016 13:42:10 -0400 Subject: [PATCH] changed function parameters to processData, update ghoul ref --- ext/ghoul | 2 +- modules/iswa/rendering/dataplane.cpp | 23 +++++++++++------------ modules/iswa/rendering/dataplane.h | 6 ++---- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 11bac4f34a..960bf261b1 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 11bac4f34ab385ede423754d62368e3c210eaabd +Subproject commit 960bf261b1e980ee56ba2300e7d58a1bfdb3b696 diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index f1b98a1ff6..a78fbe8f44 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -78,7 +78,7 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary) loadTexture();}); _useLog.onChange([this](){loadTexture();}); _useHistogram.onChange([this](){loadTexture();}); - _dataOptions.onChange([this](){loadTexture();}); + _dataOptions.onChange([this](){ loadTexture();} ); _useMultipleTf.onChange([this](){ changeTransferFunctions(_useMultipleTf.value()); @@ -359,18 +359,18 @@ std::vector DataPlane::readData(){ return std::vector(); } - // // FOR TESTING - // // =========== + // FOR TESTING + // =========== // std::chrono::time_point start, end; // start = std::chrono::system_clock::now(); - // // =========== - + // =========== + for(int i=0; i elapsed_seconds = end-start; @@ -378,7 +378,7 @@ std::vector DataPlane::readData(){ // std::cout << " readData():" << std::endl; // std::cout << "avg elapsed time: " << _avgBenchmarkTime << "s\n"; // std::cout << "num Benchmarks: " << _numOfBenchmarks << "\n"; - // // =========== + // =========== return data; @@ -390,9 +390,8 @@ std::vector DataPlane::readData(){ } -void DataPlane::processData(std::vector outputData, int inputChannel, std::vector inputData, float min, float max,float sum){ +void DataPlane::processData(float* outputData, std::vector& inputData, float min, float max,float sum){ - float* output = outputData[inputChannel]; // HISTOGRAM // number of levels/bins/values const int levels = 512; @@ -484,7 +483,7 @@ void DataPlane::processData(std::vector outputData, int inputChannel, st } v = normalizeWithStandardScore(v, mean, standardDeviation); - output[i] += v; + outputData[i] += v; } diff --git a/modules/iswa/rendering/dataplane.h b/modules/iswa/rendering/dataplane.h index 2710e64589..d9151a4a71 100644 --- a/modules/iswa/rendering/dataplane.h +++ b/modules/iswa/rendering/dataplane.h @@ -52,9 +52,8 @@ class DataPlane : public CygnetPlane { void readHeader(); std::vector readData(); void processData( - std::vector outputData, // Where you want your processed data to go - int inputChannel, // index of the data channel - std::vector inputData, //data that needs processing + float* outputData, // Where you want your processed data to go + std::vector& inputData, //data that needs processing float min, // min value of the input data float max, // max valye of the input data float sum // sum of the input data @@ -73,7 +72,6 @@ class DataPlane : public CygnetPlane { properties::BoolProperty _useMultipleTf; // properties::BoolProperty _averageValues; - // properties::Vec4Property _topColor; // properties::Vec4Property _midColor; // properties::Vec4Property _botColor;