0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IVtkTools / IVtkTools_SubPolyDataFilter.hxx
1 // Created on: 2011-10-27
2 // Created by: Roman KOZLOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS 
4 // 
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef IVtkTOOLS_SUBPOLYDATAFILTER_H
17 #define IVtkTOOLS_SUBPOLYDATAFILTER_H
18
19 #include <IVtkTools.hxx>
20
21 #include <Standard_WarningsDisable.hxx>
22 #include <vtkPolyDataAlgorithm.h>
23 #include <Standard_WarningsRestore.hxx>
24
25 #ifdef _MSC_VER
26 #pragma warning(push)
27 #pragma warning(disable: 4251) // avoid warning C4251: "class needs to have dll-interface..."
28 #endif
29
30 //! @class IVtkTools_SubPolyDataFilter 
31 //! @brief Cells filter according to the given set of cells ids.
32 class Standard_EXPORT IVtkTools_SubPolyDataFilter : public vtkPolyDataAlgorithm
33 {
34 public:
35   vtkTypeMacro(IVtkTools_SubPolyDataFilter,vtkPolyDataAlgorithm)
36
37   static IVtkTools_SubPolyDataFilter *New();
38   void PrintSelf (std::ostream& theOs, vtkIndent theIndent);
39
40   //! Set ids to be passed through this filter.
41   void SetData(const IVtk_IdTypeMap theSet);
42
43   //! Add ids to be passed through this filter.
44   void AddData(const IVtk_IdTypeMap theSet);
45
46   //! Set ids to be passed through this filter.
47   void SetData(const IVtk_ShapeIdList theIds);
48
49   //! Add ids to be passed through this filter.
50   void AddData(const IVtk_ShapeIdList theIds);
51
52   //! Clear ids set to be passed through this filter.
53   void Clear();
54
55   //! Set ids array name.
56   void SetIdsArrayName(const char* theArrayName);
57
58   void SetDoFiltering (const bool theDoFiltering);
59
60 protected:
61   //! @brief Filter cells according to the given set of ids.
62   //! Note: Data arrays are not passed through if filtering is turned on.
63   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) Standard_OVERRIDE;
64
65   IVtkTools_SubPolyDataFilter();
66   virtual ~IVtkTools_SubPolyDataFilter();
67
68 protected:
69   //! Set of ids to be passed through this filter.
70   IVtk_IdTypeMap myIdsSet;
71   const char*    myIdsArrayName;
72   bool           myDoFiltering;
73   bool           myToCopyNormals;
74 };
75
76 #ifdef _MSC_VER
77 #pragma warning(pop)
78 #endif
79
80 #endif // IVtkTOOLS_SUBPOLYDATAFILTER_H