]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
*** empty log message ***
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index 2570305265dc8684aef498aa173f121eb32b6f5c..5c8e2106dc569c61634e2ebbb6c1e4765d43ccc4 100644 (file)
@@ -36,6 +36,10 @@ Version:   $Revision$
 
 #include "wxVtkSceneManager.h"
 
+ #include <vtkPolygon.h>
+ #include <vtkUnstructuredGrid.h>
+
+
 namespace bbtk
 {
 
@@ -104,11 +108,84 @@ namespace bbtk
                _baseView->GetRenderer()->GradientBackgroundOff();
                _baseView->Refresh();
                
+               // Actos Port_Text 
                _textActor = vtkTextActor3D::New();
-               _textActor->SetPosition(  100 , 100 , 900 );
-               _textActor->SetInput( "Ups EED" );
+               _textActor->SetPosition(  -9999 , -9999 , 900 );
+               _textActor->SetInput( "<void>" );
+               _textActor->GetTextProperty()->SetFontSize(40);
+               _textActor->GetTextProperty()->BoldOn();
+               _textActor->GetTextProperty()->SetColor(PORTTEXT_NH_R,PORTTEXT_NH_G,PORTTEXT_NH_B);
+               
                _baseView->GetRenderer()->AddActor( _textActor );
                
+               
+               // Actor  Fill_Port_Text
+               
+               //------------
+               double                          xInic                           = 0;
+               double                          yInic                           = 0;
+               double                          zInic                           = 900;
+/*
+               vtkCellArray            *strip                          = vtkCellArray::New();
+               vtkPolyData                     *pdFill                         = vtkPolyData::New();
+               _fillObjectActor                                                = vtkActor::New();
+                                                       _fillPolyMapper         = vtkPolyDataMapper::New();
+*/
+printf ("EED wxVtkSceneManager::configureBaseView 1...\n");
+
+               vtkPolygon *aPolygon = vtkPolygon::New();
+               _fillObjectActor                                                = vtkActor::New();
+
+                                                       _pts                            = vtkPoints::New();     
+//ups4 EED Borrame
+               _pts->SetNumberOfPoints(7);
+               _pts->InsertPoint(0, xInic              , yInic         , zInic );
+               _pts->InsertPoint(1, xInic+50   , yInic         , zInic );
+               _pts->InsertPoint(2, xInic+50   , yInic+50      , zInic );
+               _pts->InsertPoint(3, xInic+25           , yInic+50      , zInic );
+               _pts->InsertPoint(4, xInic+20           , yInic+55      , zInic );
+               _pts->InsertPoint(5, xInic+15           , yInic+50      , zInic );
+               _pts->InsertPoint(6, xInic              , yInic+50      , zInic );
+
+/*
+               strip->InsertNextCell(8);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(1);
+               strip->InsertCellPoint(2);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(3);
+               pdFill->SetPoints( _pts );
+               pdFill->SetStrips( strip );
+               _fillPolyMapper->SetInput(pdFill);
+*/
+
+printf ("EED wxVtkSceneManager::configureBaseView 2...\n");
+
+               aPolygon->GetPointIds()->SetNumberOfIds(7);
+               aPolygon->GetPointIds()->SetId(0, 0);
+               aPolygon->GetPointIds()->SetId(1, 1);
+               aPolygon->GetPointIds()->SetId(2, 2);
+               aPolygon->GetPointIds()->SetId(3, 3);
+               aPolygon->GetPointIds()->SetId(4, 4);
+               aPolygon->GetPointIds()->SetId(5, 5);
+               aPolygon->GetPointIds()->SetId(6, 6);
+
+printf ("EED wxVtkSceneManager::configureBaseView 3...\n");
+
+               vtkUnstructuredGrid *aPolygonGrid = vtkUnstructuredGrid::New();
+               aPolygonGrid->Allocate(1, 1);
+               aPolygonGrid->InsertNextCell(aPolygon->GetCellType(), aPolygon->GetPointIds());
+               aPolygonGrid->SetPoints(_pts);
+printf ("EED wxVtkSceneManager::configureBaseView 4...\n");
+               _aPolygonMapper = vtkDataSetMapper::New();
+               _aPolygonMapper->SetInput(aPolygonGrid);
+               _fillObjectActor->SetMapper(_aPolygonMapper);
+printf ("EED wxVtkSceneManager::configureBaseView 5...\n");
+               _fillObjectActor->GetProperty()->SetColor(PORTFILL_NH_R,PORTFILL_NH_G,PORTFILL_NH_B);
+               _aPolygonMapper->Modified();
+
+               _baseView->GetRenderer()->AddActor( _fillObjectActor );         
+printf ("EED wxVtkSceneManager::configureBaseView fin...\n");
        }
 
        //=========================================================================
