_pts->SetPoint(1, mid, yFin, zInic );
_pts->SetPoint(2, xFin, yInic, zFin );
- _borderObjectActor->Modified();
+ _fillPolyMapper->Modified();
+ //-----------
setRefreshWaiting();
}
void vtkGPortView::createVtkObjects() //virtual
{
_pts = vtkPoints::New();
- vtkCellArray *lines = vtkCellArray::New();
- vtkPolyData *_pd = vtkPolyData::New();
- _borderPolyMapper=vtkPolyDataMapper::New();
- _borderObjectActor=vtkActor::New();
-
_pts->SetNumberOfPoints(3);
double xInic, yInic,zInic,xFin, yFin,zFin;
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 );
- _borderPolyMapper->SetInput(_pd);
- _borderObjectActor->SetMapper(_borderPolyMapper);
- _borderObjectActor->Modified();
+ _fillPolyMapper->SetInput(pdFill);
+ _fillObjectActor->SetMapper(_fillPolyMapper);
+ _fillPolyMapper->Modified();
+
+ ///************************* FILL *************************
updateColors();
void vtkGPortView::updateColors()
{
- _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
+ _fillObjectActor->GetProperty()->SetColor(0.45,0.45,0.45);
if(_state==HIGHLIGHTED)
{
- _borderObjectActor->GetProperty()->SetColor(0.8,0.2,0.5);
- }
- else
- {
- _borderObjectActor->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);
+ }
}
}