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

Method SetSourceData

Filters/Generic/vtkGenericGlyph3DFilter.cxx:686–723  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Specify a source object at a specified table location.

Source from the content-addressed store, hash-verified

684//------------------------------------------------------------------------------
685// Specify a source object at a specified table location.
686void vtkGenericGlyph3DFilter::SetSourceData(int id, vtkPolyData* pd)
687{
688 int numConnections = this->GetNumberOfInputConnections(1);
689
690 if (id < 0 || id > numConnections)
691 {
692 vtkErrorMacro("Bad index " << id << " for source.");
693 return;
694 }
695
696 vtkTrivialProducer* tp = nullptr;
697 if (pd)
698 {
699 tp = vtkTrivialProducer::New();
700 tp->SetOutput(pd);
701 }
702
703 if (id < numConnections)
704 {
705 if (tp)
706 {
707 this->SetNthInputConnection(1, id, tp->GetOutputPort());
708 }
709 else
710 {
711 this->SetNthInputConnection(1, id, nullptr);
712 }
713 }
714 else if (id == numConnections && tp)
715 {
716 this->AddInputConnection(1, tp->GetOutputPort());
717 }
718
719 if (tp)
720 {
721 tp->Delete();
722 }
723}
724
725//------------------------------------------------------------------------------
726// Get a pointer to a source object at a specified table location.

Callers

nothing calls this directly

Calls 7

SetNthInputConnectionMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
SetOutputMethod · 0.45
GetOutputPortMethod · 0.45
AddInputConnectionMethod · 0.45

Tested by

no test coverage detected