+ updateColors( ) ;
+
+ double xInic , yInic , zInic , xFin , yFin , zFin ;
+ _model->getInicPoint( xInic , yInic , zInic ) ;
+ _model->getFinalPoint( xFin , yFin , zFin ) ;
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
+ double mid = ( xInic + xFin ) / 2 ;
+ _pts->SetPoint( 0 , xInic , yInic , zInic ) ;
+ _pts->SetPoint( 1 , mid , yFin , zInic ) ;
+ _pts->SetPoint( 2 , xFin , yInic , zFin ) ;
+ _fillPolyMapper->Modified( ) ;
+ //-----------
+ setRefreshWaiting( ) ;
+ }
+
+ //=========================================================================
+
+ void vtkGPortView::createVtkObjects( ) //virtual
+ {
+
+ double xInic , yInic , zInic , xFin , yFin , zFin ;
+
+ _model->getInicPoint( xInic , yInic , zInic ) ;
+ _model->getFinalPoint( xFin , yFin , zFin ) ;
+
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
+
+ double mid = ( xInic + xFin ) / 2 ;
+
+ //EED _pts->SetPoint(0, xInic, yInic, zInic );
+ //EED _pts->SetPoint(1, mid, yFin, zInic );
+ //EED _pts->SetPoint(2, xFin, yInic, zFin );
+
+ _pts = vtkPoints::New( ) ;
+ _pts->SetNumberOfPoints( 3 ) ;
+
+ _pts->SetPoint( 0 , -1000 , -1000 , -1000 ) ;
+ _pts->SetPoint( 1 , mid , yFin , zInic ) ;
+ _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=GPOSITION_Z
+
+ 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( ) {
+ _fillObjectActor->GetProperty( )->SetColor( 0.45 , 0.45 , 0.45 ) ;
+
+ if ( _state == POSSIBLE_CONNECTION ) {
+ _fillObjectActor->GetProperty( )->SetColor( 1 , 1 , 0 ) ;
+ } else if ( _state == SELECTED_POSSIBLE_CONNECTION ) {
+ _fillObjectActor->GetProperty( )->SetColor( 0 , 1 , 0 ) ;
+ } else if ( _state == HIGHLIGHTED ) {
+ _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 ) ;
+ }
+ }
+ }
+
+ //=========================================================================