Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[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/
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 vtkPoints;
31
32 /*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
33  */
34 class VTKVIEWER_EXPORT VTKViewer_AppendFilter : public vtkAppendFilter 
35 {
36 public:
37   /*! \fn static VTKViewer_AppendFilter *New()
38    */
39   static VTKViewer_AppendFilter *New();
40   
41   /*! \fn vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter)
42    *  \brief VTK type revision macros.
43    */
44   vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter);
45
46   void SetDoMappingFlag(const bool theFlag);
47
48   bool DoMappingFlag() const;
49
50   void
51   SetPoints(vtkPoints* thePoints);
52
53   vtkPoints*
54   GetPoints();
55
56   vtkIdType
57   GetPointOutputID(vtkIdType theInputID,
58                    vtkIdType theInputDataSetID);
59
60   vtkIdType
61   GetCellOutputID(vtkIdType theInputID,
62                   vtkIdType theInputDataSetID);
63
64   void 
65   GetPointInputID(vtkIdType theOutputID,
66                  vtkIdType& theInputID,
67                  vtkIdType& theStartID,
68                  vtkIdType& theInputDataSetID);
69
70   void
71   GetCellInputID(vtkIdType theOutputID,
72                  vtkIdType& theInputID,
73                  vtkIdType& theStartID,
74                  vtkIdType& theInputDataSetID);
75
76   typedef std::vector<vtkIdType> TVectorIds;
77
78 protected:
79   /*! \fn VTKViewer_AppendFilter();
80    * \brief Constructor
81    */
82   VTKViewer_AppendFilter();
83   /*! \fn ~VTKViewer_AppendFilter();
84    * \brief Destructor.
85    */
86   ~VTKViewer_AppendFilter();
87   /*! \fn void Execute();
88    * \brief Filter culculation method.
89    */
90   virtual void Execute();
91   //
92   void DoMapping();
93
94   void Reset();
95
96   void MakeOutput();
97
98   bool myDoMappingFlag;
99   TVectorIds myNodeRanges;
100   TVectorIds myCellRanges;
101   vtkSmartPointer<vtkPoints> myPoints;
102 };
103
104 #endif