]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
Organizing code, the state now is in the view and the general render was simplified...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / vtkGPortView.cxx
index adbe0caac36e9cfe2402ab37c80c1b18d7a8cbf3..42dcd2129435116f877e273e0821bc528510728a 100644 (file)
@@ -42,7 +42,7 @@ namespace bbtk
 
        //=========================================================================
        vtkGPortView::vtkGPortView()
-       {                       
+       {               
        }
 
        //=========================================================================
@@ -51,18 +51,10 @@ namespace bbtk
        }
 
        //=========================================================================
-       void vtkGPortView::update(int command)
+       void vtkGPortView::update(int idObservable,int command)
        {
-               _objectActor->GetProperty()->SetColor(0.8,0.2,0.5);
-               if(_model->getState()==HIGHLIGHTED)
-               {
-                       _objectActor->GetProperty()->SetColor(0.8,0.2,0.5);
-               }
-               else
-               {
-                       _objectActor->GetProperty()->SetColor(0.3,0.2,0.2);
-               }
-
+               updateColors();
+               
                double xInic, yInic,zInic,xFin, yFin,zFin;
 
                _model->getInicPoint(xInic,yInic,zInic);
@@ -74,10 +66,8 @@ namespace bbtk
                _pts->SetPoint(1, xInic, yFin, zInic );
                _pts->SetPoint(2, xFin, yFin, zFin );
                _pts->SetPoint(3, xFin, yInic, zFin );
-
-               //_baseView->GetRenderer()->Render();
-               //_baseView->GetRenWin()->Render();
-
+               
+               setRefreshWaiting();
        }
 
        //=========================================================================
@@ -116,8 +106,25 @@ namespace bbtk
                _bboxMapper->SetInput(_pd);
                _objectActor->SetMapper(_bboxMapper);
 
+               updateColors();
+
+
+       }
+
+       //=========================================================================
+
+       void vtkGPortView::updateColors()
+       {
                _objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
 
+               if(_state==HIGHLIGHTED)
+               {
+                       _objectActor->GetProperty()->SetColor(0.8,0.2,0.5);
+               }
+               else
+               {
+                       _objectActor->GetProperty()->SetColor(0.3,0.2,0.2);
+               }
        }
 
        //=========================================================================