VTK
dox/Common/vtkInformation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkInformation.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00036 #ifndef __vtkInformation_h
00037 #define __vtkInformation_h
00038 
00039 #include "vtkObject.h"
00040 
00041 // If being "compiled" by gccxml, pretend VTK_COMMON_EXPORT is nothing
00042 // for this header file. The per-method usage of VTK_COMMON_EXPORT in
00043 // this header file leads to gccxml errors without this workaround.
00044 //
00045 #ifdef __GCCXML__
00046 #undef VTK_COMMON_EXPORT
00047 #define VTK_COMMON_EXPORT
00048 #endif
00049 
00050 class vtkDataObject;
00051 class vtkExecutive;
00052 class vtkInformationDataObjectKey;
00053 class vtkInformationDoubleKey;
00054 class vtkInformationDoubleVectorKey;
00055 class vtkInformationExecutivePortKey;
00056 class vtkInformationExecutivePortVectorKey;
00057 class vtkInformationIdTypeKey;
00058 class vtkInformationInformationKey;
00059 class vtkInformationInformationVectorKey;
00060 class vtkInformationIntegerKey;
00061 class vtkInformationIntegerPointerKey;
00062 class vtkInformationIntegerVectorKey;
00063 class vtkInformationInternals;
00064 class vtkInformationKey;
00065 class vtkInformationKeyToInformationFriendship;
00066 class vtkInformationKeyVectorKey;
00067 class vtkInformationObjectBaseKey;
00068 class vtkInformationRequestKey;
00069 class vtkInformationStringKey;
00070 class vtkInformationStringVectorKey;
00071 class vtkInformationUnsignedLongKey;
00072 class vtkInformationVector;
00073 
00074 #if defined(_WIN32)
00075 # define VTK_INFORMATION_EXPORT
00076 #else
00077 # define VTK_INFORMATION_EXPORT VTK_COMMON_EXPORT
00078 #endif
00079 
00080 
00081 class VTK_INFORMATION_EXPORT vtkInformation : public vtkObject 
00082 {
00083 public:
00084   VTK_COMMON_EXPORT static vtkInformation *New();
00085   vtkTypeMacro(vtkInformation,vtkObject);
00086   VTK_COMMON_EXPORT void PrintSelf(ostream& os, vtkIndent indent);
00087   VTK_COMMON_EXPORT void PrintKeys(ostream& os, vtkIndent indent);
00088 
00091   VTK_COMMON_EXPORT void Modified();
00092 
00096   VTK_COMMON_EXPORT void Modified(vtkInformationKey* key);
00097 
00099   VTK_COMMON_EXPORT void Clear();
00100 
00103   VTK_COMMON_EXPORT int GetNumberOfKeys();
00104 
00110   VTK_COMMON_EXPORT void Copy(vtkInformation* from, int deep=0);
00111 
00113 
00117   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationKey* key, int deep=0);
00118   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDataObjectKey* key, int deep=0);
00119   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationDoubleVectorKey* key, int deep=0);
00120   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationKey* key, int deep=0);
00121   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationInformationVectorKey* key, int deep=0);
00122   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerKey* key, int deep=0);
00123   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationIntegerVectorKey* key, int deep=0);
00124   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationRequestKey* key, int deep=0);
00125   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringKey* key, int deep=0);
00126   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationStringVectorKey* key, int deep=0);
00127   VTK_COMMON_EXPORT void CopyEntry(vtkInformation* from, vtkInformationUnsignedLongKey* key, int deep=0);
00129 
00134   VTK_COMMON_EXPORT void CopyEntries(vtkInformation* from, vtkInformationKeyVectorKey* key, int deep=0);
00135 
00137   VTK_COMMON_EXPORT int Has(vtkInformationKey* key);
00138 
00140   VTK_COMMON_EXPORT void Remove(vtkInformationKey* key);
00141 
00143 
00144   VTK_COMMON_EXPORT void Set(vtkInformationRequestKey* key);
00145   VTK_COMMON_EXPORT void Remove(vtkInformationRequestKey* key);
00146   VTK_COMMON_EXPORT int Has(vtkInformationRequestKey* key);
00148 
00150 
00151   VTK_COMMON_EXPORT void Set(vtkInformationIntegerKey* key, int value);
00152   VTK_COMMON_EXPORT int Get(vtkInformationIntegerKey* key);
00153   VTK_COMMON_EXPORT void Remove(vtkInformationIntegerKey* key);
00154   VTK_COMMON_EXPORT int Has(vtkInformationIntegerKey* key);
00156 
00158 
00159   VTK_COMMON_EXPORT void Set(vtkInformationIdTypeKey* key, vtkIdType value);
00160   VTK_COMMON_EXPORT vtkIdType Get(vtkInformationIdTypeKey* key);
00161   VTK_COMMON_EXPORT void Remove(vtkInformationIdTypeKey* key);
00162   VTK_COMMON_EXPORT int Has(vtkInformationIdTypeKey* key);
00164 
00166 
00167   VTK_COMMON_EXPORT void Set(vtkInformationDoubleKey* key, double value);
00168   VTK_COMMON_EXPORT double Get(vtkInformationDoubleKey* key);
00169   VTK_COMMON_EXPORT void Remove(vtkInformationDoubleKey* key);
00170   VTK_COMMON_EXPORT int Has(vtkInformationDoubleKey* key);
00172 
00174 
00175   VTK_COMMON_EXPORT void Append(vtkInformationIntegerVectorKey* key, int value);
00176   VTK_COMMON_EXPORT void Set(vtkInformationIntegerVectorKey* key, int* value, int length);
00177   VTK_COMMON_EXPORT void Set(vtkInformationIntegerVectorKey* key, int value1,
00178            int value2, int value3);
00179   VTK_COMMON_EXPORT void Set(vtkInformationIntegerVectorKey* key,
00180            int value1, int value2, int value3,
00181            int value4, int value5, int value6);
00182   VTK_COMMON_EXPORT int* Get(vtkInformationIntegerVectorKey* key);
00183   VTK_COMMON_EXPORT int  Get(vtkInformationIntegerVectorKey* key, int idx);
00184   VTK_COMMON_EXPORT void Get(vtkInformationIntegerVectorKey* key, int* value);
00185   VTK_COMMON_EXPORT int Length(vtkInformationIntegerVectorKey* key);
00186   VTK_COMMON_EXPORT void Remove(vtkInformationIntegerVectorKey* key);
00187   VTK_COMMON_EXPORT int Has(vtkInformationIntegerVectorKey* key);
00189 
00191 
00192   VTK_COMMON_EXPORT void Append(vtkInformationStringVectorKey* key, const char* value);
00193   VTK_COMMON_EXPORT void Set(vtkInformationStringVectorKey* key, const char* value, int idx = 0);
00194   VTK_COMMON_EXPORT const char*  Get(vtkInformationStringVectorKey* key, int idx = 0);
00195   VTK_COMMON_EXPORT int Length(vtkInformationStringVectorKey* key);
00196   VTK_COMMON_EXPORT void Remove(vtkInformationStringVectorKey* key);
00197   VTK_COMMON_EXPORT int Has(vtkInformationStringVectorKey* key);
00199 
00201 
00202   VTK_COMMON_EXPORT void Set(vtkInformationIntegerPointerKey* key, int* value, int length);
00203   VTK_COMMON_EXPORT int* Get(vtkInformationIntegerPointerKey* key);
00204   VTK_COMMON_EXPORT void Get(vtkInformationIntegerPointerKey* key, int* value);
00205   VTK_COMMON_EXPORT int Length(vtkInformationIntegerPointerKey* key);
00206   VTK_COMMON_EXPORT void Remove(vtkInformationIntegerPointerKey* key);
00207   VTK_COMMON_EXPORT int Has(vtkInformationIntegerPointerKey* key);
00209 
00211 
00212   VTK_COMMON_EXPORT void Set(vtkInformationUnsignedLongKey* key, unsigned long value);
00213   VTK_COMMON_EXPORT unsigned long Get(vtkInformationUnsignedLongKey* key);
00214   VTK_COMMON_EXPORT void Remove(vtkInformationUnsignedLongKey* key);
00215   VTK_COMMON_EXPORT int Has(vtkInformationUnsignedLongKey* key);
00217 
00219 
00220   VTK_COMMON_EXPORT void Append(vtkInformationDoubleVectorKey* key, double value);
00221   VTK_COMMON_EXPORT void Set(vtkInformationDoubleVectorKey* key, double* value, int length);
00222   VTK_COMMON_EXPORT void Set(vtkInformationDoubleVectorKey* key, double value1,
00223            double value2, double value3);
00224   VTK_COMMON_EXPORT void Set(vtkInformationDoubleVectorKey* key,
00225            double value1, double value2, double value3,
00226            double value4, double value5, double value6);
00227   VTK_COMMON_EXPORT double* Get(vtkInformationDoubleVectorKey* key);
00228   VTK_COMMON_EXPORT double  Get(vtkInformationDoubleVectorKey* key, int idx);
00229   VTK_COMMON_EXPORT void Get(vtkInformationDoubleVectorKey* key, double* value);
00230   VTK_COMMON_EXPORT int Length(vtkInformationDoubleVectorKey* key);
00231   VTK_COMMON_EXPORT void Remove(vtkInformationDoubleVectorKey* key);
00232   VTK_COMMON_EXPORT int Has(vtkInformationDoubleVectorKey* key);
00234 
00236 
00237   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
00238   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
00239   VTK_COMMON_EXPORT void Set(vtkInformationKeyVectorKey* key, vtkInformationKey** value, int length);
00240   VTK_COMMON_EXPORT void Remove(vtkInformationKeyVectorKey* key, vtkInformationKey* value);
00241   VTK_COMMON_EXPORT vtkInformationKey** Get(vtkInformationKeyVectorKey* key);
00242   VTK_COMMON_EXPORT vtkInformationKey*  Get(vtkInformationKeyVectorKey* key, int idx);
00243   VTK_COMMON_EXPORT void Get(vtkInformationKeyVectorKey* key, vtkInformationKey** value);
00244   VTK_COMMON_EXPORT int Length(vtkInformationKeyVectorKey* key);
00245   VTK_COMMON_EXPORT void Remove(vtkInformationKeyVectorKey* key);
00246   VTK_COMMON_EXPORT int Has(vtkInformationKeyVectorKey* key);
00248 
00249   // Provide extra overloads of this method to avoid requiring user
00250   // code to include the headers for these key types.  Avoid wrapping
00251   // them because the original method can be called from the wrappers
00252   // anyway and this causes a python help string to be too long.
00253   //BTX
00254   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00255               vtkInformationDataObjectKey* value);
00256   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationDoubleKey* value);
00257   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00258               vtkInformationDoubleVectorKey* value);
00259   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00260               vtkInformationInformationKey* value);
00261   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00262               vtkInformationInformationVectorKey* value);
00263   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00264               vtkInformationIntegerKey* value);
00265   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00266               vtkInformationIntegerVectorKey* value);
00267   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key, vtkInformationStringKey* value);
00268   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00269               vtkInformationStringVectorKey* value);
00270   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00271               vtkInformationObjectBaseKey* value);
00272   VTK_COMMON_EXPORT void Append(vtkInformationKeyVectorKey* key,
00273               vtkInformationUnsignedLongKey* value);
00274 
00275   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00276                     vtkInformationDataObjectKey* value);
00277   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00278                     vtkInformationDoubleKey* value);
00279   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00280                     vtkInformationDoubleVectorKey* value);
00281   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00282                     vtkInformationInformationKey* value);
00283   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00284                     vtkInformationInformationVectorKey* value);
00285   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00286                     vtkInformationIntegerKey* value);
00287   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00288                     vtkInformationIntegerVectorKey* value);
00289   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00290                     vtkInformationStringKey* value);
00291   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00292                     vtkInformationStringVectorKey* value);
00293   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00294                     vtkInformationObjectBaseKey* value);
00295   VTK_COMMON_EXPORT void AppendUnique(vtkInformationKeyVectorKey* key,
00296                     vtkInformationUnsignedLongKey* value);
00297   //ETX
00298 
00300 
00301   VTK_COMMON_EXPORT void Set(vtkInformationStringKey* key, const char*);
00302   VTK_COMMON_EXPORT const char* Get(vtkInformationStringKey* key);
00303   VTK_COMMON_EXPORT void Remove(vtkInformationStringKey* key);
00304   VTK_COMMON_EXPORT int Has(vtkInformationStringKey* key);
00306 
00308 
00309   VTK_COMMON_EXPORT void Set(vtkInformationInformationKey* key, vtkInformation*);
00310   VTK_COMMON_EXPORT vtkInformation* Get(vtkInformationInformationKey* key);
00311   VTK_COMMON_EXPORT void Remove(vtkInformationInformationKey* key);
00312   VTK_COMMON_EXPORT int Has(vtkInformationInformationKey* key);
00314 
00316 
00317   VTK_COMMON_EXPORT void Set(vtkInformationInformationVectorKey* key, vtkInformationVector*);
00318   VTK_COMMON_EXPORT vtkInformationVector* Get(vtkInformationInformationVectorKey* key);
00319   VTK_COMMON_EXPORT void Remove(vtkInformationInformationVectorKey* key);
00320   VTK_COMMON_EXPORT int Has(vtkInformationInformationVectorKey* key);
00322 
00324 
00325   VTK_COMMON_EXPORT void Set(vtkInformationObjectBaseKey* key, vtkObjectBase*);
00326   VTK_COMMON_EXPORT vtkObjectBase* Get(vtkInformationObjectBaseKey* key);
00327   VTK_COMMON_EXPORT void Remove(vtkInformationObjectBaseKey* key);
00328   VTK_COMMON_EXPORT int Has(vtkInformationObjectBaseKey* key);
00330 
00332 
00333   VTK_COMMON_EXPORT void Set(vtkInformationDataObjectKey* key,
00334     vtkDataObject VTK_WRAP_EXTERN *);
00335   VTK_COMMON_EXPORT vtkDataObject VTK_WRAP_EXTERN* Get(vtkInformationDataObjectKey* key);
00336   VTK_COMMON_EXPORT void Remove(vtkInformationDataObjectKey* key);
00337   VTK_COMMON_EXPORT int Has(vtkInformationDataObjectKey* key);
00339 
00341 
00342   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationDataObjectKey* key);
00343   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationDoubleKey* key);
00344   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationDoubleVectorKey* key);
00345   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationInformationKey* key);
00346   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationInformationVectorKey* key);
00347   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationIntegerKey* key);
00348   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationIntegerVectorKey* key);
00349   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationRequestKey* key);
00350   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationStringKey* key);
00351   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationStringVectorKey* key);
00352   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationKey* key);
00353   VTK_COMMON_EXPORT static vtkInformationKey* GetKey(vtkInformationUnsignedLongKey* key);
00355 
00357 
00358   VTK_COMMON_EXPORT virtual void Register(vtkObjectBase* o);
00359   VTK_COMMON_EXPORT virtual void UnRegister(vtkObjectBase* o);
00361 
00363 
00364   VTK_COMMON_EXPORT void SetRequest(vtkInformationRequestKey* request);
00365   VTK_COMMON_EXPORT vtkInformationRequestKey* GetRequest();
00367 
00368 #if !defined(__WRAP__)
00369 
00374   VTK_LEGACY(VTK_FILTERING_EXPORT void CopyEntry(vtkInformation* from, vtkInformationExecutivePortKey* key, int deep=0));
00375 
00377 
00379   VTK_LEGACY(VTK_FILTERING_EXPORT void Append(
00380       vtkInformationKeyVectorKey* key,
00381       vtkInformationExecutivePortKey* value));
00383 
00384 
00386   VTK_LEGACY(VTK_FILTERING_EXPORT void AppendUnique(
00387       vtkInformationKeyVectorKey* key,
00388       vtkInformationExecutivePortKey* value));
00390 
00392 
00395   VTK_LEGACY(VTK_FILTERING_EXPORT
00396     void Set(vtkInformationExecutivePortKey* key, vtkExecutive*, int));
00398 
00399 
00402   VTK_LEGACY(VTK_FILTERING_EXPORT
00403     vtkExecutive* GetExecutive(vtkInformationExecutivePortKey* key));
00405 
00406 
00409   VTK_LEGACY(VTK_FILTERING_EXPORT
00410     int GetPort(vtkInformationExecutivePortKey* key));
00412 
00413 
00416   VTK_LEGACY(VTK_FILTERING_EXPORT
00417     void Get(vtkInformationExecutivePortKey* key, vtkExecutive*& executive, int &port));
00419 
00420 
00423   VTK_LEGACY(VTK_FILTERING_EXPORT
00424     void Remove(vtkInformationExecutivePortKey* key));
00426 
00427 
00430   VTK_LEGACY(VTK_FILTERING_EXPORT
00431     int Has(vtkInformationExecutivePortKey* key));
00433 
00435 
00438   VTK_LEGACY(VTK_FILTERING_EXPORT
00439     void Append(vtkInformationExecutivePortVectorKey* key,
00440               vtkExecutive* executive, int port));
00442 
00443 
00446   VTK_LEGACY(VTK_FILTERING_EXPORT
00447     void Remove(vtkInformationExecutivePortVectorKey* key,
00448               vtkExecutive* executive, int port));
00450 
00451 
00454   VTK_LEGACY(VTK_FILTERING_EXPORT
00455     void Set(vtkInformationExecutivePortVectorKey* key,
00456            vtkExecutive** executives, int* ports, int length));
00458 
00459 
00462   VTK_LEGACY(VTK_FILTERING_EXPORT
00463     vtkExecutive** GetExecutives(vtkInformationExecutivePortVectorKey* key));
00465 
00466 
00469   VTK_LEGACY(VTK_FILTERING_EXPORT
00470     int* GetPorts(vtkInformationExecutivePortVectorKey* key));
00472 
00473 
00476   VTK_LEGACY(VTK_FILTERING_EXPORT
00477     void Get(vtkInformationExecutivePortVectorKey* key,
00478            vtkExecutive** executives, int* ports));
00480 
00481 
00484   VTK_LEGACY(VTK_FILTERING_EXPORT
00485     int Length(vtkInformationExecutivePortVectorKey* key));
00487 
00488 
00491   VTK_LEGACY(VTK_FILTERING_EXPORT
00492     void Remove(vtkInformationExecutivePortVectorKey* key));
00494 
00495 
00498   VTK_LEGACY(VTK_FILTERING_EXPORT
00499     int Has(vtkInformationExecutivePortVectorKey* key));
00501 
00503 
00505   VTK_LEGACY(VTK_FILTERING_EXPORT
00506     static vtkInformationKey* GetKey(vtkInformationExecutivePortKey* key));
00507 #endif // !defined(__WRAP__)
00508 
00509 
00510 protected:
00511   VTK_COMMON_EXPORT vtkInformation();
00512   VTK_COMMON_EXPORT ~vtkInformation();
00513 
00514   // Get/Set a map entry directly through the vtkObjectBase instance
00515   // representing the value.  Used internally to manage the map.
00516   VTK_COMMON_EXPORT void SetAsObjectBase(vtkInformationKey* key, vtkObjectBase* value);
00517   VTK_COMMON_EXPORT vtkObjectBase* GetAsObjectBase(vtkInformationKey* key);
00518 
00519   // Internal implementation details.
00520   vtkInformationInternals* Internal;
00521 
00522   // Garbage collection support.
00523   VTK_COMMON_EXPORT virtual void ReportReferences(vtkGarbageCollector*);
00524 
00525   // Report the object associated with the given key to the collector.
00526   VTK_COMMON_EXPORT void ReportAsObjectBase(vtkInformationKey* key,
00527                           vtkGarbageCollector* collector);
00528 
00529 private:
00530   //BTX
00531   friend class vtkInformationKeyToInformationFriendship;
00532   friend class vtkInformationIterator;
00533   //ETX
00534 private:
00535   VTK_COMMON_EXPORT vtkInformation(const vtkInformation&);  // Not implemented.
00536   VTK_COMMON_EXPORT void operator=(const vtkInformation&);  // Not implemented.
00537   vtkInformationRequestKey *Request;
00538 };
00539 
00540 #endif