X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkMagnitud.cxx;h=c0e21cedf3bc6f2d4775e38226cfcf4f7733c410;hb=d19c5512748aa8e2dd5c3d01d9ec680ded1f17ce;hp=db2fdecf6c50d6ae5e944b7a4bfbd09030adf7ad;hpb=088ed2b7bdbe14eb85a7245afaa693ddb7a53a97;p=bbtk.git diff --git a/packages/vtk/src/bbvtkMagnitud.cxx b/packages/vtk/src/bbvtkMagnitud.cxx index db2fdec..c0e21ce 100644 --- a/packages/vtk/src/bbvtkMagnitud.cxx +++ b/packages/vtk/src/bbvtkMagnitud.cxx @@ -59,24 +59,54 @@ void Magnitud::Process() vGreenToRedLut->Build(); //Input Data +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vVecMagnitude->SetInput(bbGetInputIn()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vVecMagnitude->SetInputData(bbGetInputIn()); +#endif + vVecMagnitude->NormalizeOff(); vVecMagnitude->Update(); vVecMagnitude->GetOutput()->GetScalarRange( range1 ); vVecMagnitude->Update(); //Glyph +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vMaskPoint->SetInput(bbGetInputIn()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vMaskPoint->SetInputData(bbGetInputIn()); +#endif + vMaskPoint->SetOnRatio(100); vMaskPoint->Update(); vMaskPoint->RandomModeOn(); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vGlyph->SetInput(vMaskPoint->GetOutput()); vGlyph->SetSource(cone->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vGlyph->SetInputData(vMaskPoint->GetOutput()); + vGlyph->SetSourceData(cone->GetOutput()); +#endif + vGlyph->SetScaleModeToScaleByVector(); vGlyph->SetColorModeToColorByVector(); vGlyph->SetScaleFactor(0.20); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vGlyphMapper->SetInput( vGlyph->GetOutput() ); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vGlyphMapper->SetInputData( vGlyph->GetOutput() ); +#endif + step = (range1[1]-range1[0])/10; //Contour @@ -84,7 +114,13 @@ void Magnitud::Process() dRangeColorForMultipleContourVelocity[1]=1; dRangeColorForGlyphVelocity[0]=0; dRangeColorForGlyphVelocity[1]=1; +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vMultipleContourVelocity->SetInput((vtkDataSet *) vVecMagnitude->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vMultipleContourVelocity->SetInputData((vtkDataSet *) vVecMagnitude->GetOutput()); +#endif index = 0; double h; @@ -96,7 +132,14 @@ void Magnitud::Process() index+=1; } +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vMultipleContourMapper->SetInput( vMultipleContourVelocity->GetOutput() ); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vMultipleContourMapper->SetInputData( vMultipleContourVelocity->GetOutput() ); +#endif + vMultipleContourMapper->SetScalarRange( range1 ); vMultipleContourMapper->SetLookupTable( vGreenToRedLut ); vMultipleContourMapper->Update(); @@ -109,8 +152,16 @@ void Magnitud::Process() vGlyphMapper->ImmediateModeRenderingOn(); //Outline Grid +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vOutlineGrid->SetInput( bbGetInputIn() ); vOutlineMapper->SetInput(vOutlineGrid->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vOutlineGrid->SetInputData( bbGetInputIn() ); + vOutlineMapper->SetInputData(vOutlineGrid->GetOutput()); +#endif + //Outline Grid Actor vOutlineActor->SetMapper(vOutlineMapper); @@ -192,7 +243,13 @@ void Magnitud::Process() //End: Change values by the user /////////////////////////////////////////////////////////////////////////////////////////////////// //The Plane Widget +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vPlaneWidget->SetInput(bbGetInputIn()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vPlaneWidget->SetInputData(bbGetInputIn()); +#endif vPlaneWidget->NormalToXAxisOn(); vPlaneWidget->NormalToZAxisOn(); vPlaneWidget->SetResolution(1); @@ -203,7 +260,7 @@ void Magnitud::Process() vPlaneWidget->On(); vPlaneWidget->GetOrigin(p0); - vPlaneWidget->GetCenter(c); //These is from Execute Method + vPlaneWidget->GetCenter(c); //These is fromvtkImageMathematics Execute Method vPlaneWidget->GetNormal(n); vPlaneWidget->GetPoint1(p1); vPlaneWidget->GetPoint2(p2); @@ -228,7 +285,14 @@ void Magnitud::Process() vDiskSourceEED->SetCircumferentialResolution (20); //Stream Lines +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vPointWidget->SetInput( bbGetInputIn() ); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vPointWidget->SetInputData( bbGetInputIn() ); +#endif + vPointWidget->AllOff(); vPointWidget->PlaceWidget(); //vPointWidget->SetInteractor(vIren); @@ -246,8 +310,16 @@ void Magnitud::Process() source->SetCenter( c ); source->SetRadius(5.0); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) streamer->SetInput( bbGetInputIn() ); streamer->SetSource(source->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + streamer->SetInputData( bbGetInputIn() ); + streamer->SetSourceData(source->GetOutput()); +#endif + streamer->SetIntegratorTypeToRungeKutta45(); streamer->SetMaximumPropagation(500000); //EED streamer->SetMaximumPropagationUnitToTimeUnit (); @@ -257,13 +329,28 @@ void Magnitud::Process() //EED streamer->ComputeVorticityOn (); streamer->Update(); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) rf->SetInput(streamer->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + rf->SetInputData(streamer->GetOutput()); +#endif + rf->SetRadius(.5); rf->SetNumberOfSides(12); rf->SetVaryRadiusToVaryRadiusOff(); streamer->GetOutput()->GetScalarRange( range ); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) streamMapper2->SetInput(rf->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + streamMapper2->SetInputData(rf->GetOutput()); +#endif + streamMapper2->SetLookupTable(vGreenToRedLut); //vStreamlineActor2->SetMapper( streamMapper2 ); @@ -285,31 +372,62 @@ void Magnitud::Process() //End: Part of the Execute Method ////////////////////////////////////////////////////////////////////////////////////// - vtransformpolydatafilter->SetInput( vDiskSourceEED->GetOutput() ); vtransformpolydatafilter->SetTransform( transformEED ); - vtransformpolydatafilter->Update(); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + vtransformpolydatafilter->SetInput( vDiskSourceEED->GetOutput() ); vProbeslices->SetInput( ( vtkDataSet* )vtransformpolydatafilter->GetOutput()); vProbeslices->SetSource( bbGetInputIn() ); - vProbeslices->Update( ); - vGlyphFlowPlane->SetInput(vProbeslices->GetOutput()); vGlyphFlowPlane->SetSource(vArrowSource->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vtransformpolydatafilter->SetInputData( vDiskSourceEED->GetOutput() ); + vProbeslices->SetInputData( ( vtkDataSet* )vtransformpolydatafilter->GetOutput()); + vProbeslices->SetSourceData( bbGetInputIn() ); + vGlyphFlowPlane->SetInputData(vProbeslices->GetOutput()); + vGlyphFlowPlane->SetSourceData(vArrowSource->GetOutput()); +#endif + + vtransformpolydatafilter->Update(); + vProbeslices->Update( ); + + vGlyphFlowPlane->SetScaleModeToScaleByVector(); vGlyphFlowPlane->SetColorModeToColorByVector(); vGlyphFlowPlane->SetScaleFactor(0.2); vGlyphFlowPlane->Update(); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vProbeslicesFlowWidget->SetInput( ( vtkDataSet* )vPlanSource->GetOutput()); vProbeslicesFlowWidget->SetSource( vVecMagnitude->GetOutput() ); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vProbeslicesFlowWidget->SetInputData( ( vtkDataSet* )vPlanSource->GetOutput()); + vProbeslicesFlowWidget->SetSourceData( vVecMagnitude->GetOutput() ); +#endif + vProbeslicesFlowWidget->Update( ); vVecMagnitude->GetOutput()->GetScalarRange( range ); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) vAppendDataForFlowWidgetVisualisation->AddInput(vGlyphFlowPlane->GetOutput()); vAppendDataForFlowWidgetVisualisation->AddInput(vProbeslicesFlowWidget->GetPolyDataOutput()); - vSliceMapper->SetInput( vAppendDataForFlowWidgetVisualisation->GetOutput()); +#endif +#if (VTK_MAJOR_VERSION >= 6) + vAppendDataForFlowWidgetVisualisation->AddInputData(vGlyphFlowPlane->GetOutput()); + vAppendDataForFlowWidgetVisualisation->AddInputData(vProbeslicesFlowWidget->GetPolyDataOutput()); + vSliceMapper->SetInputData( vAppendDataForFlowWidgetVisualisation->GetOutput()); +#endif + vSliceMapper->SetScalarRange( range ); vSliceMapper->SetLookupTable( vGreenToRedLut );