]> Creatis software - creaVtk.git/blobdiff - lib/creaVtk/vtkVectorsVisu.cpp
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaVtk.git] / lib / creaVtk / vtkVectorsVisu.cpp
index 92c3df40293c4ceac6970204482ccad1dbd404da..184bd0f2a0e24dbbba38b29090e5e36d8261a84c 100644 (file)
 vtkVectorsVisu::vtkVectorsVisu()
   :vtkVectorsTensorsVisuBase()
 {
-       _vtkarrowsource = vtkArrowSource::New();
+       _vtkarrowsource         = vtkArrowSource::New();
        _vtklinesource          = vtkLineSource::New();
        _vtkglyph                       = vtkGlyph3D::New();
 }
 
-
 //------------------------------------------------------------------------------
 vtkVectorsVisu::~vtkVectorsVisu()
 {
 }
 
+
 //------------------------------------------------------------------------------
 void vtkVectorsVisu::Process()
 {
+
      if(_active==true)
      {
 #if VTK_MAJOR_VERSION <= 5
@@ -62,14 +63,16 @@ void vtkVectorsVisu::Process()
                        if(GetTypeForm()==1)                                                            // source Arrow
                        {
 #if VTK_MAJOR_VERSION <= 5
-                _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+                       _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
 #else
-                _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
+                               _vtkarrowsource->Update();
+                       _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
 #endif
                        } else {                                                                                                // source Line
 #if VTK_MAJOR_VERSION <= 5
                                _vtkglyph->SetSource( _vtklinesource->GetOutput() );    
 #else
+                               _vtklinesource->Update();
                                _vtkglyph->SetSourceData( _vtklinesource->GetOutput() );        
 #endif
                        }
@@ -77,7 +80,8 @@ void vtkVectorsVisu::Process()
          _vtkglyph->SetScaleModeToScaleByVector();
          _vtkglyph->SetColorModeToColorByVector();
          _vtkglyph->SetScaleFactor( GetScaleFactor() );
-         _vtkglyph->Update();
+
+               _vtkglyph->Update();
 
 #if VTK_MAJOR_VERSION <= 5
          _pdm->SetInput( _vtkglyph->GetOutput());
@@ -96,8 +100,6 @@ printf("EED vtkVectorsVisu::Process  sizeDa %d \n", sizeDa );
 for (i=0;i<sizeDa;i++)
 {
        printf("EED vtkVectorsVisu::Process-name %d, %s \n", i, data->GetArrayName(i) );
-       data->GetArray(i)->Print(std::cout);
-       printf("EED -------------------------------------------\n");
 }
 
 //EED         _pdm->SetScalarRange( range );
@@ -112,10 +114,6 @@ for (i=0;i<sizeDa;i++)
 //EED         bbGetInputIn()->GetPointData()->AddArray( nda );
 //EED2         _pdm->ScalarVisibilityOn();
 
-
-
-
-
        _pdm->ScalarVisibilityOn();
        _pdm->SetColorModeToMapScalars();
        //_pdm->SetColorModeToDefault();
@@ -127,8 +125,6 @@ for (i=0;i<sizeDa;i++)
        //_LutEED->SetVectorModeToRGBColors();
        //_LutEED->SetVectorModeToMagnitud();
 
-
-
 //         _pdm->SetScalarModeToUsePointFieldData();
          _pdm->SetLookupTable( _LutEED );
          _pdm->SelectColorArray( "GlyphVector" );
@@ -136,15 +132,15 @@ for (i=0;i<sizeDa;i++)
 //       vSliceMapperVec->SetLookupTable( vGreenToRedLut );
 //       vSliceMapperVec->SetColorModeToMapScalars();
 
+#if VTK_MAJOR_VERSION <= 5
+               // ..
+#else
+         _pdm->Update();
+#endif
          _actor->SetMapper( _pdm );
          _actor->GetProperty()->SetOpacity( GetOpacity() );
     }// if _active
 
     VisibilityActor(); 
 }
-       
-
-
-
-