vtkCPInputDataDescription.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkCPInputDataDescription_h
4 #define vtkCPInputDataDescription_h
5 
6 class vtkDataObject;
7 class vtkDataSet;
8 class vtkFieldData;
9 class vtkSMSourceProxy;
10 
11 #include "vtkObject.h"
12 #include "vtkPVCatalystModule.h" // For windows import/export of shared libraries
13 
18 {
19 public:
22  void PrintSelf(ostream& os, vtkIndent indent) override;
23 
24  // Description:
25  // Reset the names of the fields that are needed.
26  void Reset();
27 
28  // Description:
29  // Add in a name of an array with name *fieldName* of type *type*
30  // where the values comes from vtkDataObject::AttributeTypes.
31  void AddField(const char* fieldName, int type);
32 
33  // Description:
34  // Get the number of fields currently specified in this object.
35  unsigned int GetNumberOfFields();
36 
37  // Description:
38  // Get the name of the field given its current index.
39  const char* GetFieldName(unsigned int fieldIndex);
40 
41  // Description:
42  // Get the type of field given its current index. The types are defined
43  // in vtkDataObject::AttributeTypes. A return value of -1 indicates an invalid
44  // fieldIndex.
45  int GetFieldType(unsigned int fieldIndex);
46 
47  // Description:
48  // Return true if a field with fieldName is needed.
49  bool IsFieldNeeded(const char* fieldName, int type);
50 
51  // Description:
52  // When set to true, all fields are requested. Off by default.
53  // Note that calling Reset() resets this flag to Off as well.
54  vtkSetMacro(AllFields, bool);
55  vtkGetMacro(AllFields, bool);
56  vtkBooleanMacro(AllFields, bool);
57 
58  // Description:
59  // Use this to enable the mesh. Off by default. Note that calling Reset()
60  // resets this flag to Off as well.
61  vtkSetMacro(GenerateMesh, bool);
62  vtkGetMacro(GenerateMesh, bool);
63  vtkBooleanMacro(GenerateMesh, bool);
64 
65  // Description:
66  // Set the grid input for coprocessing. The grid should have all of
67  // the point data and cell data properly set.
68  void SetGrid(vtkDataObject* grid);
69 
70  // Description:
71  // Get the grid for coprocessing.
72  vtkGetObjectMacro(Grid, vtkDataObject);
73 
74  // Description:
75  // Returns true if the grid is necessary..
76  bool GetIfGridIsNecessary();
77 
78  // Description:
79  // Set/get the extents for a partitioned topologically regular grid
80  // (i.e. vtkUniformGrid, vtkImageData, vtkRectilinearGrid, and
81  // vtkStructuredGrid).
82  vtkSetVector6Macro(WholeExtent, int);
83  vtkGetVector6Macro(WholeExtent, int);
84 
85  // Description:
86  // Shallow copy.
87  void ShallowCopy(vtkCPInputDataDescription*);
88 
89  // Description:
90  // Set the temporal cache. Adaptors can get a cache from the coprocessor
91  // object and apply them to the InputDataDescription when they want to
92  // use temporal filters in their pipelines.
93  void SetTemporalCache(vtkSMSourceProxy* cache);
94 
95  // Description:
96  // Get the temporal cache.
97  vtkGetObjectMacro(TemporalCache, vtkSMSourceProxy);
98 
99 protected:
101  ~vtkCPInputDataDescription() override;
102 
103  // Description:
104  // On when all fields must be requested for the coprocessing pipeline.
105  bool AllFields;
106 
107  // Description:
108  // On when the mesh should be generated.
110 
111  // Description:
112  // The grid for coprocessing. The grid is not owned by the object.
114 
115  // Description:
116  // The temporal cache associated with grid. The cache is not owned by the object.
118 
119 private:
121  void operator=(const vtkCPInputDataDescription&) = delete;
122 
123  class vtkInternals;
124  vtkInternals* Internals;
125  int WholeExtent[6];
126 };
127 
128 #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 &)