]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
Ports updated when connected and the properties panel will be changed ...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsVtkGUIEditorGraphic / vtkGPortView.cxx
index a21ba849c2e44a5c14a7d58d977406ec16a066b4..97a89586b32ac5bbb75ecd7bba22a2c1ec7cff9e 100644 (file)
@@ -69,6 +69,7 @@ namespace bbtk
                _pts->SetPoint(2, xFin, yInic, zFin );
 
                _borderObjectActor->Modified();
+               _fillPolyMapper->Modified();
                
                setRefreshWaiting();
        }
@@ -109,7 +110,31 @@ namespace bbtk
 
                _borderPolyMapper->SetInput(_pd);
                _borderObjectActor->SetMapper(_borderPolyMapper);
-               _borderObjectActor->Modified();
+               _borderPolyMapper->Modified();
+
+               
+               ///************************* FILL *************************
+
+               vtkCellArray *strip = vtkCellArray::New();
+               vtkPolyData *pdFill = vtkPolyData::New();
+               _fillPolyMapper=vtkPolyDataMapper::New();
+               _fillObjectActor=vtkActor::New();
+
+               // RaC In the actual version, zInic=zFin=900
+
+               strip->InsertNextCell(3);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(1);
+               strip->InsertCellPoint(2);
+                       
+               pdFill->SetPoints( _pts );
+               pdFill->SetStrips( strip );
+
+               _fillPolyMapper->SetInput(pdFill);
+               _fillObjectActor->SetMapper(_fillPolyMapper);
+               _fillPolyMapper->Modified();
+
+               ///************************* FILL *************************
 
                updateColors();
 
@@ -121,14 +146,25 @@ namespace bbtk
        void vtkGPortView::updateColors()
        {
                _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
+               _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
 
                if(_state==HIGHLIGHTED)
                {
-                       _borderObjectActor->GetProperty()->SetColor(0.8,0.2,0.5);
+                       _borderObjectActor->GetProperty()->SetColor(0.35,0.15,0.1);
+                       _fillObjectActor->GetProperty()->SetColor(0.8,0.8,0.8);
                }
                else
                {
-                       _borderObjectActor->GetProperty()->SetColor(0.3,0.2,0.2);
+                       GPortModel* portm = (GPortModel*)_model;
+                       _borderObjectActor->GetProperty()->SetColor(0.15,0.15,0.15);
+                       if(portm->isConnected())
+                       {
+                               _fillObjectActor->GetProperty()->SetColor(0.2,0.2,0.2);
+                       }
+                       else
+                       {
+                               _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+                       }
                }
        }