vtkPVDataInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVDataInformation.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 =========================================================================*/
30 #ifndef vtkPVDataInformation_h
31 #define vtkPVDataInformation_h
32 
33 #include "vtkPVInformation.h"
34 #include "vtkRemotingCoreModule.h" //needed for exports
35 
36 class vtkCollection;
38 class vtkDataObject;
39 class vtkDataSet;
40 class vtkGenericDataSet;
41 class vtkGraph;
42 class vtkHyperTreeGrid;
43 class vtkInformation;
48 class vtkSelection;
49 class vtkTable;
50 
52 {
53 public:
54  static vtkPVDataInformation* New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
67  vtkPVArrayInformation* GetArrayInformation(const char* arrayname, int fieldAssociation);
68 
70 
75  vtkSetMacro(PortNumber, int);
76  vtkGetMacro(PortNumber, int);
78 
82  void CopyFromObject(vtkObject*) override;
83 
87  void AddInformation(vtkPVInformation* info) override;
88 
94  virtual void AddInformation(vtkPVInformation*, int addingParts);
95 
97 
100  void CopyToStream(vtkClientServerStream*) override;
101  void CopyFromStream(const vtkClientServerStream*) override;
103 
105 
114 
119  void Initialize();
120 
122 
125  vtkGetMacro(DataSetType, int);
126  vtkGetMacro(CompositeDataSetType, int);
127  const char* GetDataSetTypeAsString();
128  bool DataSetTypeIsA(const char* type);
129  vtkGetMacro(NumberOfPoints, vtkTypeInt64);
130  vtkGetMacro(NumberOfCells, vtkTypeInt64);
131  vtkGetMacro(NumberOfRows, vtkTypeInt64);
132  vtkGetMacro(NumberOfTrees, vtkTypeInt64);
133  vtkGetMacro(NumberOfVertices, vtkTypeInt64);
134  vtkGetMacro(NumberOfEdges, vtkTypeInt64);
135  vtkGetMacro(NumberOfLeaves, vtkTypeInt64);
136  vtkGetMacro(MemorySize, int);
137  vtkGetMacro(PolygonCount, vtkIdType);
138  vtkGetMacro(NumberOfDataSets, int);
139  vtkGetVector6Macro(Bounds, double);
141 
146  vtkTypeInt64 GetNumberOfElements(int type);
147 
152  const char* GetPrettyDataTypeString();
153 
155 
159  vtkGetVector6Macro(Extent, int);
161 
163 
167  vtkGetObjectMacro(PointArrayInformation, vtkPVArrayInformation);
169 
171 
174  vtkGetObjectMacro(PointDataInformation, vtkPVDataSetAttributesInformation);
175  vtkGetObjectMacro(CellDataInformation, vtkPVDataSetAttributesInformation);
176  vtkGetObjectMacro(VertexDataInformation, vtkPVDataSetAttributesInformation);
177  vtkGetObjectMacro(EdgeDataInformation, vtkPVDataSetAttributesInformation);
178  vtkGetObjectMacro(RowDataInformation, vtkPVDataSetAttributesInformation);
180 
182 
185  vtkGetObjectMacro(FieldDataInformation, vtkPVDataSetAttributesInformation);
187 
195  vtkPVDataSetAttributesInformation* GetAttributeInformation(int fieldAssociation);
196 
198 
202  vtkGetObjectMacro(CompositeDataInformation, vtkPVCompositeDataInformation);
204 
209  vtkPVDataInformation* GetDataInformationForCompositeIndex(int index);
210 
218  unsigned int GetNumberOfBlockLeafs(bool skipEmpty);
219 
224  vtkPVDataInformation* GetDataInformationForCompositeIndex(int* index);
225 
227 
230  vtkGetStringMacro(DataClassName);
232 
234 
237  vtkGetStringMacro(CompositeDataClassName);
239 
240  vtkGetVector2Macro(TimeSpan, double);
241 
243 
246  vtkGetMacro(HasTime, int);
248 
250 
253  vtkGetMacro(Time, double);
255 
257 
260  vtkGetMacro(NumberOfTimeSteps, int);
262 
264 
267  vtkGetStringMacro(TimeLabel);
269 
273  bool IsDataStructured();
274 
280  bool IsAttributeValid(int fieldAssociation);
281 
283 
291  vtkGetStringMacro(CompositeDataSetName);
293 
297  static void RegisterHelper(const char* classname, const char* helperclassname);
298 
299 protected:
301  ~vtkPVDataInformation() override;
302 
303  void DeepCopy(vtkPVDataInformation* dataInfo, bool copyCompositeInformation = true);
304 
305  void AddFromMultiPieceDataSet(vtkCompositeDataSet* data);
306  void CopyFromCompositeDataSet(vtkCompositeDataSet* data);
307  void CopyFromCompositeDataSetInitialize(vtkCompositeDataSet* data);
308  void CopyFromCompositeDataSetFinalize(vtkCompositeDataSet* data);
309  virtual void CopyFromDataSet(vtkDataSet* data);
310  void CopyFromGenericDataSet(vtkGenericDataSet* data);
311  void CopyFromGraph(vtkGraph* graph);
312  void CopyFromTable(vtkTable* table);
313  void CopyFromHyperTreeGrid(vtkHyperTreeGrid* data);
314  void CopyFromSelection(vtkSelection* selection);
315  void CopyCommonMetaData(vtkDataObject*, vtkInformation*);
316 
317  static vtkPVDataInformationHelper* FindHelper(const char* classname);
318 
319  // Data information collected from remote processes.
320  int DataSetType = -1;
321  int CompositeDataSetType = -1;
322  int NumberOfDataSets = 0;
323  vtkTypeInt64 NumberOfPoints = 0; // data sets
324  vtkTypeInt64 NumberOfCells = 0;
325  vtkTypeInt64 NumberOfRows = 0; // tables
326  vtkTypeInt64 NumberOfTrees = 0; // hypertreegrids
327  vtkTypeInt64 NumberOfVertices = 0;
328  vtkTypeInt64 NumberOfEdges = 0; // graphs
329  vtkTypeInt64 NumberOfLeaves = 0;
330  int MemorySize = 0;
331  vtkIdType PolygonCount = 0;
332  double Bounds[6] = { VTK_DOUBLE_MAX, -VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, -VTK_DOUBLE_MAX,
333  VTK_DOUBLE_MAX, -VTK_DOUBLE_MAX };
334  int Extent[6] = { VTK_INT_MAX, -VTK_INT_MAX, VTK_INT_MAX, -VTK_INT_MAX, VTK_INT_MAX,
335  -VTK_INT_MAX };
336  double TimeSpan[2] = { VTK_DOUBLE_MAX, -VTK_DOUBLE_MAX };
337  double Time = 0.0;
338  int HasTime = 0;
339  int NumberOfTimeSteps = 0;
340 
341  char* DataClassName = nullptr;
342  vtkSetStringMacro(DataClassName);
343 
344  char* TimeLabel = nullptr;
345  vtkSetStringMacro(TimeLabel);
346 
347  char* CompositeDataClassName = nullptr;
348  vtkSetStringMacro(CompositeDataClassName);
349 
350  char* CompositeDataSetName = nullptr;
351  vtkSetStringMacro(CompositeDataSetName);
352 
359 
361 
363 
366 
367 private:
369  void operator=(const vtkPVDataInformation&) = delete;
370 
371  int PortNumber = -1;
372 };
373 
374 #endif
vtkPVCompositeDataInformation * CompositeDataInformation
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
vtkPVDataSetAttributesInformation * PointDataInformation
#define VTK_DOUBLE_MAX
Light object for holding data information.
vtkPVArrayInformation * PointArrayInformation
Light object for holding composite data information.
virtual void CopyParametersToStream(vtkMultiProcessStream &)
Serialize/Deserialize the parameters that control how/what information is gathered.
#define VTK_INT_MAX
void PrintSelf(ostream &os, vtkIndent indent) override
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
int vtkIdType
vtkPVDataSetAttributesInformation * VertexDataInformation
Store messages for the interpreter.
vtkPVDataSetAttributesInformation * CellDataInformation
vtkPVDataSetAttributesInformation * FieldDataInformation
void operator=(const vtkPVInformation &)=delete
#define VTKREMOTINGCORE_EXPORT
Data array information like type.
virtual void CopyParametersFromStream(vtkMultiProcessStream &)
Serialize/Deserialize the parameters that control how/what information is gathered.
virtual void AddInformation(vtkPVInformation *)
Merge another information object.
virtual void CopyToStream(vtkClientServerStream *)=0
Manage a serialized version of the information.
vtkPVDataSetAttributesInformation * RowDataInformation
virtual void CopyFromObject(vtkObject *)
Transfer information about a single object into this object.
static vtkObject * New()
allows extension of types that PVDataInformation can handle
Superclass for information objects.
vtkPVDataSetAttributesInformation * EdgeDataInformation