Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/gui.git] / src / VTKViewer / VTKViewer_AppendFilter.h
1 // Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA 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.
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 #ifndef VTKVIEWER_APPENDFILTER_H
20 #define VTKVIEWER_APPENDFILTER_H
21
22 #include "VTKViewer.h"
23
24 #include <vtkAppendFilter.h>
25 #include <vtkSmartPointer.h>
26
27 #include <vector>
28 #include <map>
29
30 class vtkPointSet;
31
32 #ifdef WIN32
33 #pragma warning ( disable:4251 )
34 #endif
35
36 /*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
37  */
38 class VTKVIEWER_EXPORT VTKViewer_AppendFilter : public vtkAppendFilter 
39 {
40 public:
41   /*! \fn static VTKViewer_AppendFilter *New()
42    */
43   static VTKViewer_AppendFilter *New();
44   
45   /*! \fn vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter)
46    *  \brief VTK type revision macros.
47    */
48   vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter);
49
50   void SetDoMappingFlag(const bool theFlag);
51
52   bool DoMappingFlag() const;
53
54   void
55   SetSharedPointsDataSet(vtkPointSet* thePointsDataSet);
56
57   vtkPointSet*
58   GetSharedPointsDataSet();
59
60   vtkIdType
61   GetPointOutputID(vtkIdType theInputID,
62                    vtkIdType theInputDataSetID);
63
64   vtkIdType
65   GetCellOutputID(vtkIdType theInputID,
66                   vtkIdType theInputDataSetID);
67
68   void 
69   GetPointInputID(vtkIdType theOutputID,
70                  vtkIdType& theInputID,
71                  vtkIdType& theStartID,
72                  vtkIdType& theInputDataSetID);
73
74   void
75   GetCellInputID(vtkIdType theOutputID,
76                  vtkIdType& theInputID,
77                  vtkIdType& theStartID,
78                  vtkIdType& theInputDataSetID);
79
80   typedef std::vector<vtkIdType> TVectorIds;
81
82 protected:
83   /*! \fn VTKViewer_AppendFilter();
84    * \brief Constructor
85    */
86   VTKViewer_AppendFilter();
87   /*! \fn ~VTKViewer_AppendFilter();
88    * \brief Destructor.
89    */
90   ~VTKViewer_AppendFilter();
91
92   // Usual data generation method
93   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
94
95   virtual int FillInputPortInformation(int port, vtkInformation *info);
96   
97   void DoMapping();
98
99   void Reset();
100
101   int MakeOutput(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
102
103   bool myDoMappingFlag;
104   TVectorIds myNodeRanges;
105   TVectorIds myCellRanges;
106   vtkSmartPointer<vtkPointSet> mySharedPointsDataSet;
107 };
108
109 #ifdef WIN32
110 #pragma warning ( default:4251 )
111 #endif
112
113 #endif