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 =========================================================================*/
36 #ifndef __vtkInformation_h
37 #define __vtkInformation_h
38 
39 #include "vtkObject.h"
40 
41 // If being "compiled" by gccxml, pretend VTK_COMMON_EXPORT is nothing
42 // for this header file. The per-method usage of VTK_COMMON_EXPORT in
43 // this header file leads to gccxml errors without this workaround.
44 //
45 #ifdef __GCCXML__
46 #undef VTK_COMMON_EXPORT
47 #define VTK_COMMON_EXPORT
48 #endif
49 
50 class vtkDataObject;
51 class vtkExecutive;
55 class vtkInformationExecutivePortKey;
56 class vtkInformationExecutivePortVectorKey;
64 class vtkInformationKey;
65 class vtkInformationKeyToInformationFriendship;
73 
74 #if defined(_WIN32)
75 # define VTK_INFORMATION_EXPORT
76 #else
77 # define VTK_INFORMATION_EXPORT VTK_COMMON_EXPORT
78 #endif
79 
80 
82 {
83 public:
85  vtkTypeMacro(vtkInformation,vtkObject);
86  VTK_COMMON_EXPORT void PrintSelf(ostream& os, vtkIndent indent);
87  VTK_COMMON_EXPORT void PrintKeys(ostream& os, vtkIndent indent);
88 
92 
97 
99  VTK_COMMON_EXPORT void Clear();
100 
103  VTK_COMMON_EXPORT int GetNumberOfKeys();
104 
110  VTK_COMMON_EXPORT void Copy(vtkInformation* from, int deep=0);
111 
113 
117  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep=0);
118  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep=0);
119  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep=0);
120  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep=0);
121  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep=0);
122  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep=0);
123  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep=0);
124  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep=0);
125  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep=0);
126  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep=0);
127  VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep=0);
129 
134  VTK_COMMON_EXPORT void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep=0);
135 
137  VTK_COMMON_EXPORT int Has(vtkInformationKey* key);
138 
140  VTK_COMMON_EXPORT void Remove(vtkInformationKey* key);
141 
143 
148 
150 
151  VTK_COMMON_EXPORT void Set(vtkInformationIntegerKey* key, int value);
156 
158 
161  VTK_COMMON_EXPORT void Remove(vtkInformationIdTypeKey* key);
164 
166 
167  VTK_COMMON_EXPORT void Set(vtkInformationDoubleKey* key, double value);
169  VTK_COMMON_EXPORT void Remove(vtkInformationDoubleKey* key);
172 
174 
175  VTK_COMMON_EXPORT void Append(vtkInformationIntegerVectorKey* key, int value);
176  VTK_COMMON_EXPORT void Set(vtkInformationIntegerVectorKey* key, int* value, int length);
177  VTK_COMMON_EXPORT void Set(vtkInformationIntegerVectorKey* key, int value1,
178  int value2, int value3);
180  int value1, int value2, int value3,
181  int value4, int value5, int value6);
183  VTK_COMMON_EXPORT int Get(vtkInformationIntegerVectorKey* key, int idx);
184  VTK_COMMON_EXPORT void Get(vtkInformationIntegerVectorKey* key, int* value);
189 
191 
192  VTK_COMMON_EXPORT void Append(vtkInformationStringVectorKey* key, const char* value);
193  VTK_COMMON_EXPORT void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
194  VTK_COMMON_EXPORT const char* Get(vtkInformationStringVectorKey* key, int idx = 0);
199 
201 
202  VTK_COMMON_EXPORT void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
204  VTK_COMMON_EXPORT void Get(vtkInformationIntegerPointerKey* key, int* value);
209 
211 
212  VTK_COMMON_EXPORT void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
213  VTK_COMMON_EXPORT unsigned long Get(vtkInformationUnsignedLongKey* key);
217 
219 
220  VTK_COMMON_EXPORT void Append(vtkInformationDoubleVectorKey* key, double value);
221  VTK_COMMON_EXPORT void Set(vtkInformationDoubleVectorKey* key, double* value, int length);
222  VTK_COMMON_EXPORT void Set(vtkInformationDoubleVectorKey* key, double value1,
223  double value2, double value3);
225  double value1, double value2, double value3,
226  double value4, double value5, double value6);
228  VTK_COMMON_EXPORT double Get(vtkInformationDoubleVectorKey* key, int idx);
229  VTK_COMMON_EXPORT void Get(vtkInformationDoubleVectorKey* key, double* value);
234 
236 
238  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
239  VTK_COMMON_EXPORT void Set(vtkInformationKeyVectorKey* key, vtkInformationKey** value, int length);
248 
249  // Provide extra overloads of this method to avoid requiring user
250  // code to include the headers for these key types. Avoid wrapping
251  // them because the original method can be called from the wrappers
252  // anyway and this causes a python help string to be too long.
253  //BTX
264  vtkInformationIntegerKey* value);
274 
275  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
277  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
278  vtkInformationDoubleKey* value);
279  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
281  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
283  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
285  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
286  vtkInformationIntegerKey* value);
287  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
289  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
290  vtkInformationStringKey* value);
291  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
293  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
295  VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
297  //ETX
298 
300 
301  VTK_COMMON_EXPORT void Set(vtkInformationStringKey* key, const char*);
302  VTK_COMMON_EXPORT const char* Get(vtkInformationStringKey* key);
303  VTK_COMMON_EXPORT void Remove(vtkInformationStringKey* key);
306 
308 
314 
316 
322 
324 
330 
332 
334  vtkDataObject VTK_WRAP_EXTERN *);
339 
341 
355 
357 
358  VTK_COMMON_EXPORT virtual void Register(vtkObjectBase* o);
359  VTK_COMMON_EXPORT virtual void UnRegister(vtkObjectBase* o);
361 
363 
364  VTK_COMMON_EXPORT void SetRequest(vtkInformationRequestKey* request);
367 
368 #if !defined(__WRAP__)
369 
374  VTK_LEGACY(VTK_FILTERING_EXPORT void CopyEntry(vtkInformation* from, vtkInformationExecutivePortKey* key, int deep=0));
375 
377 
379  VTK_LEGACY(VTK_FILTERING_EXPORT void Append(
381  vtkInformationExecutivePortKey* value));
382  // Description:
383  // Append an InformationKey-vector-valued entry.
384  // @deprecated Replaced by vtkInformationExecutivePortKey::AppendUnique() as of VTK 5.2.
385  VTK_LEGACY(VTK_FILTERING_EXPORT void AppendUnique(
387  vtkInformationExecutivePortKey* value));
389 
391 
394  VTK_LEGACY(VTK_FILTERING_EXPORT
395  void Set(vtkInformationExecutivePortKey* key, vtkExecutive*, int));
396  // Description:
397  // Retrieve/Modify an entry storing a vtkExecutive/port number pair.
398  // @deprecated Replaced by vtkInformationExecutivePortKey::GetExecutive() as of VTK 5.2.
399  VTK_LEGACY(VTK_FILTERING_EXPORT
400  vtkExecutive* GetExecutive(vtkInformationExecutivePortKey* key));
401  // Description:
402  // Retrieve/Modify an entry storing a vtkExecutive/port number pair.
403  // @deprecated Replaced by vtkInformationExecutivePortKey::GetPort() as of VTK 5.2.
404  VTK_LEGACY(VTK_FILTERING_EXPORT
405  int GetPort(vtkInformationExecutivePortKey* key));
406  // Description:
407  // Retrieve/Modify an entry storing a vtkExecutive/port number pair.
408  // @deprecated Replaced by vtkInformationExecutivePortKey::Get() as of VTK 5.2.
409  VTK_LEGACY(VTK_FILTERING_EXPORT
410  void Get(vtkInformationExecutivePortKey* key, vtkExecutive*& executive, int &port));
411  // Description:
412  // Retrieve/Modify an entry storing a vtkExecutive/port number pair.
413  // @deprecated Replaced by vtkInformationExecutivePortKey::Remove() as of VTK 5.2.
414  VTK_LEGACY(VTK_FILTERING_EXPORT
415  void Remove(vtkInformationExecutivePortKey* key));
416  // Description:
417  // Retrieve/Modify an entry storing a vtkExecutive/port number pair.
418  // @deprecated Replaced by vtkInformationExecutivePortKey::Has() as of VTK 5.2.
419  VTK_LEGACY(VTK_FILTERING_EXPORT
420  int Has(vtkInformationExecutivePortKey* key));
422 
424 
427  VTK_LEGACY(VTK_FILTERING_EXPORT
428  void Append(vtkInformationExecutivePortVectorKey* key,
429  vtkExecutive* executive, int port));
430  // Description:
431  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
432  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Remove() as of VTK 5.2.
433  VTK_LEGACY(VTK_FILTERING_EXPORT
434  void Remove(vtkInformationExecutivePortVectorKey* key,
435  vtkExecutive* executive, int port));
436  // Description:
437  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
438  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Set() as of VTK 5.2.
439  VTK_LEGACY(VTK_FILTERING_EXPORT
440  void Set(vtkInformationExecutivePortVectorKey* key,
441  vtkExecutive** executives, int* ports, int length));
442  // Description:
443  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
444  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::GetExecutives() as of VTK 5.2.
445  VTK_LEGACY(VTK_FILTERING_EXPORT
446  vtkExecutive** GetExecutives(vtkInformationExecutivePortVectorKey* key));
447  // Description:
448  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
449  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::GetPorts() as of VTK 5.2.
450  VTK_LEGACY(VTK_FILTERING_EXPORT
451  int* GetPorts(vtkInformationExecutivePortVectorKey* key));
452  // Description:
453  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
454  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Get() as of VTK 5.2.
455  VTK_LEGACY(VTK_FILTERING_EXPORT
456  void Get(vtkInformationExecutivePortVectorKey* key,
457  vtkExecutive** executives, int* ports));
458  // Description:
459  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
460  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Length() as of VTK 5.2.
461  VTK_LEGACY(VTK_FILTERING_EXPORT
462  int Length(vtkInformationExecutivePortVectorKey* key));
463  // Description:
464  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
465  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Remove() as of VTK 5.2.
466  VTK_LEGACY(VTK_FILTERING_EXPORT
467  void Remove(vtkInformationExecutivePortVectorKey* key));
468  // Description:
469  // Retrieve/Modify an entry storing a vector of vtkExecutive/port number pairs.
470  // @deprecated Replaced by vtkInformationExecutivePortVectorKey::Has() as of VTK 5.2.
471  VTK_LEGACY(VTK_FILTERING_EXPORT
472  int Has(vtkInformationExecutivePortVectorKey* key));
474 
476 
478  VTK_LEGACY(VTK_FILTERING_EXPORT
479  static vtkInformationKey* GetKey(vtkInformationExecutivePortKey* key));
480 #endif // !defined(__WRAP__)
481 
482 
483 protected:
486 
487  // Get/Set a map entry directly through the vtkObjectBase instance
488  // representing the value. Used internally to manage the map.
489  VTK_COMMON_EXPORT void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
490  VTK_COMMON_EXPORT vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
491 
492  // Internal implementation details.
494 
495  // Garbage collection support.
497 
498  // Report the object associated with the given key to the collector.
499  VTK_COMMON_EXPORT void ReportAsObjectBase(vtkInformationKey* key,
500  vtkGarbageCollector* collector);
501 
502 private:
503  //BTX
504  friend class vtkInformationKeyToInformationFriendship;
506  //ETX
507 private:
508  VTK_COMMON_EXPORT vtkInformation(const vtkInformation&); // Not implemented.
509  VTK_COMMON_EXPORT void operator=(const vtkInformation&); // Not implemented.
510  vtkInformationRequestKey *Request;
511 };
512 
513 #endif
Key for unsigned long values in vtkInformation.
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void Register(vtkObjectBase *o)
Key for vtkInformation values.
Store vtkAlgorithm input/output information.
#define VTK_FILTERING_EXPORT
Key for vtkDataObject values.
vtkInformationInternals * Internal
internal structure for vtkInformation
int vtkIdType
Definition: vtkType.h:255
Key for string values in vtkInformation.
Detect and break reference loops.
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:37
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.
#define VTK_COMMON_EXPORT
virtual void Modified()
abstract base class for most VTK objects
Definition: vtkObjectBase.h:59
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()
helper class to get VTK data object types as string and instantiate them
Key for vtkIdType values in vtkInformation.