@@ -399,7 +476,7 @@ namespace bbtk
 
                model->notifyObservers(_idManager);
 
-               int newId = addObjectController(controller);
+               addObjectController(controller);
 
                return (GPortController*)controller;
        }
@@ -669,17 +746,34 @@ namespace bbtk
                                        } // if GBLACKBOX
                                        if(type==GPORT)
                                        {
+                                               // PortText
                                                okPortMessage   =       true;
+                                               py=py+5;
                                                _textActor->SetInput( desc->getStatusText().c_str() );
-                                               _textActor->SetScale(1);
-//ups1 EED
-                                               _textActor->SetPosition(  px ,py , pz+1 );
+                                               _textActor->SetScale(0.1);
+                                               _textActor->SetPosition(  px-25 ,py , pz+2 );
+                                               
+                                               // FillPortText
+                                               px=px-35;
+                                               py=py-2;
+/*
+                                               _pts->SetPoint(0, px            , py            , 900+1 );
+                                               _pts->SetPoint(1, px+150        , py            , 900+1 );
+                                               _pts->SetPoint(2, px+150        , py+7          , 900+1 );
+                                               _pts->SetPoint(3, px-150+40     , py+7          , 900+1 );
+                                               _pts->SetPoint(4, px-150+40-5   , py+7+5        , 900+1 );
+                                               _pts->SetPoint(5, px-150+40-10  , py+7          , 900+1 );
+                                               _pts->SetPoint(6, px            , py+7          , 900+1 );
+*/                                             
+                                               _fillObjectActor->SetScale(1);
+                                               _fillObjectActor->SetPosition(px,py,1);
+                                               _aPolygonMapper->Modified();
                                        } // if GPORT
 
                                } // for controllers it
                        } 
                }
-               
+//ups4 EED Borrame             
                if (okStatusMessage==false) 
                {
                        updateStatusBar("");
@@ -688,6 +782,7 @@ namespace bbtk
                if (okPortMessage==false) 
                {
                        _textActor->SetScale(0.0001);
+                       _fillObjectActor->SetScale(0.0001);
                }
                
 
@@ -1546,7 +1641,7 @@ namespace bbtk
 
                                        configGComBoxInputOutputPort(true, inputPortName,xIn,yIn,zIn);
 
-//ups 3 EED Borrame
+//ups3 EED Borrame
 //                                     int idInputPort = createGComplexBoxInputPort(inputPortName);
 //                                     GObjectController *cont = _controllers[idInputPort];
 //                                     GBoxModel *cbmod = (GBoxModel*)cont->getModel();
@@ -2131,8 +2226,7 @@ namespace bbtk
                                {                                       
                                        int ID = cont->getId();
                                        mapSelected[ID]=cont;
-                               }
-                               
+                               }                               
                        }
                }
                return mapSelected;
@@ -2180,7 +2274,7 @@ namespace bbtk
                        
                }
                
-               for(int i = 0 ;i<connections.size();i++)
+               for(int i = 0 ;i<(int)connections.size();i++)
                {
                        int objId = connections[i];
                        GObjectController *cont = objectsMap[objId];