VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInformationObjectBaseVectorKey.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 =========================================================================*/ 00024 #ifndef __vtkInformationObjectBaseVectorKey_h 00025 #define __vtkInformationObjectBaseVectorKey_h 00026 00027 #include "vtkCommonCoreModule.h" // For export macro 00028 #include "vtkInformationKey.h" 00029 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type. 00030 00031 class vtkInformationObjectBaseVectorValue; 00032 00033 class VTKCOMMONCORE_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey 00034 { 00035 public: 00036 vtkTypeMacro(vtkInformationObjectBaseVectorKey,vtkInformationKey); 00037 void PrintSelf(ostream& os, vtkIndent indent); 00039 00045 vtkInformationObjectBaseVectorKey(const char* name, 00046 const char* location, 00047 const char* requiredClass=0); 00048 // 00049 ~vtkInformationObjectBaseVectorKey(); 00051 00053 void Clear(vtkInformation* info); 00056 void Resize(vtkInformation* info, int n); 00058 00059 int Size(vtkInformation* info); 00060 int Length(vtkInformation* info){ return this->Size(info); } 00062 00063 void Append(vtkInformation* info, vtkObjectBase *value); 00065 void Set(vtkInformation* info, vtkObjectBase *value, int i); 00067 00070 void SetRange(vtkInformation* info, 00071 vtkObjectBase **source, 00072 int from, 00073 int to, 00074 int n); 00076 00078 00081 void GetRange(vtkInformation *info, 00082 vtkObjectBase **dest, 00083 int from, 00084 int to, 00085 int n); 00087 00089 vtkObjectBase *Get(vtkInformation* info, int idx); 00090 00091 // _escription: 00092 // Get a pointer to the first vtkObjectBase in the vector. We are 00093 // uysing a vector of smart pointers so this is not easy to 00094 // implement. 00095 // vtkObjectBase **Get(vtkInformation* info); 00096 00100 virtual void ShallowCopy(vtkInformation* from, vtkInformation* to); 00101 00103 virtual void Print(ostream& os, vtkInformation* info); 00104 00105 protected: 00106 // The type required of all objects stored with this key. 00107 const char* RequiredClass; 00108 00109 private: 00112 void CreateObjectBase(); 00115 bool ValidateDerivedType(vtkInformation* info,vtkObjectBase* aValue); 00118 vtkInformationObjectBaseVectorValue *GetObjectBaseVector(vtkInformation *info); 00119 00120 // 00121 vtkInformationObjectBaseVectorKey(const vtkInformationObjectBaseVectorKey&); // Not implemented. 00122 void operator=(const vtkInformationObjectBaseVectorKey&); // Not implemented. 00123 }; 00124 00125 #endif