X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbCreaContournDimensions.cxx;h=336a7637b53964296a4f5c239c662f6fe72dc369;hb=f440179be0d3ac00240a569c464b59ff35bd8b81;hp=143cd5e471bf1174c66cce88cab4ab1737d5baa0;hpb=28671ae02163f2b674da599a98a128f58dfead88;p=creaContours.git diff --git a/bbtk/src/bbCreaContournDimensions.cxx b/bbtk/src/bbCreaContournDimensions.cxx index 143cd5e..336a763 100644 --- a/bbtk/src/bbCreaContournDimensions.cxx +++ b/bbtk/src/bbCreaContournDimensions.cxx @@ -32,37 +32,46 @@ namespace bbcreaContours BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,nDimensions) BBTK_BLACK_BOX_IMPLEMENTATION(nDimensions,bbtk::WxBlackBox); + void nDimensions::Process() { - double **vectx = 0, **vecty = 0, **vectz = 0; - - std::vector< void * > vectortemp; - std::vector size; - vtkImageData **mask = 0, **value = 0; - - vtkImageData* img = bbGetInputIn(); - - std::vector selectedimages; - if(img!=NULL && currentimg!=img) - { - wxContourMainFrame::getInstance()->ShowToolsPanel(true); - currentimg=img; - selectedimages.push_back(img); - wxContourMainFrame::getInstance()->setVectImages(selectedimages); - } - - if(currentimg != NULL){ - int contourtype = bbGetInputContourType(); - //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size); - //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype); - } - - bbSetOutputX(vectx); - bbSetOutputY(vecty); - bbSetOutputZ(vectz); - bbSetOutputSizeContour(size); - bbSetOutputMask(*mask); - bbSetOutputValue(*value); +// double **vectx = 0, **vecty = 0, **vectz = 0; +// std::vector< void * > vectortemp; +// std::vector size; +// vtkImageData **mask = 0, **value = 0; + + if (firsttime==true) + { + firsttime=false; + std::vector selectedimages; + if(bbGetInputIn()!=NULL) + { + currentimg = bbGetInputIn(); + selectedimages.push_back( bbGetInputIn() ); + wxContourMainFrame::getInstance()->ShowToolsPanel(true); + wxContourMainFrame::getInstance()->configure(selectedimages); + } // if In + } else{ + + //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size); + //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype); + + if ( currentimg!=bbGetInputIn() ) + { + wxContourMainFrame::getInstance()->changeImage(0, bbGetInputIn() ); + currentimg=bbGetInputIn(); + } // if currentimg!=In + + + } // if firsttime + wxContourMainFrame::getInstance()->RefreshInterface(); + bbSetOutputwxContourMainFrame( wxContourMainFrame::getInstance() ); +// bbSetOutputX(vectx); +// bbSetOutputY(vecty); +// bbSetOutputZ(vectz); +// bbSetOutputSizeContour(size); +// bbSetOutputMask(*mask); +// bbSetOutputValue(*value); } //----------------------------------------------------------------- @@ -96,17 +105,20 @@ printf("EED WARNING Verify that GetDllAppPath in nDimensions::CreateWidget bbCr #endif // MACOSX - printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() ); +//printf("EED nDimensions::CreateWidget path=%s\n",datadir.c_str() ); - wxPanel* panel = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir ); + wxContourMainFrame* wxcontourmainframe = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir ); wxContourMainFrame::getInstance()->ShowToolsPanel(false); -//EED bbSetOutputWidget( panel ); - bbSetOutputWidget( new wxPanel(parent,-1) ); + + bbSetOutputWidget( wxcontourmainframe ); + } //----------------------------------------------------------------- void nDimensions::bbUserSetDefaultValues() { + firsttime = true; + currentimg = NULL; bbSetInputContourType(0); bbSetInputIn(NULL); }