vtkCPInputDataDescription.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCPInputDataDescription.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #ifndef vtkCPInputDataDescription_h
16 #define vtkCPInputDataDescription_h
17 
18 class vtkDataObject;
19 class vtkDataSet;
20 class vtkFieldData;
21 class vtkSMSourceProxy;
22 
23 #include "vtkObject.h"
24 #include "vtkPVCatalystModule.h" // For windows import/export of shared libraries
25 
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
36  // Description:
37  // Reset the names of the fields that are needed.
38  void Reset();
39 
40  // Description:
41  // Add in a name of an array with name *fieldName* of type *type*
42  // where the values comes from vtkDataObject::AttributeTypes.
43  void AddField(const char* fieldName, int type);
44 
45  // Description:
46  // Get the number of fields currently specified in this object.
47  unsigned int GetNumberOfFields();
48 
49  // Description:
50  // Get the name of the field given its current index.
51  const char* GetFieldName(unsigned int fieldIndex);
52 
53  // Description:
54  // Get the type of field given its current index. The types are defined
55  // in vtkDataObject::AttributeTypes. A return value of -1 indicates an invalid
56  // fieldIndex.
57  int GetFieldType(unsigned int fieldIndex);
58 
59  // Description:
60  // Return true if a field with fieldName is needed.
61  bool IsFieldNeeded(const char* fieldName, int type);
62 
63  // Description:
64  // When set to true, all fields are requested. Off by default.
65  // Note that calling Reset() resets this flag to Off as well.
66  vtkSetMacro(AllFields, bool);
67  vtkGetMacro(AllFields, bool);
68  vtkBooleanMacro(AllFields, bool);
69 
70  // Description:
71  // Use this to enable the mesh. Off by default. Note that calling Reset()
72  // resets this flag to Off as well.
73  vtkSetMacro(GenerateMesh, bool);
74  vtkGetMacro(GenerateMesh, bool);
75  vtkBooleanMacro(GenerateMesh, bool);
76 
77  // Description:
78  // Set the grid input for coprocessing. The grid should have all of
79  // the point data and cell data properly set.
80  void SetGrid(vtkDataObject* grid);
81 
82  // Description:
83  // Get the grid for coprocessing.
84  vtkGetObjectMacro(Grid, vtkDataObject);
85 
86  // Description:
87  // Returns true if the grid is necessary..
88  bool GetIfGridIsNecessary();
89 
90  // Description:
91  // Set/get the extents for a partitioned topologically regular grid
92  // (i.e. vtkUniformGrid, vtkImageData, vtkRectilinearGrid, and
93  // vtkStructuredGrid).
94  vtkSetVector6Macro(WholeExtent, int);
95  vtkGetVector6Macro(WholeExtent, int);
96 
97  // Description:
98  // Shallow copy.
99  void ShallowCopy(vtkCPInputDataDescription*);
100 
101  // Description:
102  // Set the temporal cache. Adaptors can get a cache from the coprocessor
103  // object and apply them to the InputDataDescription when they want to
104  // use temporal filters in their pipelines.
105  void SetTemporalCache(vtkSMSourceProxy* cache);
106 
107  // Description:
108  // Get the temporal cache.
109  vtkGetObjectMacro(TemporalCache, vtkSMSourceProxy);
110 
111 protected:
113  ~vtkCPInputDataDescription() override;
114 
115  // Description:
116  // On when all fields must be requested for the coprocessing pipeline.
117  bool AllFields;
118 
119  // Description:
120  // On when the mesh should be generated.
122 
123  // Description:
124  // The grid for coprocessing. The grid is not owned by the object.
126 
127  // Description:
128  // The temporal cache associated with grid. The cache is not owned by the object.
130 
131 private:
133  void operator=(const vtkCPInputDataDescription&) = delete;
134 
135  class vtkInternals;
136  vtkInternals* Internals;
137  int WholeExtent[6];
138 };
139 
140 #endif
This class provides the data description for each input for the coprocessor pipelines.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
proxy for a VTK source on a server
#define VTKPVCATALYST_EXPORT
static vtkObject * New()
void operator=(const vtkObjectBase &)