X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaVtk%2FvtkTensorsVisu.cpp;h=f1a73ec92eb835c40dd4697fd3f583a5ce349131;hb=ef9f90810fcc3800acac54a104f14ff505135fd3;hp=7d451f31699b4025d4f1f5f652de92e14f49bd51;hpb=757629f8d0ef2c660febc7f1ce734021559a3763;p=creaVtk.git diff --git a/lib/creaVtk/vtkTensorsVisu.cpp b/lib/creaVtk/vtkTensorsVisu.cpp index 7d451f3..f1a73ec 100644 --- a/lib/creaVtk/vtkTensorsVisu.cpp +++ b/lib/creaVtk/vtkTensorsVisu.cpp @@ -52,30 +52,50 @@ vtkTensorsVisu::~vtkTensorsVisu() //------------------------------------------------------------------------ void vtkTensorsVisu::Process() { -printf("EED vtkTensorsVisu::Process Start\n"); - if (_active==true) { if(GetTypeForm()==2) // source superquadratic { superquadratic->SetThetaResolution(20); superquadratic->SetPhiResolution(20); +#if VTK_MAJOR_VERSION <= 5 tg->SetSource(superquadratic->GetOutput()); +#else + tg->SetSourceData(superquadratic->GetOutput()); +#endif } else if(GetTypeForm()==1) { // source sphere +#if VTK_MAJOR_VERSION <= 5 tg->SetSource(ss->GetOutput()); +#else + tg->SetSourceData(ss->GetOutput()); +#endif } else { // source cube +#if VTK_MAJOR_VERSION <= 5 tg->SetSource(cs->GetOutput()); +#else + tg->SetSourceData(cs->GetOutput()); +#endif } +#if VTK_MAJOR_VERSION <= 5 tg->SetInput( GetDataObject() ); +#else + tg->SetInputData( GetDataObject() ); +#endif // tg->ScalingOn(); // tg->SetScaling(25); tg->SetScaleFactor( GetScaleFactor() ); //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 +#if VTK_MAJOR_VERSION <= 5 pdn->SetInput(tg->GetOutput()); _pdm->SetInput( pdn->GetOutput() ); +#else + pdn->SetInputData(tg->GetOutput()); + _pdm->SetInputData( pdn->GetOutput() ); +#endif _actor->SetMapper( _pdm ); _actor->GetProperty()->SetOpacity( GetOpacity() ); @@ -83,8 +103,15 @@ printf("EED vtkTensorsVisu::Process Start\n"); // tg->SetColorModeToScalars(); tg->Update(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 pd = tg->GetOutput(); pd->Update(); +#else + tg->Update(); + pd = tg->GetOutput(); +#endif + pod = pd->GetPointData(); pod->Update(); @@ -121,7 +148,7 @@ printf("EED vtkTensorsVisu::Process Start\n"); int idEigen; for (iNumPts=0;iNumPtsGetTuple9(iNumPts); + normalValue = tensorsArray->GetTuple9(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]); @@ -193,6 +220,5 @@ printf("EED vtkTensorsVisu::Process Start\n"); VisibilityActor(); -printf("EED vtkTensorsVisu::Process End.\n"); }