ParaView
vtkPVArrayInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVArrayInformation.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 =========================================================================*/
27 #ifndef vtkPVArrayInformation_h
28 #define vtkPVArrayInformation_h
29 
30 #include "vtkPVClientServerCoreCoreModule.h" //needed for exports
31 #include "vtkPVInformation.h"
32 class vtkAbstractArray;
34 class vtkStdString;
35 class vtkStringArray;
36 
37 class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVArrayInformation : public vtkPVInformation
38 {
39 public:
40  static vtkPVArrayInformation* New();
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
49  vtkSetMacro(DataType, int);
50  vtkGetMacro(DataType, int);
52 
54 
57  vtkSetStringMacro(Name);
58  vtkGetStringMacro(Name);
60 
62 
65  void SetNumberOfComponents(int numComps);
66  vtkGetMacro(NumberOfComponents, int);
68 
72  void SetComponentName(vtkIdType component, const char* name);
73 
79  const char* GetComponentName(vtkIdType component);
80 
82 
85  vtkSetMacro(NumberOfTuples, vtkTypeInt64);
86  vtkGetMacro(NumberOfTuples, vtkTypeInt64);
88 
90 
95  void SetComponentRange(int comp, double min, double max);
96  void SetComponentRange(int comp, double* range)
97  {
98  this->SetComponentRange(comp, range[0], range[1]);
99  }
100  double* GetComponentRange(int component);
101  void GetComponentRange(int comp, double* range);
103 
110  void GetDataTypeRange(double range[2]);
111 
116  int Compare(vtkPVArrayInformation* info);
117 
121  void AddRanges(vtkPVArrayInformation* info);
122 
123  void DeepCopy(vtkPVArrayInformation* info);
124 
128  virtual void CopyFromObject(vtkObject*);
129 
133  virtual void AddInformation(vtkPVInformation*);
134 
136 
139  virtual void CopyToStream(vtkClientServerStream*);
140  virtual void CopyFromStream(const vtkClientServerStream*);
142 
144 
149  vtkSetMacro(IsPartial, int);
150  vtkGetMacro(IsPartial, int);
152 
156  void Initialize();
157 
159 
162  void AddInformationKeys(vtkPVArrayInformation* info);
163  void AddInformationKey(const char* location, const char* name);
164  void AddUniqueInformationKey(const char* location, const char* name);
166 
168 
171  int GetNumberOfInformationKeys();
172  const char* GetInformationKeyLocation(int);
173  const char* GetInformationKeyName(int);
174  int HasInformationKey(const char* location, const char* name);
176 
177 protected:
180 
182  int DataType;
184  vtkTypeInt64 NumberOfTuples;
185  char* Name;
186  double* Ranges;
187 
188  // this array is used to store existing information keys (location/name pairs)
189 
190  class vtkInternalInformationKeys;
191  vtkInternalInformationKeys* InformationKeys;
192 
193  // this is used by GetComponentName, so that it always return a valid component name
194 
195  vtkStdString* DefaultComponentName;
196 
198  void DetermineDefaultComponentName(const int& component_no, const int& numComps);
199 
200  class vtkInternalComponentNames;
201  vtkInternalComponentNames* ComponentNames;
202 
203  vtkPVArrayInformation(const vtkPVArrayInformation&) VTK_DELETE_FUNCTION;
204  void operator=(const vtkPVArrayInformation&) VTK_DELETE_FUNCTION;
205 };
206 
207 #endif
vtkInternalInformationKeys * InformationKeys
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
void SetComponentRange(int comp, double *range)
There is a range for each component.
Store messages for the interpreter.
vtkStdString * DefaultComponentName
vtkInternalComponentNames * ComponentNames
void operator=(const vtkPVInformation &) VTK_DELETE_FUNCTION
void PrintSelf(ostream &os, vtkIndent indent)
Data array information like type.
virtual void AddInformation(vtkPVInformation *)
Merge another information object.
virtual void CopyToStream(vtkClientServerStream *)=0
Manage a serialized version of the information.
virtual void CopyFromObject(vtkObject *)
Transfer information about a single object into this object.
Superclass for information objects.