MCPcopy Create free account
hub / github.com/Kitware/VTK / RemoveDataSetInputConnection

Method RemoveDataSetInputConnection

Rendering/Annotation/vtkXYPlotActor.cxx:507–538  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Remove a dataset from the list of data to plot.

Source from the content-addressed store, hash-verified

505//------------------------------------------------------------------------------
506// Remove a dataset from the list of data to plot.
507void 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//------------------------------------------------------------------------------
541vtkAlgorithmOutput* vtkXYPlotActor::GetDataSetInputConnection(unsigned int idx)

Callers 3

RemoveDataSetInputMethod · 0.95
xyPlot4.pyFile · 0.80

Calls 6

IsInputPresentMethod · 0.95
ModifiedMethod · 0.45
RemoveInputConnectionMethod · 0.45
SetValueMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected