]> Creatis software - creaContours.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 2 Sep 2010 00:39:17 +0000 (00:39 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 2 Sep 2010 00:39:17 +0000 (00:39 +0000)
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.h

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){
index 2dafb31c8e49ccd3457bbfa0e1dec6b848ec40c8..93a2d866cb62a8b492ecc9eee2473cac4c5fec53 100644 (file)
@@ -209,9 +209,9 @@ private:
        
        std::map<std::string, ContourWrap_ViewControl *> * _contours_ViewControl;
        std::map<std::string, ContourWrap_ViewControl *> * _sceneContours_ViewControl;
-       wxVtkBaseView                   *_wxVtk_BaseView;
-       wxEvtHandler                    *_eventHandler;
-       ContourWrap_ViewControl *_lastInteraction;
+       wxVtkBaseView                           *_wxVtk_BaseView;
+       wxEvtHandler                            *_eventHandler;
+       ContourWrap_ViewControl                 *_lastInteraction;
        std::string                             _lastInteractionName;
        std::map<std::string, ContourWrap_ViewControl *> * _workingGroup;
        bool                                    _creatingMULT_ROI;
@@ -219,19 +219,20 @@ private:
        bool                                    _toIncludeAtInteractionGroup;
        bool                                    _waiting;
        bool                                    _creatingROI;
-       int                                             _enventID;
-       int                                             _leftClickCount;
-       int                                             _rigthClickCount;
-       int                                             clickX;
-       int                                             clickY;
+       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;
+       manualRoiControler                      *_controlerSelectionROI;
+       manualViewRoi                           *_viewerSelectionROI;
+       manualBaseModel                         *_modelSelectionROI;
        double                                  _widthOfContour;
+       double                                  _widthOfControlPoint;
 
        bool _ctrlKey;
        bool _shiftKey;