VTK  9.0.1
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 =========================================================================*/
31 #ifndef vtkInformation_h
32 #define vtkInformation_h
33 
34 #include "vtkCommonCoreModule.h" // For export macro
35 #include "vtkObject.h"
36 
37 #include <string> // for std::string compat
38 
39 class vtkDataObject;
40 class vtkExecutive;
53 class vtkInformationKey;
54 class vtkInformationKeyToInformationFriendship;
65 class vtkVariant;
66 
67 class VTKCOMMONCORE_EXPORT vtkInformation : public vtkObject
68 {
69 public:
70  static vtkInformation* New();
71  vtkTypeMacro(vtkInformation, vtkObject);
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73  void PrintKeys(ostream& os, vtkIndent indent);
74 
79  void Modified() override;
80 
87 
91  void Clear();
92 
97  int GetNumberOfKeys();
98 
106  void Copy(vtkInformation* from, int deep = 0);
107 
114  void Append(vtkInformation* from, int deep = 0);
115 
117 
123  void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep = 0);
124  void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep = 0);
125  void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep = 0);
126  void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, int deep = 0);
127  void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, int deep = 0);
128  void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep = 0);
129  void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep = 0);
130  void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep = 0);
131  void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep = 0);
132  void CopyEntry(vtkInformation* from, vtkInformationObjectBaseVectorKey* key, int deep = 0);
133  void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep = 0);
134  void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep = 0);
135  void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep = 0);
136  void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep = 0);
138 
145  void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep = 0);
146 
150  int Has(vtkInformationKey* key);
151 
155  void Remove(vtkInformationKey* key);
156 
158 
161  void Set(vtkInformationRequestKey* key);
162  void Remove(vtkInformationRequestKey* key);
163  int Has(vtkInformationRequestKey* key);
165 
167 
170  void Set(vtkInformationIntegerKey* key, int value);
171  int Get(vtkInformationIntegerKey* key);
172  void Remove(vtkInformationIntegerKey* key);
173  int Has(vtkInformationIntegerKey* key);
175 
177 
182  void Remove(vtkInformationIdTypeKey* key);
183  int Has(vtkInformationIdTypeKey* key);
185 
187 
190  void Set(vtkInformationDoubleKey* key, double value);
191  double Get(vtkInformationDoubleKey* key);
192  void Remove(vtkInformationDoubleKey* key);
193  int Has(vtkInformationDoubleKey* key);
195 
197 
200  void Set(vtkInformationVariantKey* key, const vtkVariant& value);
202  void Remove(vtkInformationVariantKey* key);
203  int Has(vtkInformationVariantKey* key);
205 
207 
210  void Append(vtkInformationIntegerVectorKey* key, int value);
211  void Set(vtkInformationIntegerVectorKey* key, const int* value, int length);
212  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3);
213  void Set(vtkInformationIntegerVectorKey* key, int value1, int value2, int value3, int value4,
214  int value5, int value6);
216  int Get(vtkInformationIntegerVectorKey* key, int idx);
217  void Get(vtkInformationIntegerVectorKey* key, int* value);
218  int Length(vtkInformationIntegerVectorKey* key);
219  void Remove(vtkInformationIntegerVectorKey* key);
222 
224 
227  void Append(vtkInformationStringVectorKey* key, const char* value);
228  void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
229  void Append(vtkInformationStringVectorKey* key, const std::string& value);
230  void Set(vtkInformationStringVectorKey* key, const std::string& value, int idx = 0);
231  const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
232  int Length(vtkInformationStringVectorKey* key);
233  void Remove(vtkInformationStringVectorKey* key);
236 
238 
241  void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
243  void Get(vtkInformationIntegerPointerKey* key, int* value);
245  void Remove(vtkInformationIntegerPointerKey* key);
248 
250 
253  void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
254  unsigned long Get(vtkInformationUnsignedLongKey* key);
255  void Remove(vtkInformationUnsignedLongKey* key);
258 
260 
263  void Append(vtkInformationDoubleVectorKey* key, double value);
264  void Set(vtkInformationDoubleVectorKey* key, const double* value, int length);
265  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3);
266  void Set(vtkInformationDoubleVectorKey* key, double value1, double value2, double value3,
267  double value4, double value5, double value6);
268  double* Get(vtkInformationDoubleVectorKey* key);
269  double Get(vtkInformationDoubleVectorKey* key, int idx);
270  void Get(vtkInformationDoubleVectorKey* key, double* value);
271  int Length(vtkInformationDoubleVectorKey* key);
272  void Remove(vtkInformationDoubleVectorKey* key);
275 
277 
280  void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
281  void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
282  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
283  const vtkVariant& value3);
284  void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1, const vtkVariant& value2,
285  const vtkVariant& value3, const vtkVariant& value4, const vtkVariant& value5,
286  const vtkVariant& value6);
288  const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
290  int Length(vtkInformationVariantVectorKey* key);
291  void Remove(vtkInformationVariantVectorKey* key);
294 
296 
306  int Length(vtkInformationKeyVectorKey* key);
307  void Remove(vtkInformationKeyVectorKey* key);
310 
311  // Provide extra overloads of this method to avoid requiring user
312  // code to include the headers for these key types. Avoid wrapping
313  // them because the original method can be called from the wrappers
314  // anyway and this causes a python help string to be too long.
315 
327 
339 
341 
344  void Set(vtkInformationStringKey* key, const char*);
345  void Set(vtkInformationStringKey* key, const std::string&);
346  const char* Get(vtkInformationStringKey* key);
347  void Remove(vtkInformationStringKey* key);
348  int Has(vtkInformationStringKey* key);
350 
352 
357  void Remove(vtkInformationInformationKey* key);
360 
362 
370 
372 
377  void Remove(vtkInformationObjectBaseKey* key);
380 
382 
386  void Set(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* value, int idx = 0);
390  void Remove(vtkInformationObjectBaseVectorKey* key, vtkObjectBase* objectToRemove);
391  void Remove(vtkInformationObjectBaseVectorKey* key, int indexToRemove);
394 
396 
399  void Set(vtkInformationDataObjectKey* key, vtkDataObject VTK_WRAP_EXTERN*);
400  vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
401  void Remove(vtkInformationDataObjectKey* key);
404 
406 
419  static vtkInformationKey* GetKey(vtkInformationKey* key);
424 
426 
429  void Register(vtkObjectBase* o) override;
430  void UnRegister(vtkObjectBase* o) override;
432 
434 
437  void SetRequest(vtkInformationRequestKey* request);
438  vtkInformationRequestKey* GetRequest();
440 
441 protected:
442  vtkInformation();
443  ~vtkInformation() override;
444 
445  // Get/Set a map entry directly through the vtkObjectBase instance
446  // representing the value. Used internally to manage the map.
447  void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
448  const vtkObjectBase* GetAsObjectBase(const vtkInformationKey* key) const;
449  vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
450 
451  // Internal implementation details.
453 
454  // Garbage collection support.
455  void ReportReferences(vtkGarbageCollector*) override;
456 
457  // Report the object associated with the given key to the collector.
458  void ReportAsObjectBase(vtkInformationKey* key, vtkGarbageCollector* collector);
459 
460 private:
461  friend class vtkInformationKeyToInformationFriendship;
463 
464 private:
465  vtkInformation(const vtkInformation&) = delete;
466  void operator=(const vtkInformation&) = delete;
467  vtkInformationRequestKey* Request;
468 };
469 
470 #endif
471 // VTK-HeaderTest-Exclude: vtkInformation.h
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:56
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
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:338
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:46
Key for string values in vtkInformation.
Detect and break reference loops.
A atomic type representing the union of many types.
Definition: vtkVariant.h:65
Superclass for vtkInformation keys.
Key for double vector values.
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
a simple class to control print indentation
Definition: vtkIndent.h:33
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:63
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:59
Key for vtkIdType values in vtkInformation.
Key for vtkExecutive/Port value pairs.