Salome HOME
Copyright update 2021
[modules/paravis.git] / src / Plugins / ElevationSurface / plugin / ElevationSurfaceModule / vtkElevationSurfaceFilter.h
1 // Copyright (C) 2010-2021  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) override;
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() override;
61
62   int FillInputPortInformation(int, vtkInformation*) override;
63   int FillOutputPortInformation(int, vtkInformation*) override;
64
65   int ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
66
67   virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
68
69   virtual int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
70
71   virtual int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
72
73   virtual void ComputeDirection(vtkPolyData*, double* outDir);
74
75   double ScaleFactor;
76   double Direction[3];
77   int AutoDetectDirection;
78
79 private:
80   vtkElevationSurfaceFilter(const vtkElevationSurfaceFilter&) = delete;
81   void operator=(const vtkElevationSurfaceFilter&) = delete;
82 };
83 #endif