Salome HOME
Update copyrights 2014.
[modules/paravis.git] / src / Plugins / ElevationSurface / vtkElevationSurfaceFilter.h
1 // Copyright (C) 2010-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _vtkElevationSurfaceFilter_h
21 #define _vtkElevationSurfaceFilter_h
22
23 #include "vtkAlgorithm.h"
24
25 class vtkPolyData;
26
27 class VTK_EXPORT vtkElevationSurfaceFilter: public vtkAlgorithm
28 {
29 public:
30   static vtkElevationSurfaceFilter *New();
31   vtkTypeMacro(vtkElevationSurfaceFilter,vtkAlgorithm);
32   void PrintSelf(ostream& os, vtkIndent indent);
33
34   // Description :
35   // This is the factor applied to shrink the cell before extracting
36   // the Elevation points.
37   // A value of 0 shrinks the cells to their center, and a value of 1
38   // do not shrink the cell at all.
39   // default value 0.5
40   vtkSetMacro(ScaleFactor,double);
41   vtkGetMacro(ScaleFactor,double);
42
43   // Description:
44   // Set the direction of the deformation
45   vtkSetVector3Macro(Direction, double);
46   vtkGetVector3Macro(Direction, double);
47
48   // Description:
49   // If this flag is != 0, the filter will attempt detect automatically the
50   // direction of the normal of the input.
51   // The direction is given by the sum of the normals of all input polygons.
52   // If there is no input poly, or if the sum is 0, it will revert to the
53   // Direction ivar
54   vtkBooleanMacro(AutoDetectDirection, int);
55   vtkSetMacro(AutoDetectDirection, int);
56   vtkGetMacro(AutoDetectDirection, int);
57
58 protected:
59   vtkElevationSurfaceFilter();
60   ~vtkElevationSurfaceFilter();
61
62   int FillInputPortInformation(int , vtkInformation* );
63   int FillOutputPortInformation(int , vtkInformation* );
64
65   int ProcessRequest(vtkInformation* ,
66                       vtkInformationVector** ,
67                       vtkInformationVector* );
68
69
70   int RequestData(vtkInformation *,
71                   vtkInformationVector **,
72                   vtkInformationVector *);
73
74   int RequestInformation(vtkInformation *,
75                          vtkInformationVector **,
76                          vtkInformationVector *);
77
78   int RequestUpdateExtent(vtkInformation* ,
79                           vtkInformationVector**,
80                           vtkInformationVector*);
81
82   virtual void  ComputeDirection(vtkPolyData*, double *outDir);
83
84   double ScaleFactor;
85   double Direction[3];
86   int AutoDetectDirection;
87
88 private:
89   vtkElevationSurfaceFilter(const vtkElevationSurfaceFilter&);
90   void operator =(const vtkElevationSurfaceFilter&);
91 };
92 #endif