X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbcreaMaracasVisuManualPaint_Model.cxx;h=856a509587e02650d95d5e00199a78336d7c5807;hb=2a1cde86bf45b8f9b11514a9b04d5834b10af209;hp=5c513422088d8bcc769e309305fc8a33ead7763f;hpb=56eb704bce4e7a4206ffa16c84f3000b8b8f93eb;p=creaMaracasVisu.git diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx index 5c51342..856a509 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -1,8 +1,12 @@ //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== + +#include "creaVtk_MACROS.h" #include "bbcreaMaracasVisuManualPaint_Model.h" #include "bbcreaMaracasVisuPackage.h" + + namespace bbcreaMaracasVisu { @@ -11,6 +15,8 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ManualPaint_Model,bbtk::AtomicBlackBox); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== + + void ManualPaint_Model::Process() { @@ -46,7 +52,6 @@ void ManualPaint_Model::Process() { manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] ); } // if Points - if ( bbGetInputByLstPointsX().size()!=0 ) { int i,size = bbGetInputByLstPointsX().size(); @@ -55,10 +60,8 @@ void ManualPaint_Model::Process() manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[i] , bbGetInputByLstPointsY()[i] , bbGetInputByLstPointsZ()[i] ); } // for }// if ByLstPointsX - - if (bbGetInputByImagePoints()!=NULL) + if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) { - int i,j,k; // int ia,ja,ka; // int ii,jj,kk; int ext[6]; @@ -68,35 +71,42 @@ void ManualPaint_Model::Process() #else bbGetInputByImagePoints()->GetExtent(ext); #endif - int dimX=ext[1]-ext[0]+1; int dimY=ext[3]-ext[2]+1; int dimZ=ext[5]-ext[4]+1; - for (i=0;iGetScalarComponentAsDouble(i,j,k, 0)>0) + GETVALUE_VTK_CREA(vBIP,pBIP,sTBIP) + if (vBIP>0) { - if (bbGetInputImage2()->GetScalarComponentAsDouble(i,j,k, 0)==0) + GETVALUE_VTK_CREA(vI2,pI2,sTI2) + if (vI2==0) { manualpaintmodel->PaintImage(i,j,k); - } // bbGetInputImage2 - } // GetScalarComponentAsDouble - }// for k + } // vI2 + } // vBIP + pBIP = pBIP + sSBIP; + pI2 = pI2 + sSI2; + }// for i }// for j - }// for i + }// for k printf("ManualPaint_Model %d%\n", 100 ); } // if ByImagePoints } else { - printf("EED Warning: Image not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n"); - } // if + printf("EED Warning: ByImagePoints or Image2 not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n"); + } // if ((bbGetInputByImagePoints()!=NULL) && (bbGetInputImage2()!=NULL) ) if (bbGetInputImage2()!=NULL) { @@ -117,30 +127,26 @@ void ManualPaint_Model::bbUserSetDefaultValues() // Here we initialize the input 'In' to 0 bbSetInputActive(true); - bbSetInputTool(1); // Paint - bbSetInput2D3D(1); // 3D + bbSetInputTool(1); // Paint + bbSetInput2D3D(1); // 3D bbSetInputImage(NULL); bbSetInputImage2(NULL); bbSetInputGrayLevel(100); - bbSetInputDirection(2); // XY + bbSetInputDirection(2); // XY bbSetInputBrushSize(3); - bbSetInputBrushForm(1); // sphere + bbSetInputBrushForm(1); // sphere bbSetInputToleranceFill(50); bbSetInputDistanceFill(25); - std::vector point; point.push_back(0); point.push_back(0); point.push_back(0); bbSetInputPoint(point); - std::vector range; range.push_back(0); range.push_back(200); bbSetInputRange(range); - bbSetInputByImagePoints(NULL); - } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)