]> Creatis software - creaContours.git/commitdiff
#3145 creaContours Bug New Normal - changeWx28to30
authorEduardo DAVILA <davila@localhost.localdomain>
Tue, 10 Oct 2017 07:18:45 +0000 (09:18 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Tue, 10 Oct 2017 07:18:45 +0000 (09:18 +0200)
appli/wxContourGUIExample/wxContourGUIExample.cxx
bbtk/src/bbCreaContournDimensions.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.h
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.h

index 46c896e3b8c4c41e118a0938c7dcf7e8d53bff83..72c91300216936db650430cdac00e7294f64370d 100644 (file)
 #include "wxContourMainFrame.h"
 //#include "OutlineModelManager.h"
 //#include "wxContourEventHandler.h"
-
 //#include <creaImageIOWxGimmickDialog.h>
 //#include <creaImageIOWxGimmickReaderDialog.h>
 #include <creaImageIOWxSimpleDlg.h>
-
 #include <creaImageIOSystem.h>
-
 #include <creaVtkBasicSlicer.h>
 //#include "wxContourMainPanel.h"
-
 #include "vtkMetaImageReader.h"
 #include <map>
 #include "vtkImageData.h"
-
 #include "wx/artprov.h"
 #include <wx/filedlg.h>
 
-
-/* EED EraseMe
-//#include "OutlineModelBuilder.h"
-//#include "ContourThing.h"
-//#include "AxeThing.h"
-//#include "ImageSourceThing.h"
-//#include "ImageSectionThing.h"
-//#include "SomeEnvironment.h"
-//#include "ReaderEnvironment.h"
-
-//#include "interfMainPanel.h"
-
-#if defined(MACOSX) // assume this is OSX
-# include <sys/param.h>
-# include <mach-o/dyld.h> // _NSGetExecutablePath : must add -framework CoreFoundation to link line
-# include <string.h>
-# ifndef PATH_MAX
-#  define PATH_MAX MAXPATHLEN
-# endif
-#endif // MACOSX
-*/
-
 #ifndef PATH_MAX // If not defined yet : do it
 #  define PATH_MAX 2048
 #endif
-
 #if defined(WIN32)
   #include <direct.h>
 #else
    #include <dirent.h>
 #endif
-
 #include <stdlib.h>
 
-
-
 wxContourMainFrame* wxTheApplication::frame = 0;
 
 //----------------------------------------------------------------------------------------------------------------
 // This macro implements the entry point (main function) for the application
 //----------------------------------------------------------------------------------------------------------------
 
-
-
-
-
-
 //=========================================================================
 //=========================================================================
 IMPLEMENT_APP( wxTheApplication );
@@ -115,14 +79,11 @@ void wxAppConsole::OnAssertFailure(char const *,int,char const *,char const *,ch
 }
 #endif
 
-
-
-bool wxTheApplication :: OnInit()
+bool wxTheApplication::OnInit()
 {
        vtkOutputWindowCreaContour *outputWindowCreaContour= vtkOutputWindowCreaContour::New();
        vtkOutputWindow::SetInstance( outputWindowCreaContour );
        outputWindowCreaContour->Delete();
-
        wxString infoImage;
        wxInitAllImageHandlers();
 
@@ -131,7 +92,6 @@ bool wxTheApplication :: OnInit()
 //EED01Juin2010        int output_dim = NATIVE;
 //EED01Juin2010        int threads = 1;
 
-
 //EED 1Juin2010
       creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB");
       w.ShowModal();
@@ -150,78 +110,33 @@ bool wxTheApplication :: OnInit()
 //                                                                             threads);
 //     w.ShowModal();
 
-
 //JCP
        //std::string datadir(  crea::wx2std(GetExecutablePath()) );
        std::string datadir(  crea::System::GetExecutablePath() );
 //JCP
-
            #ifdef LINUX /* assume this is OSX */
                    datadir=datadir+"/../share/creaContours";
            #endif // MACOSX
-
                #ifdef MACOSX /* assume this is OSX */
                        datadir=datadir+"/../../../../share/creaContours";
                #endif // MACOSX
-
-
                if(w.GetReturnCode() == wxID_OK)
                {
-                               std::vector<std::string> s;
-//EED 01Juin2010                               w.GetSelectedFiles(s);
-
-
-//EED                  std::vector<std::string>::iterator i;
-//                             for (i=s.begin();i!=s.end();++i)
-//                             {
-//                                     std::cout << *i << std::endl;
-//                             }
-//                             std::cout << "$$$$ "<<std::endl;
-                               //w.GetSelectedImages(images);
-
-//EED31mai2010                         w.GetSelectedImages(images,output_dim);
-
-
-//EED 1Juin2010
-//                             std::vector<creaImageIO::OutStrGimmick> out;
-//                             std::vector<std::string> attr;
-////                           attr.push_back("D0028_0010");
-////                           attr.push_back("D0008_0023");
-////                           attr.push_back("D0008_1070");
-//                             w.getSelected(out, attr,true,"");
-////                           std::cout<<out.size()<<std::endl;
-////                           crea::VtkBasicSlicer(out.front().img);
-//                             int size=out.size();
-//                             int ii;
-//                             for (ii=0;ii<size;ii++)
-//                             {
-//                                     images.push_back(out[ii].img);
-//                             }
-
-//EED 1Juin2010
-//                             printf("EED creaContours wxTheApplication :: OnInit  %d\n", w.getImagesSelected().size() );
-                               images    = w.getImagesSelected();
-                               infoImage = w.getInfoImage();
-//                             printf("EED creaContours wxTheApplication :: OnInit  %d\n", images.size() );
-
-               }
-               else if (w.GetReturnCode() == wxID_CANCEL)
+                       std::vector<std::string> s;
+                       images    = w.getImagesSelected();
+                       infoImage = w.getInfoImage();
+               } else if (w.GetReturnCode() == wxID_CANCEL)
                {
-                               vtkMetaImageReader *reader = vtkMetaImageReader::New();
-                               std::string filename= datadir + "/data/hola.mhd";
-                               infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
-                               reader->SetFileName( filename.c_str() );
-                               reader->Update();
-                               images.push_back(reader->GetOutput());
-                       }
-                       else
-                       {
-                               return -1;
-                       }
-
-
+                       vtkMetaImageReader *reader = vtkMetaImageReader::New();
+                       std::string filename= datadir + "/data/hola.mhd";
+                       infoImage=_T("DEFAULT-Image:")+crea::std2wx(filename);
+                       reader->SetFileName( filename.c_str() );
+                       reader->Update();
+                       images.push_back(reader->GetOutput());
+               } else {
+                       return -1;
+               }
        wxFrame* frame1 = new wxFrame(NULL, wxID_ANY, wxT("Creatis- ROI Application- Evaluation version,01 Agost 2010 ")+infoImage, wxPoint(400,50), wxSize(800, 600) );
