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 "vtkPVInformation.h"
31 #include "vtkRemotingCoreModule.h" //needed for exports
32 
33 #include <string> // for std::string
34 #include <vector> // for std::vector
35 
36 class vtkAbstractArray;
38 class vtkStringArray;
39 
41 {
42 public:
43  static vtkPVArrayInformation* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
52  vtkSetMacro(DataType, int);
53  vtkGetMacro(DataType, int);
55 
57 
60  vtkSetStringMacro(Name);
61  vtkGetStringMacro(Name);
63 
65 
68  void SetNumberOfComponents(int numComps);
69  vtkGetMacro(NumberOfComponents, int);
71 
75  void SetComponentName(vtkIdType component, const char* name);
76 
82  const char* GetComponentName(vtkIdType component);
83 
85 
88  vtkSetMacro(NumberOfTuples, vtkTypeInt64);
89  vtkGetMacro(NumberOfTuples, vtkTypeInt64);
91 
93 
98  void SetComponentRange(int comp, double min, double max);
99  void SetComponentRange(int comp, double* range)
100  {
101  this->SetComponentRange(comp, range[0], range[1]);
102  }
103  double* GetComponentRange(int component) VTK_SIZEHINT(2);
104  void GetComponentRange(int comp, double range[2]);
106 
108 
113  void SetComponentFiniteRange(int comp, double min, double max);
114  void SetComponentFiniteRange(int comp, double* range)
115  {
116  this->SetComponentFiniteRange(comp, range[0], range[1]);
117  }
118  double* GetComponentFiniteRange(int component);
119  void GetComponentFiniteRange(int comp, double range[2]);
121 
128  void GetDataTypeRange(double range[2]);
129 
134  int Compare(vtkPVArrayInformation* info);
135 
136  void DeepCopy(vtkPVArrayInformation* info);
137 
141  void CopyFromObject(vtkObject*) override;
142 
146  void AddInformation(vtkPVInformation*) override;
147 
149 
152  void CopyToStream(vtkClientServerStream*) override;
153  void CopyFromStream(const vtkClientServerStream*) override;
155 
157 
162  vtkSetMacro(IsPartial, int);
163  vtkGetMacro(IsPartial, int);
165 
169  void Initialize();
170 
172 
175  void AddInformationKeys(vtkPVArrayInformation* info);
176  void AddInformationKey(const char* location, const char* name);
177  void AddUniqueInformationKey(const char* location, const char* name);
179 
181 
184  int GetNumberOfInformationKeys();
185  const char* GetInformationKeyLocation(int);
186  const char* GetInformationKeyName(int);
187  int HasInformationKey(const char* location, const char* name);
189 
191 
194  int GetNumberOfStringValues();
195  const char* GetStringValue(int);
197 
198 protected:
200  ~vtkPVArrayInformation() override;
201 
205  void AddRanges(vtkPVArrayInformation* info);
206  void AddFiniteRanges(vtkPVArrayInformation* info);
207  void AddValues(vtkPVArrayInformation* info);
208 
210  int DataType;
212  vtkTypeInt64 NumberOfTuples;
213  char* Name;
214  double* Ranges;
215  double* FiniteRanges;
216  std::vector<std::string> StringValues;
217 
218  // this array is used to store existing information keys (location/name pairs)
219 
220  class vtkInternalInformationKeys;
221  vtkInternalInformationKeys* InformationKeys;
222 
223  // this is used by GetComponentName, so that it always return a valid component name
224 
225  std::string* DefaultComponentName;
226 
228  void DetermineDefaultComponentName(const int& component_no, const int& numComps);
229 
230  class vtkInternalComponentNames;
231  vtkInternalComponentNames* ComponentNames;
232 
234  void operator=(const vtkPVArrayInformation&) = delete;
235 };
236 
237 #endif
void SetComponentFiniteRange(int comp, double *range)
There is a range for each component.
location
component
vtkInternalInformationKeys * InformationKeys
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
void PrintSelf(ostream &os, vtkIndent indent) override
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
void SetComponentRange(int comp, double *range)
There is a range for each component.
info
int vtkIdType
Store messages for the interpreter.
name
vtkInternalComponentNames * ComponentNames
void operator=(const vtkPVInformation &)=delete
#define VTKREMOTINGCORE_EXPORT
range
std::vector< std::string > StringValues
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.
static vtkObject * New()
Superclass for information objects.
#define max(a, b)