2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
28 #include "vtkVectorsVisu.h"
30 #include "vtkProperty.h"
32 //------------------------------------------------------------------------------
33 vtkVectorsVisu::vtkVectorsVisu()
34 :vtkVectorsTensorsVisuBase()
36 _vtkarrowsource = vtkArrowSource::New();
37 _vtkglyph = vtkGlyph3D::New();
41 //------------------------------------------------------------------------------
42 vtkVectorsVisu::~vtkVectorsVisu()
46 //------------------------------------------------------------------------------
47 void vtkVectorsVisu::Process()
49 printf("EED vtkVectorsVisu::Process() start\n");
52 printf("EED vtkVectorsVisu::Process() 1\n");
53 _vtkglyph->SetInput( GetDataObject() );
54 printf("EED vtkVectorsVisu::Process() 2\n");
55 _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
56 printf("EED vtkVectorsVisu::Process() 3\n");
57 _vtkglyph->SetScaleModeToScaleByVector();
58 _vtkglyph->SetColorModeToColorByVector();
59 _vtkglyph->SetScaleFactor( GetScaleFactor() );
60 printf("EED vtkVectorsVisu::Process() 4\n");
62 printf("EED vtkVectorsVisu::Process() 5\n");
64 _pdm->SetInput( _vtkglyph->GetOutput());
65 printf("EED vtkVectorsVisu::Process() 5.1\n");
66 //EED _pdm->SetScalarRange( range );
67 //EED vtkPolyData *pd = vGlyphFlowPlane->GetOutput();
68 //EED vtkPointData *pointdata = pd->GetPointData();
69 //EED vtkDataArray *da = pointdata->GetVectors();
70 //EED vtkDataArray *nda = vtkFloatArray::New();
71 //EED nda->DeepCopy(da);
72 // pointdata->RemoveArray( "GlyphVector" );
73 // bbGetInputIn()->GetPointData()->RemoveArray( "GlyphVector" );
74 //EED pointdata->AddArray( nda );
75 //EED bbGetInputIn()->GetPointData()->AddArray( nda );
76 //EED2 _pdm->ScalarVisibilityOn();
77 printf("EED vtkVectorsVisu::Process() 6\n");
78 _pdm->SetScalarModeToUsePointFieldData();
80 _pdm->SetLookupTable( _LutEED );
81 printf("EED vtkVectorsVisu::Process() 7\n");
82 _pdm->SelectColorArray( "GlyphVector" );
84 // vSliceMapperVec->SetLookupTable( vGreenToRedLut );
85 // vSliceMapperVec->SetColorModeToMapScalars();
87 _actor->SetMapper( _pdm );
88 printf("EED vtkVectorsVisu::Process() 8\n");
89 _actor->GetProperty()->SetOpacity( GetOpacity() );
90 printf ("EED vtkVectorsVisu::Process opacity:%f\n",GetOpacity() );
93 printf("EED vtkVectorsVisu::Process() 9\n");
95 printf("EED vtkVectorsVisu::Process() end\n");