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