From 61a38c679e47c9f102d2834c835c3c6eac487a9b Mon Sep 17 00:00:00 2001 From: davila <> Date: Thu, 23 Sep 2010 07:18:00 +0000 Subject: [PATCH] no message --- .../bbsKernelEditorGraphic/GlobalConstants.h | 9 +++ .../wxVtkSceneManager.cxx | 63 ++++++++++++++++--- .../bbsWxGUIEditorGraphic/wxVtkSceneManager.h | 9 ++- 3 files changed, 71 insertions(+), 10 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h index 1982207..ce7fbc8 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h @@ -133,6 +133,15 @@ namespace bbtk //Object Text colors + + const double PORTFILL_NH_R = 0.20; + const double PORTFILL_NH_G = 0.20; + const double PORTFILL_NH_B = 0.20; + + const double PORTTEXT_NH_R = 1.0; + const double PORTTEXT_NH_G = 1.0; + const double PORTTEXT_NH_B = 0.0; + const double BOXTEXT_NH_R = 0.25; const double BOXTEXT_NH_G = 0.0; const double BOXTEXT_NH_B = 0.0; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index 2570305..a2cd1dc 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -104,11 +104,48 @@ 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( "" ); + _textActor->GetTextProperty()->SetFontSize(80); + _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(); + _pts = vtkPoints::New(); + + _pts->SetNumberOfPoints(4); + _pts->SetPoint(0, xInic , yInic , zInic ); + _pts->SetPoint(1, xInic+50 , yInic , zInic ); + _pts->SetPoint(2, xInic+50 , yInic+50 , zInic ); + _pts->SetPoint(3, xInic , yInic+50 , zInic ); + strip->InsertNextCell(5); + strip->InsertCellPoint(0); + strip->InsertCellPoint(1); + strip->InsertCellPoint(2); + strip->InsertCellPoint(0); + strip->InsertCellPoint(3); + pdFill->SetPoints( _pts ); + pdFill->SetStrips( strip ); + _fillPolyMapper->SetInput(pdFill); + _fillObjectActor->SetMapper(_fillPolyMapper); + _fillObjectActor->GetProperty()->SetColor(PORTFILL_NH_R,PORTFILL_NH_G,PORTFILL_NH_B); + _fillPolyMapper->Modified(); + + _baseView->GetRenderer()->AddActor( _fillObjectActor ); } //========================================================================= @@ -399,7 +436,7 @@ namespace bbtk model->notifyObservers(_idManager); - int newId = addObjectController(controller); + addObjectController(controller); return (GPortController*)controller; } @@ -669,11 +706,20 @@ namespace bbtk } // if GBLACKBOX if(type==GPORT) { + // PortText okPortMessage = true; _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; + _pts->SetPoint(0, px , py , 900+1 ); + _pts->SetPoint(1, px+100, py , 900+1 ); + _pts->SetPoint(2, px+100, py+10 , 900+1 ); + _pts->SetPoint(3, px , py+10 , 900+1 ); + _fillPolyMapper->Modified(); + } // if GPORT } // for controllers it @@ -2131,8 +2177,7 @@ namespace bbtk { int ID = cont->getId(); mapSelected[ID]=cont; - } - + } } } return mapSelected; @@ -2180,7 +2225,7 @@ namespace bbtk } - for(int i = 0 ;i #include #include +#include +#include #include +#include + //Includes std #include @@ -219,7 +223,10 @@ namespace bbtk int _contLastId; - vtkTextActor3D *_textActor; + vtkTextActor3D *_textActor; + vtkPoints *_pts; + vtkActor *_fillObjectActor; + vtkPolyDataMapper *_fillPolyMapper; protected: -- 2.45.1