]> Creatis software - bbtk.git/commitdiff
#3290 BBTK Feature New Normal - VectorFilterDounble invert option 9
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 1 Aug 2019 14:35:49 +0000 (16:35 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 1 Aug 2019 14:35:49 +0000 (16:35 +0200)
packages/std/src/bbstdVectorFilterDouble.cxx
packages/std/src/bbstdVectorFilterDouble.h

index 63d22719334da7b6bb2062b1bef187f4811664d7..ffed94ac2ef729909a3aec9b4459d736abe7cd15 100644 (file)
@@ -279,7 +279,6 @@ void VectorFilterDouble::Process()
 
        if (bbGetInputType()==8)   // order all vectors using as base the vector In0
        {
-printf("EED VectorFilterDouble::Process Type 8 Start\n");
                double tmp;
                int i,j,ii,sizeII;
                sizeII=pLstVec.size();
@@ -305,17 +304,40 @@ printf("EED VectorFilterDouble::Process Type 8 Start\n");
                                                tmp = (*pLstVecOut[ii])[i]; 
                                                (*pLstVecOut[ii])[i] = (*pLstVecOut[ii])[j]; 
                                                (*pLstVecOut[ii])[j] = tmp; 
-//                                             tmp=Out0[i]; Out0[i]=Out0[j]; Out0[j]=tmp; 
-                                       }
-                               }
+                                       } // for ii
+                               } // if <
                        } // for j
                } // for i
-printf("EED VectorFilterDouble::Process Type 8 End\n");
-
        } // Type 8
 
 
+       if (bbGetInputType()==9)   // Invert vectors
+       {
+               double tmp;
+               int i,j,ii,sizeII;
+               sizeII=pLstVec.size();
+
+               int size=In0.size();
+               int size2=size/2;
+               for (i=0;i<size; i++)
+               {
+                       for (ii=0;ii<sizeII;ii++)
+                       {
+                                (*pLstVecOut[ii]).push_back( (*pLstVec[ii])[i] ); 
+                       } // for ii
+               } // i
 
+               for (i=0;i<size2;i++)
+               {
+                       for (ii=0;ii<sizeII;ii++)
+                       {
+                               j=size-1-i;     
+                               tmp = (*pLstVecOut[ii])[i]; 
+                               (*pLstVecOut[ii])[i] = (*pLstVecOut[ii])[ j ]; 
+                               (*pLstVecOut[ii])[j] = tmp; 
+                       } // for ii
+               } // for i
+       } // Type 9
 
        bbSetOutputOut0( Out0 );
        bbSetOutputOut1( Out1 );
index a5d4b0fc7ec0bf012cbe1000b4ed0426499b934e..f08a2e3fb4f44059c8907aa38ba94f7a19d36251 100644 (file)
@@ -52,7 +52,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorFilterDouble,bbtk::AtomicBlackBox);
   BBTK_AUTHOR("InfoDev");
   BBTK_DESCRIPTION("No Description.");
   BBTK_CATEGORY("empty");
-  BBTK_INPUT(VectorFilterDouble,Type,"default (0)  0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition, 4=Substraction, 5=Multilication, 6=Division, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 ",int,"");
+  BBTK_INPUT(VectorFilterDouble,Type,"default (0)  0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition, 4=Substraction, 5=Multilication, 6=Division, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 , 9=Invert Vectors",int,"");
   BBTK_INPUT(VectorFilterDouble,k1,"default (0)  nothing (Type0), k1=new size vectors (Type 1) , nothing (Type2), k1 = Addition const. (Type 3), k1 = Substraction const. (Type 4), k1 = Multiplication const. (Type 5) , k1 = Division const. (Type 6) ,  ",double,"");
   BBTK_INPUT(VectorFilterDouble,In0,"Input vector",std::vector<double>,"");
   BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector<double>,"");