X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsVtkGUIEditorGraphic%2FvtkGPortView.cxx;h=40e9478051cc50b9554afee148347d130c6375fb;hb=f6286f6851a4c0757cbacbee679d31bcc5a933bd;hp=6cf1839fdd013e9b9f6db0b275db93b7e0bf2765;hpb=50851761f4216d932217db8e8fe56dd5aac6b0fb;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx index 6cf1839..40e9478 100644 --- a/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx +++ b/lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx @@ -67,7 +67,10 @@ namespace bbtk _pts->SetPoint(0, xInic, yInic, zInic ); _pts->SetPoint(1, mid, yFin, zInic ); _pts->SetPoint(2, xFin, yInic, zFin ); + + _fillPolyMapper->Modified(); + //----------- setRefreshWaiting(); } @@ -76,11 +79,6 @@ namespace bbtk void vtkGPortView::createVtkObjects() //virtual { _pts = vtkPoints::New(); - vtkCellArray *lines = vtkCellArray::New(); - vtkPolyData *_pd = vtkPolyData::New(); - vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New(); - _objectBorderActor=vtkActor::New(); - _pts->SetNumberOfPoints(3); double xInic, yInic,zInic,xFin, yFin,zFin; @@ -92,21 +90,37 @@ namespace bbtk double mid = (xInic+xFin)/2; - _pts->SetPoint(0, xInic, yInic, zInic ); +//EED _pts->SetPoint(0, xInic, yInic, zInic ); +//EED _pts->SetPoint(1, mid, yFin, zInic ); +//EED _pts->SetPoint(2, xFin, yInic, zFin ); + + _pts->SetPoint(0, -1000, -1000, -1000 ); _pts->SetPoint(1, mid, yFin, zInic ); - _pts->SetPoint(2, xFin, yInic, zFin ); - - lines->InsertNextCell(4); - lines->InsertCellPoint(0); - lines->InsertCellPoint(1); - lines->InsertCellPoint(2); - lines->InsertCellPoint(0); + _pts->SetPoint(2, 1000, 1000, 1000 ); + + + ///************************* 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); - _pd->SetPoints( _pts ); - _pd->SetLines( lines ); + pdFill->SetPoints( _pts ); + pdFill->SetStrips( strip ); - _bboxMapper->SetInput(_pd); - _objectBorderActor->SetMapper(_bboxMapper); + _fillPolyMapper->SetInput(pdFill); + _fillObjectActor->SetMapper(_fillPolyMapper); + _fillPolyMapper->Modified(); + + ///************************* FILL ************************* updateColors(); @@ -117,15 +131,23 @@ namespace bbtk void vtkGPortView::updateColors() { - _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B); + _fillObjectActor->GetProperty()->SetColor(0.45,0.45,0.45); if(_state==HIGHLIGHTED) { - _objectBorderActor->GetProperty()->SetColor(0.8,0.2,0.5); - } - else - { - _objectBorderActor->GetProperty()->SetColor(0.3,0.2,0.2); + _fillObjectActor->GetProperty()->SetColor( 0 , 0 , 1 ); + } else { + GPortModel* portm = (GPortModel*)_model; + if(portm->isConnected()) + { + _fillObjectActor->GetProperty()->SetColor(0.15,0.15,0.15); + } + else if(portm->isValueSet()) + { + _fillObjectActor->GetProperty()->SetColor(0.55,0.25,0.25); + } else { + _fillObjectActor->GetProperty()->SetColor(0.45,0.45,0.45); + } } }