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 #ifndef _VTKVECTORSTENSORSVISUBASE_H_
29 #define _VTKVECTORSTENSORSVISUBASE_H_
32 #include "vtkLookupTable.h"
33 #include "vtkPolyDataMapper.h"
34 #include "vtkRenderer.h"
35 #include "vtkSmartPointer.h"
36 #include "vtkVectorNorm.h"
38 //---------------------------------------------
39 // Class Name: vtkVectorsTensorsVisuBase
41 //---------------------------------------------
43 class /*VTK_COMMON_EXPORT*/ vtkLookupTableDirectionVector : public vtkScalarsToColors
47 // Construct with range=[0,1]; and hsv ranges set up for rainbow color table
48 // (from red to blue).
49 static vtkLookupTableDirectionVector *New();
51 vtkTypeMacro(vtkLookupTableDirectionVector,vtkScalarsToColors);
52 void PrintSelf(ostream& os, vtkIndent indent);
54 double *GetRange() { return this->GetTableRange(); };
55 void SetRange(double min, double max) { this->SetTableRange(min, max); };
56 void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); };
58 void SetTableRange(double r[2]);
59 virtual void SetTableRange(double min, double max);
60 vtkGetVectorMacro(TableRange,double,2);
62 unsigned char *MapValue(double v);
64 void GetColor(double x, double rgb[3]);
66 void MapScalarsThroughTable2(void *input, unsigned char *output,
67 int inputDataType, int numberOfValues,
68 int inputIncrement, int outputIncrement);
72 vtkLookupTableDirectionVector(int sze=256, int ext=256);
73 ~vtkLookupTableDirectionVector();
76 vtkLookupTableDirectionVector(const vtkLookupTableDirectionVector&); // Not implemented.
77 void operator=(const vtkLookupTableDirectionVector&); // Not implemented.
81 class vtkVectorsTensorsVisuBase
84 //---------------------------------------------
85 //Methods and attributes exposed to other classes
86 //---------------------------------------------
88 vtkVectorsTensorsVisuBase();
89 ~vtkVectorsTensorsVisuBase();
92 void SetDataObject(vtkDataObject*);
93 void SetRenderer(vtkRenderer *);
94 void SetScaleFactor(double);
95 void SetOpacity(double);
96 void SetTypeForm(int);
97 void SetColorLaw(int);
98 void SetColor(std::vector<double>);
99 void SetOrientation(int orientation);
100 void SetExternalLut(vtkScalarsToColors* lut);
103 vtkDataObject* GetDataObject();
104 vtkRenderer* GetRenderer();
105 double GetScaleFactor();
107 vtkProp3D* GetProp3D();
109 int GetOrientation();
111 virtual void Process();
112 void VisibilityActor();
116 //---------------------------------------------
117 //Methods and attributes exposed only to classes
118 //that are derived from this class
119 //---------------------------------------------
122 //---------------------------------------------
123 //Methods and attributes only visible by this class
124 //---------------------------------------------
129 vtkDataObject *_dataobject;
130 vtkRenderer *_renderer;
137 vtkSmartPointer<vtkPolyDataMapper> _pdm;
138 vtkSmartPointer<vtkActor> _actor;
139 vtkLookupTableDirectionVector *_LutEED;
140 vtkScalarsToColors *_externalLut; // lookuptable
143 double _colorR,_colorG,_colorB;
146 //-end of _VTKVECTORSTENSORSVISUBASE_H_------------------------------------------------------