------------------------------------------------------------------------------ Remove a dataset from the list of data to plot.
| 505 | //------------------------------------------------------------------------------ |
| 506 | // Remove a dataset from the list of data to plot. |
| 507 | void vtkXYPlotActor::RemoveDataSetInputConnection( |
| 508 | vtkAlgorithmOutput* in, const char* arrayName, int component) |
| 509 | { |
| 510 | // IsInputPresent returns 0 on failure, index+1 on success. |
| 511 | // Subtract 1 for the actual index. |
| 512 | int found = this->IsInputPresent(in, arrayName, component) - 1; |
| 513 | if (found == -1) |
| 514 | { |
| 515 | return; |
| 516 | } |
| 517 | |
| 518 | this->Modified(); |
| 519 | |
| 520 | int num = this->InputConnectionHolder->GetNumberOfInputConnections(0); |
| 521 | |
| 522 | this->InputConnectionHolder->RemoveInputConnection(0, found); |
| 523 | |
| 524 | // Do not bother reallocating the SelectedInputScalars |
| 525 | // string array to make it smaller. |
| 526 | delete[] this->SelectedInputScalars[found]; |
| 527 | this->SelectedInputScalars[found] = nullptr; |
| 528 | for (int idx = found + 1; idx < num; ++idx) |
| 529 | { |
| 530 | this->SelectedInputScalars[idx - 1] = this->SelectedInputScalars[idx]; |
| 531 | this->SelectedInputScalarsComponent->SetValue( |
| 532 | idx - 1, this->SelectedInputScalarsComponent->GetValue(idx)); |
| 533 | } |
| 534 | // Resetting the last item is not really necessary, |
| 535 | // but to be clean we do it anyway. |
| 536 | this->SelectedInputScalarsComponent->SetValue(num - 1, -1); |
| 537 | this->SelectedInputScalars[num - 1] = nullptr; |
| 538 | } |
| 539 | |
| 540 | //------------------------------------------------------------------------------ |
| 541 | vtkAlgorithmOutput* vtkXYPlotActor::GetDataSetInputConnection(unsigned int idx) |
no test coverage detected