From a0405409d86ab041e72fd82d92d022bbb4caab19 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 21 Jun 2019 13:33:58 +0200 Subject: [PATCH] #3265 creaMaracasVisu Bug New Normal - DrawAxisTree3D box --- bbtk/bbs/appli/exampleDrawAxisTree3D.bbg | 64 ++++++++++++++++++++++++ bbtk/bbs/appli/exampleDrawAxisTree3D.bbs | 45 +++++++++++++++++ bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx | 11 ++-- 3 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 bbtk/bbs/appli/exampleDrawAxisTree3D.bbg create mode 100644 bbtk/bbs/appli/exampleDrawAxisTree3D.bbs diff --git a/bbtk/bbs/appli/exampleDrawAxisTree3D.bbg b/bbtk/bbs/appli/exampleDrawAxisTree3D.bbg new file mode 100644 index 0000000..b19f7d6 --- /dev/null +++ b/bbtk/bbs/appli/exampleDrawAxisTree3D.bbg @@ -0,0 +1,64 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleDrawAxisTree3D.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +creaMaracasVisu:DrawAxisTree3D:Box00 +ISEXEC:FALSE +-21.033945:-26.493137:-900.000000 +24.206055:-36.493137:-900.000000 +PORT +ColourLaw:"2" +PORT +LineWidth:"1" +PORT +Opacity:"1" +PORT +lstIndexs:"6 3 3" +PORT +lstPointX:"10 20 30 40 50 60 30 80 90 40 80 90" +PORT +lstPointY:"10 30 20 40 60 60 20 50 70 40 40 60" +PORT +lstPointZ:"10 20 30 40 50 60 30 45 53 40 80 90" +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +-32.915716:74.662477:-900.000000 +2.634284:64.662477:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:TRUE +-42.870713:32.594587:-900.000000 +20.849287:22.594587:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box03 +ISEXEC:FALSE +-32.273458:55.394741:-900.000000 +19.901542:45.394741:-900.000000 +FIN_BOX +CONNECTIONS:4 +CONNECTION +Box01:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box00:Renderer +NumberOfControlPoints:0 +CONNECTION +Box02:BoxChange:Box00:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleDrawAxisTree3D.bbs b/bbtk/bbs/appli/exampleDrawAxisTree3D.bbs new file mode 100644 index 0000000..d2339c2 --- /dev/null +++ b/bbtk/bbs/appli/exampleDrawAxisTree3D.bbs @@ -0,0 +1,45 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C8/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleDrawAxisTree3D.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include vtk + +author "Author ??" +description "Description ??" +category "" + +new creaMaracasVisu:DrawAxisTree3D Box00 + set Box00.ColourLaw "2" + set Box00.LineWidth "1" + set Box00.Opacity "1" + set Box00.lstIndexs "6 3 3" + set Box00.lstPointX "10 20 30 40 50 60 30 80 90 40 80 90" + set Box00.lstPointY "10 30 20 40 60 60 20 50 70 40 40 60" + set Box00.lstPointZ "10 20 30 40 50 60 30 45 53 40 80 90" + +new vtk:LoadHola Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new vtk:vtkImageDataPointerRelay Box03 + + +connect Box01.Out Box03.In + +connect Box03.Out Box02.In + +connect Box02.Renderer1 Box00.Renderer + +connect Box02.BoxChange Box00.BoxExecute + + + +# Complex input ports +exec Box02 diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx index 33bb1d7..f56b416 100644 --- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx @@ -54,6 +54,7 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis) polydatamapper->SetInput(polydata); #else polydatamapper->SetInputData(polydata); + polydatamapper->Update(); #endif vtkactor->SetMapper(polydatamapper); @@ -147,7 +148,6 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral); vtkactor->GetProperty()->SetColor( r,g,b ); } // Law 2 color for each segment - if (bbGetInputColourLaw()==3) // color for each point { // Setup the colors array @@ -171,7 +171,6 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral); } // Law 3 color for each point - vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() ); vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() ); @@ -185,18 +184,19 @@ polyline->GetPointIds()->InsertNextId(i-iGeneral); { bbGetInputRenderer()->AddActor( vtkactor ); } + } void DrawAxisTree3D::Process() { - printf("EED DrawAxisTree3D::Process start \n"); int iGeneral=0; int iAxis,sizeLstAxis=bbGetInputlstIndexs().size(); int iActor,sizeActors = vecVtkActors.size(); int numPoints; + // if (oldLstSize!=sizeLstAxis) // { // oldLstSize=sizeLstAxis; @@ -214,6 +214,7 @@ void DrawAxisTree3D::Process() vecVtkPolyDataMaper.clear(); vecVtkActors.clear(); + for ( iAxis=0 ; iAxisGetProperty()->SetOpacity( bbGetInputOpacity() ); @@ -242,8 +244,6 @@ void DrawAxisTree3D::Process() } // } // if oldLstSize - printf("EED DrawAxisTree3D::Process end \n"); - } void DrawAxisTree3D::bbUserSetDefaultValues() @@ -281,6 +281,7 @@ void DrawAxisTree3D::bbUserSetDefaultValues() bbSetInputOpacity(1); bbSetInputLineWidth(0.5); bbSetInputColourLaw(1); + bbSetInputTransform(NULL); } -- 2.47.1