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 class vtkAbstractArray;
34 class vtkStdString;
35 class vtkStringArray;
36 
37 class VTKREMOTINGCORE_EXPORT vtkPVArrayInformation : public vtkPVInformation
38 {
39 public:
40  static vtkPVArrayInformation* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
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) VTK_SIZEHINT(2);
101  void GetComponentRange(int comp, double range[2]);
103 
105 
110  void SetComponentFiniteRange(int comp, double min, double max);
111  void SetComponentFiniteRange(int comp, double* range)
112  {
113  this->SetComponentFiniteRange(comp, range[0], range[1]);
114  }
115  double* GetComponentFiniteRange(int component);
116  void GetComponentFiniteRange(int comp, double range[2]);
118 
125  void GetDataTypeRange(double range[2]);
126 
131  int Compare(vtkPVArrayInformation* info);
132 
136  void AddRanges(vtkPVArrayInformation* info);
137  void AddFiniteRanges(vtkPVArrayInformation* info);
138 
139  void DeepCopy(vtkPVArrayInformation* info);
140 
144  void CopyFromObject(vtkObject*) override;
145 
149  void AddInformation(vtkPVInformation*) override;
150 
152 
155  void CopyToStream(vtkClientServerStream*) override;
156  void CopyFromStream(const vtkClientServerStream*) override;
158 
160 
165  vtkSetMacro(IsPartial, int);
166  vtkGetMacro(IsPartial, int);
168 
172  void Initialize();
173 
175 
178  void AddInformationKeys(vtkPVArrayInformation* info);
179  void AddInformationKey(const char* location, const char* name);
180  void AddUniqueInformationKey(const char* location, const char* name);
182 
184 
187  int GetNumberOfInformationKeys();
188  const char* GetInformationKeyLocation(int);
189  const char* GetInformationKeyName(int);
190  int HasInformationKey(const char* location, const char* name);
192 
193 protected:
195  ~vtkPVArrayInformation() override;
196 
198  int DataType;
200  vtkTypeInt64 NumberOfTuples;
201  char* Name;
202  double* Ranges;
203  double* FiniteRanges;
204 
205  // this array is used to store existing information keys (location/name pairs)
206 
207  class vtkInternalInformationKeys;
208  vtkInternalInformationKeys* InformationKeys;
209 
210  // this is used by GetComponentName, so that it always return a valid component name
211 
213 
215  void DetermineDefaultComponentName(const int& component_no, const int& numComps);
216 
217  class vtkInternalComponentNames;
218  vtkInternalComponentNames* ComponentNames;
219 
221  void operator=(const vtkPVArrayInformation&) = delete;
222 };
223 
224 #endif
void SetComponentFiniteRange(int comp, double *range)
There is a range for each 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.
int vtkIdType
Store messages for the interpreter.
vtkStdString * DefaultComponentName
vtkInternalComponentNames * ComponentNames
void operator=(const vtkPVInformation &)=delete
range
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.