+ if ( (k1omp==i2) || (k2omp==i2) || (k3omp==i2) ||
+ (k4omp==i2) || (k5omp==i2) || (k6omp==i2) )
+ {
+ if (size2==1)
+ {
+ printf(" 100% (just one element)\n");
+ } else {
+ printf(" %d% \n", (int)(((double)i2/(double)(size2-1))*100 ));
+ }
+ }// if K#omp
+ manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[ lst2[i2] ] ,
+ bbGetInputByLstPointsY()[ lst2[i2] ] ,
+ bbGetInputByLstPointsZ()[ lst2[i2] ] );
+ } // for i2
+
+// B.4. Quitar los elementos de lst2 en lst1 y recomenzar desde el punto B;
+ for (i2=0;i2<size2;i2++)
+ {
+ size1=lst1.size();
+ for (i1=0;i1<size1;i1++)
+ {
+ if (lst2[i2]==lst1[i1])
+ {
+ lst1.erase( lst1.begin()+i1 );
+ i1=size1;
+ } // if
+ } // for i1
+ } // for i2
+
+ } // while
+printf("EED ManualPaint_Model::LstPointOMPAnalice End\n");
+
+}
+
+
+void ManualPaint_Model::Process()
+{
+/* Notas
+0. Quitar comentarion ByLstPoints openmp
+1. Falta openmp ByImagePoints
+2. Desligar cada PaintImage de la mascara
+ -pequeno bloque de memoria para cada PaintImage
+ -el resultado volverlo a colocar en la image2 original
+ -Si no existe image2 original y hay que colocarlo en la imagen de origien
+ hay que crear una imagen2 temporal y luego bajar la imagen
+3. Verificar el mecanismo de undo con ByLstPoints
+4. Verificar el mecanismo de undo con ByImagePoints
+*/
+ if (bbGetInputActive()==true)
+ {
+ if (bbGetInputImage()!=NULL)
+ {
+ manualpaintmodel->SetActive( bbGetInputActive() );
+ manualpaintmodel->SetTool( bbGetInputTool() );
+ manualpaintmodel->Set2D3D( bbGetInput2D3D() );
+ manualpaintmodel->SetImages( bbGetInputImage(),bbGetInputImage2() );
+ manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() );
+ manualpaintmodel->SetDirection( bbGetInputDirection() );
+ manualpaintmodel->SetBrushSize( bbGetInputBrushSize() );
+ manualpaintmodel->SetBrushForm( bbGetInputBrushForm() );
+ manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() );
+ manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() );
+ manualpaintmodel->SetRangeMin( bbGetInputRange()[0] );
+ manualpaintmodel->SetRangeMax( bbGetInputRange()[1] );
+ if (bbGetInputPoint().size()==3)
+ {
+ manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
+ manualpaintmodel->SetUndoImage();
+ manualpaintmodel->Copy_GeneralAuxFill_to_Results();
+ } // if Points
+ if ( bbGetInputByLstPointsX().size()!=0 )
+ {
+ //-- Alternativa con openmp --
+// LstPointOMPAnalice();
+
+// /* -- Original ByLstPoints sin openmp --
+ int i,size = bbGetInputByLstPointsX().size();
+long int k1omp=(double)(size-1)*0.0;
+long int k2omp=(double)(size-1)*0.2;
+long int k3omp=(double)(size-1)*0.4;
+long int k4omp=(double)(size-1)*0.6;
+long int k5omp=(double)(size-1)*0.8;
+long int k6omp=(double)(size-1)*1.0;
+printf("EED ManualPaint_Model::Process list of points (with openmp) size=%d\n",size);
+#pragma omp parallel for
+ for (i=0;i<size;i++)
+ {
+ if ( (k1omp==i) || (k2omp==i) || (k3omp==i) ||
+ (k4omp==i) || (k5omp==i) || (k6omp==i) )
+ {
+ if (size==1)
+ {
+ printf(" 100% (just one element)\n");
+ } else {
+ printf(" %d% \n", (int)(((double)i/(double)(size-1))*100 ));
+ }
+ }// if K#omp
+ manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[i] ,
+ bbGetInputByLstPointsY()[i] ,
+ bbGetInputByLstPointsZ()[i] );
+ //_manualPaintModel->SetUndoImage(); // Probably needed. Here is ok.
+ } // for
+// -- Original ByLstPoints sin openmp --*/
+
+ manualpaintmodel->Copy_GeneralAuxFill_to_Results();
+
+ }// if ByLstPointsX
+ if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) )