From: davila <> Date: Thu, 23 Sep 2010 16:35:58 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v1_0_0~36 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e9ab2c3abb5398388f62fcb9414df85be0eb37d8;p=bbtkGEditor.git *** empty log message *** --- diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h index ce7fbc8..63f718b 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h @@ -61,8 +61,8 @@ namespace bbtk // Object dimensions const double BOX_HEIGHT = 10; const double BOX_WIDTH = 100; - const double PORT_HEIGHT = 2.8; - const double PORT_WIDTH = 2.8; + const double PORT_HEIGHT = 3.8; + const double PORT_WIDTH = 3.8; const double COMPLEXPORT_HEIGHT = 6; const double COMPLEXPORT_WIDTH = 6; @@ -134,9 +134,9 @@ 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 PORTFILL_NH_R = 0.50; + const double PORTFILL_NH_G = 0.50; + const double PORTFILL_NH_B = 0.50; const double PORTTEXT_NH_R = 1.0; const double PORTTEXT_NH_G = 1.0; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index a2cd1dc..5c8e210 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -36,6 +36,10 @@ Version: $Revision$ #include "wxVtkSceneManager.h" + #include + #include + + namespace bbtk { @@ -108,7 +112,7 @@ namespace bbtk _textActor = vtkTextActor3D::New(); _textActor->SetPosition( -9999 , -9999 , 900 ); _textActor->SetInput( "" ); - _textActor->GetTextProperty()->SetFontSize(80); + _textActor->GetTextProperty()->SetFontSize(40); _textActor->GetTextProperty()->BoldOn(); _textActor->GetTextProperty()->SetColor(PORTTEXT_NH_R,PORTTEXT_NH_G,PORTTEXT_NH_B); @@ -121,18 +125,30 @@ namespace bbtk 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(); - - _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); +//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); @@ -141,11 +157,35 @@ namespace bbtk pdFill->SetPoints( _pts ); pdFill->SetStrips( strip ); _fillPolyMapper->SetInput(pdFill); - _fillObjectActor->SetMapper(_fillPolyMapper); +*/ + +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); - _fillPolyMapper->Modified(); + _aPolygonMapper->Modified(); _baseView->GetRenderer()->AddActor( _fillObjectActor ); +printf ("EED wxVtkSceneManager::configureBaseView fin...\n"); } //========================================================================= @@ -708,24 +748,32 @@ namespace bbtk { // PortText okPortMessage = true; + py=py+5; _textActor->SetInput( desc->getStatusText().c_str() ); _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(); - + 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(""); @@ -734,6 +782,7 @@ namespace bbtk if (okPortMessage==false) { _textActor->SetScale(0.0001); + _fillObjectActor->SetScale(0.0001); } @@ -1592,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(); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 612ec7e..e3bd1b1 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -77,7 +77,7 @@ Version: $Revision$ #include #include #include -#include + #include //Includes std @@ -226,7 +226,8 @@ namespace bbtk vtkTextActor3D *_textActor; vtkPoints *_pts; vtkActor *_fillObjectActor; - vtkPolyDataMapper *_fillPolyMapper; +//EED Borrame vtkPolyDataMapper *_fillPolyMapper; + vtkDataSetMapper *_aPolygonMapper; protected: