------------------------------------------------------------------------------
| 117 | |
| 118 | //------------------------------------------------------------------------------ |
| 119 | int vtkHyperTreeGridAlgorithm::RequestDataObject( |
| 120 | vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 121 | { |
| 122 | if (this->GetNumberOfInputPorts() == 0 || this->GetNumberOfOutputPorts() == 0) |
| 123 | { |
| 124 | return 1; |
| 125 | } |
| 126 | |
| 127 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 128 | if (!inInfo) |
| 129 | { |
| 130 | return 0; |
| 131 | } |
| 132 | vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT()); |
| 133 | |
| 134 | if (input) |
| 135 | { |
| 136 | // for each output |
| 137 | for (int i = 0; i < this->GetNumberOfOutputPorts(); ++i) |
| 138 | { |
| 139 | vtkInformation* info = outputVector->GetInformationObject(i); |
| 140 | vtkDataObject* output = info->Get(vtkDataObject::DATA_OBJECT()); |
| 141 | |
| 142 | if (!output || !output->IsA(input->GetClassName())) |
| 143 | { |
| 144 | vtkDataObject* newOutput = input->NewInstance(); |
| 145 | info->Set(vtkDataObject::DATA_OBJECT(), newOutput); |
| 146 | newOutput->Delete(); |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | return 1; |
| 151 | } |
| 152 | |
| 153 | //------------------------------------------------------------------------------ |
| 154 | vtkTypeBool vtkHyperTreeGridAlgorithm::ProcessRequest( |
no test coverage detected