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"
33 #include "vtkPointData.h"
36 //------------------------------------------------------------------------------
37 vtkVectorsVisu::vtkVectorsVisu()
38 :vtkVectorsTensorsVisuBase()
40 _vtkarrowsource = vtkArrowSource::New();
41 _vtklinesource = vtkLineSource::New();
42 _vtkglyph = vtkGlyph3D::New();
46 //------------------------------------------------------------------------------
47 vtkVectorsVisu::~vtkVectorsVisu()
51 //------------------------------------------------------------------------------
52 void vtkVectorsVisu::Process()
54 printf("EED vtkVectorsVisu::Process() start\n");
57 _vtkglyph->SetInput( GetDataObject() );
59 if(GetTypeForm()==1) // source Arrow
61 _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
62 } else { // source Line
63 _vtkglyph->SetSource( _vtklinesource->GetOutput() );
66 _vtkglyph->SetScaleModeToScaleByVector();
67 _vtkglyph->SetColorModeToColorByVector();
68 _vtkglyph->SetScaleFactor( GetScaleFactor() );
71 _pdm->SetInput( _vtkglyph->GetOutput());
73 vtkPointData *data = _vtkglyph->GetOutput()->GetPointData();
74 //printf("EED -------------------------------------------\n");
75 //_vtkglyph->GetOutput()->Print(std::cout);
76 //printf("EED -------------------------------------------\n");
77 //data->Print(std::cout);
78 printf("EED -------------------------------------------\n");
79 int i,sizeDa = data->GetNumberOfArrays();
80 printf("EED vtkVectorsVisu::Process sizeDa %d \n", sizeDa );
81 for (i=0;i<sizeDa;i++)
83 printf("EED vtkVectorsVisu::Process-name %d, %s \n", i, data->GetArrayName(i) );
84 data->GetArray(i)->Print(std::cout);
85 printf("EED -------------------------------------------\n");
88 //EED _pdm->SetScalarRange( range );
89 //EED vtkPolyData *pd = vGlyphFlowPlane->GetOutput();
90 //EED vtkPointData *pointdata = pd->GetPointData();
91 //EED vtkDataArray *da = pointdata->GetVectors();
92 //EED vtkDataArray *nda = vtkFloatArray::New();
93 //EED nda->DeepCopy(da);
94 // pointdata->RemoveArray( "GlyphVector" );
95 // bbGetInputIn()->GetPointData()->RemoveArray( "GlyphVector" );
96 //EED pointdata->AddArray( nda );
97 //EED bbGetInputIn()->GetPointData()->AddArray( nda );
98 //EED2 _pdm->ScalarVisibilityOn();
99 _pdm->SetScalarModeToUsePointFieldData();
100 _pdm->SetLookupTable( _LutEED );
101 _pdm->SelectColorArray( "GlyphVector" );
103 // vSliceMapperVec->SetLookupTable( vGreenToRedLut );
104 // vSliceMapperVec->SetColorModeToMapScalars();
106 _actor->SetMapper( _pdm );
107 _actor->GetProperty()->SetOpacity( GetOpacity() );
111 printf("EED vtkVectorsVisu::Process() end\n");