From: Eduardo DAVILA Date: Wed, 16 Aug 2017 13:38:00 +0000 (+0200) Subject: #3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ae7fdf94ccaa1c21be9e2d1a4775253a6ca08670;p=creaVtk.git #3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7 --- diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg index 5201ac5..54079e3 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbg # ---------------------------------- APP_START @@ -9,24 +9,24 @@ DESCRIPTION:Description ?? AUTHOR:Author ?? COMPLEXBOX:FALSE COMPLEXINPUTS:0 -BOXES:12 +BOXES:14 BOX creaVtk:PlaneWidget:Box00 ISEXEC:FALSE -76.705485:79.270049:-900.000000 --31.130485:69.270049:-900.000000 +-38.180485:69.270049:-900.000000 FIN_BOX BOX vtk:ProbeFilter:Box02 ISEXEC:FALSE -43.835869:45.416427:-900.000000 -1.739131:35.416427:-900.000000 +-7.435869:35.416427:-900.000000 FIN_BOX BOX creaMaracasVisu:ViewerNV:Box03 ISEXEC:FALSE 100.754389:107.101567:-900.000000 -161.394389:97.101567:-900.000000 +164.474389:97.101567:-900.000000 PORT nTypeView:"5" FIN_BOX @@ -34,7 +34,7 @@ BOX wx:LayoutSplit:Box05 ISEXEC:TRUE 97.322929:-128.251406:-900.000000 -142.897929:-138.251406:-900.000000 +136.402929:-138.251406:-900.000000 PORT Orientation:"H" FIN_BOX @@ -42,13 +42,13 @@ BOX vtk:LoadHola:Box09 ISEXEC:FALSE 142.671975:134.967207:-900.000000 -188.246975:124.967207:-900.000000 +178.221975:124.967207:-900.000000 FIN_BOX BOX vtk:StructuredPointsReader:Box10 ISEXEC:FALSE 77.497560:159.524340:-900.000000 -148.672560:149.524340:-900.000000 +126.197560:149.524340:-900.000000 PORT In:"/home/davila/Creatis/creaVtk/data/Vectors.vtk" FIN_BOX @@ -56,7 +56,7 @@ BOX creaVtk:VectorsVisu:Box12 ISEXEC:FALSE -27.687849:-11.740630:-900.000000 -17.887151:-21.740630:-900.000000 +9.937151:-21.740630:-900.000000 PORT Active:"true" PORT @@ -66,7 +66,7 @@ BOX vtk:UpdateRender:Box22 ISEXEC:FALSE 165.995379:-60.051937:-900.000000 -211.570379:-70.051937:-900.000000 +206.320379:-70.051937:-900.000000 PORT Active:"true" FIN_BOX @@ -74,13 +74,13 @@ BOX creaVtk:PlaneWidget_Interface:Box24 ISEXEC:FALSE -47.463465:136.171302:-900.000000 -23.711535:126.171302:-900.000000 +0.761535:126.171302:-900.000000 FIN_BOX BOX creaVtk:VectorsVisu_Interface:Box14 ISEXEC:FALSE -16.543876:28.960560:-900.000000 -54.631124:18.960560:-900.000000 +30.781124:18.960560:-900.000000 FIN_BOX BOX wx:LayoutLine:Box15 @@ -92,11 +92,25 @@ BOX std:MultipleInputs:Box16 ISEXEC:FALSE -70.786709:7.815093:-900.000000 --25.211709:-2.184907:-900.000000 +-31.086709:-2.184907:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX -CONNECTIONS:22 +BOX +std:Configuration:Box17 +ISEXEC:FALSE +92.222261:199.620337:-900.000000 +131.647261:189.620337:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box18 +ISEXEC:FALSE +92.611384:176.078367:-900.000000 +132.336384:166.078367:-900.000000 +PORT +In2:"/creaVtk/Vectors.vtk" +FIN_BOX +CONNECTIONS:24 CONNECTION Box03:Widget:Box05:Widget2 NumberOfControlPoints:0 @@ -163,4 +177,10 @@ NumberOfControlPoints:0 CONNECTION Box16:BoxChange:Box12:BoxExecute NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box17:DataPath:Box18:In1 +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs index 3b80981..7c5d8b4 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleProbeFilter.bbs # ---------------------------------- # BBTK GEditor Script @@ -18,37 +18,42 @@ author "Author ??" description "Description ??" category "" -new PlaneWidget Box00 +new creaVtk:PlaneWidget Box00 -new ProbeFilter Box02 +new vtk:ProbeFilter Box02 -new ViewerNV Box03 +new creaMaracasVisu:ViewerNV Box03 set Box03.nTypeView "5" -new LayoutSplit Box05 +new wx:LayoutSplit Box05 set Box05.Orientation "H" -new LoadHola Box09 +new vtk:LoadHola Box09 -new StructuredPointsReader Box10 +new vtk:StructuredPointsReader Box10 set Box10.In "/home/davila/Creatis/creaVtk/data/Vectors.vtk" -new VectorsVisu Box12 +new creaVtk:VectorsVisu Box12 set Box12.Active "true" set Box12.ScaleFactor "10" -new UpdateRender Box22 +new vtk:UpdateRender Box22 set Box22.Active "true" -new PlaneWidget_Interface Box24 +new creaVtk:PlaneWidget_Interface Box24 -new VectorsVisu_Interface Box14 +new creaVtk:VectorsVisu_Interface Box14 -new LayoutLine Box15 +new wx:LayoutLine Box15 -new MultipleInputs Box16 +new std:MultipleInputs Box16 set Box16.BoxProcessMode "Reactive" +new std:Configuration Box17 + +new std:ConcatStrings Box18 + set Box18.In2 "/creaVtk/Vectors.vtk" + connect Box03.Widget Box05.Widget2 @@ -94,6 +99,10 @@ connect Box14.boxChange Box16.In2 connect Box16.BoxChange Box12.BoxExecute +connect Box18.Out Box10.In + +connect Box17.DataPath Box18.In1 + # Complex input ports diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg index ef820d9..dd01e2b 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbg # ---------------------------------- APP_START @@ -9,12 +9,12 @@ DESCRIPTION:Description ?? AUTHOR:Author ?? COMPLEXBOX:FALSE COMPLEXINPUTS:0 -BOXES:8 +BOXES:11 BOX vtk:MaskPoint:Box01 ISEXEC:FALSE -92.837953:-22.712415:-900.000000 --47.262953:-32.712415:-900.000000 +-56.687953:-32.712415:-900.000000 PORT Ratio:"1" FIN_BOX @@ -22,7 +22,7 @@ BOX creaMaracasVisu:ViewerNV:Box03 ISEXEC:FALSE 27.598176:-3.687687:-900.000000 -88.238176:-13.687687:-900.000000 +91.318176:-13.687687:-900.000000 PORT nTypeView:"5" FIN_BOX @@ -30,7 +30,7 @@ BOX wx:CommandButton:Box04 ISEXEC:FALSE 0.713746:16.059283:-900.000000 -46.288746:6.059283:-900.000000 +43.488746:6.059283:-900.000000 PORT Label:"Run" FIN_BOX @@ -38,27 +38,27 @@ BOX wx:LayoutSplit:Box05 ISEXEC:TRUE 20.586047:-67.968368:-900.000000 -66.161047:-77.968368:-900.000000 +59.666047:-77.968368:-900.000000 PORT Proportion:"10" FIN_BOX BOX wx:FileSelector:Box06 ISEXEC:FALSE --79.676950:57.942181:-900.000000 --34.101950:47.942181:-900.000000 +-78.601104:56.059450:-900.000000 +-41.226104:46.059450:-900.000000 FIN_BOX BOX vtk:LoadHola:Box07 ISEXEC:FALSE 68.757525:22.245082:-900.000000 -114.332525:12.245082:-900.000000 +104.307525:12.245082:-900.000000 FIN_BOX BOX vtk:StructuredPointsReader:Box08 ISEXEC:FALSE -77.679349:22.958827:-900.000000 --6.504349:12.958827:-900.000000 +-28.979349:12.958827:-900.000000 PORT In:"/home/davila/Creatis/creaVtk/data/Tensors.vtk" FIN_BOX @@ -66,13 +66,33 @@ BOX creaVtk:TensorsVisu:Box09 ISEXEC:FALSE -72.890772:-52.601588:-900.000000 --27.315772:-62.601588:-900.000000 +-35.615772:-62.601588:-900.000000 PORT Active:"true" PORT ScaleFactor:"1000" FIN_BOX -CONNECTIONS:7 +BOX +std:Configuration:Box10 +ISEXEC:FALSE +-22.323806:72.216167:-900.000000 +17.101194:62.216167:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box11 +ISEXEC:FALSE +-29.585767:55.002630:-900.000000 +10.139233:45.002630:-900.000000 +PORT +In3:"/creaVtk/Tensors.vtk" +FIN_BOX +BOX +wx:OutputText:Box12 +ISEXEC:TRUE +-12.103268:34.561555:-900.000000 +24.671732:24.561555:-900.000000 +FIN_BOX +CONNECTIONS:10 CONNECTION Box03:Widget:Box05:Widget2 NumberOfControlPoints:0 @@ -94,4 +114,13 @@ NumberOfControlPoints:0 CONNECTION Box03:Renderer1:Box09:Renderer NumberOfControlPoints:0 +CONNECTION +Box10:DataPath:Box11:In1 +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box08:In +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box12:In +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs index 07e26f3..3118f90 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleTensorsVisu.bbs # ---------------------------------- # BBTK GEditor Script @@ -12,34 +12,42 @@ include vtk include creaMaracasVisu include wx include creaVtk +include std author "Author ??" description "Description ??" category "" -new MaskPoint Box01 +new vtk:MaskPoint Box01 set Box01.Ratio "1" -new ViewerNV Box03 +new creaMaracasVisu:ViewerNV Box03 set Box03.nTypeView "5" -new CommandButton Box04 +new wx:CommandButton Box04 set Box04.Label "Run" -new LayoutSplit Box05 +new wx:LayoutSplit Box05 set Box05.Proportion "10" -new FileSelector Box06 +new wx:FileSelector Box06 -new LoadHola Box07 +new vtk:LoadHola Box07 -new StructuredPointsReader Box08 +new vtk:StructuredPointsReader Box08 set Box08.In "/home/davila/Creatis/creaVtk/data/Tensors.vtk" -new TensorsVisu Box09 +new creaVtk:TensorsVisu Box09 set Box09.Active "true" set Box09.ScaleFactor "1000" +new std:Configuration Box10 + +new std:ConcatStrings Box11 + set Box11.In3 "/creaVtk/Tensors.vtk" + +new wx:OutputText Box12 + connect Box03.Widget Box05.Widget2 @@ -55,7 +63,14 @@ connect Box04.BoxChange Box09.BoxExecute connect Box03.Renderer1 Box09.Renderer +connect Box10.DataPath Box11.In1 + +connect Box11.Out Box08.In + +connect Box11.Out Box12.In + # Complex input ports exec Box05 +exec Box12 diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx index d05e1a7..15c8e5c 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx @@ -38,7 +38,9 @@ printf("EED TensorsVisu::Process() Start\n"); tensorsvisu.SetOpacity( bbGetInputOpacity() ); tensorsvisu.SetRenderer( bbGetInputRenderer() ); tensorsvisu.SetTypeForm( bbGetInputTypeForm() ); +printf("EED TensorsVisu::Process() 1\n"); tensorsvisu.Process(); +printf("EED TensorsVisu::Process() 2\n"); bbSetOutputOut( tensorsvisu.GetProp3D() ); printf("EED TensorsVisu::Process() End\n"); diff --git a/lib/creaVtk/vtkTensorsVisu.cpp b/lib/creaVtk/vtkTensorsVisu.cpp index f1a73ec..81bcef7 100644 --- a/lib/creaVtk/vtkTensorsVisu.cpp +++ b/lib/creaVtk/vtkTensorsVisu.cpp @@ -35,12 +35,12 @@ vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase() { ss = vtkSphereSource::New(); - superquadratic = vtkSuperquadricSource::New(); + superquadratic = vtkSuperquadricSource::New(); cs = vtkCubeSource::New(); tg = vtkTensorGlyph::New(); - pdn = vtkPolyDataNormals::New(); + pdn = vtkPolyDataNormals::New(); pd = vtkPolyData::New(); - pod = vtkPointData::New(); + pod = vtkPointData::New(); } //------------------------------------------------------------------------ @@ -52,6 +52,7 @@ vtkTensorsVisu::~vtkTensorsVisu() //------------------------------------------------------------------------ void vtkTensorsVisu::Process() { +printf("EED vtkTensorsVisu::Process() start\n"); if (_active==true) { if(GetTypeForm()==2) // source superquadratic @@ -86,6 +87,9 @@ void vtkTensorsVisu::Process() // tg->SetScaling(25); tg->SetScaleFactor( GetScaleFactor() ); +printf("EED vtkTensorsVisu::Process() 1\n"); + + //The normals are needed to generate the right colors and if // not used some of the glyphs are black. //EED 2017-01-01 Migration VTK7 @@ -93,16 +97,30 @@ void vtkTensorsVisu::Process() pdn->SetInput(tg->GetOutput()); _pdm->SetInput( pdn->GetOutput() ); #else +printf("EED vtkTensorsVisu::Process() 1.1\n"); pdn->SetInputData(tg->GetOutput()); +printf("EED vtkTensorsVisu::Process() 1.2\n"); _pdm->SetInputData( pdn->GetOutput() ); + _pdm->Update(); #endif +printf("EED vtkTensorsVisu::Process() 1.3\n"); _actor->SetMapper( _pdm ); +printf("EED vtkTensorsVisu::Process() 1.4\n"); _actor->GetProperty()->SetOpacity( GetOpacity() ); + + + +printf("EED vtkTensorsVisu::Process() 1.5\n"); tg->SetColorModeToEigenvalues(); // tg->SetColorModeToScalars(); +printf("EED vtkTensorsVisu::Process() 1.6\n"); tg->Update(); +printf("EED vtkTensorsVisu::Process() 1.7\n"); + + + //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 pd = tg->GetOutput(); @@ -113,7 +131,9 @@ void vtkTensorsVisu::Process() #endif pod = pd->GetPointData(); +printf("EED vtkTensorsVisu::Process() 1.8\n"); pod->Update(); +printf("EED vtkTensorsVisu::Process() 1.9\n"); tg->Update(); vtkPolyData *pd_pdn = pdn->GetOutput(); @@ -122,6 +142,7 @@ void vtkTensorsVisu::Process() vtkPolyData *pd_tg = tg->GetOutput(); vtkPointData *pointdata_tg = pd_tg->GetPointData(); +printf("EED vtkTensorsVisu::Process() 1.20\n"); vtkPolyData *pd_do = (vtkPolyData*)GetDataObject(); vtkPointData *pointdata_do = pd_do->GetPointData(); @@ -130,17 +151,25 @@ void vtkTensorsVisu::Process() vtkIdType numSourcePts; // vtkIdType numSourceCells; - vtkPoints *sourcePts = tg->GetSource()->GetPoints(); - numSourcePts = sourcePts->GetNumberOfPoints(); +printf("EED vtkTensorsVisu::Process() 1.22\n"); + vtkPoints *sourcePts = tg->GetSource()->GetPoints(); +printf("EED vtkTensorsVisu::Process() 1.23\n"); + + + numSourcePts = sourcePts->GetNumberOfPoints(); // numSourceCells = tg->GetSource()->GetNumberOfCells(); + +printf("EED vtkTensorsVisu::Process() 2\n"); + + vtkDataArray *tensorsArray = pointdata_do->GetArray("tensors"); if (tensorsArray) { vtkDoubleArray *newScalarArray = vtkDoubleArray::New(); newScalarArray->SetName( "NormalsEED" ); newScalarArray->SetNumberOfComponents(3); - int iNumPts,iNumSourcePts; + int iNumPts,iNumSourcePts; int iNormalsEED=0; double *normalValue; double sumEigenvalue,sumEigenvalue1,sumEigenvalue2,sumEigenvalue3; @@ -149,9 +178,9 @@ void vtkTensorsVisu::Process() for (iNumPts=0;iNumPtsGetTuple9(iNumPts); - sumEigenvalue1 = sqrt (normalValue[0]*normalValue[0] + normalValue[1]*normalValue[1] + normalValue[2]*normalValue[2]); - sumEigenvalue2 = sqrt (normalValue[3]*normalValue[3] + normalValue[4]*normalValue[4] + normalValue[5]*normalValue[5]); - sumEigenvalue3 = sqrt (normalValue[6]*normalValue[6] + normalValue[7]*normalValue[7] + normalValue[8]*normalValue[8]); + sumEigenvalue1 = sqrt (normalValue[0]*normalValue[0] + normalValue[1]*normalValue[1] + normalValue[2]*normalValue[2]); + sumEigenvalue2 = sqrt (normalValue[3]*normalValue[3] + normalValue[4]*normalValue[4] + normalValue[5]*normalValue[5]); + sumEigenvalue3 = sqrt (normalValue[6]*normalValue[6] + normalValue[7]*normalValue[7] + normalValue[8]*normalValue[8]); if ((sumEigenvalue1>=sumEigenvalue2) && (sumEigenvalue1>=sumEigenvalue3)) { @@ -181,6 +210,8 @@ void vtkTensorsVisu::Process() } // for iNumSourcePts } // for iNumPts + + pointdata_tg->RemoveArray( "NormalsEED" ); pointdata_tg->AddArray( newScalarArray ); // pointdata_pdn->Update(); @@ -189,6 +220,10 @@ void vtkTensorsVisu::Process() + + +printf("EED vtkTensorsVisu::Process() 3\n"); + _pdm->ScalarVisibilityOn(); _pdm->SetColorModeToMapScalars(); //_pdm->SetColorModeToDefault(); @@ -202,6 +237,12 @@ void vtkTensorsVisu::Process() _pdm->SetLookupTable( _LutEED ); _pdm->SelectColorArray( "NormalsEED" ); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + //... +#else + _pdm->Update(); +#endif /* int i,sizeDa = pointdata_tg->GetNumberOfArrays(); @@ -217,8 +258,12 @@ void vtkTensorsVisu::Process() } // _active +printf("EED vtkTensorsVisu::Process() 4\n"); VisibilityActor(); +printf("EED vtkTensorsVisu::Process() END\n"); + + } diff --git a/lib/creaVtk/vtkTensorsVisu.h b/lib/creaVtk/vtkTensorsVisu.h index 8f1f135..162521c 100644 --- a/lib/creaVtk/vtkTensorsVisu.h +++ b/lib/creaVtk/vtkTensorsVisu.h @@ -69,13 +69,13 @@ protected: //--------------------------------------------- private: - vtkSmartPointer ss; + vtkSmartPointer ss; vtkSmartPointer superquadratic; - vtkSmartPointer cs; - vtkSmartPointer tg; + vtkSmartPointer cs; + vtkSmartPointer tg; vtkSmartPointer pdn; - vtkSmartPointer pd; - vtkSmartPointer pod; + vtkSmartPointer pd; + vtkSmartPointer pod; }; //-end of _VTKTENSORSVISU_H_------------------------------------------------------ diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp index ee7fc49..0322efc 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp @@ -196,13 +196,13 @@ void vtkLookupTableDirectionVector::PrintSelf(ostream& os, vtkIndent indent) vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() { - _firsttime = true; - _active = false; - _scalefactor= 1; + _firsttime = true; + _active = false; + _scalefactor = 1; _opacity = 1; - _dataobject = NULL; - _renderer = NULL; - _typeForm = 0; + _dataobject = NULL; + _renderer = NULL; + _typeForm = 0; _LutEED = vtkLookupTableDirectionVector::New(); // _LutEED->SetVectorMode(0); @@ -210,7 +210,7 @@ vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() //_LutEED->SetVectorModeToComponent(); _LutEED->SetVectorModeToRGBColors(); - _pdm = vtkPolyDataMapper::New(); + _pdm = vtkPolyDataMapper::New(); _actor = vtkActor::New(); _actorAdded = false; } diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.h b/lib/creaVtk/vtkVectorsTensorsVisuBase.h index c1e7b75..1c9ba9e 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.h +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.h @@ -140,7 +140,7 @@ protected: //Methods and attributes only visible by this class //--------------------------------------------- private: - bool _actorAdded; + bool _actorAdded; double _scalefactor; double _opacity; @@ -150,13 +150,13 @@ private: protected: - bool _firsttime; + bool _firsttime; bool _active; - vtkSmartPointer _pdm; - vtkSmartPointer _actor; - vtkLookupTableDirectionVector *_LutEED; - int _colorlaw; + vtkSmartPointer _pdm; + vtkSmartPointer _actor; + vtkLookupTableDirectionVector *_LutEED; + int _colorlaw; double _colorR,_colorG,_colorB; }; diff --git a/lib/creaVtk/vtkVectorsVisu.cpp b/lib/creaVtk/vtkVectorsVisu.cpp index 92c3df4..416a426 100644 --- a/lib/creaVtk/vtkVectorsVisu.cpp +++ b/lib/creaVtk/vtkVectorsVisu.cpp @@ -37,7 +37,7 @@ vtkVectorsVisu::vtkVectorsVisu() :vtkVectorsTensorsVisuBase() { - _vtkarrowsource = vtkArrowSource::New(); + _vtkarrowsource = vtkArrowSource::New(); _vtklinesource = vtkLineSource::New(); _vtkglyph = vtkGlyph3D::New(); } @@ -51,6 +51,8 @@ vtkVectorsVisu::~vtkVectorsVisu() //------------------------------------------------------------------------------ void vtkVectorsVisu::Process() { +printf("EED vtkVectorsVisu::Process Start\n"); + if(_active==true) { #if VTK_MAJOR_VERSION <= 5 @@ -77,7 +79,10 @@ void vtkVectorsVisu::Process() _vtkglyph->SetScaleModeToScaleByVector(); _vtkglyph->SetColorModeToColorByVector(); _vtkglyph->SetScaleFactor( GetScaleFactor() ); - _vtkglyph->Update(); +printf("EED vtkVectorsVisu::Process A\n" ); + + + _vtkglyph->Update(); #if VTK_MAJOR_VERSION <= 5 _pdm->SetInput( _vtkglyph->GetOutput()); @@ -136,11 +141,17 @@ for (i=0;iSetLookupTable( vGreenToRedLut ); // vSliceMapperVec->SetColorModeToMapScalars(); +#if VTK_MAJOR_VERSION <= 5 + // .. +#else + _pdm->Update(); +#endif _actor->SetMapper( _pdm ); _actor->GetProperty()->SetOpacity( GetOpacity() ); }// if _active VisibilityActor(); +printf("EED vtkVectorsVisu::Process END\n"); }