------------------------------------------------------------------------------
| 54 | |
| 55 | //------------------------------------------------------------------------------ |
| 56 | void vtkInformationVariantVectorKey::Set(vtkInformation* info, const vtkVariant* value, int length) |
| 57 | { |
| 58 | if (value) |
| 59 | { |
| 60 | if (this->RequiredLength >= 0 && length != this->RequiredLength) |
| 61 | { |
| 62 | vtkErrorWithObjectMacro(info, |
| 63 | "Cannot store vtkVariant vector of length " |
| 64 | << length << " with key " << this->Location << "::" << this->Name |
| 65 | << " which requires a vector of length " << this->RequiredLength |
| 66 | << ". Removing the key instead."); |
| 67 | this->SetAsObjectBase(info, nullptr); |
| 68 | return; |
| 69 | } |
| 70 | vtkInformationVariantVectorValue* v = new vtkInformationVariantVectorValue; |
| 71 | v->InitializeObjectBase(); |
| 72 | v->Value.insert(v->Value.begin(), value, value + length); |
| 73 | this->SetAsObjectBase(info, v); |
| 74 | v->Delete(); |
| 75 | } |
| 76 | else |
| 77 | { |
| 78 | this->SetAsObjectBase(info, nullptr); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | //------------------------------------------------------------------------------ |
| 83 | const vtkVariant* vtkInformationVariantVectorKey::Get(vtkInformation* info) const |
no test coverage detected