-
        //frame = new wxContourMainFrame( frame1, wxID_ANY, wxString(_T("")), wxPoint(50,50), wxSize(800, 600), images );
        frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(200,50), wxSize(800, 600), images,  wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
        frame1->CreateStatusBar();
index 5a02859a7261ca56b4441abaed3cc73b4d2b8b1f..143cd5e471bf1174c66cce88cab4ab1737d5baa0 100644 (file)
@@ -43,14 +43,12 @@ void nDimensions::Process()
        vtkImageData* img = bbGetInputIn();
 
        std::vector<vtkImageData*> selectedimages;
-       if(img!=NULL && currentimg!=img){
-
-               printf("EED nDimensions::Process 02\n");        
+       if(img!=NULL && currentimg!=img)
+       {
                wxContourMainFrame::getInstance()->ShowToolsPanel(true);
                currentimg=img;
                selectedimages.push_back(img);
                wxContourMainFrame::getInstance()->setVectImages(selectedimages);
-               printf("EED nDimensions::Process 03\n");        
        }
 
        if(currentimg != NULL){
index 83da40fc269afdd5f346003d8d53ba907185ceaf..64fb2ee4de73553a846a2bb6bf6f786bd0b9ab74 100644 (file)
@@ -26,8 +26,8 @@
 #include "interfMainPanel.h"
 
 
-interfMainPanel* interfMainPanel::interfmainpanel=NULL;
-wxFrame* interfMainPanel::_newframe=NULL;
+interfMainPanel        *interfMainPanel::interfmainpanel       = NULL;
+wxFrame                        *interfMainPanel::_newframe                     = NULL;
 
 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
index 5b5f61f822f541564ac1064b67308c1565a59f71..760f5431b8e2618120e0b19db779df4059a8f100 100644 (file)
@@ -96,7 +96,7 @@ char wxContourMainFrame::COPY = 'C';
                _viewColorLayerImagePanel       = NULL;
        }
 
-       wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
+       wxContourMainFrame::wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
                : wxPanel(parent, id, pos, size, style)
        {
                m_mgr.SetManagedWindow(this);
@@ -233,17 +233,13 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
                        notebook->AddPage( _theViewPanel, wxT("       View       ") );
                        m_mgr.Update();
                }
-
-
                if( configured )
                {
                        notebook->AddPage( _instantPanel, wxT("Instant Page") );
                        m_mgr.Update();
                }
-
                m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
                m_mgr.Update();
-
                SetMinSize(wxSize(300,300));
                m_mgr.Update();
                return configured;
@@ -446,13 +442,15 @@ manualBaseModel * wxContourMainFrame::factoryManualContourModel(wxPanel* panel){
 
        return manModelContour;
 }
-void wxContourMainFrame :: saveState(){
 
+void wxContourMainFrame :: saveState()
+{
        std::string temp = kernelManager->saveState();
        saveFileWithContours(temp);
 }
 
-void wxContourMainFrame::onDeleteContour(){
+void wxContourMainFrame::onDeleteContour()
+{
        //JCP 20-10-08 Undo redo implementation
                saveState();
                //JCP 20-10-08 Undo redo implementation
@@ -513,7 +511,8 @@ void wxContourMainFrame :: deleteContours( std::vector<std::string>  keyNamesVec
        }
 }
 
-void wxContourMainFrame :: deleteContour( std::string theKeyName ){
+void wxContourMainFrame :: deleteContour( std::string theKeyName )
+{
        /*
        manualContourModel                      * cModel;
        manualViewBaseContour           * cViewer;
@@ -602,17 +601,20 @@ void wxContourMainFrame::deleteAllContours(){
 JCP --08-09-2008 */
 }
 
-void wxContourMainFrame::setConceptValue( std::string name, int value ){
+void wxContourMainFrame::setConceptValue( std::string name, int value )
+{
        _instantPanel->setConceptValue(name, value);
 }
 
 
-ConceptDataWrap* wxContourMainFrame::getLastConceptData(){
+ConceptDataWrap* wxContourMainFrame::getLastConceptData()
+{
        return _instantPanel->getLastConceptData();
 }
 
 
-bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos ){
+bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
+{
        return _instantPanel->getIfConceptCheckedAt( name, pos );
 }
 
@@ -655,11 +657,10 @@ void wxContourMainFrame::changeInstant()
                std::vector<int> instantVect;
                _instantPanel->getInstant( instantVect );
                int actualSlice = instantVect[1];
-
                kernelManager->setInstant(instantVect);
-
            // Refresh Mask image
-               if(_viewMaskImage!=NULL){
+               if(_viewMaskImage!=NULL)
+               {
                        _viewMaskImage->SetZ(actualSlice);
                        if (_viewMaskImagePanel->IsVisible()==true)
                        {
@@ -667,17 +668,16 @@ void wxContourMainFrame::changeInstant()
                                getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
                                _viewMaskImage->onThreshold();
                        }
-               }
-
+               } // if _viewMaskImage
        // Refresh Threshold image
-               if(_viewThresholdImage!=NULL){
+               if(_viewThresholdImage!=NULL)
+               {
                        _viewThresholdImage->SetZ(actualSlice);
-                       if (_viewThresholdImagePanel->IsVisible()==true){
+                       if (_viewThresholdImagePanel->IsVisible()==true)
+                       {
                                _viewThresholdImage->onThreshold();
                        }
-               }
-
-
+               } // if _viewThresholdImage
                updateInstantOutlines();
                updateInstantImageData();
                updateInstantAxes();
@@ -685,7 +685,7 @@ void wxContourMainFrame::changeInstant()
 
 
 
-void wxContourMainFrame :: updateInstantOutlines()
+void wxContourMainFrame::updateInstantOutlines()
 {
        _theViewPanel->removeSceneContours();
        _theViewPanel->addNameWrapperToScene();
@@ -696,10 +696,13 @@ void wxContourMainFrame :: updateInstantOutlines()
        //}
 }
 
-int wxContourMainFrame::getNamesWrappingSize(){
+int wxContourMainFrame::getNamesWrappingSize()
+{
        return kernelManager->getNamesWrappingSize();
 }
-std::string wxContourMainFrame::getNameWrapping(int i){
+
+std::string wxContourMainFrame::getNameWrapping(int i)
+{
        return kernelManager->getNameWrapping(i);
 }
 
@@ -731,7 +734,6 @@ void wxContourMainFrame::onChangeDeep(int val){
 
 void wxContourMainFrame::onCopy(){
        std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
-
        std::vector<int> tempVector;
        _instantPanel->getInstant( tempVector );
     _performingOperation->reset();
@@ -740,9 +742,8 @@ void wxContourMainFrame::onCopy(){
        _performingOperation->setKeyNamesOperationElems( currentSelection );
 }
 
-void wxContourMainFrame::onPaste(){
-
-
+void wxContourMainFrame::onPaste()
+{
        char theStartCommand = _performingOperation->getStartCommand();
        if (  theStartCommand == COPY )
        {
@@ -760,7 +761,9 @@ void wxContourMainFrame::onPaste(){
                }
        }
 }
-void wxContourMainFrame::onUndo(){
+
+void wxContourMainFrame::onUndo()
+{
        std::string filename;
        if(kernelManager->onUndoSaveFile(filename)){
                saveFileWithContours(filename);
@@ -829,109 +832,11 @@ void wxContourMainFrame :: createMirrorContourOf ( std::string anExistingKName,
        _theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
 }
 
-//EED04
-void wxContourMainFrame ::loadState(std::string filename){
-
+void wxContourMainFrame ::loadState(std::string filename)
+{
        deleteAllContours();
        onLoadContours(filename,false);
-
-       /* EED Borrame
-       char tmp[255];
-       FILE *pFile=fopen(filename.c_str(),"r+");
-
-       fscanf(pFile,"%s",tmp); // --CreaContour--
-
-       fscanf(pFile,"%s",tmp); // Version
-       fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
-
-       deleteAllContours();
-
-       loadContours(pFile, false);
-       loadContours(pFile, true);
-
-       fclose(pFile);
-       */
-}
-
-
-//EED03
-/*EED Borrame
-void wxContourMainFrame::loadContours( FILE *pFile, bool staticContour )
-{
-       char tmp[255];
-
-       if (staticContour==false)
-       {
-               fscanf(pFile,"%s",tmp); // ImageDimensions
-               fscanf(pFile,"%s",tmp); // X
-               fscanf(pFile,"%s",tmp); // Y
-               fscanf(pFile,"%s",tmp); // Z
-
-               fscanf(pFile,"%s",tmp); // ImageSpacing
-               fscanf(pFile,"%s",tmp); // X
-               fscanf(pFile,"%s",tmp); // Y
-               fscanf(pFile,"%s",tmp); // Z
-       }
-
-       fscanf(pFile,"%s",tmp); // NumberOfContours
-       fscanf(pFile,"%s",tmp); // ##
-       int numberOfContours = atoi(tmp);
-
-       std::vector<int> instantVector;
-       int typeContourModel;
-       manualBaseModel *manModelContour;
-       int typeView;
-
-       int i;
-       for (i=0;i<numberOfContours;i++)
-       {
-               instantVector.clear();
-               fscanf(pFile,"%s",tmp); // Instant
-               fscanf(pFile,"%s",tmp); // 1
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 2
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 3
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 4
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 5
-               instantVector.push_back( atoi(tmp) );
-               fscanf(pFile,"%s",tmp); // 6
-               instantVector.push_back( atoi(tmp) );
-
-               fscanf(pFile,"%s",tmp); // TypeContourModel
-               fscanf(pFile,"%s",tmp); // ##
-               typeContourModel = atoi(tmp);
-
-               manModelContour =  kernelManager->factoryManualContourModel(typeContourModel);
-               manModelContour->Open(pFile);
-
-               fscanf(pFile,"%s",tmp); // TypeView
-               fscanf(pFile,"%s",tmp); // ##
-               typeView = atoi(tmp);
-
-               std::string theName;
-               theName = kernelManager->createOutline( manModelContour, instantVector );
-               bool addedModel = theName.compare("") != 0;
-               if( addedModel )
-               {
-                       double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
-                       _theViewPanel->getSpacing(spc);
-                       //Adding the manualContourControler to interface objects structure
-                       //Adding the manualViewContour to interface objects structure
-                       //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
-                       _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeView) ;
-               }
-
-               if (staticContour==true)
-               {
-                       Instant instant(&instantVector);
-                       kernelManager->changeContourOfManager( theName , &instant );
-               }
-       }// for  numberOfContours
 }
-*/
 
 
 void wxContourMainFrame::onLoad()
@@ -959,10 +864,7 @@ void wxContourMainFrame::onLoad()
 
 void  wxContourMainFrame::SetZForAllContours(int pz)
 {
-       printf("EED wxContourMainFrame::SetZForAllContours\n");
-
        //-- Normal Contours
-
        std::vector< std::string > lstNameThings;       
        int i,sizeLstNameThings;
        int ii,sizeLstPoints;
@@ -1018,17 +920,10 @@ void wxContourMainFrame::onLoadContours(std::string fileNameContourROI, bool int
                        fscanf(pFileData,"%s",tmpD); // NumberOfContours
                        fscanf(pFileData,"%s",tmpD); // #
                }
-
                fscanf(pFile,"%s",tmp); // --CreaContour--
-
                fscanf(pFile,"%s",tmp); // Version
                fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
                std::string version(tmp);
-
-
-printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() );
-
-
                //AD:02-06-09
         _tmpReadFileTypeOfTransformation=-1;
                if (version=="1.0.3")
@@ -1037,7 +932,6 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                        openContours(pFile,pFileData,false);
                        openContours(pFile,pFileData,true);     //Load StaticContours
                }       
-
                if (version=="1.0.2")
                {
 //EED001
@@ -1047,7 +941,6 @@ printf("EED wxContourMainFrame::onLoadContours  version%s \n", version.c_str() )
                        openContours(pFile,pFileData,true);     // Load StaticContours
                        SetZForAllContours(-900);
                }
-
                //AD:02-06-09
                else if (version=="1.0.1")
                {
@@ -1463,14 +1356,16 @@ void wxContourMainFrame::openContours( FILE *pFile, FILE *pFileData, bool static
 
 }
 
-void wxContourMainFrame::RefreshInterface(){
+void wxContourMainFrame::RefreshInterface()
+{
        changeInstant();
        _theViewPanel->RefreshInterface();
        //wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
        //wxvtk2dbaseview->Refresh();
 }
 
-vtkImageData* wxContourMainFrame::getImageData(){
+vtkImageData* wxContourMainFrame::getImageData()
+{
        return _theViewPanel->getImageData();
 }
 
@@ -2439,29 +2334,33 @@ int wxContourMainFrame::getWindowLevel()
        return _theViewPanel->getWindowLevel();
 }
 
-void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
        _theViewPanel->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
 
        RefreshInterface();
 }
 
-void wxContourMainFrame::onInterpolation(bool interpolate){
+void wxContourMainFrame::onInterpolation(bool interpolate)
+{
        _theViewPanel->onInterpolation(interpolate);
        RefreshInterface();
 }
 
-void wxContourMainFrame::onChangeInstant(std::string name,int actual){
+void wxContourMainFrame::onChangeInstant(std::string name,int actual)
+{
        _instantPanel->setConceptValue( name, actual );
 }
 
 
-void wxContourMainFrame::resetAppend(){
+void wxContourMainFrame::resetAppend()
+{
        kernelManager->resetAppend();
-
 }
 
 
-void wxContourMainFrame::onSpreadAdd(){
+void wxContourMainFrame::onSpreadAdd()
+{
        std::vector<double> vecX;
        std::vector<double> vecY;
        std::vector<double> vecZ;
@@ -2473,7 +2372,8 @@ void wxContourMainFrame::onSpreadAdd(){
 }
 
 
-void wxContourMainFrame::onSpreadAddAll(){
+void wxContourMainFrame::onSpreadAddAll()
+{
 //EED02
        std::vector<int> tempVector;
        _instantPanel->getInstant( tempVector );
@@ -2511,7 +2411,8 @@ void wxContourMainFrame::onSpreadAddAll(){
 }
 
 
-void wxContourMainFrame::onSpreadGo(int type){
+void wxContourMainFrame::onSpreadGo(int type)
+{
        //JCP 20-10-08 Undo redo implementation
        saveState();
        //JCP 20-10-08 Undo redo implementation
@@ -2566,11 +2467,12 @@ void wxContourMainFrame::onSpreadGo(int type){
        //RefreshInterface();
 }
 
-void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector){
-
+void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
+{
 }
 
-std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
+std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
+{
        std::vector<int> tempVector;
        _instantPanel->getInstant(tempVector);
        //Asignation of slide number should be different ex by name
index 934238ed23ac3235c499b8719bd627483edc053c..546484a18f94314b3a5c94b529cd5ba7faea1efd 100644 (file)
@@ -96,7 +96,6 @@
 #include "vtkMetaImageWriter.h"
 #include "vtkImageData.h"
 #include "vtkTransform.h"
-
 #include "vtkCamera.h"
 #include "vtkImageActor.h"
 #include <vtkImageMapToColors.h>
@@ -384,7 +383,7 @@ private:
        int                      _numberOfVariablesStatistics;
 
        // Contour Image Mask
-       ThresholdImageView              *_viewMaskImage;
+       ThresholdImageView                      *_viewMaskImage;
        ThresholdImageViewPanel         *_viewMaskImagePanel;
 
        // Threshold Image
index 4286054e785fb92ef3bb80c2deca61b883204759..b1d05679baff70d22551d1164534789e4890adea 100644 (file)
@@ -52,65 +52,6 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
        //------------------------------------------------------------------------------------------------------------
        // Constructors & Destructors
        //------------------------------------------------------------------------------------------------------------
-       /*{
-
-               showingVID = theShowingImage;
-               int gapH = 20;
-               int gapV = 10;
-               createHorizontalBar(1,80);
-               createVerticalBar(1,200);
-               createViewPanel();
-
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(3,1,0,0);
-               panelSizer->AddSpacer(gapV);
-               panelSizer -> AddGrowableCol(1);
-               panelSizer->Add(theViewPanel, 1, wxEXPAND);
-               panelSizer->AddSpacer(gapV);
-
-               wxFlexGridSizer * downSizer = new wxFlexGridSizer(1,3,gapV,gapH);
-               downSizer->Add(_verticalBar, 1, wxEXPAND);
-               //downSizer->AddSpacer(gapH);
-               downSizer -> AddGrowableCol(1);
-               downSizer->Add(panelSizer, 1, wxEXPAND|wxALL|wxCENTER);
-               //downSizer->AddSpacer(gapH);
-               outSizer = new wxFlexGridSizer(3,1,1,1);
-               outSizer->Add(_horizontalBar, 1, wxEXPAND);
-               outSizer -> AddGrowableRow(1);
-               outSizer -> AddGrowableCol(1);
-               outSizer->Add(downSizer, 1, wxEXPAND);
-
-               _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + gapH, gapV);
-               _horizontalBar->setDeviceEndMargin( gapH+10 );
-
-               //Connecting the events to the horizontal bar
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStartChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Horizontal );
-               Connect(_horizontalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Horizontal );
-
-               //Connecting the events to the vertical bar
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStartChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Vertical );
-               Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Vertical );
-
-
-               this->SetAutoLayout( true );
-               SetSizer( outSizer );
-               this->Layout();
-
-               SetSize(900,700);
-               theViewPanel->SetSize(800,600);
-               theViewPanel->GetWindow(1)->SetSize(800,600);
-
-               outSizer->Fit( this );
-               SetBackgroundColour(wxColour(255,0,0));
-
-       }*/
        //:wxScrolledWindow(parent, -1, pos, size, style)
        wxContourViewPanel::wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
        :wxPanel(parent, -1, pos, size, style)
@@ -126,31 +67,31 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                createViewPanel();
                _eventHandler                   = NULL;
 
+               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4,  gapV, gapH);
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
 #if wxMAJOR_VERSION <= 2
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4,  gapV, gapH);
                panelSizer -> AddGrowableCol(2);
                panelSizer -> AddGrowableRow(2);
 #else
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(4);
-               panelSizer -> AddGrowableCol(2);
+               panelSizer -> AddGrowableRow(0,1);
+               panelSizer -> AddGrowableCol(2,1);
 #endif
-               panelSizer->Add(_verticalBar, 1, wxGROW);
+               panelSizer->Add(_verticalBar, 0, wxEXPAND);
                panelSizer->AddSpacer(gapV);
-               panelSizer->Add(theViewPanel, 1, wxGROW);
+               panelSizer->Add(theViewPanel, 1, wxEXPAND);
                panelSizer->AddSpacer(gapV);
 
+               outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
 #if wxMAJOR_VERSION <= 2
-               outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
                outSizer -> AddGrowableCol(1);
                outSizer -> AddGrowableRow(1);
 #else
-               outSizer = new wxFlexGridSizer(3);
-               outSizer -> AddGrowableCol(1);
+               outSizer -> AddGrowableRow(1,1);
+               outSizer -> AddGrowableCol(0,1);
 #endif
-               outSizer->Add( _horizontalBar, 1, wxGROW);
-               outSizer->Add( panelSizer, 1, wxGROW);
+               outSizer->Add( _horizontalBar, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP);
+               outSizer->Add( panelSizer, 1, wxEXPAND);
                outSizer->AddSpacer(gapH);
 
                _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
@@ -758,11 +699,13 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                }
        }
 
-       void wxContourViewPanel::removeSceneContours(){
+       void wxContourViewPanel::removeSceneContours()
+       {
                _sceneManager->removeSceneContours();
        }
 
-       void wxContourViewPanel::addNameWrapperToScene(){
+       void wxContourViewPanel::addNameWrapperToScene()
+       {
                int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
                for(int i = 0; i < size;i++){
                        std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
index c8f70333b0200bd5a0c6fb8992bdb39fd3f2278d..ecc5c9721fc4e932c661019c0325cc58301cc756 100644 (file)
@@ -360,39 +360,33 @@ private:
        //------------------------------------------------------------------------------------------------------------
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
-       wxVtkBaseView_SceneManager_sceneManager;
+       wxVtkBaseView_SceneManager              *_sceneManager;
        /*
        * Represents the outer sizer of the ContourViewPanel
        */
-       wxFlexGridSizeroutSizer;
+       wxFlexGridSizer                                 *outSizer;
 
        /*
        * Represents the panel for viewing
        */
-       wxMaracas_N_ViewersWidget theViewPanel;
+       wxMaracas_N_ViewersWidget               *theViewPanel;
        /*
        * Represents the vertical barrange
        */
-       mBarRange _verticalBar;
+       mBarRange                                               *_verticalBar;
 
        /*
        * Represents the horizontal barrange
        */
-       mBarRange * _horizontalBar;
+       mBarRange                                               *_horizontalBar;
+       vtkImageData                                    *showingVID;    
+       std::string                                     _verticalConceptName;
+       std::string                                     _horizontalConceptName;
+       double                                                  last_spacing[3];
+       bool                                                    _useVerticalBar;
+       bool                                                    _useHorizontalBar;
 
-       vtkImageData * showingVID;      
-
-       std::string _verticalConceptName;
-
-       std::string _horizontalConceptName;
-
-       double last_spacing[3];
-
-       bool _useVerticalBar;
-
-       bool _useHorizontalBar;
-       
-       wxEvtHandler * _eventHandler;
+       wxEvtHandler                                    *_eventHandler;
        
 //EED
 
index 166f8ed9a5066789c43b8dc33eb3fbe8e3b070ec..1d8f1e51659104368b0f3234d3f609dade2ee545 100644 (file)
@@ -65,25 +65,21 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
        wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
        {
-               
                _lastInteraction                                = NULL;
-               _lastInteractionName                            = "";
+               _lastInteractionName                    = "";
                _eventHandler                                   = theEventHandler;
                _leftClickCount                                 = 0;
                _rigthClickCount                                = 0;
-               
-               _contours_ViewControl                           = new std::map< std::string, ContourWrap_ViewControl * >();
-               _sceneContours_ViewControl                      = new std::map< std::string, ContourWrap_ViewControl * >();
+               _contours_ViewControl                   = new std::map< std::string, ContourWrap_ViewControl * >();
+               _sceneContours_ViewControl              = new std::map< std::string, ContourWrap_ViewControl * >();
                _workingGroup                                   = new std::map< std::string, ContourWrap_ViewControl * >();
-
                _creatingMULT_ROI                               = false;
-               _editingROI                                     = false;
-               _toIncludeAtInteractionGroup                    = false;
-               _waiting                                        = false;
+               _editingROI                                             = false;
+               _toIncludeAtInteractionGroup    = false;
+               _waiting                                                = false;
                _creatingROI                                    = false;
-               _drawingSelectionROI                            = false;
-               SetWidthContour(1.0);
-               
+               _drawingSelectionROI                    = false;
+               SetWidthContour(1.0);   
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
                {
@@ -93,6 +89,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                }
                configureSelectionROI( spc );
        }
+
        //------------------------------------------------------------------------------------------------------------
        wxVtkBaseView_SceneManager :: ~wxVtkBaseView_SceneManager()
        {
@@ -102,7 +99,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                {
                        _contours_ViewControl->erase( iter );
                        i++;
-               }
+               } // for
                _contours_ViewControl->clear();         
                delete _contours_ViewControl;           
                _workingGroup->clear();
@@ -126,10 +123,9 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        wxCommandEvent cevent( theEventType );
                        cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
                        _eventHandler->ProcessEvent( cevent );
-               }
+               } // if
        }
 
-
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
@@ -137,6 +133,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        {
                _eventHandler = theEventHandler;
        }
+
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: setWxVtkViewBase( wxVtkBaseView * theBaseView )
        {
@@ -461,7 +458,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        }
 
        //------------------------------------------------------------------------------------------------------------
-       void wxVtkBaseView_SceneManager :: removeSceneContours( )
+       void wxVtkBaseView_SceneManager::removeSceneContours()
        {
                std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin(); 
                int size = _sceneContours_ViewControl->size();
@@ -471,8 +468,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        iter++;
                }
                _sceneContours_ViewControl->clear();
-
-
                //Removing the selection rectangle to avoid showing when it's innecesary
                _controlerSelectionROI->SetActive( false );             
                _viewerSelectionROI->RemoveCompleteContourActor();      
index e565266d28361fdc24c18e89d87c0898ba91949a..ecc6a5111afd3a193d295e287d3d212b35731495 100644 (file)
@@ -209,7 +209,7 @@ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas {
 
        int                       GetImageDataSizeZ();
        void              GetImageDataRange( double *range );
-       void                    SetWidthContour(double width);
+       void              SetWidthContour(double width);
 
 //JCP 21 - 09 - 08
        bool isEditableCControler(std::string theKeyName);
@@ -232,35 +232,34 @@ private:
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
        
-       std::map<std::string, ContourWrap_ViewControl *> * _contours_ViewControl;
-       std::map<std::string, ContourWrap_ViewControl *> * _sceneContours_ViewControl;
-       wxVtkBaseView                           *_wxVtk_BaseView;
-       wxEvtHandler                            *_eventHandler;
-       ContourWrap_ViewControl                 *_lastInteraction;
-       std::string                             _lastInteractionName;
-       std::map<std::string, ContourWrap_ViewControl *> * _workingGroup;
-       bool                                    _creatingMULT_ROI;
-       bool                                    _editingROI;
-       bool                                    _toIncludeAtInteractionGroup;
-       bool                                    _waiting;
-       bool                                    _creatingROI;
-       int                                     _enventID;
-       int                                     _leftClickCount;
-       int                                     _rigthClickCount;
-       int                                     clickX;
-       int                                     clickY;
-       char                                    _lastKeyCode;
-       long int                                onCharCallBackTimeEnd;
-       long int                                onCharNeeded;
-       bool                                    _drawingSelectionROI;
-       manualRoiControler                      *_controlerSelectionROI;
-       manualViewRoi                           *_viewerSelectionROI;
-       manualBaseModel                         *_modelSelectionROI;
-       double                                  _widthOfContour;
-       double                                  _widthOfControlPoint;
-
-       bool _ctrlKey;
-       bool _shiftKey;
+       std::map<std::string, ContourWrap_ViewControl *>        *_contours_ViewControl;
+       std::map<std::string, ContourWrap_ViewControl *>        *_sceneContours_ViewControl;
+       wxVtkBaseView                                                                           *_wxVtk_BaseView;
+       wxEvtHandler                                                                            *_eventHandler;
+       ContourWrap_ViewControl                                                         *_lastInteraction;
+       std::string                                                                                     _lastInteractionName;
+       std::map<std::string, ContourWrap_ViewControl *>        *_workingGroup;
+       bool                                                                                            _creatingMULT_ROI;
+       bool                                                                                            _editingROI;
+       bool                                                                                            _toIncludeAtInteractionGroup;
+       bool                                                                                            _waiting;
+       bool                                                                                            _creatingROI;
+       int                                                                                                     _enventID;
+       int                                                                                                     _leftClickCount;
+       int                                                                                                     _rigthClickCount;
+       int                                                                                                     clickX;
+       int                                                                                                     clickY;
+       char                                                                                            _lastKeyCode;
+       long int                                                                                        onCharCallBackTimeEnd;
+       long int                                                                                        onCharNeeded;
+       bool                                                                                            _drawingSelectionROI;
+       manualRoiControler                                                                      *_controlerSelectionROI;
+       manualViewRoi                                                                           *_viewerSelectionROI;
+       manualBaseModel                                                                         *_modelSelectionROI;
+       double                                                                                          _widthOfContour;
+       double                                                                                          _widthOfControlPoint;
+       bool                                                                                            _ctrlKey;
+       bool                                                                                            _shiftKey;
 };
 #endif // __wxVtkBaseView_SceneManager_HEADER_FILE__