From: Eduardo DAVILA Date: Wed, 3 Jun 2020 10:59:18 +0000 (+0200) Subject: #3438 BBTK Feature New Normal - bbstdMathOperationVector add Center Mass X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e221d1e7e10e597a456ca962b99486264ab5832f;p=bbtk.git #3438 BBTK Feature New Normal - bbstdMathOperationVector add Center Mass --- diff --git a/packages/std/src/bbstdMathOperationVector.cxx b/packages/std/src/bbstdMathOperationVector.cxx index f6d9309..b3633ad 100644 --- a/packages/std/src/bbstdMathOperationVector.cxx +++ b/packages/std/src/bbstdMathOperationVector.cxx @@ -116,8 +116,8 @@ void MathOperationVector::Process() std::vector *v8 = &_v8; std::vector *v9 = &_v9; - double minTmp; - double maxTmp; + double minTmp; + double maxTmp; if (firsttime==true) { @@ -445,6 +445,31 @@ void MathOperationVector::Process() bbSetOutputOut( resultVec ); } // Type 21 + + if (bbGetInputType()==22) + { + double resultX=0; + double resultY=0; + double resultZ=0; + double resultMassTotal=0; + for (i=0;i,""); BBTK_INPUT(MathOperationVector,In8,"Input vector 8",std::vector,""); BBTK_INPUT(MathOperationVector,In9,"Input vector 9",std::vector,""); - BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0 adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i] , 20 lessThan In0[i]In1[i] " ,int,""); + BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0 adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i] , 20 lessThan In0[i]In1[i], 22 Centre of Mass In0=lstX In1=lstY In2=lstZ In3=lstValues " ,int,""); BBTK_OUTPUT(MathOperationVector,Out,"Output vector",std::vector,"");