From: Eduardo DAVILA Date: Wed, 18 Dec 2019 14:50:55 +0000 (+0100) Subject: #3328 creaContours Feature New Normal - SetFileLocation box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9ff44b27d3213ad802523f2dd4eb8572f3551183;p=creaContours.git #3328 creaContours Feature New Normal - SetFileLocation box --- diff --git a/bbtk/src/bbcreaContoursOnSave.cxx b/bbtk/src/bbcreaContoursOnSave.cxx new file mode 100644 index 0000000..b067e6e --- /dev/null +++ b/bbtk/src/bbcreaContoursOnSave.cxx @@ -0,0 +1,84 @@ +//===== +// 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 "bbcreaContoursOnSave.h" +#include "bbcreaContoursPackage.h" + +#include "wxContourMainFrame.h" + +namespace bbcreaContours +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,OnSave) +BBTK_BLACK_BOX_IMPLEMENTATION(OnSave,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 OnSave::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetFileLocation().empty()==false ) + { + wxContourMainFrame::getInstance()->onSave(); + } // if FileLocation + } // if getInstance +} +//===== +// 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 OnSave::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 +// bbSetInputIn(0); + +} +//===== +// 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 OnSave::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// 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 OnSave::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaContours + + diff --git a/bbtk/src/bbcreaContoursOnSave.h b/bbtk/src/bbcreaContoursOnSave.h new file mode 100644 index 0000000..afcf663 --- /dev/null +++ b/bbtk/src/bbcreaContoursOnSave.h @@ -0,0 +1,48 @@ +//===== +// 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) +//===== +#ifndef __bbcreaContoursOnSave_h_INCLUDED__ +#define __bbcreaContoursOnSave_h_INCLUDED__ + +#include "bbcreaContours_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +namespace bbcreaContours +{ + +class bbcreaContours_EXPORT OnSave + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(OnSave,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) +//===== +// BBTK_DECLARE_INPUT(Active,bool); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// 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) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(OnSave,bbtk::AtomicBlackBox); + BBTK_NAME("OnSave"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + +// BBTK_INPUT(OnSave,Active,"(default false) true/false",bool,""); + +// BBTK_OUTPUT(OnSave,Out,"First output",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(OnSave); +//===== +// 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) +//===== +} +// EO namespace bbcreaContours + +#endif // __bbcreaContoursOnSave_h_INCLUDED__ + diff --git a/bbtk/src/bbcreaContoursSetFileLocation.cxx b/bbtk/src/bbcreaContoursSetFileLocation.cxx index 2274585..84c73b2 100644 --- a/bbtk/src/bbcreaContoursSetFileLocation.cxx +++ b/bbtk/src/bbcreaContoursSetFileLocation.cxx @@ -6,7 +6,6 @@ #include "wxContourMainFrame.h" - namespace bbcreaContours { @@ -32,23 +31,22 @@ void SetFileLocation::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <GetFileLocation().empty()==true) - { - wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() ); - }else { - wxContourMainFrame::getInstance()->onSave(); - wxContourMainFrame::getInstance()->deleteAllContours(); - wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() ); - } // if FileLocaton - - wxContourMainFrame::getInstance()->onLoad(); - wxContourMainFrame::getInstance()->RefreshInterface(); -printf("EED SetFileLocation::Process End\n"); + if (wxContourMainFrame::getInstance()!=NULL) + { + if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true) + { + wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() ); + }else { + wxContourMainFrame::getInstance()->onSave(); + wxContourMainFrame::getInstance()->deleteAllContours(); + wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() ); + } // if FileLocaton + + wxContourMainFrame::getInstance()->onLoad(); + wxContourMainFrame::getInstance()->RefreshInterface(); + } // if Instance } //===== // 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) diff --git a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx index e10e836..371e7fb 100644 --- a/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfImageToolsMenu.cxx @@ -46,23 +46,9 @@ interfImageToolsMenu::interfImageToolsMenu(wxWindow * parent, int sizex, int siz void interfImageToolsMenu::initButtons(wxEvtHandler* evtHandler) { -printf("EED interfImageToolsMenu::initButtons start\n"); std::vector path, nom; std::vector funct; -/*EED Borrame - path.push_back(datadir + "/Segmentation.png"); - nom.push_back("Find shapes by automatic segmentation"); - funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed); - - path.push_back(datadir + "/ITK.png"); - nom.push_back("Find shapes by automatic segmentation with ITK"); - funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK); - - path.push_back(datadir + "/snake.png"); - nom.push_back("Find shapes using border snake interaction"); - funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed); -*/ path.push_back(datadir + "/pignon.png"); nom.push_back("Configuration of the window"); funct.push_back((wxObjectEventFunction) &interfImageToolsMenu:: onConfigurationPressed); @@ -86,7 +72,6 @@ printf("EED interfImageToolsMenu::initButtons start\n"); this->addButtons(path, nom); this->setVectorFunction(funct); this->connectEvents(evtHandler); -printf("EED interfImageToolsMenu::initButtons End\n"); } interfImageToolsMenu::~interfImageToolsMenu() diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 9fbe24a..9d4319e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -52,7 +52,7 @@ using namespace std; // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ -wxContourMainFrame* wxContourMainFrame:: instance = NULL; +wxContourMainFrame* wxContourMainFrame::instance=NULL; char wxContourMainFrame::COPY = 'C'; wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style) @@ -94,7 +94,6 @@ char wxContourMainFrame::COPY = 'C'; _viewThresholdImage = NULL; _viewThresholdImagePanel = NULL; _viewColorLayerImagePanel = NULL; - _frameShowResultImages = NULL; } @@ -162,28 +161,29 @@ void wxContourMainFrame::setVectImages(std::vector imgs) wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector images, long style,std::string datadir ) { - if(instance == NULL){ - instance = new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir); + if(instance == NULL) + { + instance=new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir); } return instance; } - std::vector wxContourMainFrame ::getVectImages() + std::vector wxContourMainFrame::getVectImages() { return kernelManager->getVectImages(); } - wxContourMainFrame* wxContourMainFrame :: getInstance() + wxContourMainFrame* wxContourMainFrame::getInstance() { return instance; } - void wxContourMainFrame :: resetInstance() + void wxContourMainFrame::resetInstance() { instance->Destroy(); } - wxContourMainFrame :: ~wxContourMainFrame() + wxContourMainFrame::~wxContourMainFrame() { delete _contourextractdata; deleteAllContours(); @@ -212,7 +212,7 @@ void wxContourMainFrame::setVectImages(std::vector imgs) // Creational and initialization methods using WxAui //------------------------------------------------------------------------------------------------------------ // - wxAuiNotebook * wxContourMainFrame :: createNotebook() + wxAuiNotebook * wxContourMainFrame::createNotebook() { wxSize client_size = GetClientSize(); wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style); @@ -224,7 +224,7 @@ void wxContourMainFrame::setVectImages(std::vector imgs) //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ - bool wxContourMainFrame :: configurePanels( ) + bool wxContourMainFrame::configurePanels( ) { bool configured = _theViewPanel!=NULL; @@ -1174,12 +1174,13 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption) { wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(460,360)); wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL); - wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL); +// wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL); + wxFlexGridSizer *dialSizer = new wxFlexGridSizer(1); wxString lstOptOperation[2]; lstOptOperation[0]=_T("By Dimension"); lstOptOperation[1]=_T("By Spacing"); - wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS); + wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,90), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS); dialSizer->Add( new wxStaticText(dial,-1,_T("The image resolution is not compatible with the ")) , 0, wxGROW ); dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?")) , 0, wxGROW );