ParaView
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 
22 #include "vtkObject.h"
23 #include "vtkPVCatalystModule.h" // For windows import/export of shared libraries
24 
28 class VTKPVCATALYST_EXPORT vtkCPInputDataDescription : public vtkObject
29 {
30 public:
31  static vtkCPInputDataDescription* New();
32  vtkTypeMacro(vtkCPInputDataDescription, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent);
34 
35  // Description:
36  // Reset the names of the fields that are needed.
37  void Reset();
38 
39  // Description:
40  // Add in a name of a point field .
41  void AddPointField(const char* FieldName);
42 
43  // Description:
44  // Add in a name of a cell field.
45  void AddCellField(const char* FieldName);
46 
47  // Description:
48  // Get the number of fields currently specified in this object.
49  unsigned int GetNumberOfFields();
50 
51  // Description:
52  // Get the name of the field given its current index.
53  const char* GetFieldName(unsigned int FieldIndex);
54 
55  // Description:
56  // Return true if a field with FieldName is needed.
57  bool IsFieldNeeded(const char* FieldName);
58 
59  // Description:
60  // Return true if the field associated with FieldName is point data
61  // and false if it is cell data.
62  bool IsFieldPointData(const char* FieldName);
63 
64  // Description:
65  // When set to true, all fields are requested. Off by default.
66  // Note that calling Reset() resets this flag to Off as well.
67  vtkSetMacro(AllFields, bool);
68  vtkGetMacro(AllFields, bool);
69  vtkBooleanMacro(AllFields, bool);
70 
71  // Description:
72  // Use this to enable the mesh. Off by default. Note that calling Reset()
73  // resets this flag to Off as well.
74  vtkSetMacro(GenerateMesh, bool);
75  vtkGetMacro(GenerateMesh, bool);
76  vtkBooleanMacro(GenerateMesh, bool);
77 
78  // Description:
79  // Set the grid input for coprocessing. The grid should have all of
80  // the point data and cell data properly set.
81  void SetGrid(vtkDataObject* grid);
82 
83  // Description:
84  // Get the grid for coprocessing.
85  vtkGetObjectMacro(Grid, vtkDataObject);
86 
87  // Description:
88  // Returns true if the grid is necessary..
89  bool GetIfGridIsNecessary();
90 
91  // Description:
92  // Set/get the extents for a partitioned topologically regular grid
93  // (i.e. vtkUniformGrid, vtkImageData, vtkRectilinearGrid, and
94  // vtkStructuredGrid).
95  vtkSetVector6Macro(WholeExtent, int);
96  vtkGetVector6Macro(WholeExtent, int);
97 
98 protected:
101 
102  // Description:
103  // Verify that the input grid has the required information.
104  // Returns true if it does and false otherwise.
105  bool IsInputSufficient();
106 
107  // Description:
108  // Check each grid for the required fields needed by the coprocessor.
109  // Returns true if it does and false otherwise.
110  bool DoesGridContainNeededFields(vtkDataSet* DataSet);
111 
112  // Description:
113  // On when all fields must be requested for the coprocessing pipeline.
114  bool AllFields;
115 
116  // Description:
117  // On when the mesh should be generated.
119 
120  // Description:
121  // The grid for coprocessing. The grid is not owned by the object.
122  vtkDataObject* Grid;
123 
124 private:
125  vtkCPInputDataDescription(const vtkCPInputDataDescription&) VTK_DELETE_FUNCTION;
126  void operator=(const vtkCPInputDataDescription&) VTK_DELETE_FUNCTION;
127 
128  class vtkInternals;
129  vtkInternals* Internals;
130  int WholeExtent[6];
131 };
132 
133 #endif
This class provides the data description for each input for the coprocessor pipelines.