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 =========================================================================*/
24 #ifndef vtkPVArrayInformation_h
25 #define vtkPVArrayInformation_h
26 
27 #include "vtkObject.h"
28 #include "vtkRemotingCoreModule.h" //needed for exports
29 #include "vtkTuple.h" // for vtkTuple
30 
31 #include <set> // for std::set
32 #include <string> // for std::string
33 #include <vector> // for std::vector
34 
35 class vtkAbstractArray;
38 
40 {
41 public:
42  static vtkPVArrayInformation* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  void Initialize();
50 
54  vtkGetMacro(DataType, int);
55 
59  const char* GetDataTypeAsString() const { return vtkImageScalarTypeNameMacro(this->DataType); }
60 
65  std::string GetRangesAsString() const;
66 
70  const char* GetName() const { return this->Name.empty() ? nullptr : this->Name.c_str(); }
71 
75  int GetNumberOfComponents() const;
76 
81  const char* GetComponentName(int component) const;
82 
86  vtkGetMacro(NumberOfTuples, vtkTypeInt64);
87 
89 
95  const double* GetComponentRange(int comp) const VTK_SIZEHINT(2);
96  void GetComponentRange(int comp, double range[2]) const;
98 
100 
107  const double* GetComponentFiniteRange(int component) const VTK_SIZEHINT(2);
108  void GetComponentFiniteRange(int comp, double range[2]) const;
110 
117  void GetDataTypeRange(double range[2]) const;
118 
120 
125  vtkGetMacro(IsPartial, bool);
127 
129 
132  int GetNumberOfInformationKeys() const;
133  const char* GetInformationKeyLocation(int) const;
134  const char* GetInformationKeyName(int) const;
135  bool HasInformationKey(const char* location, const char* name) const;
137 
139 
142  int GetNumberOfStringValues();
143  const char* GetStringValue(int);
145 
146  void CopyFromArray(vtkAbstractArray* array);
147  void CopyFromGenericAttribute(vtkGenericAttribute* array);
148  void CopyToStream(vtkClientServerStream*) const;
149  bool CopyFromStream(const vtkClientServerStream*);
150 
151 protected:
153  ~vtkPVArrayInformation() override;
154 
156  friend class vtkPVDataInformation;
157 
159 
162  void DeepCopy(vtkPVArrayInformation* info);
163  void AddInformation(vtkPVArrayInformation*, int fieldAssociation);
164  vtkSetMacro(IsPartial, bool);
166 
167  vtkSetMacro(Name, std::string);
168 
169 private:
170  std::string Name;
171  int DataType = -1;
172  vtkTypeInt64 NumberOfTuples = 0;
173  bool IsPartial = false;
174 
175  struct ComponentInfo
176  {
179  std::string Name;
180  mutable std::string DefaultName;
181  };
182 
183  std::vector<ComponentInfo> Components;
184  std::vector<std::string> StringValues;
185 
186  // this array is used to store existing information keys (location/name pairs)
187  std::set<std::pair<std::string, std::string>> InformationKeys;
188 
190  void operator=(const vtkPVArrayInformation&) = delete;
191 };
192 
193 #endif
location
component
#define VTK_DOUBLE_MAX
provides meta data about a vtkDataObject subclass.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
void DeepCopy(vtkPVDataInformation *info)
Simply copies from another vtkPVDataInformation.
Store messages for the interpreter.
name
const char * GetDataTypeAsString() const
Returns a printable string for the array value type.
const char * GetName() const
Get array&#39;s name.
#define VTKREMOTINGCORE_EXPORT
void AddInformation(vtkPVInformation *info) override
vtkPVInformation API implementation.
range
provides meta data about arrays.
static vtkObject * New()