]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdVectorFilterDouble.cxx
#3212 BBTK Feature New Normal - vtk8itk4wx3-mingw64
[bbtk.git] / packages / std / src / bbstdVectorFilterDouble.cxx
index 0fb6621500aef7c3ae2277947cf6a8754e689a10..9a948a85367b3884d62c19964248e2a20502f9bb 100644 (file)
@@ -123,7 +123,7 @@ void VectorFilterDouble::Process()
                } // for ipLstVec
        } // Type==1
 
-       if (bbGetInputType()==2) // Insert intermediate pointss
+       if (bbGetInputType()==2) // Insert intermediate points
        {
                int             ipLstvec;
                int     i;
@@ -146,6 +146,80 @@ void VectorFilterDouble::Process()
        } // Type==2
 
 
+       if (bbGetInputType()==3) // Addition  k1
+       {
+               int             ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] + bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==3
+
+       if (bbGetInputType()==4) // Substraction  k1
+       {
+               int             ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] - bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==4
+
+       if (bbGetInputType()==5) // Multiplication  k1
+       {
+               int     ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] * bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==5
+
+       if (bbGetInputType()==6) // Division  k1
+       {
+               int     ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               if (bbGetInputk1()!=0)
+                               {
+                                       result= (*pLstVec[ipLstvec])[i] / bbGetInputk1() ;
+                                       (*pLstVecOut[ipLstvec]).push_back( result );                            
+                               } else {
+                                       printf("EED VectorFilterDouble::Process  Warning!! Div by 0 in Type 6 \n");
+                                       (*pLstVecOut[ipLstvec]).push_back( -1 );                                
+                               }
+                       }// for size
+               } // for pLstVec                
+       } // Type==6
+
        bbSetOutputOut0( Out0 );
        bbSetOutputOut1( Out1 );
        bbSetOutputOut2( Out2 );
@@ -166,6 +240,7 @@ void VectorFilterDouble::bbUserSetDefaultValues()
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
    bbSetInputType(0);
+   bbSetInputk1(0);
   
 }
 //=====