VTK  9.0.20200711
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  void Register(vtkObjectBase* o) override;
436  void UnRegister(vtkObjectBase* o) override;
438 
440 
443  void SetRequest(vtkInformationRequestKey* request);
444  vtkInformationRequestKey* GetRequest();
446 
447 protected:
448  vtkInformation();
449  ~vtkInformation() override;
450 
451  // Get/Set a map entry directly through the vtkObjectBase instance
452  // representing the value. Used internally to manage the map.
453  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
454  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
455  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
456 
457  // Internal implementation details.
459 
460  // Garbage collection support.
461  void ReportReferences(vtkGarbageCollector*) override;
462 
463  // Report the object associated with the given key to the collector.
464  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
465 
466 private:
467  friend class vtkInformationKeyToInformationFriendship;
469 
470 private:
471  vtkInformation(const vtkInformation&) = delete;
472  void operator=(const vtkInformation&) = delete;
473  vtkInformationRequestKey* Request;
474 };
475 
476 #endif
477 // VTK-HeaderTest-Exclude: vtkInformation.h
vtkInformationIterator
Iterates over keys of an information object.
Definition: vtkInformationIterator.h:37
vtkInformationIdTypeKey
Key for vtkIdType values in vtkInformation.
Definition: vtkInformationIdTypeKey.h:31
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:33
vtkInformationKeyVectorKey
Key for vector-of-keys values.
Definition: vtkInformationKeyVectorKey.h:31
vtkX3D::value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkInformationInternals
internal structure for vtkInformation
Definition: vtkInformationInternals.h:38
vtkObjectBase::Register
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
vtkX3D::data
Definition: vtkX3D.h:321
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkObjectBase::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *)
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkX3D::key
Definition: vtkX3D.h:263
vtkInformationDataObjectKey
Key for vtkDataObject values.
Definition: vtkInformationDataObjectKey.h:33
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkInformationInformationKey
Key for vtkInformation values.
Definition: vtkInformationInformationKey.h:31
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkX3D::length
Definition: vtkX3D.h:399
vtkInformationIntegerPointerKey
Key for pointer to integer.
Definition: vtkInformationIntegerPointerKey.h:31
vtkInformationDoubleKey
Key for double values in vtkInformation.
Definition: vtkInformationDoubleKey.h:31
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:46
vtkInformation::Internal
vtkInformationInternals * Internal
Definition: vtkInformation.h:458
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:69
vtkInformationObjectBaseKey
Key for vtkObjectBase values.
Definition: vtkInformationObjectBaseKey.h:33
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:31
vtkInformationExecutivePortVectorKey
Key for vtkExecutive/Port value pair vectors.
Definition: vtkInformationExecutivePortVectorKey.h:34
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInformationVariantVectorKey
Key for variant vector values.
Definition: vtkInformationVariantVectorKey.h:33
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:65
vtkInformationRequestKey
Key for pointer to pointer.
Definition: vtkInformationRequestKey.h:31
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformationObjectBaseVectorKey
Key for vtkObjectBase vector values.
Definition: vtkInformationObjectBaseVectorKey.h:34
vtkInformationUnsignedLongKey
Key for unsigned long values in vtkInformation.
Definition: vtkInformationUnsignedLongKey.h:31
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:94
vtkObject.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::string
Definition: vtkX3D.h:496
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:31
vtkInformationStringVectorKey
Key for String vector values.
Definition: vtkInformationStringVectorKey.h:33
vtkInformationInformationVectorKey
Key for vtkInformation vectors.
Definition: vtkInformationInformationVectorKey.h:33
vtkInformationVariantKey
Key for variant values in vtkInformation.
Definition: vtkInformationVariantKey.h:33
vtkInformationIntegerVectorKey
Key for integer vector values.
Definition: vtkInformationIntegerVectorKey.h:31
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkInformationKey
Superclass for vtkInformation keys.
Definition: vtkInformationKey.h:38
vtkObjectBase::UnRegister
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
vtkInformationExecutivePortKey
Key for vtkExecutive/Port value pairs.
Definition: vtkInformationExecutivePortKey.h:34