VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
36 #ifndef __vtkInformation_h
37 #define __vtkInformation_h
38 
39 #include "vtkCommonCoreModule.h" // For export macro
40 #include "vtkObject.h"
41 
42 // If being "compiled" by gccxml, pretend VTKCOMMONCORE_EXPORT is nothing
43 // for this header file. The per-method usage of VTKCOMMONCORE_EXPORT in
44 // this header file leads to gccxml errors without this workaround.
45 //
46 #ifdef __GCCXML__
47 #undef VTKCOMMONCORE_EXPORT
48 #define VTKCOMMONCORE_EXPORT
49 #endif
50 
51 class vtkDataObject;
52 class vtkExecutive;
56 class vtkInformationExecutivePortKey;
57 class vtkInformationExecutivePortVectorKey;
65 class vtkInformationKey;
66 class vtkInformationKeyToInformationFriendship;
76 class vtkVariant;
77 
78 #if defined(_WIN32)
79 # define VTK_INFORMATION_EXPORT
80 #else
81 # define VTK_INFORMATION_EXPORT VTKCOMMONCORE_EXPORT
82 #endif
83 
84 
86 {
87 public:
88  VTKCOMMONCORE_EXPORT static vtkInformation *New();
89  vtkTypeMacro(vtkInformation,vtkObject);
90  VTKCOMMONCORE_EXPORT void PrintSelf(ostream& os, vtkIndent indent);
91  VTKCOMMONCORE_EXPORT void PrintKeys(ostream& os, vtkIndent indent);
92 
95  VTKCOMMONCORE_EXPORT void Modified();
96 
100  VTKCOMMONCORE_EXPORT void Modified(vtkInformationKey* key);
101 
103  VTKCOMMONCORE_EXPORT void Clear();
104 
107  VTKCOMMONCORE_EXPORT int GetNumberOfKeys();
108 
114  VTKCOMMONCORE_EXPORT void Copy(vtkInformation* from, int deep=0);
115 
117 
121  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep=0);
122  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep=0);
123  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep=0);
124  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationVariantKey* key, int deep=0);
125  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationVariantVectorKey* key, int deep=0);
126  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep=0);
127  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep=0);
128  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep=0);
129  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep=0);
130  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep=0);
131  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep=0);
132  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep=0);
133  VTKCOMMONCORE_EXPORT void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep=0);
135 
140  VTKCOMMONCORE_EXPORT void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep=0);
141 
143  VTKCOMMONCORE_EXPORT int Has(vtkInformationKey* key);
144 
146  VTKCOMMONCORE_EXPORT void Remove(vtkInformationKey* key);
147 
149 
150  VTKCOMMONCORE_EXPORT void Set(vtkInformationRequestKey* key);
151  VTKCOMMONCORE_EXPORT void Remove(vtkInformationRequestKey* key);
152  VTKCOMMONCORE_EXPORT int Has(vtkInformationRequestKey* key);
154 
156 
157  VTKCOMMONCORE_EXPORT void Set(vtkInformationIntegerKey* key, int value);
158  VTKCOMMONCORE_EXPORT int Get(vtkInformationIntegerKey* key);
159  VTKCOMMONCORE_EXPORT void Remove(vtkInformationIntegerKey* key);
160  VTKCOMMONCORE_EXPORT int Has(vtkInformationIntegerKey* key);
162 
164 
165  VTKCOMMONCORE_EXPORT void Set(vtkInformationIdTypeKey* key, vtkIdType value);
166  VTKCOMMONCORE_EXPORT vtkIdType Get(vtkInformationIdTypeKey* key);
167  VTKCOMMONCORE_EXPORT void Remove(vtkInformationIdTypeKey* key);
168  VTKCOMMONCORE_EXPORT int Has(vtkInformationIdTypeKey* key);
170 
172 
173  VTKCOMMONCORE_EXPORT void Set(vtkInformationDoubleKey* key, double value);
174  VTKCOMMONCORE_EXPORT double Get(vtkInformationDoubleKey* key);
175  VTKCOMMONCORE_EXPORT void Remove(vtkInformationDoubleKey* key);
176  VTKCOMMONCORE_EXPORT int Has(vtkInformationDoubleKey* key);
178 
180 
181  VTKCOMMONCORE_EXPORT void Set(vtkInformationVariantKey* key, const vtkVariant& value);
182  VTKCOMMONCORE_EXPORT const vtkVariant& Get(vtkInformationVariantKey* key);
183  VTKCOMMONCORE_EXPORT void Remove(vtkInformationVariantKey* key);
184  VTKCOMMONCORE_EXPORT int Has(vtkInformationVariantKey* key);
186 
188 
189  VTKCOMMONCORE_EXPORT void Append(vtkInformationIntegerVectorKey* key, int value);
190  VTKCOMMONCORE_EXPORT void Set(vtkInformationIntegerVectorKey* key, int* value, int length);
191  VTKCOMMONCORE_EXPORT void Set(vtkInformationIntegerVectorKey* key, int value1,
192  int value2, int value3);
193  VTKCOMMONCORE_EXPORT void Set(vtkInformationIntegerVectorKey* key,
194  int value1, int value2, int value3,
195  int value4, int value5, int value6);
196  VTKCOMMONCORE_EXPORT int* Get(vtkInformationIntegerVectorKey* key);
197  VTKCOMMONCORE_EXPORT int Get(vtkInformationIntegerVectorKey* key, int idx);
198  VTKCOMMONCORE_EXPORT void Get(vtkInformationIntegerVectorKey* key, int* value);
199  VTKCOMMONCORE_EXPORT int Length(vtkInformationIntegerVectorKey* key);
200  VTKCOMMONCORE_EXPORT void Remove(vtkInformationIntegerVectorKey* key);
201  VTKCOMMONCORE_EXPORT int Has(vtkInformationIntegerVectorKey* key);
203 
205 
206  VTKCOMMONCORE_EXPORT void Append(vtkInformationStringVectorKey* key, const char* value);
207  VTKCOMMONCORE_EXPORT void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
208  VTKCOMMONCORE_EXPORT const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
209  VTKCOMMONCORE_EXPORT int Length(vtkInformationStringVectorKey* key);
210  VTKCOMMONCORE_EXPORT void Remove(vtkInformationStringVectorKey* key);
211  VTKCOMMONCORE_EXPORT int Has(vtkInformationStringVectorKey* key);
213 
215 
216  VTKCOMMONCORE_EXPORT void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
217  VTKCOMMONCORE_EXPORT int* Get(vtkInformationIntegerPointerKey* key);
218  VTKCOMMONCORE_EXPORT void Get(vtkInformationIntegerPointerKey* key, int* value);
219  VTKCOMMONCORE_EXPORT int Length(vtkInformationIntegerPointerKey* key);
220  VTKCOMMONCORE_EXPORT void Remove(vtkInformationIntegerPointerKey* key);
221  VTKCOMMONCORE_EXPORT int Has(vtkInformationIntegerPointerKey* key);
223 
225 
226  VTKCOMMONCORE_EXPORT void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
227  VTKCOMMONCORE_EXPORT unsigned long Get(vtkInformationUnsignedLongKey* key);
228  VTKCOMMONCORE_EXPORT void Remove(vtkInformationUnsignedLongKey* key);
229  VTKCOMMONCORE_EXPORT int Has(vtkInformationUnsignedLongKey* key);
231 
233 
234  VTKCOMMONCORE_EXPORT void Append(vtkInformationDoubleVectorKey* key, double value);
235  VTKCOMMONCORE_EXPORT void Set(vtkInformationDoubleVectorKey* key, double* value, int length);
236  VTKCOMMONCORE_EXPORT void Set(vtkInformationDoubleVectorKey* key, double value1,
237  double value2, double value3);
238  VTKCOMMONCORE_EXPORT void Set(vtkInformationDoubleVectorKey* key,
239  double value1, double value2, double value3,
240  double value4, double value5, double value6);
241  VTKCOMMONCORE_EXPORT double* Get(vtkInformationDoubleVectorKey* key);
242  VTKCOMMONCORE_EXPORT double Get(vtkInformationDoubleVectorKey* key, int idx);
243  VTKCOMMONCORE_EXPORT void Get(vtkInformationDoubleVectorKey* key, double* value);
244  VTKCOMMONCORE_EXPORT int Length(vtkInformationDoubleVectorKey* key);
245  VTKCOMMONCORE_EXPORT void Remove(vtkInformationDoubleVectorKey* key);
246  VTKCOMMONCORE_EXPORT int Has(vtkInformationDoubleVectorKey* key);
248 
250 
251  VTKCOMMONCORE_EXPORT void Append(vtkInformationVariantVectorKey* key, const vtkVariant& value);
252  VTKCOMMONCORE_EXPORT void Set(vtkInformationVariantVectorKey* key, const vtkVariant* value, int length);
253  VTKCOMMONCORE_EXPORT void Set(vtkInformationVariantVectorKey* key, const vtkVariant& value1,
254  const vtkVariant& value2, const vtkVariant& value3);
255  VTKCOMMONCORE_EXPORT void Set(vtkInformationVariantVectorKey* key,
256  const vtkVariant& value1, const vtkVariant& value2, const vtkVariant& value3,
257  const vtkVariant& value4, const vtkVariant& value5, const vtkVariant& value6);
258  VTKCOMMONCORE_EXPORT const vtkVariant* Get(vtkInformationVariantVectorKey* key);
259  VTKCOMMONCORE_EXPORT const vtkVariant& Get(vtkInformationVariantVectorKey* key, int idx);
260  VTKCOMMONCORE_EXPORT void Get(vtkInformationVariantVectorKey* key, vtkVariant* value);
261  VTKCOMMONCORE_EXPORT int Length(vtkInformationVariantVectorKey* key);
262  VTKCOMMONCORE_EXPORT void Remove(vtkInformationVariantVectorKey* key);
263  VTKCOMMONCORE_EXPORT int Has(vtkInformationVariantVectorKey* key);
265 
267 
268  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
269  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
270  VTKCOMMONCORE_EXPORT void Set(vtkInformationKeyVectorKey* key, vtkInformationKey** value, int length);
271  VTKCOMMONCORE_EXPORT void Remove(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
272  VTKCOMMONCORE_EXPORT vtkInformationKey** Get(vtkInformationKeyVectorKey* key);
273  VTKCOMMONCORE_EXPORT vtkInformationKey* Get(vtkInformationKeyVectorKey* key, int idx);
274  VTKCOMMONCORE_EXPORT void Get(vtkInformationKeyVectorKey* key, vtkInformationKey** value);
275  VTKCOMMONCORE_EXPORT int Length(vtkInformationKeyVectorKey* key);
276  VTKCOMMONCORE_EXPORT void Remove(vtkInformationKeyVectorKey* key);
277  VTKCOMMONCORE_EXPORT int Has(vtkInformationKeyVectorKey* key);
279 
280  // Provide extra overloads of this method to avoid requiring user
281  // code to include the headers for these key types. Avoid wrapping
282  // them because the original method can be called from the wrappers
283  // anyway and this causes a python help string to be too long.
284  //BTX
285  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
287  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationDoubleKey* value);
288  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
290  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
292  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
294  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
295  vtkInformationIntegerKey* value);
296  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
298  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationStringKey* value);
299  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
301  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
303  VTKCOMMONCORE_EXPORT void Append(vtkInformationKeyVectorKey* key,
305 
306  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
308  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
309  vtkInformationDoubleKey* value);
310  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
312  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
314  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
316  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
317  vtkInformationIntegerKey* value);
318  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
320  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
321  vtkInformationStringKey* value);
322  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
324  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
326  VTKCOMMONCORE_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
328  //ETX
329 
331 
332  VTKCOMMONCORE_EXPORT void Set(vtkInformationStringKey* key, const char*);
333  VTKCOMMONCORE_EXPORT const char* Get(vtkInformationStringKey* key);
334  VTKCOMMONCORE_EXPORT void Remove(vtkInformationStringKey* key);
335  VTKCOMMONCORE_EXPORT int Has(vtkInformationStringKey* key);
337 
339 
340  VTKCOMMONCORE_EXPORT void Set(vtkInformationInformationKey* key, vtkInformation*);
341  VTKCOMMONCORE_EXPORT vtkInformation* Get(vtkInformationInformationKey* key);
342  VTKCOMMONCORE_EXPORT void Remove(vtkInformationInformationKey* key);
343  VTKCOMMONCORE_EXPORT int Has(vtkInformationInformationKey* key);
345 
347 
348  VTKCOMMONCORE_EXPORT void Set(vtkInformationInformationVectorKey* key, vtkInformationVector*);
349  VTKCOMMONCORE_EXPORT vtkInformationVector* Get(vtkInformationInformationVectorKey* key);
350  VTKCOMMONCORE_EXPORT void Remove(vtkInformationInformationVectorKey* key);
351  VTKCOMMONCORE_EXPORT int Has(vtkInformationInformationVectorKey* key);
353 
355 
356  VTKCOMMONCORE_EXPORT void Set(vtkInformationObjectBaseKey* key, vtkObjectBase*);
357  VTKCOMMONCORE_EXPORT vtkObjectBase* Get(vtkInformationObjectBaseKey* key);
358  VTKCOMMONCORE_EXPORT void Remove(vtkInformationObjectBaseKey* key);
359  VTKCOMMONCORE_EXPORT int Has(vtkInformationObjectBaseKey* key);
361 
363 
364  VTKCOMMONCORE_EXPORT void Set(vtkInformationDataObjectKey* key,
365  vtkDataObject VTK_WRAP_EXTERN *);
366  VTKCOMMONCORE_EXPORT vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
367  VTKCOMMONCORE_EXPORT void Remove(vtkInformationDataObjectKey* key);
368  VTKCOMMONCORE_EXPORT int Has(vtkInformationDataObjectKey* key);
370 
372 
373  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationDataObjectKey* key);
374  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationDoubleKey* key);
375  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationDoubleVectorKey* key);
376  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationInformationKey* key);
377  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationInformationVectorKey* key);
378  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationIntegerKey* key);
379  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationIntegerVectorKey* key);
380  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationRequestKey* key);
381  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationStringKey* key);
382  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationStringVectorKey* key);
383  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationKey* key);
384  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationUnsignedLongKey* key);
385  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationVariantKey* key);
386  VTKCOMMONCORE_EXPORT static vtkInformationKey* GetKey(vtkInformationVariantVectorKey* key);
388 
390 
391  VTKCOMMONCORE_EXPORT virtual void Register(vtkObjectBase* o);
392  VTKCOMMONCORE_EXPORT virtual void UnRegister(vtkObjectBase* o);
394 
396 
397  VTKCOMMONCORE_EXPORT void SetRequest(vtkInformationRequestKey* request);
398  VTKCOMMONCORE_EXPORT vtkInformationRequestKey* GetRequest();
400 
401 protected:
402  VTKCOMMONCORE_EXPORT vtkInformation();
403  VTKCOMMONCORE_EXPORT ~vtkInformation();
404 
405  // Get/Set a map entry directly through the vtkObjectBase instance
406  // representing the value. Used internally to manage the map.
407  VTKCOMMONCORE_EXPORT void SetAsObjectBase(
408  vtkInformationKey* key, vtkObjectBase* value);
409  VTKCOMMONCORE_EXPORT const vtkObjectBase* GetAsObjectBase(
410  const vtkInformationKey* key) const;
411  VTKCOMMONCORE_EXPORT vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
412 
413  // Internal implementation details.
415 
416  // Garbage collection support.
417  VTKCOMMONCORE_EXPORT virtual void ReportReferences(vtkGarbageCollector*);
418 
419  // Report the object associated with the given key to the collector.
420  VTKCOMMONCORE_EXPORT void ReportAsObjectBase(vtkInformationKey* key,
421  vtkGarbageCollector* collector);
422 
423 private:
424  //BTX
425  friend class vtkInformationKeyToInformationFriendship;
427  //ETX
428 private:
429  VTKCOMMONCORE_EXPORT vtkInformation(const vtkInformation&); // Not implemented.
430  VTKCOMMONCORE_EXPORT void operator=(const vtkInformation&); // Not implemented.
431  vtkInformationRequestKey *Request;
432 };
433 
434 #endif
435 // VTK-HeaderTest-Exclude: vtkInformation.h
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual void Register(vtkObjectBase *o)
Key for vtkInformation values.
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
vtkInformationInternals * Internal
internal structure for vtkInformation
int vtkIdType
Definition: vtkType.h:268
Key for string values in vtkInformation.
Detect and break reference loops.
A atomic type representing the union of many types.
Definition: vtkVariant.h:78
Superclass for vtkInformation keys.
Key for double vector values.
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void UnRegister(vtkObjectBase *o)
a simple class to control print indentation
Definition: vtkIndent.h:38
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()
abstract base class for most VTK objects
Definition: vtkObjectBase.h:57
Key for variant values in vtkInformation.
Key for String vector values.
Key for vector-of-keys values.
#define VTK_INFORMATION_EXPORT
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
Key for vtkIdType values in vtkInformation.