]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxVtkBaseView_SceneManager.cxx
index 128f1bca280b567bb6e3659a5756a728f0205189..0189493190fe812c3197d0f74bf5d57d8a5a7de5 100644 (file)
@@ -40,23 +40,23 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
 
        wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
        {
-               _widthOfContour                                 = 1.0;
+               SetWidthContour(1.0);
                _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;
+               _drawingSelectionROI                            = false;
 
                
                _wxVtk_BaseView = theWxBaseViewToManage;
@@ -195,7 +195,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                //Configuring the relations between the contour members representation                  
                manViewerContour->SetModel( manModelContour );
                manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
-               manViewerContour->SetRange( 0.5 );
+               manViewerContour->SetRange( _widthOfControlPoint );
                manViewerContour->SetZ( 1000 );
 
                manViewerContour->SetSpacing(spc);
@@ -1182,17 +1182,22 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
        //------------------------------------------------------------------------------------------------------------
        void wxVtkBaseView_SceneManager::SetWidthContour(double width)
        {
-               _widthOfContour = width;
+               _widthOfContour         = width;
+               _widthOfControlPoint    = _widthOfContour*_widthOfContour/2;
                manualViewBaseContour           *cViewer;
                ContourWrap_ViewControl         *conwraviwcont;
                std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
 
-               for (iter=_contours_ViewControl->begin(); iter!=_contours_ViewControl->end(); iter++ )
+               if (_contours_ViewControl!=NULL)
                {
-                       conwraviwcont   = iter->second;
-                       cViewer                 = conwraviwcont->getViewer();
-                       cViewer->SetWidthLine(_widthOfContour);
-               }
+                       for (iter=_contours_ViewControl->begin(); iter!=_contours_ViewControl->end(); iter++ )
+                       {
+                               conwraviwcont           = iter->second;
+                               cViewer                 = conwraviwcont->getViewer();
+                               cViewer->SetWidthLine( _widthOfContour );
+                               cViewer->SetRange( _widthOfControlPoint );
+                       } // for
+               } // if 
        }
 
        bool wxVtkBaseView_SceneManager::isEditableCControler(std::string theKeyName){