]> Creatis software - creaContours.git/commitdiff
Clean code
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 19 Jan 2022 07:33:03 +0000 (08:33 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 19 Jan 2022 07:33:03 +0000 (08:33 +0100)
bbtk/src/bbCreaContournDimensions.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx

index 8aad345e44e55ce97664e87428f594a742ee1ae9..c53e63787fbe754b63256fd65eda03cc327366d1 100644 (file)
@@ -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<vtkImageData*> 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);
 
 }
 
index 7eab8c93249c7203b05e7d9740ddd262fcd5a30d..c50fa9b4f3356b0f3c2aa4548369f7e37b9754de 100644 (file)
@@ -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<vtkImageData*> imgs)
+void wxContourMainFrame::configure(std::vector<vtkImageData*> 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()
index aa7a947df3139d0dbebe42c5eaaf3de4ceef4731..eabf81e44f1967fece7939429d95e1fcaa3a7e83 100644 (file)
@@ -132,7 +132,7 @@ class wxContourMainFrame : public wxPanel {
        //------------------------------------------------------------------------------------------------------------
        // Creational and initialization methods
        //------------------------------------------------------------------------------------------------------------
-       void setVectImages(std::vector<vtkImageData*> imgs);
+       void configure(std::vector<vtkImageData*> imgs);
        bool configurePanels( );
        bool addNewPanel(wxPanel* panel);
        wxAuiNotebook * createNotebook();
index 8e9f1d8e3663b3c498ae5d7327eb2c4635c13e7d..5671ae0e6a204767b5a24c7e99d77f8819614f23 100644 (file)
@@ -98,8 +98,8 @@ void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg)
        std::vector<double> vectspc;
        for(int i = 0; i < (int)(vectimg.size()); i++)
        {
-               vtkImageData* img = vectimg[i];
-               vtkImageChangeInformationchange = 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<std::string, ImageSourceThing *> * sourcesMap      = new std::map<std::string, ImageSourceThing *>();
-       std::map<std::string, ImageSectionThing *>* sectionsMap     = new std::map<std::string, ImageSectionThing *>();
-       std::map<std::string, AxeThing *>* axesMap                                  = new std::map<std::string, AxeThing *>();
-       std::map<std::string, ContourThing *>* outlinesMap                  = new std::map<std::string, ContourThing *>();
+                                                _datadir            = datadir;
+       std::string                                 conceptsFN                  = datadir+"holaConceptsFile.cf";
+       std::string                                 imageSourcesFN              = datadir+"holaImagesInstantsFile.of";
+       std::string                                 imageSectionsFN             = "";
+       std::string                                 axeThingsFN                 = "";
+       std::map<std::string, ImageSourceThing *>   *sourcesMap         = new std::map<std::string, ImageSourceThing *>();
+       std::map<std::string, ImageSectionThing *>  *sectionsMap            = new std::map<std::string, ImageSectionThing *>();
+       std::map<std::string, AxeThing *>           *axesMap                    = new std::map<std::string, AxeThing *>();
+       std::map<std::string, ContourThing *>       *outlinesMap                = new std::map<std::string, ContourThing *>();
        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<std::string, ImageSourceThing *>( 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<std::string>& conc
 }
 
 
-vtkImageData* KernelManagerContour::getImageAtInstant(std::vector<int> inst){
+vtkImageData* KernelManagerContour::getImageAtInstant(std::vector<int> 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