Salome HOME
62dfe0ee36cb1f03e161b8f6d8aa836406c86031
[modules/visu.git] / src / PIPELINE / VISU_FieldTransform.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_FieldTransform.hxx
24 //  Author : Alexey PETROV
25 //  Module : VISU
26 //
27 #ifndef VISU_FieldTransform_HeaderFile
28 #define VISU_FieldTransform_HeaderFile
29
30 #include <vtkDataSetAlgorithm.h>
31
32 #include "VISUPipeline.hxx"
33
34 class VTKViewer_Transform;
35
36 class VISU_PIPELINE_EXPORT VISU_FieldTransform : public vtkDataSetAlgorithm
37 {
38 public:
39   vtkTypeMacro(VISU_FieldTransform, vtkDataSetAlgorithm);
40
41   static 
42   VISU_FieldTransform
43   *New();
44
45   virtual
46   unsigned long 
47   GetMTime();
48   
49   static
50   double
51   Ident(double theArg);
52
53   static
54   double
55   Log10(double theArg);
56
57   typedef double (*TTransformFun)(double);
58
59   void
60   SetScalarTransform(TTransformFun theFunction);
61
62   TTransformFun
63   GetScalarTransform() 
64   {
65     return myFunction;
66   }
67
68   void
69   SetSpaceTransform(VTKViewer_Transform* theTransform);
70
71   VTKViewer_Transform* 
72   GetSpaceTransform() 
73   {
74     return myTransform;
75   }
76
77   vtkFloatingPointType* 
78   GetScalarRange()
79   {
80     return myScalarRange; 
81   }
82   
83   void
84   SetScalarRange(vtkFloatingPointType theScalarRange[2]);
85
86   void
87   SetScalarMin(vtkFloatingPointType theValue);
88
89   void
90   SetScalarMax(vtkFloatingPointType theValue);
91
92 protected:
93   VISU_FieldTransform();
94
95   virtual
96   ~VISU_FieldTransform();
97
98   virtual
99   int
100   RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
101
102   VTKViewer_Transform *myTransform;
103   TTransformFun myFunction;
104   vtkFloatingPointType myScalarRange[2];
105   
106 private:
107   VISU_FieldTransform(const VISU_FieldTransform&);
108   void operator=(const VISU_FieldTransform&);
109 };
110
111 #endif