Salome HOME
21bc030581cdc44aa9b25007723a3972dc800d3e
[modules/visu.git] / src / CONVERTOR / VISU_GaussMergeFilter.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 //  SALOME VTKViewer : build VTK viewer into Salome desktop
23 //  File   : 
24 //  Author : 
25 //  Module : SALOME
26 //  $Header$
27 //
28 #ifndef VISU_GaussMergeFilter_H
29 #define VISU_GaussMergeFilter_H
30
31 #include "VISU_Convertor.hxx"
32
33 //#include <vtkDataSetAlgorithm.h>
34 #include <vtkPointSetAlgorithm.h>
35
36 namespace VISU
37 {
38   class TFieldList;
39 }
40
41
42 //------------------------------------------------------------------------------
43 class VISU_CONVERTOR_EXPORT VISU_GaussMergeFilter : public vtkPointSetAlgorithm
44 {
45 public:
46   static VISU_GaussMergeFilter *New();
47   vtkTypeMacro(VISU_GaussMergeFilter, vtkPointSetAlgorithm);
48
49   // Description:
50   // Specify object from which to extract geometry information.
51   void SetGeometry(vtkDataSet *input);
52   vtkDataSet *GetGeometry();
53
54   // Description:
55   // Specify object from which to extract scalar information.
56   void SetScalars(vtkDataSet *);
57   vtkDataSet *GetScalars();
58
59   // Description:
60   // Set / get the object from which to extract vector information.
61   void SetVectors(vtkDataSet *);
62   vtkDataSet *GetVectors();
63
64   // Description:
65   // Set / get the object from which to extract normal information.
66   void SetNormals(vtkDataSet *);
67   vtkDataSet *GetNormals();
68   
69   // Description:
70   // Set / get the object from which to extract texture coordinates
71   // information.
72   void SetTCoords(vtkDataSet *);
73   vtkDataSet *GetTCoords();
74
75   // Description:
76   // Set / get the object from which to extract tensor data.
77   void SetTensors(vtkDataSet *);
78   vtkDataSet *GetTensors();
79
80   // Description:
81   // Set the object from which to extract a field and the name
82   // of the field
83   void AddField(const char* name, vtkDataSet* input);
84
85   // Description:
86   // Removes all previously added fields
87   void RemoveFields();
88
89   // Description:
90   // Defines whether to perform merging of data with the geometry according to
91   // the ids of the cell or not
92   void
93   SetMergingInputs(bool theIsMergingInputs);
94   
95   bool
96   IsMergingInputs();
97
98   void 
99   SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper);
100
101   const VISU::PGaussPtsIDMapper&  
102   GetGaussPtsIDMapper();
103   
104 protected:
105   VISU_GaussMergeFilter();
106   ~VISU_GaussMergeFilter();
107
108   virtual
109   int
110   RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
111
112   int
113   RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
114
115   int
116   FillInputPortInformation(int port, vtkInformation *info);
117
118   int
119   FillOutputPortInformation(int port, vtkInformation *info);
120
121   VISU::TFieldList* FieldList;
122   bool myIsMergingInputs;
123
124   VISU::PGaussPtsIDMapper myGaussPtsIDMapper;
125
126   bool
127   ExecuteGauss(vtkUnstructuredGrid* theInput,
128                vtkPolyData*         theOutput);
129   
130 private:
131   VISU_GaussMergeFilter(const VISU_GaussMergeFilter&);  // Not implemented.
132   void operator=(const VISU_GaussMergeFilter&);  // Not implemented.
133 };
134
135 #endif
136
137