VTK  9.2.6
vtkInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInformation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
37 #ifndef vtkInformation_h
38 #define vtkInformation_h
39 
40 #include "vtkCommonCoreModule.h" // For export macro
41 #include "vtkObject.h"
42 
43 #include <string> // for std::string compat
44 
45 class vtkDataObject;
46 class vtkExecutive;
59 class vtkInformationKey;
60 class vtkInformationKeyToInformationFriendship;
71 class vtkVariant;
72 
73 class VTKCOMMONCORE_EXPORT vtkInformation : public vtkObject
74 {
75 public:
76  static vtkInformation* New();
77  vtkTypeMacro(vtkInformation, vtkObject);
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79  void PrintKeys(ostream& os, vtkIndent indent);
80 
85  void Modified() override;
86 
93 
97  void Clear();
98 
103  int GetNumberOfKeys();
104 
112  void Copy(vtkInformation* from, int deep = 0);
113 
120  void Append(vtkInformation* from, int deep = 0);
121 
123 
129  void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep = 0);
130  void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep = 0);
131  void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep = 0);
132  void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, int deep = 0);
133  void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, int deep = 0);
134  void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep = 0);
135  void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep = 0);
136  void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep = 0);
137  void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep = 0);
138  void CopyEntry(vtkInformation* from, vtkInformationObjectBaseVectorKey* key, int deep = 0);
139  void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep = 0);
140  void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep = 0);
141  void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep = 0);
142  void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep = 0);
144 
151  void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep = 0);
152 
156  int Has(vtkInformationKey* key);
157 
161  void Remove(vtkInformationKey* key);
162 
164 
167  void Set(vtkInformationRequestKey* key);
168  void Remove(vtkInformationRequestKey* key);
169  int Has(vtkInformationRequestKey* key);
171 
173 
176  void Set(vtkInformationIntegerKey* key, int value);
177  int Get(vtkInformationIntegerKey* key);
178  void Remove(vtkInformationIntegerKey* key);
179  int Has(vtkInformationIntegerKey* key);
181 
183 
188  void Remove(vtkInformationIdTypeKey* key);
189  int Has(vtkInformationIdTypeKey* key);
191 
193 
196  void Set(vtkInformationDoubleKey* key, double value);
197  double Get(vtkInformationDoubleKey* key);
198  void Remove(vtkInformationDoubleKey* key);
199  int Has(vtkInformationDoubleKey* key);
201 
203 
206  void Set(vtkInformationVariantKey* key, const vtkVariant& value);
208  void Remove(vtkInformationVariantKey* key);
209  int Has(vtkInformationVariantKey* key);
211 
213 
216  void Append(vtkInformationIntegerVectorKey* key, int value);
217  void Set(vtkInformationIntegerVectorKey* key, const int* value, int length);
218  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3);
219  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3, int value4,
220  int value5, int value6);
222  int Get(vtkInformationIntegerVectorKey* key, int idx);
223  void Get(vtkInformationIntegerVectorKey* key, int* value);
224  int Length(vtkInformationIntegerVectorKey* key);
225  void Remove(vtkInformationIntegerVectorKey* key);
228 
230 
233  void Append(vtkInformationStringVectorKey* key, const char* value);
234  void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
235  void Append(vtkInformationStringVectorKey* key, const std::string& value);
236  void Set(vtkInformationStringVectorKey* key, const std::string& value, int idx = 0);
237  const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
238  int Length(vtkInformationStringVectorKey* key);
239  void Remove(vtkInformationStringVectorKey* key);
242 
244 
247  void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
249  void Get(vtkInformationIntegerPointerKey* key, int* value);
251  void Remove(vtkInformationIntegerPointerKey* key);
254 
256 
259  void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
260  unsigned long Get(vtkInformationUnsignedLongKey* key);
261  void Remove(vtkInformationUnsignedLongKey* key);
264 
266 
269  void Append(vtkInformationDoubleVectorKey* key, double value);
270  void Set(vtkInformationDoubleVectorKey* key, const double* value, int length);
271  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3);
272  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3,
273  double value4, double value5, double value6);
274  double* Get(vtkInformationDoubleVectorKey* key);
275  double Get(vtkInformationDoubleVectorKey* key, int idx);
276  void Get(vtkInformationDoubleVectorKey* key, double* value);
277  int Length(vtkInformationDoubleVectorKey* key);
278  void Remove(vtkInformationDoubleVectorKey* key);
281 
283 
286  void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
287  void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
288  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
289  const vtkVariant& value3);
290  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
291  const vtkVariant& value3, const vtkVariant& value4, const vtkVariant& value5,
292  const vtkVariant& value6);
294  const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
296  int Length(vtkInformationVariantVectorKey* key);
297  void Remove(vtkInformationVariantVectorKey* key);
300 
302 
312  int Length(vtkInformationKeyVectorKey* key);
313  void Remove(vtkInformationKeyVectorKey* key);
316 
317  // Provide extra overloads of this method to avoid requiring user
318  // code to include the headers for these key types. Avoid wrapping
319  // them because the original method can be called from the wrappers
320  // anyway and this causes a python help string to be too long.
321 
333 
345 
347 
350  void Set(vtkInformationStringKey* key, const char*);
351  void Set(vtkInformationStringKey* key, const std::string&);
352  const char* Get(vtkInformationStringKey* key);
353  void Remove(vtkInformationStringKey* key);
354  int Has(vtkInformationStringKey* key);
356 
358 
363  void Remove(vtkInformationInformationKey* key);
366 
368 
376 
378 
383  void Remove(vtkInformationObjectBaseKey* key);
386 
388 
392  void Set(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* value, int idx = 0);
396  void Remove(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* objectToRemove);
397  void Remove(vtkInformationObjectBaseVectorKey* key, int indexToRemove);
400 
402 
405  void Set(vtkInformationDataObjectKey* key, vtkDataObject VTK_WRAP_EXTERN*);
406  vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
407  void Remove(vtkInformationDataObjectKey* key);
410 
412 
425  static vtkInformationKey* GetKey(vtkInformationKey* key);
430 
432 
435  bool UsesGarbageCollector() const override { return true; }
437 
439 
442  void SetRequest(vtkInformationRequestKey* request);
443  vtkInformationRequestKey* GetRequest();
445 
446 protected:
447  vtkInformation();
448  ~vtkInformation() override;
449 
450  // Get/Set a map entry directly through the vtkObjectBase instance
451  // representing the value. Used internally to manage the map.
452  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
453  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
454  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
455 
456  // Internal implementation details.
458 
459  // Garbage collection support.
460  void ReportReferences(vtkGarbageCollector*) override;
461 
462  // Report the object associated with the given key to the collector.
463  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
464 
465 private:
466  friend class vtkInformationKeyToInformationFriendship;
468 
469 private:
470  vtkInformation(const vtkInformation&) = delete;
471  void operator=(const vtkInformation&) = delete;
472  vtkInformationRequestKey* Request;
473 };
474 
475 #endif
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Key for vtkInformation values.
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
vtkInformationInternals * Internal
internal structure for vtkInformation
int vtkIdType
Definition: vtkType.h:332
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
Key for string values in vtkInformation.
Detect and break reference loops.
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
Superclass for vtkInformation keys.
Key for double vector values.
bool UsesGarbageCollector() const override
Initiate garbage collection when a reference is removed.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ReportReferences(vtkGarbageCollector *)
Key for pointer to pointer.
Key for integer values in vtkInformation.
Iterates over keys of an information object.
Key for vtkObjectBase values.
virtual void Modified()
Update the modification time for this object.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:73
Key for variant values in vtkInformation.
Key for String vector values.
Key for vector-of-keys values.
Key for vtkExecutive/Port value pair vectors.
Key for vtkObjectBase vector values.
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:65
Key for vtkIdType values in vtkInformation.
Key for vtkExecutive/Port value pairs.