]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
no message
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxVtkBaseView_SceneManager.cxx
index 0ede4c607c2d1d8de97d3dfe576fbe0e1fbf8027..5aabd85529be24397810b43f5488869125ecfe59 100644 (file)
@@ -3,6 +3,7 @@
 // Class definition include
 //----------------------------------------------------------------------------------------------------------------
 #include "wxVtkBaseView_SceneManager.h"
+#include "wxVtk2DBaseView.h"
 
 //----------------------------------------------------------------------------------------------------------------
 // Class implementation
@@ -61,7 +62,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
                {
-                       vtkInteractorStyleBaseView* theInteractorStyleBaseView = _wxVtk_BaseView->GetInteractorStyleBaseView();
+                       vtkInteractorStyleBaseView* theInteractorStyleBaseView = (vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView();
                        theInteractorStyleBaseView->AddInteractorStyleMaracas( this );
                        SetVtkInteractorStyleBaseView( theInteractorStyleBaseView );                    
                }
@@ -172,12 +173,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                }
 
 
-//EED Borrame
-//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-//fprintf(ff,"EED wxVtkBaseView_SceneManager :: configureViewControlTo \n" );
-//fprintf(ff,"    %s %p \n",theKeyName.c_str() , manContourControl );
-//fclose(ff);
-
 
         _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
                _lastInteractionName = theKeyName;
@@ -185,7 +180,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                //Configuring the relations between the contour members representation                  
                manViewerContour->SetModel( manModelContour );
                manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
-               manViewerContour->SetRange( 2 );
+               manViewerContour->SetRange( 0.5 );
                manViewerContour->SetZ( 1000 );
 
                manViewerContour->SetSpacing(spc);
@@ -223,7 +218,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _viewerSelectionROI->SetSpacing( spc );
 
                _controlerSelectionROI->SetModelView( _modelSelectionROI , _viewerSelectionROI );
-               _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _controlerSelectionROI );
+               ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI );
                _controlerSelectionROI->SetActive(false);
        }
 
@@ -342,17 +337,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                }
         std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
 
-//EED Borrame
-// FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-// fprintf(ff,"EED wxVtkBaseView_SceneManager::createCopyContourOf() \n" );
-//     int ii,size = _contours_ViewControl->size();
-//     iter = _contours_ViewControl->begin();
-//    for (ii=0;ii<size;ii++)
-//     {
-//             fprintf(ff,"   %d  %s\n ", ii ,iter->first.c_str() );
-//             iter++;
-//     }
-//fclose(ff);
 
                iter = _contours_ViewControl->find( anExistingKName );
 
@@ -386,13 +370,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        _lastInteractionName = "";
                }
 
-//EED Borrame
-//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-//fprintf(ff,"EED wxVtkBaseView_SceneManager :: removeFromScene \n" );
-//fprintf(ff,"    %p \n", contourWRP->getControler() );
-//fclose(ff);
 
-               _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( contourWRP->getControler() );
+               ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->RemoveInteractorStyleMaracas( contourWRP->getControler() );
 
                contourWRP->getControler()->SetActive( control );       
                contourWRP->getControler()->SetEditable( false );               
@@ -418,15 +397,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                {
                        ContourWrap_ViewControl * contourWRP =   iter->second;
                        removeFromScene( contourWRP );  
-//EED Borrame
-//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-//fprintf(ff,"EED wxVtkBaseView_SceneManager :: removeFromScene Bbbbb \n" );
-//fprintf(ff,"    %d \n", _sceneContours_ViewControl->size() );
                        _sceneContours_ViewControl->erase(iter);
-               }
-//EED Borrame
-//fprintf(ff,"    %d \n", _sceneContours_ViewControl->size() );
-//fclose(ff);
+               }       
        }
 
 
@@ -447,10 +419,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager :: removeSceneContours( )
        {
-//EED Borrame
-//FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-//fprintf(ff,"EED wxVtkBaseView_SceneManager :: removeSceneContours  \n" );
-//fprintf(ff,"    %d \n", _sceneContours_ViewControl->size() );
                std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin(); 
                int size = _sceneContours_ViewControl->size();
                for ( int i = 0; i<size; i++ )
@@ -460,9 +428,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                }
                _sceneContours_ViewControl->clear();
 
-//EED Borrame
-//fprintf(ff,"    %d \n", _sceneContours_ViewControl->size() );
-//fclose(ff);
 
                //Removing the selection rectangle to avoid showing when it's innecesary
                _controlerSelectionROI->SetActive( false );             
@@ -517,7 +482,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
                if( control )
                {
-                       _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( contourWRP->getControler() );
+                       ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() );
                }
                if( ifActive )
                {
@@ -739,10 +704,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
        bool  wxVtkBaseView_SceneManager :: OnMouseMove()
        { 
-//EED Borrame
-// FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-// fprintf(ff,"EED wxVtkBaseView_SceneManager::OnMouseMove() \n" );
-// fclose(ff);
 
                bool condition = true;  
                int X,Y;
@@ -813,11 +774,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                        
                        if( ((_lastInteraction != NULL && !control->IsEditable() && !control->IsMoving() ) || _lastInteraction==NULL ))
                        {                                       
-//EED Borrame
-// FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-// fprintf(ff,"EED wxVtkBaseView_SceneManager::OnMouseMove() 00222\n" );
-// fclose(ff);
-                        _lastInteraction=NULL;
+
+                               _lastInteraction=NULL;
                                for( i =0; i<size ; i++ )
                                {
                                        control = iter->second->getControler();
@@ -865,12 +823,6 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        bool  wxVtkBaseView_SceneManager :: OnLeftButtonDown()
        { 
 
-               /*FILE *ff;
-               ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
-               long int endtime = clock();
-//             double sg = (double)(endtime-startTimeAE) / (double)CLK_TCK;
-               fprintf(ff,"wxVtkBaseView_SceneManager :: OnLeftButtonDown() tLBDown = %i \n  \n",endtime);
-               fclose(ff);*/
 
 
 //EED???               char aa = _vtkInteractorStyleBaseView->GetInteractor()->GetKeyCode();