From 696cdf7e15e3a90613c358774bab4525987571f9 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 19 Jan 2022 08:33:03 +0100 Subject: [PATCH] Clean code --- bbtk/src/bbCreaContournDimensions.cxx | 4 +- .../wxContourMainFrame.cxx | 7 +-- .../wxContourMainFrame.h | 2 +- .../KernelManagerContour.cxx | 45 ++++++++++--------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/bbtk/src/bbCreaContournDimensions.cxx b/bbtk/src/bbCreaContournDimensions.cxx index 8aad345..c53e637 100644 --- a/bbtk/src/bbCreaContournDimensions.cxx +++ b/bbtk/src/bbCreaContournDimensions.cxx @@ -46,7 +46,7 @@ void nDimensions::Process() wxContourMainFrame::getInstance()->ShowToolsPanel(true); currentimg=img; selectedimages.push_back(img); - wxContourMainFrame::getInstance()->setVectImages(selectedimages); + wxContourMainFrame::getInstance()->configure(selectedimages); } // if img if(currentimg != NULL) @@ -68,7 +68,6 @@ void nDimensions::Process() //----------------------------------------------------------------- void nDimensions::CreateWidget(wxWindow* parent) { - printf("EED nDimensions::CreateWidget Start \n"); //vtkImageData* img = bbGetInputIn(); std::vector selectedimages; @@ -103,7 +102,6 @@ printf("EED WARNING Verify that GetDllAppPath in nDimensions::CreateWidget bbCr wxContourMainFrame::getInstance()->ShowToolsPanel(false); bbSetOutputWidget( wxcontourmainframe ); - printf("EED nDimensions::CreateWidget End %p\n", wxcontourmainframe); } diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 7eab8c9..c50fa9b 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -126,12 +126,12 @@ char wxContourMainFrame::COPY = 'C'; _performingOperation = new PerformingOperation(); if(images.size() > 0) { - this->setVectImages(images); + this->configure(images); } _contourextractdata = NULL; } -void wxContourMainFrame::setVectImages(std::vector imgs) +void wxContourMainFrame::configure(std::vector imgs) { _images = imgs; #if defined(_WIN32) @@ -1211,7 +1211,6 @@ void wxContourMainFrame::readDimSpc(FILE *pFile, bool interactiveOption) //AD:04-06-09 void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool staticContour ) { -printf ("EED wxContourMainFrame::openContours Start \n"); char tmp[255]; vtkImageData *image = _images[0]; @@ -1373,8 +1372,6 @@ printf ("EED wxContourMainFrame::openContours Start \n"); /* } */ -printf ("EED wxContourMainFrame::openContours END \n"); - } void wxContourMainFrame::RefreshInterface() diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index aa7a947..eabf81e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -132,7 +132,7 @@ class wxContourMainFrame : public wxPanel { //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ - void setVectImages(std::vector imgs); + void configure(std::vector imgs); bool configurePanels( ); bool addNewPanel(wxPanel* panel); wxAuiNotebook * createNotebook(); diff --git a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx index 8e9f1d8..5671ae0 100644 --- a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx +++ b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx @@ -98,8 +98,8 @@ void KernelManagerContour::setVectImages(std::vector vectimg) std::vector vectspc; for(int i = 0; i < (int)(vectimg.size()); i++) { - vtkImageData* img = vectimg[i]; - vtkImageChangeInformation* change = vtkImageChangeInformation::New(); + vtkImageData *img = vectimg[i]; + vtkImageChangeInformation *change = vtkImageChangeInformation::New(); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 change->SetInformationInput(img); @@ -131,23 +131,23 @@ void KernelManagerContour::GetSpacing(double *vecspc, int iImage) void KernelManagerContour::initializeEnvironment(std::string datadir) { - _datadir = datadir; - std::string conceptsFN = datadir+"holaConceptsFile.cf"; - std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of"; - std::string imageSectionsFN = ""; - std::string axeThingsFN = ""; - std::map * sourcesMap = new std::map(); - std::map* sectionsMap = new std::map(); - std::map* axesMap = new std::map(); - std::map* outlinesMap = new std::map(); + _datadir = datadir; + std::string conceptsFN = datadir+"holaConceptsFile.cf"; + std::string imageSourcesFN = datadir+"holaImagesInstantsFile.of"; + std::string imageSectionsFN = ""; + std::string axeThingsFN = ""; + std::map *sourcesMap = new std::map(); + std::map *sectionsMap = new std::map(); + std::map *axesMap = new std::map(); + std::map *outlinesMap = new std::map(); for(int i = 0; i < (int)(vectimages.size()); i++) { - vtkImageData* selectedimage = vectimages[i]; - ImageSourceThing * thing = new ImageSourceThing(selectedimage); - std::string imgstring = "Source Image "+intToString(i+1); + vtkImageData *selectedimage = vectimages[i]; + ImageSourceThing *thing = new ImageSourceThing(selectedimage); + std::string imgstring = "Source Image "+intToString(i+1); sourcesMap->insert(std::pair( imgstring, thing)); } // for - OutlineModelBuilder * _builder = new OutlineModelBuilder( conceptsFN ,datadir); + OutlineModelBuilder *_builder = new OutlineModelBuilder( conceptsFN ,datadir); _builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap ); _builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap ); _builder->buildAxe_Envornment(axeThingsFN, axesMap ); @@ -490,25 +490,30 @@ void KernelManagerContour::getConceptsInformation(std::vector& conc } -vtkImageData* KernelManagerContour::getImageAtInstant(std::vector inst){ +vtkImageData* KernelManagerContour::getImageAtInstant(std::vector inst) +{ int index = inst[5]-1; - if(index < (int)(vectimages.size())&&index!=_currentIndex){ + if(index < (int)(vectimages.size())&&index!=_currentIndex) + { _currentIndex=index; return vectimages[index]; } return NULL; } -std::string KernelManagerContour::getCurrentFileName(){ +std::string KernelManagerContour::getCurrentFileName() +{ return filename; } -void KernelManagerContour::setCurrentFileName(std::string filenam){ +void KernelManagerContour::setCurrentFileName(std::string filenam) +{ this->filename = filenam; } -std::string KernelManagerContour::parseOsirixFile(std::string filename){ +std::string KernelManagerContour::parseOsirixFile(std::string filename) +{ #ifdef ParserOsirix_BUILD -- 2.47.1