GConnectorModel::GConnectorModel()
{
- //_startPort = NULL;
- //_endPort = NULL;
+ _startPort = NULL;
+ _endPort = NULL;
}
//=========================================================================
void GConnectorModel::setStartPort(GPortModel* startPort)
{
_startPort = startPort;
+ startPort->setConnected(true);
double xCenter,yCenter,zCenter;
startPort->getCenter(xCenter,yCenter,zCenter);
void GConnectorModel::setEndPort(GPortModel* endPort)
{
_endPort = endPort;
+ endPort->setConnected(true);
double xCenter,yCenter,zCenter;
endPort->getCenter(xCenter,yCenter,zCenter);
_pts->SetPoint(2, xFin, yInic, zFin );
_borderObjectActor->Modified();
+ _fillPolyMapper->Modified();
setRefreshWaiting();
}
_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();
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);
+ }
}
}