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 "vtkInformationKey.h" 00028 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type. 00029 00030 class vtkInformationObjectBaseVectorValue; 00031 00032 class VTK_COMMON_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey 00033 { 00034 public: 00035 vtkTypeMacro(vtkInformationObjectBaseVectorKey,vtkInformationKey); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00038 00044 vtkInformationObjectBaseVectorKey(const char* name, 00045 const char* location, 00046 const char* requiredClass=0); 00047 // 00048 ~vtkInformationObjectBaseVectorKey(); 00050 00052 void Clear(vtkInformation* info); 00055 void Resize(vtkInformation* info, int n); 00057 00058 int Size(vtkInformation* info); 00059 int Length(vtkInformation* info){ return this->Size(info); } 00061 00062 void Append(vtkInformation* info, vtkObjectBase *value); 00064 void Set(vtkInformation* info, vtkObjectBase *value, int i); 00066 00069 void SetRange(vtkInformation* info, 00070 vtkObjectBase **source, 00071 int from, 00072 int to, 00073 int n); 00075 00077 00080 void GetRange(vtkInformation *info, 00081 vtkObjectBase **dest, 00082 int from, 00083 int to, 00084 int n); 00086 00088 vtkObjectBase *Get(vtkInformation* info, int idx); 00089 00090 // _escription: 00091 // Get a pointer to the first vtkObjectBase in the vector. We are 00092 // uysing a vector of smart pointers so this is not easy to 00093 // implement. 00094 // vtkObjectBase **Get(vtkInformation* info); 00095 00099 virtual void ShallowCopy(vtkInformation* from, vtkInformation* to); 00100 00102 virtual void Print(ostream& os, vtkInformation* info); 00103 00104 protected: 00105 // The type required of all objects stored with this key. 00106 const char* RequiredClass; 00107 00108 private: 00111 void CreateObjectBase(); 00114 bool ValidateDerivedType(vtkInformation* info,vtkObjectBase* aValue); 00117 vtkInformationObjectBaseVectorValue *GetObjectBaseVector(vtkInformation *info); 00118 00119 // 00120 vtkInformationObjectBaseVectorKey(const vtkInformationObjectBaseVectorKey&); // Not implemented. 00121 void operator=(const vtkInformationObjectBaseVectorKey&); // Not implemented. 00122 }; 00123 00124 #endif