]> Creatis software - creaContours.git/commitdiff
initialisation bug
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Thu, 10 Feb 2011 14:19:10 +0000 (14:19 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Thu, 10 Feb 2011 14:19:10 +0000 (14:19 +0000)
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx

index 0189493190fe812c3197d0f74bf5d57d8a5a7de5..daa8a32088f58c2ebfe9e2b0524d1097dd0b5f88 100644 (file)
@@ -40,7 +40,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
        wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
        {
-               SetWidthContour(1.0);
+               
                _lastInteraction                                = NULL;
                _lastInteractionName                            = "";
                _eventHandler                                   = theEventHandler;
@@ -57,7 +57,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _waiting                                        = false;
                _creatingROI                                    = false;
                _drawingSelectionROI                            = false;
-
+               SetWidthContour(1.0);
                
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
@@ -241,6 +241,10 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        ContourWrap_ViewControl * wxVtkBaseView_SceneManager :: insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour  * manViewerContour )
        {       
                ContourWrap_ViewControl * newContourWrap = new ContourWrap_ViewControl(manContourControl, manViewerContour);
+               if(_contours_ViewControl == NULL)
+               {
+                       _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
+               }
                _contours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, newContourWrap ));
                return newContourWrap;
        } 
@@ -1187,7 +1191,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                manualViewBaseContour           *cViewer;
                ContourWrap_ViewControl         *conwraviwcont;
                std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
-
+       
                if (_contours_ViewControl!=NULL)
                {
                        for (iter=_contours_ViewControl->begin(); iter!=_contours_ViewControl->end(); iter++ )