]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkMagnitud.cxx
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
[bbtk.git] / packages / vtk / src / bbvtkMagnitud.cxx
index b2b3794a0f4c8f0b3e206e751a6e9466cb7aa6a1..c0e21cedf3bc6f2d4775e38226cfcf4f7733c410 100644 (file)
@@ -1,4 +1,31 @@
-//===== 
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Santé)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+//=====
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 #include "bbvtkMagnitud.h"
@@ -26,29 +53,60 @@ void Magnitud::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
-// ---------- [
+// ---------- 
+ if (bbGetInputIn()!=NULL) {
    vGreenToRedLut->SetHueRange(0.6667,0.0);
    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
@@ -56,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;
@@ -68,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();
@@ -81,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);
@@ -164,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);
@@ -175,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);
@@ -200,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);
@@ -218,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 ();
@@ -229,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 );
    
@@ -257,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 );
    
@@ -314,8 +460,13 @@ void Magnitud::Process()
    //temp->GetData( vMultipleContourMapper->GetOutput() );
    //bbSetOutputOutTest( temp );
 
-// ---------- ]  
-}
+
+ } // if
+
+} // process
+
+
+
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //=====