From 3756cecc1ce2a296d9a19628ecb49248e7472f09 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 24 Jan 2020 16:22:03 +0100 Subject: [PATCH] #3348 BBTK Feature New Normal - VectorFilterDouble (find nearest point) WriteColumnsString (bug vectors different sizes) --- packages/std/src/bbstdVectorFilterDouble.cxx | 48 +++++++++ packages/std/src/bbstdVectorFilterDouble.h | 2 +- packages/std/src/bbstdWriteColumnsString.cxx | 105 +++++++++++-------- packages/vtk/src/bbvtkTemporalPicker.cxx | 4 - 4 files changed, 111 insertions(+), 48 deletions(-) diff --git a/packages/std/src/bbstdVectorFilterDouble.cxx b/packages/std/src/bbstdVectorFilterDouble.cxx index ffed94a..812f646 100644 --- a/packages/std/src/bbstdVectorFilterDouble.cxx +++ b/packages/std/src/bbstdVectorFilterDouble.cxx @@ -3,6 +3,8 @@ //===== #include "bbstdVectorFilterDouble.h" #include "bbstdPackage.h" +#include "math.h" + namespace bbstd { @@ -339,6 +341,52 @@ void VectorFilterDouble::Process() } // for i } // Type 9 + +printf("EED VectorFilterDouble::Process() start\n"); + if (bbGetInputType()==10) // Invert vectors + { + int sizeLstX = In0.size(); // lstX + int sizeLstY = In1.size(); // lstY + int sizeLstZ = In2.size(); // lstZ + printf("EED Warnning VectorFilterDouble::Process() %d %d %d %d\n", sizeLstX,sizeLstY,sizeLstZ,In3.size() ); + if ( (sizeLstX==sizeLstY) && (sizeLstY==sizeLstZ) && (sizeLstX>0) && (In3.size()==3) ) + { + int i; + double x1 = In3[0]; // pointX of pointXYZ + double y1 = In3[1]; // pointY of pointXYZ + double z1 = In3[2]; // pointZ of pointXYZ + double distMin = 100000; + double dist; + double x2; + double y2; + double z2; + Out0.push_back( -1 ); + Out1.push_back( -999 ); + Out1.push_back( -999 ); + Out1.push_back( -999 ); + for (i=0;i,""); BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector,""); diff --git a/packages/std/src/bbstdWriteColumnsString.cxx b/packages/std/src/bbstdWriteColumnsString.cxx index 229601c..3c5d8d5 100644 --- a/packages/std/src/bbstdWriteColumnsString.cxx +++ b/packages/std/src/bbstdWriteColumnsString.cxx @@ -18,16 +18,19 @@ void WriteColumnsString::Process() std::vector headers = bbGetInputHeaders(); //Headers Input bool onHeaders = bbGetInputOnHeaders(); std::vector > values; - values.push_back(bbGetInputlstData1()); - values.push_back(bbGetInputlstData2()); - values.push_back(bbGetInputlstData3()); - values.push_back(bbGetInputlstData4()); - values.push_back(bbGetInputlstData5()); - values.push_back(bbGetInputlstData6()); - values.push_back(bbGetInputlstData7()); - values.push_back(bbGetInputlstData8()); - values.push_back(bbGetInputlstData9()); + values.push_back( bbGetInputlstData1() ); + values.push_back( bbGetInputlstData2() ); + values.push_back( bbGetInputlstData3() ); + values.push_back( bbGetInputlstData4() ); + values.push_back( bbGetInputlstData5() ); + values.push_back( bbGetInputlstData6() ); + values.push_back( bbGetInputlstData7() ); + values.push_back( bbGetInputlstData8() ); + values.push_back( bbGetInputlstData9() ); std::vector >::iterator it; + + + for(it = values.begin() ; it != values.end() ; ) { if((*it).empty()) @@ -36,44 +39,63 @@ void WriteColumnsString::Process() }else { it++; - } - } - if(write_fi.is_open()) - { - if(onHeaders == true) // If onHeaders is true, the file is write with Headers. + } // if + } // for it + + + bool ok = true; + int i,size = values.size(); + for ( i=0 ; i0) { result.push_back( acum/numElem ); -- 2.47.1