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