VTK
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 =========================================================================*/
28 #ifndef vtkInformation_h
29 #define vtkInformation_h
30 
31 #include "vtkCommonCoreModule.h" // For export macro
32 #include "vtkObject.h"
33 
34 #include <string> // for std::string compat
35 
36 class vtkDataObject;
37 class vtkExecutive;
50 class vtkInformationKey;
51 class vtkInformationKeyToInformationFriendship;
62 class vtkVariant;
63 
64 class VTKCOMMONCORE_EXPORT vtkInformation : public vtkObject
65 {
66 public:
67  static vtkInformation* New();
68  vtkTypeMacro(vtkInformation, vtkObject);
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70  void PrintKeys(ostream& os, vtkIndent indent);
71 
76  void Modified() override;
77 
84 
88  void Clear();
89 
94  int GetNumberOfKeys();
95 
103  void Copy(vtkInformation* from, int deep = 0);
104 
111  void Append(vtkInformation* from, int deep = 0);
112 
114 
120  void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep = 0);
121  void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep = 0);
122  void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep = 0);
123  void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, int deep = 0);
124  void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, int deep = 0);
125  void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep = 0);
126  void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep = 0);
127  void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep = 0);
128  void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep = 0);
129  void CopyEntry(vtkInformation* from, vtkInformationObjectBaseVectorKey* key, int deep = 0);
130  void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep = 0);
131  void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep = 0);
132  void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep = 0);
133  void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep = 0);
135 
142  void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep = 0);
143 
147  int Has(vtkInformationKey* key);
148 
152  void Remove(vtkInformationKey* key);
153 
155 
158  void Set(vtkInformationRequestKey* key);
159  void Remove(vtkInformationRequestKey* key);
160  int Has(vtkInformationRequestKey* key);
162 
164 
167  void Set(vtkInformationIntegerKey* key, int value);
168  int Get(vtkInformationIntegerKey* key);
169  void Remove(vtkInformationIntegerKey* key);
170  int Has(vtkInformationIntegerKey* key);
172 
174 
179  void Remove(vtkInformationIdTypeKey* key);
180  int Has(vtkInformationIdTypeKey* key);
182 
184 
187  void Set(vtkInformationDoubleKey* key, double value);
188  double Get(vtkInformationDoubleKey* key);
189  void Remove(vtkInformationDoubleKey* key);
190  int Has(vtkInformationDoubleKey* key);
192 
194 
197  void Set(vtkInformationVariantKey* key, const vtkVariant& value);
199  void Remove(vtkInformationVariantKey* key);
200  int Has(vtkInformationVariantKey* key);
202 
204 
207  void Append(vtkInformationIntegerVectorKey* key, int value);
208  void Set(vtkInformationIntegerVectorKey* key, const int* value, int length);
209  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3);
210  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3, int value4,
211  int value5, int value6);
213  int Get(vtkInformationIntegerVectorKey* key, int idx);
214  void Get(vtkInformationIntegerVectorKey* key, int* value);
215  int Length(vtkInformationIntegerVectorKey* key);
216  void Remove(vtkInformationIntegerVectorKey* key);
219 
221 
224  void Append(vtkInformationStringVectorKey* key, const char* value);
225  void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
226  void Append(vtkInformationStringVectorKey* key, const std::string& value);
227  void Set(vtkInformationStringVectorKey* key, const std::string& value, int idx = 0);
228  const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
229  int Length(vtkInformationStringVectorKey* key);
230  void Remove(vtkInformationStringVectorKey* key);
233 
235 
238  void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
240  void Get(vtkInformationIntegerPointerKey* key, int* value);
242  void Remove(vtkInformationIntegerPointerKey* key);
245 
247 
250  void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
251  unsigned long Get(vtkInformationUnsignedLongKey* key);
252  void Remove(vtkInformationUnsignedLongKey* key);
255 
257 
260  void Append(vtkInformationDoubleVectorKey* key, double value);
261  void Set(vtkInformationDoubleVectorKey* key, const double* value, int length);
262  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3);
263  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3,
264  double value4, double value5, double value6);
265  double* Get(vtkInformationDoubleVectorKey* key);
266  double Get(vtkInformationDoubleVectorKey* key, int idx);
267  void Get(vtkInformationDoubleVectorKey* key, double* value);
268  int Length(vtkInformationDoubleVectorKey* key);
269  void Remove(vtkInformationDoubleVectorKey* key);
272 
274 
277  void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
278  void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
279  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
280  const vtkVariant& value3);
281  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
282  const vtkVariant& value3, const vtkVariant& value4, const vtkVariant& value5,
283  const vtkVariant& value6);
285  const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
287  int Length(vtkInformationVariantVectorKey* key);
288  void Remove(vtkInformationVariantVectorKey* key);
291 
293 
303  int Length(vtkInformationKeyVectorKey* key);
304  void Remove(vtkInformationKeyVectorKey* key);
307 
308  // Provide extra overloads of this method to avoid requiring user
309  // code to include the headers for these key types. Avoid wrapping
310  // them because the original method can be called from the wrappers
311  // anyway and this causes a python help string to be too long.
312 
324 
336 
338 
341  void Set(vtkInformationStringKey* key, const char*);
342  void Set(vtkInformationStringKey* key, const std::string&);
343  const char* Get(vtkInformationStringKey* key);
344  void Remove(vtkInformationStringKey* key);
345  int Has(vtkInformationStringKey* key);
347 
349 
354  void Remove(vtkInformationInformationKey* key);
357 
359 
367 
369 
374  void Remove(vtkInformationObjectBaseKey* key);
377 
379 
383  void Set(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* value, int idx = 0);
387  void Remove(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* objectToRemove);
388  void Remove(vtkInformationObjectBaseVectorKey* key, int indexToRemove);
391 
393 
396  void Set(vtkInformationDataObjectKey* key, vtkDataObject VTK_WRAP_EXTERN*);
397  vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
398  void Remove(vtkInformationDataObjectKey* key);
401 
403 
416  static vtkInformationKey* GetKey(vtkInformationKey* key);
421 
423 
426  void Register(vtkObjectBase* o) override;
427  void UnRegister(vtkObjectBase* o) override;
429 
431 
434  void SetRequest(vtkInformationRequestKey* request);
435  vtkInformationRequestKey* GetRequest();
437 
438 protected:
439  vtkInformation();
440  ~vtkInformation() override;
441 
442  // Get/Set a map entry directly through the vtkObjectBase instance
443  // representing the value. Used internally to manage the map.
444  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
445  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
446  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
447 
448  // Internal implementation details.
450 
451  // Garbage collection support.
452  void ReportReferences(vtkGarbageCollector*) override;
453 
454  // Report the object associated with the given key to the collector.
455  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
456 
457 private:
458  friend class vtkInformationKeyToInformationFriendship;
460 
461 private:
462  vtkInformation(const vtkInformation&) = delete;
463  void operator=(const vtkInformation&) = delete;
464  vtkInformationRequestKey* Request;
465 };
466 
467 #endif
468 // 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:349
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:53
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:449
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:63
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:64
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:58
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